Skip to content

Commit d0c8f15

Browse files
authored
[PWGEM/Dilepton] update studyMCTruth.cxx (#10219)
1 parent 06e94ad commit d0c8f15

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

PWGEM/Dilepton/Tasks/studyMCTruth.cxx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ struct studyMCTruth {
8282
const AxisSpec axis_mll{ConfMllBins, "m_{ll} (GeV/c^{2})"};
8383
const AxisSpec axis_ptll{ConfPtllBins, "p_{T,ll} (GeV/c)"};
8484

85+
fRegistry.add("Event/hReccollsPerMCcoll", "Rec. colls per MC coll;Rec. colls per MC coll;Number of MC collisions", kTH1D, {{21, -0.5, 20.5}}, false);
86+
fRegistry.add("Event/hSelReccollsPerMCcoll", "Selected Rec. colls per MC coll;Selected Rec. colls per MC coll;Number of MC collisions", kTH1D, {{21, -0.5, 20.5}}, false);
8587
fRegistry.add("Event/hDiffBC", "diffrence in BC;BC_{rec. coll.} - BC_{mc coll.}", kTH1D, {{101, -50.5, +50.5}}, false);
8688
fRegistry.add("Event/allMC/hZvtx", "MC Zvtx;Z_{vtx} (cm)", kTH1D, {{100, -50, +50}}, false);
8789
fRegistry.add("Event/allMC/hImpactParameter", "impact parameter;impact parameter b (fm)", kTH1D, {{200, 0, 20}}, false);
@@ -238,6 +240,16 @@ struct studyMCTruth {
238240
const auto& bc_from_mcCollision = mcCollision.template bc_as<TBCs>();
239241
bool isSelectedMC = isSelectedCollision(mcCollision, bc_from_mcCollision);
240242

243+
auto reccolls_per_mccoll = collisions.sliceBy(recColperMcCollision, mcCollision.globalIndex());
244+
fRegistry.fill(HIST("Event/hReccollsPerMCcoll"), reccolls_per_mccoll.size());
245+
int nselreccolls_per_mccoll = 0;
246+
for (const auto& rec_col : reccolls_per_mccoll) {
247+
if (isSelectedCollision(rec_col, rec_col.template foundBC_as<TBCs>())) {
248+
nselreccolls_per_mccoll++;
249+
}
250+
} // end of reconstructed collision
251+
fRegistry.fill(HIST("Event/hSelReccollsPerMCcoll"), nselreccolls_per_mccoll);
252+
241253
bool isSelectedRec = false;
242254
bool hasRecCollision = false;
243255
if (mcCollision.mpemeventId() >= 0) {
@@ -312,6 +324,7 @@ struct studyMCTruth {
312324

313325
SliceCache cache;
314326
Preslice<aod::McParticles> perMcCollision = aod::mcparticle::mcCollisionId;
327+
PresliceUnsorted<aod::McCollisionLabels> recColperMcCollision = aod::mccollisionlabel::mcCollisionId;
315328

316329
using MyMcCollisions = soa::Join<aod::McCollisions, aod::MostProbableEMEventIdsInMC>;
317330

0 commit comments

Comments
 (0)