Skip to content

Commit

Permalink
PWGEM/Dilepton: update sturyMCTruth.cxx
Browse files Browse the repository at this point in the history
  • Loading branch information
dsekihat committed Feb 27, 2025
1 parent 7f67b50 commit 0f82a97
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions PWGEM/Dilepton/Tasks/studyMCTruth.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -238,6 +240,10 @@ struct studyMCTruth {
const auto& bc_from_mcCollision = mcCollision.template bc_as<TBCs>();
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) {
Expand All @@ -246,7 +252,14 @@ struct studyMCTruth {
const auto& bc_from_collision = collision.template foundBC_as<TBCs>();
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());
Expand Down Expand Up @@ -312,6 +325,7 @@ struct studyMCTruth {

SliceCache cache;
Preslice<aod::McParticles> perMcCollision = aod::mcparticle::mcCollisionId;
PresliceUnsorted<aod::McCollisionLabels> recColperMcCollision = aod::mccollisionlabel::mcCollisionId;

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

Expand Down

0 comments on commit 0f82a97

Please sign in to comment.