Skip to content

Commit 903fad1

Browse files
committed
Protection against track beta>1
1 parent 325c13e commit 903fad1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Detectors/AOD/src/AODProducerWorkflowSpec.cxx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2353,7 +2353,10 @@ AODProducerWorkflowDPL::TrackExtraInfo AODProducerWorkflowDPL::processBarrelTrac
23532353
extraInfoHolder.length = intLen;
23542354
const float mass = o2::constants::physics::MassPionCharged; // default pid = pion
23552355
if (tofInt.getTOF(o2::track::PID::Pion) > 0.f) {
2356-
const float expBeta = (intLen / (tofInt.getTOF(o2::track::PID::Pion) * cSpeed));
2356+
float expBeta = (intLen / (tofInt.getTOF(o2::track::PID::Pion) * cSpeed));
2357+
if (expBeta > o2::constants::math::Almost1) {
2358+
expBeta = o2::constants::math::Almost1;
2359+
}
23572360
extraInfoHolder.tofExpMom = mass * expBeta / std::sqrt(1.f - expBeta * expBeta);
23582361
}
23592362
// correct the time of the track
@@ -2657,6 +2660,9 @@ void AODProducerWorkflowDPL::addRefGlobalBCsForTOF(const o2::dataformats::VtxTra
26572660
float tofExpMom = 0.;
26582661
if (tofInt.getTOF(o2::track::PID::Pion) > 0.f) {
26592662
float expBeta = (intLen / (tofInt.getTOF(o2::track::PID::Pion) * cSpeed));
2663+
if (expBeta > o2::constants::math::Almost1) {
2664+
expBeta = o2::constants::math::Almost1;
2665+
}
26602666
tofExpMom = o2::constants::physics::MassPionCharged * expBeta / std::sqrt(1.f - expBeta * expBeta);
26612667
} else {
26622668
continue;

0 commit comments

Comments
 (0)