Skip to content

Commit 9dbed32

Browse files
committed
add ct-gen to mc-rec thn
1 parent f311e28 commit 9dbed32

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

PWGHF/D2H/Tasks/taskLc.cxx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ struct HfTaskLc {
270270
const AxisSpec thnAxisTracklets{thnConfigAxisNumPvContr, "Number of PV contributors"};
271271
const AxisSpec thnAxisOccupancy{thnConfigAxisOccupancy, "Occupancy"};
272272
const AxisSpec thnAxisProperDecayTime{thnConfigAxisProperDecayTime, "#it{t}_{proper} (ps)"};
273+
const AxisSpec thnAxisProperDecayTimeGen{thnConfigAxisProperDecayTime, "#it{t}_{proper, gen} (ps)"};
273274

274275
bool const isDataWithMl = doprocessDataWithMl || doprocessDataWithMlWithFT0C || doprocessDataWithMlWithFT0M;
275276
bool const isMcWithMl = doprocessMcWithMl || doprocessMcWithMlWithFT0C || doprocessMcWithMlWithFT0M;
@@ -305,6 +306,9 @@ struct HfTaskLc {
305306
for (const auto& axes : std::array<std::vector<AxisSpec>*, 3>{&axesWithBdt, &axesStd, &axesGen}) {
306307
if (!axes->empty()) {
307308
axes->push_back(thnAxisProperDecayTime);
309+
if (!isData && axes != &axesGen) {
310+
axes->push_back(thnAxisProperDecayTimeGen);
311+
}
308312
}
309313
}
310314
}
@@ -421,6 +425,18 @@ struct HfTaskLc {
421425
const auto numPvContributors = collision.numContrib();
422426
const auto ptRecB = candidate.ptBhadMotherPart();
423427

428+
const auto mcCollision = particleMother.template mcCollision_as<aod::McCollisions>();
429+
const auto p = particleMother.p();
430+
const float pvX = mcCollision.posX();
431+
const float pvY = mcCollision.posY();
432+
const float pvZ = mcCollision.posZ();
433+
const float svX = mcParticleProng0.vx();
434+
const float svY = mcParticleProng0.vy();
435+
const float svZ = mcParticleProng0.vz();
436+
437+
const float decayLengthGen = static_cast<float>(RecoDecay::distance(std::array<float, 3>{svX, svY, svZ}, std::array<float, 3>{pvX, pvY, pvZ}));
438+
const float properDecayTimeGen = decayLengthGen * static_cast<float>(MassLambdaCPlus) / LightSpeedCm2PS / p;
439+
424440
/// MC reconstructed signal
425441
fillHistogramsRecSig<Signal>(candidate);
426442

@@ -464,6 +480,7 @@ struct HfTaskLc {
464480
}
465481
if (storeProperDecayTime) {
466482
valuesToFill.push_back(properDecayTime);
483+
valuesToFill.push_back(properDecayTimeGen);
467484
}
468485
if constexpr (FillMl) {
469486
registry.get<THnSparse>(HIST("hnLcVarsWithBdt"))->Fill(valuesToFill.data());

0 commit comments

Comments
 (0)