Skip to content

Commit f311e28

Browse files
committed
fix definition of generated decay time
1 parent 8ddc5a5 commit f311e28

2 files changed

Lines changed: 15 additions & 11 deletions

File tree

PWGHF/D2H/Tasks/taskLc.cxx

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ using namespace o2::framework::expressions;
6363
using namespace o2::hf_centrality;
6464
using namespace o2::hf_occupancy;
6565
using namespace o2::hf_evsel;
66+
using namespace o2::constants::physics;
6667

6768
/// Λc± → p± K∓ π± analysis task
6869
struct HfTaskLc {
@@ -522,10 +523,18 @@ struct HfTaskLc {
522523
occ = o2::hf_occupancy::getOccupancyGenColl(recoCollsPerMcColl, occEstimator);
523524
}
524525

525-
const auto& mcDaughter0 = particle.template daughters_as<soa::Join<aod::McParticles, aod::HfCand3ProngMcGen>>().begin();
526-
const float p2m = particle.p() / o2::constants::physics::MassLambdaCPlus;
527-
const float gamma = std::sqrt(1 + p2m * p2m); // mother's particle Lorentz factor
528-
const float properDecayTime = mcDaughter0.vt() * NanoToPico / gamma; // from ns to ps * from lab time to proper time
526+
const auto mcDaughter0 = particle.template daughters_as<soa::Join<aod::McParticles, aod::HfCand3ProngMcGen>>().begin();
527+
const auto mcCollision = particle.template mcCollision_as<aod::McCollisions>();
528+
const auto p = particle.p();
529+
const float pvX = mcCollision.posX();
530+
const float pvY = mcCollision.posY();
531+
const float pvZ = mcCollision.posZ();
532+
const float svX = mcDaughter0.vx();
533+
const float svY = mcDaughter0.vy();
534+
const float svZ = mcDaughter0.vz();
535+
536+
const float decayLength = static_cast<float>(RecoDecay::distance(std::array<float, 3>{svX, svY, svZ}, std::array<float, 3>{pvX, pvY, pvZ}));
537+
const float properDecayTime = decayLength * static_cast<float>(MassLambdaCPlus) / LightSpeedCm2PS / p;
529538

530539
fillHistogramsGen<Signal>(particle);
531540

PWGHF/TableProducer/treeCreatorLcToPKPi.cxx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,6 @@ struct HfTreeCreatorLcToPKPi {
412412

413413
constexpr static float UndefValueFloat = -999.f;
414414
constexpr static int UndefValueInt = -999;
415-
constexpr static float NanoToPico = 1000.f;
416415

417416
using TracksWPid = soa::Join<aod::Tracks, aod::TracksPidPi, aod::PidTpcTofFullPi, aod::TracksPidKa, aod::PidTpcTofFullKa, aod::TracksPidPr, aod::PidTpcTofFullPr>;
418417
using Cents = soa::Join<aod::CentFV0As, aod::CentFT0Ms, aod::CentFT0As, aod::CentFT0Cs, aod::CentFDDMs>;
@@ -1002,16 +1001,14 @@ struct HfTreeCreatorLcToPKPi {
10021001
const auto mcCollision = particleMother.template mcCollision_as<aod::McCollisions>();
10031002
p = particleMother.p();
10041003
pt = particleMother.pt();
1005-
const float p2m = p / static_cast<float>(MassLambdaCPlus);
1006-
const float gamma = std::sqrt(1 + p2m * p2m); // mother's particle Lorentz factor
10071004
pvX = mcCollision.posX();
10081005
pvY = mcCollision.posY();
10091006
pvZ = mcCollision.posZ();
10101007
svX = mcParticleProng0.vx();
10111008
svY = mcParticleProng0.vy();
10121009
svZ = mcParticleProng0.vz();
10131010
decayLength = static_cast<float>(RecoDecay::distance(std::array<float, 3>{svX, svY, svZ}, std::array<float, 3>{pvX, pvY, pvZ}));
1014-
decayTime = mcParticleProng0.vt() * NanoToPico / gamma; // from ns to ps * from lab time to proper time
1011+
decayTime = decayLength * static_cast<float>(MassLambdaCPlus) / LightSpeedCm2PS / p;
10151012
}
10161013
rowCandidateMC(
10171014
p, pt,
@@ -1032,16 +1029,14 @@ struct HfTreeCreatorLcToPKPi {
10321029
const auto mcDaughter0 = particle.template daughters_as<soa::Join<aod::McParticles, aod::HfCand3ProngMcGen>>().begin();
10331030
const auto mcCollision = particle.template mcCollision_as<aod::McCollisions>();
10341031
const auto p = particle.p();
1035-
const float p2m = p / static_cast<float>(MassLambdaCPlus);
1036-
const float gamma = std::sqrt(1 + p2m * p2m); // mother's particle Lorentz factor
10371032
const float pvX = mcCollision.posX();
10381033
const float pvY = mcCollision.posY();
10391034
const float pvZ = mcCollision.posZ();
10401035
const float svX = mcDaughter0.vx();
10411036
const float svY = mcDaughter0.vy();
10421037
const float svZ = mcDaughter0.vz();
10431038
const float l = static_cast<float>(RecoDecay::distance(std::array<float, 3>{svX, svY, svZ}, std::array<float, 3>{pvX, pvY, pvZ}));
1044-
const float t = mcDaughter0.vt() * NanoToPico / gamma; // from ns to ps * from lab time to proper time
1039+
const float t = l * static_cast<float>(MassLambdaCPlus) / LightSpeedCm2PS / p;
10451040
rowCandidateFullParticles(
10461041
particle.pt(),
10471042
particle.eta(),

0 commit comments

Comments
 (0)