Skip to content

Commit 158eed2

Browse files
committed
get rid of magic constant; use float suffix
1 parent 4c306fe commit 158eed2

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

DPG/Tasks/TPC/tpcSkimsTableCreator.cxx

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,14 @@ struct TreeWriterTpcV0 {
7575
constexpr static o2::track::PID::ID PidKaon{o2::track::PID::Kaon};
7676
constexpr static o2::track::PID::ID PidProton{o2::track::PID::Proton};
7777

78+
// an arbitrary value of N sigma TOF assigned by TOF task to tracks which are not matched to TOF hits
79+
constexpr static float NSigmaTofUnmatched{999.f};
80+
7881
/// Configurables
79-
Configurable<float> nSigmaTofDauTrackPi{"nSigmaTofDauTrackPi", 999., "n-sigma TOF cut on the pion daughter tracks"};
80-
Configurable<float> nSigmaTofDauTrackPr{"nSigmaTofDauTrackPr", 999., "n-sigma TOF cut on the proton daughter tracks"};
81-
Configurable<float> nSigmaTofDauTrackEl{"nSigmaTofDauTrackEl", 999., "n-sigma TOF cut on the electron daughter tracks"};
82-
Configurable<float> nSigmaTofDauTrackKa{"nSigmaTofDauTrackKa", 999., "n-sigma TOF cut on the kaon daughter tracks"};
82+
Configurable<float> nSigmaTofDauTrackPi{"nSigmaTofDauTrackPi", 999.f, "n-sigma TOF cut on the pion daughter tracks"};
83+
Configurable<float> nSigmaTofDauTrackPr{"nSigmaTofDauTrackPr", 999.f, "n-sigma TOF cut on the proton daughter tracks"};
84+
Configurable<float> nSigmaTofDauTrackEl{"nSigmaTofDauTrackEl", 999.f, "n-sigma TOF cut on the electron daughter tracks"};
85+
Configurable<float> nSigmaTofDauTrackKa{"nSigmaTofDauTrackKa", 999.f, "n-sigma TOF cut on the kaon daughter tracks"};
8386
Configurable<bool> rejectNoTofDauTrackPi{"rejectNoTofDauTrackPi", false, "reject not matched to TOF pion daughter tracks"};
8487
Configurable<bool> rejectNoTofDauTrackPr{"rejectNoTofDauTrackPr", false, "reject not matched to TOF proton daughter tracks"};
8588
Configurable<bool> rejectNoTofDauTrackEl{"rejectNoTofDauTrackEl", false, "reject not matched to TOF electron daughter tracks"};
@@ -463,8 +466,8 @@ struct TreeWriterTpcV0 {
463466

464467
auto fillDaughterTrack = [&](const auto& mother, const TrksType::iterator& dauTrack, const V0Daughter& daughter) {
465468
const bool passDownsamplig = downsampleTsalisCharged(dauTrack.pt(), daughter.downsamplingTsalis, daughter.mass, daughter.maxPt4dwnsmplTsalis);
466-
const bool passNSigmaTofCut = std::fabs(daughter.tofNSigma) < daughter.nSigmaTofDauTrack || std::fabs(daughter.tofNSigma + 999.) < 1e-3;
467-
const bool passMatchTofRequirement = !daughter.rejectNoTofDauTrack || std::fabs(daughter.tofNSigma + 999.) > 1e-3;
469+
const bool passNSigmaTofCut = std::fabs(daughter.tofNSigma) < daughter.nSigmaTofDauTrack || std::fabs(daughter.tofNSigma - NSigmaTofUnmatched) < 1e-3;
470+
const bool passMatchTofRequirement = !daughter.rejectNoTofDauTrack || std::fabs(daughter.tofNSigma - NSigmaTofUnmatched) > 1e-3;
468471
if (passDownsamplig && passNSigmaTofCut && passMatchTofRequirement) {
469472
fillSkimmedV0Table<IsCorrectedDeDx>(mother, dauTrack, collision, daughter.tpcNSigma, daughter.tofNSigma, daughter.tpcExpSignal, daughter.id, runnumber, daughter.dwnSmplFactor, hadronicRate);
470473
}
@@ -552,8 +555,8 @@ struct TreeWriterTpcV0 {
552555

553556
auto fillDaughterTrack = [&](const auto& mother, const TrksType::iterator& dauTrack, const V0Daughter& daughter, const aod::TracksQA& trackQAInstance, const bool existTrkQA) {
554557
const bool passDownsamplig = downsampleTsalisCharged(dauTrack.pt(), daughter.downsamplingTsalis, daughter.mass, daughter.maxPt4dwnsmplTsalis);
555-
const bool passNSigmaTofCut = std::fabs(daughter.tofNSigma) < daughter.nSigmaTofDauTrack || std::fabs(daughter.tofNSigma + 999.) < 1e-3;
556-
const bool passMatchTofRequirement = !daughter.rejectNoTofDauTrack || std::fabs(daughter.tofNSigma + 999.) > 1e-3;
558+
const bool passNSigmaTofCut = std::fabs(daughter.tofNSigma) < daughter.nSigmaTofDauTrack || std::fabs(daughter.tofNSigma - NSigmaTofUnmatched) < 1e-3;
559+
const bool passMatchTofRequirement = !daughter.rejectNoTofDauTrack || std::fabs(daughter.tofNSigma - NSigmaTofUnmatched) > 1e-3;
557560
if (passDownsamplig && passNSigmaTofCut && passMatchTofRequirement) {
558561
fillSkimmedV0TableWithTrQAGeneric<IsCorrectedDeDx, IsWithdEdx>(mother, dauTrack, trackQAInstance, existTrkQA, collision, daughter.tpcNSigma, daughter.tofNSigma, daughter.tpcExpSignal, daughter.id, runnumber, daughter.dwnSmplFactor, hadronicRate, bcGlobalIndex, bcTimeFrameId, bcBcInTimeFrame);
559562
}

0 commit comments

Comments
 (0)