From 0f82a978f1290e21637f92f89a22757510a9a066 Mon Sep 17 00:00:00 2001 From: Daiki Sekihata Date: Thu, 27 Feb 2025 18:19:48 +0900 Subject: [PATCH] PWGEM/Dilepton: update sturyMCTruth.cxx --- PWGEM/Dilepton/Tasks/studyMCTruth.cxx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/PWGEM/Dilepton/Tasks/studyMCTruth.cxx b/PWGEM/Dilepton/Tasks/studyMCTruth.cxx index 4e5fbf44ae3..f3563a0bbd4 100644 --- a/PWGEM/Dilepton/Tasks/studyMCTruth.cxx +++ b/PWGEM/Dilepton/Tasks/studyMCTruth.cxx @@ -82,6 +82,8 @@ struct studyMCTruth { const AxisSpec axis_mll{ConfMllBins, "m_{ll} (GeV/c^{2})"}; const AxisSpec axis_ptll{ConfPtllBins, "p_{T,ll} (GeV/c)"}; + 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); + 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); fRegistry.add("Event/hDiffBC", "diffrence in BC;BC_{rec. coll.} - BC_{mc coll.}", kTH1D, {{101, -50.5, +50.5}}, false); fRegistry.add("Event/allMC/hZvtx", "MC Zvtx;Z_{vtx} (cm)", kTH1D, {{100, -50, +50}}, false); fRegistry.add("Event/allMC/hImpactParameter", "impact parameter;impact parameter b (fm)", kTH1D, {{200, 0, 20}}, false); @@ -238,6 +240,10 @@ struct studyMCTruth { const auto& bc_from_mcCollision = mcCollision.template bc_as(); bool isSelectedMC = isSelectedCollision(mcCollision, bc_from_mcCollision); + auto rec_colls_per_mccoll = collisions.sliceBy(recColperMcCollision, mcCollision.globalIndex()); + fRegistry.fill(HIST("Event/hReccollsPerMCcoll"), rec_colls_per_mccoll.size()); + int nselrec_colls_per_mccoll = 0; + bool isSelectedRec = false; bool hasRecCollision = false; if (mcCollision.mpemeventId() >= 0) { @@ -246,7 +252,14 @@ struct studyMCTruth { const auto& bc_from_collision = collision.template foundBC_as(); isSelectedRec = isSelectedCollision(collision, bc_from_collision); fRegistry.fill(HIST("Event/hDiffBC"), bc_from_collision.globalBC() - bc_from_mcCollision.globalBC()); + + for (const auto& rec_col : rec_colls_per_mccoll) { + if (isSelectedCollision(rec_col, bc_from_collision)) { + nselrec_colls_per_mccoll++; + } + } // end of reconstructed collision } + fRegistry.fill(HIST("Event/hSelReccollsPerMCcoll"), nselrec_colls_per_mccoll); fRegistry.fill(HIST("Event/allMC/hZvtx"), mcCollision.posZ()); fRegistry.fill(HIST("Event/allMC/hImpactParameter"), mcCollision.impactParameter()); @@ -312,6 +325,7 @@ struct studyMCTruth { SliceCache cache; Preslice perMcCollision = aod::mcparticle::mcCollisionId; + PresliceUnsorted recColperMcCollision = aod::mccollisionlabel::mcCollisionId; using MyMcCollisions = soa::Join;