Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion PWGHF/DataModel/CandidateReconstructionTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -1905,6 +1905,7 @@ DECLARE_SOA_COLUMN(FlagMcMatchRec, flagMcMatchRec, int8_t); // reconstruction le
DECLARE_SOA_COLUMN(FlagMcMatchGen, flagMcMatchGen, int8_t); // generator level
DECLARE_SOA_COLUMN(OriginMcRec, originMcRec, int8_t);
DECLARE_SOA_COLUMN(OriginMcGen, originMcGen, int8_t);
DECLARE_SOA_COLUMN(DecayLengthMcGen, decayLengthMcGen, float);
// Residuals and pulls
DECLARE_SOA_COLUMN(PtResidual, ptResidual, float);
DECLARE_SOA_COLUMN(PResidual, pResidual, float);
Expand Down Expand Up @@ -2012,7 +2013,8 @@ DECLARE_SOA_TABLE(HfCandXicMcRec, "AOD", "HFCANDXICMCREC",
DECLARE_SOA_TABLE(HfCandXicMcGen, "AOD", "HFCANDXICMCGEN",
hf_cand_xic_to_xi_pi_pi::FlagMcMatchGen,
hf_cand_xic_to_xi_pi_pi::OriginMcGen,
hf_cand::PdgBhadMotherPart);
hf_cand::PdgBhadMotherPart,
hf_cand_xic_to_xi_pi_pi::DecayLengthMcGen);

// table with residuals and pulls of PV
DECLARE_SOA_TABLE(HfCandXicResid, "AOD", "HFCANDXICRESID",
Expand Down
12 changes: 9 additions & 3 deletions PWGHF/TableProducer/candidateCreatorXicToXiPiPi.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -912,6 +912,7 @@ struct HfCandidateCreatorXicToXiPiPiExpressions {
int8_t sign = 0;
int8_t flag = 0;
int8_t origin = RecoDecay::OriginType::None;
float decayLengthGen = -999.f;
int8_t nPionsDecayed = 0;
int8_t nInteractionsWithMaterial = 0;
// for resonance matching
Expand Down Expand Up @@ -1088,7 +1089,7 @@ struct HfCandidateCreatorXicToXiPiPiExpressions {
if (rejectionMask != 0) {
// at least one event selection not satisfied --> reject all particles from this collision
for (unsigned int i = 0; i < mcParticlesPerMcColl.size(); ++i) {
rowMcMatchGen(-99, -99, -99);
rowMcMatchGen(-99, -99, -99, decayLengthGen);
}
continue;
}
Expand Down Expand Up @@ -1134,13 +1135,18 @@ struct HfCandidateCreatorXicToXiPiPiExpressions {
// Check whether the charm baryon is non-prompt (from a b quark).
if (flag != 0) {
origin = RecoDecay::getCharmHadronOrigin(mcParticles, particle, false, &idxBhadMothers);
// Calculate the decay length of the generated particle
auto dau0 = particle.template daughters_as<aod::McParticles>().begin();
const std::array vtxDau{dau0.vx(), dau0.vy(), dau0.vz()};
const std::array vtxPV{mcCollision.posX(), mcCollision.posY(), mcCollision.posZ()};
decayLengthGen = RecoDecay::distance(vtxPV, vtxDau);
}
// Fill table
if (origin == RecoDecay::OriginType::NonPrompt) {
auto bHadMother = mcParticles.rawIteratorAt(idxBhadMothers[0]);
rowMcMatchGen(flag, origin, bHadMother.pdgCode());
rowMcMatchGen(flag, origin, bHadMother.pdgCode(), decayLengthGen);
} else {
rowMcMatchGen(flag, origin, 0);
rowMcMatchGen(flag, origin, 0, decayLengthGen);
}
} // close loop over generated particles
} // close loop over McCollisions
Expand Down
9 changes: 6 additions & 3 deletions PWGHF/TableProducer/treeCreatorXicToXiPiPi.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,8 @@ DECLARE_SOA_TABLE(HfCandXicToXiPiPiFullPs, "AOD", "HFXICXI2PIFULLP",
full::Pt,
full::Eta,
full::Phi,
full::Y);
full::Y,
hf_cand_xic_to_xi_pi_pi::DecayLengthMcGen);
} // namespace o2::aod

/// Writes the full information in an output TTree
Expand Down Expand Up @@ -723,7 +724,8 @@ struct HfTreeCreatorXicToXiPiPi {
particle.pt(),
particle.eta(),
particle.phi(),
RecoDecay::y(particle.pVector(), o2::constants::physics::MassXiCPlus));
RecoDecay::y(particle.pVector(), o2::constants::physics::MassXiCPlus),
particle.decayLengthMcGen());
}
}
}
Expand Down Expand Up @@ -776,7 +778,8 @@ struct HfTreeCreatorXicToXiPiPi {
particle.pt(),
particle.eta(),
particle.phi(),
RecoDecay::y(particle.pVector(), o2::constants::physics::MassXiCPlus));
RecoDecay::y(particle.pVector(), o2::constants::physics::MassXiCPlus),
particle.decayLengthMcGen());
}
}
}
Expand Down
Loading