Skip to content

Commit 6652328

Browse files
committed
fixing bug for efficiency correction
1 parent 9348ae9 commit 6652328

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

PWGCF/JCorran/Tasks/jEPFlowAnalysis.cxx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ using namespace std;
4040
using MyCollisions = soa::Join<aod::Collisions, aod::EvSels, aod::Qvectors>;
4141
using MyTracks = soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksDCA, aod::TrackSelection>;
4242

43+
4344
struct jEPFlowAnalysis {
4445

4546
HistogramRegistry epFlowHistograms{"EPFlow", {}, OutputObjHandlingPolicy::AnalysisObject, true, true};
@@ -169,6 +170,8 @@ struct jEPFlowAnalysis {
169170
effVars[1] = eff->GetAxis(1)->FindBin(pt);
170171
effVars[2] = eff->GetAxis(2)->FindBin(multiplicity);
171172
effVars[3] = eff->GetAxis(3)->FindBin(posZ);
173+
LOGF(info, "etabin: %d, ptbin: %d, centbin: %d, poszbin: %d", effVars[0], effVars[1], effVars[2], effVars[3]);
174+
172175
return eff->GetBinContent(effVars);
173176
}
174177

@@ -251,7 +254,12 @@ struct jEPFlowAnalysis {
251254

252255
if (cfgEffCor) {
253256
auto bc = coll.bc_as<aod::BCsWithTimestamps>();
254-
effMap = ccdb->getForTimeStamp<THnT<float>>(cfgEffCorDir, bc.timestamp());
257+
currentRunNumber = bc.runNumber();
258+
if (currentRunNumber != lastRunNumber) {
259+
effMap.clear();
260+
effMap = ccdb->getForTimeStamp<THnT<float>>(cfgEffCorDir, bc.timestamp());
261+
lastRunNumber = currentRunNumber;
262+
}
255263
}
256264

257265
float cent = coll.cent();
@@ -350,7 +358,7 @@ struct jEPFlowAnalysis {
350358
continue;
351359

352360
if (cfgEffCor) {
353-
weight /= getEfficiencyCorrection(effMap, track.eta(), track.pt(), cent, coll.posZ());
361+
weight = getEfficiencyCorrection(effMap, track.eta(), track.pt(), cent, coll.posZ());
354362
}
355363

356364
float vn = std::cos((i + 2) * (track.phi() - eps[0]));
@@ -365,6 +373,8 @@ struct jEPFlowAnalysis {
365373
}
366374
}
367375
PROCESS_SWITCH(jEPFlowAnalysis, processDefault, "default process", true);
376+
377+
368378
};
369379

370380
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)

0 commit comments

Comments
 (0)