Skip to content

Commit 53da407

Browse files
committed
add lifetime-relevant fields to mc particles table
1 parent 57a1086 commit 53da407

File tree

1 file changed

+27
-2
lines changed

1 file changed

+27
-2
lines changed

PWGHF/TableProducer/treeCreatorLcToPKPi.cxx

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,16 @@ DECLARE_SOA_TABLE(HfCandLcFullPs, "AOD", "HFCANDLCFULLP",
308308
full::Phi,
309309
full::Y,
310310
full::FlagMc,
311-
full::OriginMcGen);
311+
full::OriginMcGen,
312+
mc_match::P,
313+
mc_match::XDecay,
314+
mc_match::YDecay,
315+
mc_match::ZDecay,
316+
mc_match::LDecay,
317+
mc_match::TDecay,
318+
mc_match::XEvent,
319+
mc_match::YEvent,
320+
mc_match::ZEvent);
312321

313322
} // namespace o2::aod
314323

@@ -704,13 +713,29 @@ struct HfTreeCreatorLcToPKPi {
704713
rowCandidateFullParticles.reserve(particles.size());
705714
for (const auto& particle : particles) {
706715
if (std::abs(particle.flagMcMatchGen()) == 1 << aod::hf_cand_3prong::DecayType::LcToPKPi) {
716+
auto mcDaughter0 = particle.template daughters_as<aod::McParticles>().begin();
717+
auto mcCollision = particle.template mcCollision_as<aod::McCollisions>();
718+
auto p = particle.p();
719+
const float p2m = p / MassLambdaCPlus;
720+
const float gamma = std::sqrt(1 + p2m * p2m); // mother's particle Lorentz factor
721+
const float pvX = mcCollision.posX();
722+
const float pvY = mcCollision.posY();
723+
const float pvZ = mcCollision.posZ();
724+
const float svX = mcDaughter0.vx();
725+
const float svY = mcDaughter0.vy();
726+
const float svZ = mcDaughter0.vz();
727+
const float l = std::sqrt((svX - pvX) * (svX - pvX) + (svY - pvY) * (svY - pvY) + (svZ - pvZ) * (svZ - pvZ));
728+
const float t = mcDaughter0.vt() * NanoToPico / gamma; // from ns to ps * from lab time to proper time
707729
rowCandidateFullParticles(
708730
particle.pt(),
709731
particle.eta(),
710732
particle.phi(),
711733
RecoDecay::y(particle.pVector(), o2::constants::physics::MassLambdaCPlus),
712734
particle.flagMcMatchGen(),
713-
particle.originMcGen());
735+
particle.originMcGen(),
736+
p,
737+
svX, svY, svZ, l, t,
738+
pvX, pvY, pvZ);
714739
}
715740
}
716741
}

0 commit comments

Comments
 (0)