Skip to content

Commit 92b0296

Browse files
ddobrigkalibuild
andauthored
[PWGLF] StraTOF: Addition of hasTOF functionality, remove ITS requirement (AliceO2Group#13685)
Co-authored-by: ALICE Builder <[email protected]>
1 parent 6f9cb0f commit 92b0296

File tree

2 files changed

+79
-10
lines changed

2 files changed

+79
-10
lines changed

PWGLF/DataModel/LFStrangenessPIDTables.h

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,16 @@
99
// granted to it by virtue of its status as an Intergovernmental Organization
1010
// or submit itself to any jurisdiction.
1111

12+
//**********************************************************************
1213
// Defines TOF PID tables for strangeness.
1314
// Entries calculated per candidate, tables are joinable with v0/cascdata tables.
15+
//**********************************************************************
16+
17+
//**********************************************************************
18+
// Nota bene: when using, do not check track.hasTOF! That conditional may not match
19+
// the calculation of strangeness TOF, which requires e.g. a successful calculation
20+
// of the collision time for the reassociated collision
21+
//**********************************************************************
1422

1523
#ifndef PWGLF_DATAMODEL_LFSTRANGENESSPIDTABLES_H_
1624
#define PWGLF_DATAMODEL_LFSTRANGENESSPIDTABLES_H_
@@ -203,6 +211,25 @@ DECLARE_SOA_COLUMN(TOFNSigmaALaPi, tofNSigmaALaPi, float); //! positive
203211
DECLARE_SOA_COLUMN(TOFNSigmaK0PiPlus, tofNSigmaK0PiPlus, float); //! positive track NSigma from pion <- k0short expectation
204212
DECLARE_SOA_COLUMN(TOFNSigmaK0PiMinus, tofNSigmaK0PiMinus, float); //! negative track NSigma from pion <- k0short expectation
205213

214+
// dynamics to replace hasTOF (note: that condition does not match track hasTOF!)
215+
// note: only single hypothesis check necessary; other hypotheses will always be valid
216+
DECLARE_SOA_DYNAMIC_COLUMN(PositiveHasTOF, positiveHasTOF, //! positive daughter TOF calculation valid
217+
[](float TOFNSigmaLaPr) -> bool {
218+
bool returnStatus = true;
219+
if (std::abs(TOFNSigmaLaPr - kNoTOFValue) < kEpsilon) {
220+
returnStatus = false;
221+
}
222+
return returnStatus;
223+
});
224+
DECLARE_SOA_DYNAMIC_COLUMN(NegativeHasTOF, negativeHasTOF, //! negative daughter TOF calculation valid
225+
[](float TOFNSigmaALaPr) -> bool {
226+
bool returnStatus = true;
227+
if (std::abs(TOFNSigmaALaPr - kNoTOFValue) < kEpsilon) {
228+
returnStatus = false;
229+
}
230+
return returnStatus;
231+
});
232+
206233
// dynamics based on n-sigmas with use-only-if-tof-present logic
207234
DECLARE_SOA_DYNAMIC_COLUMN(TofLambdaCompatibility, tofLambdaCompatibility, //! compatibility with being lambda, checked only if TOF present. Argument: number of sigmas
208235
[](float tofNSigmaLaPr, float tofNSigmaLaPi, float nsigma) -> float {
@@ -284,6 +311,8 @@ DECLARE_SOA_TABLE(V0TOFNSigmas, "AOD", "V0TOFNSIGMA", // processed NSigma table
284311
v0data::TOFNSigmaLaPr, v0data::TOFNSigmaLaPi,
285312
v0data::TOFNSigmaALaPr, v0data::TOFNSigmaALaPi,
286313
v0data::TOFNSigmaK0PiPlus, v0data::TOFNSigmaK0PiMinus,
314+
v0data::PositiveHasTOF<v0data::TOFNSigmaLaPr>,
315+
v0data::NegativeHasTOF<v0data::TOFNSigmaALaPr>,
287316
v0data::TofLambdaCompatibility<v0data::TOFNSigmaLaPr, v0data::TOFNSigmaLaPi>,
288317
v0data::TofAntiLambdaCompatibility<v0data::TOFNSigmaALaPr, v0data::TOFNSigmaALaPi>,
289318
v0data::TofK0ShortCompatibility<v0data::TOFNSigmaK0PiPlus, v0data::TOFNSigmaK0PiMinus>);
@@ -325,6 +354,33 @@ DECLARE_SOA_COLUMN(TOFNSigmaOmLaPi, tofNSigmaOmLaPi, float); //! meson track NSi
325354
DECLARE_SOA_COLUMN(TOFNSigmaOmLaPr, tofNSigmaOmLaPr, float); //! baryon track NSigma from proton <- lambda <- om expectation
326355
DECLARE_SOA_COLUMN(TOFNSigmaOmKa, tofNSigmaOmKa, float); //! bachelor track NSigma from kaon <- om expectation
327356

357+
// dynamics to replace hasTOF (note: that condition does not match track hasTOF!)
358+
// note: only single hypothesis check necessary; other hypotheses will always be valid
359+
DECLARE_SOA_DYNAMIC_COLUMN(PositiveHasTOF, positiveHasTOF, //! positive daughter TOF calculation valid
360+
[](float PosTOFDeltaTXiPr) -> bool {
361+
bool returnStatus = true;
362+
if (std::abs(PosTOFDeltaTXiPr - kNoTOFValue) < kEpsilon) {
363+
returnStatus = false;
364+
}
365+
return returnStatus;
366+
});
367+
DECLARE_SOA_DYNAMIC_COLUMN(NegativeHasTOF, negativeHasTOF, //! positive daughter TOF calculation valid
368+
[](float NegTOFDeltaTXiPr) -> bool {
369+
bool returnStatus = true;
370+
if (std::abs(NegTOFDeltaTXiPr - kNoTOFValue) < kEpsilon) {
371+
returnStatus = false;
372+
}
373+
return returnStatus;
374+
});
375+
DECLARE_SOA_DYNAMIC_COLUMN(BachelorHasTOF, bachelorHasTOF, //! bachelor daughter TOF calculation valid
376+
[](float BachTOFDeltaTXiPi) -> bool {
377+
bool returnStatus = true;
378+
if (std::abs(BachTOFDeltaTXiPi - kNoTOFValue) < kEpsilon) {
379+
returnStatus = false;
380+
}
381+
return returnStatus;
382+
});
383+
328384
// dynamics based on n-sigmas with use-only-if-tof-present logic
329385
DECLARE_SOA_DYNAMIC_COLUMN(TofXiCompatibility, tofXiCompatibility, //! compatibility with being lambda, checked only if TOF present. Argument: number of sigmas
330386
[](float tofNSigmaXiLaPr, float tofNSigmaXiLaPi, float tofNSigmaXiPi, float nsigma) -> float {
@@ -376,6 +432,9 @@ DECLARE_SOA_TABLE(CascTOFPIDs, "AOD", "CASCTOFPID", // processed information for
376432
DECLARE_SOA_TABLE(CascTOFNSigmas, "AOD", "CascTOFNSigmas", // Nsigmas for cascades
377433
cascdata::TOFNSigmaXiLaPi, cascdata::TOFNSigmaXiLaPr, cascdata::TOFNSigmaXiPi,
378434
cascdata::TOFNSigmaOmLaPi, cascdata::TOFNSigmaOmLaPr, cascdata::TOFNSigmaOmKa,
435+
cascdata::PositiveHasTOF<cascdata::PosTOFDeltaTXiPr>,
436+
cascdata::NegativeHasTOF<cascdata::NegTOFDeltaTXiPr>,
437+
cascdata::BachelorHasTOF<cascdata::BachTOFDeltaTXiPi>,
379438
cascdata::TofXiCompatibility<cascdata::TOFNSigmaXiLaPr, cascdata::TOFNSigmaXiLaPi, cascdata::TOFNSigmaXiPi>,
380439
cascdata::TofOmegaCompatibility<cascdata::TOFNSigmaOmLaPr, cascdata::TOFNSigmaOmLaPi, cascdata::TOFNSigmaOmKa>);
381440
} // namespace o2::aod

PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -805,7 +805,7 @@ struct strangenesstofpid {
805805
float velocityPositivePr, velocityPositivePi, lengthPositive;
806806
velocityPositivePr = velocityPositivePi = lengthPositive = o2::aod::v0data::kNoTOFValue;
807807

808-
if (pTof.hasTOF && pTof.hasITS && pTof.tofEvTime > -1e+5 && pValidTOF) {
808+
if (pTof.hasTOF && pTof.tofEvTime > -1e+5 && pValidTOF) {
809809
// method 0: legacy standalone without use of primary particle TOF
810810
if (calculationMethod.value == 0) {
811811
velocityPositivePr = velocity(posTrack.getP(), o2::constants::physics::MassProton);
@@ -824,7 +824,9 @@ struct strangenesstofpid {
824824
const o2::math_utils::Point3D<float> trackVertex{trackCollision.posX(), trackCollision.posY(), trackCollision.posZ()};
825825
o2::track::TrackLTIntegral ltIntegral;
826826
bool successPropag = o2::base::Propagator::Instance()->propagateToDCA(trackVertex, posTrack, d_bz, 2.f, o2::base::Propagator::MatCorrType::USEMatCorrNONE, nullptr, &ltIntegral);
827-
histos.fill(HIST("hPropagationBookkeeping"), kPropagPosV0, static_cast<float>(successPropag));
827+
if (doQA) {
828+
histos.fill(HIST("hPropagationBookkeeping"), kPropagPosV0, static_cast<float>(successPropag));
829+
}
828830
if (successPropag) {
829831
lengthPositive = pTof.length - ltIntegral.getL();
830832
v0tof.timePositivePr = o2::framework::pid::tof::MassToExpTime(pTof.tofExpMom, lengthPositive, o2::constants::physics::MassProton * o2::constants::physics::MassProton);
@@ -881,7 +883,7 @@ struct strangenesstofpid {
881883
}
882884
float velocityNegativePr, velocityNegativePi, lengthNegative;
883885
velocityNegativePr = velocityNegativePi = lengthNegative = o2::aod::v0data::kNoTOFValue;
884-
if (nTof.hasTOF && nTof.hasITS && nTof.tofEvTime > -1e+5 && nValidTOF) {
886+
if (nTof.hasTOF && nTof.tofEvTime > -1e+5 && nValidTOF) {
885887
// method 0: legacy standalone without use of primary particle TOF
886888
if (calculationMethod.value == 0) {
887889
velocityNegativePr = velocity(negTrack.getP(), o2::constants::physics::MassProton);
@@ -900,7 +902,9 @@ struct strangenesstofpid {
900902
const o2::math_utils::Point3D<float> trackVertex{trackCollision.posX(), trackCollision.posY(), trackCollision.posZ()};
901903
o2::track::TrackLTIntegral ltIntegral;
902904
bool successPropag = o2::base::Propagator::Instance()->propagateToDCA(trackVertex, negTrack, d_bz, 2.f, o2::base::Propagator::MatCorrType::USEMatCorrNONE, nullptr, &ltIntegral);
903-
histos.fill(HIST("hPropagationBookkeeping"), kPropagNegV0, static_cast<float>(successPropag));
905+
if (doQA) {
906+
histos.fill(HIST("hPropagationBookkeeping"), kPropagNegV0, static_cast<float>(successPropag));
907+
}
904908
if (successPropag) {
905909
lengthNegative = nTof.length - ltIntegral.getL();
906910
v0tof.timeNegativePr = o2::framework::pid::tof::MassToExpTime(nTof.tofExpMom, lengthNegative, o2::constants::physics::MassProton * o2::constants::physics::MassProton);
@@ -1073,7 +1077,7 @@ struct strangenesstofpid {
10731077

10741078
//_____________________________________________________________________________________________
10751079
// Actual calculation
1076-
if (pTof.hasTOF && pTof.hasITS && pTof.tofEvTime > -1e+5 && pValidTOF) {
1080+
if (pTof.hasTOF && pTof.tofEvTime > -1e+5 && pValidTOF) {
10771081
float velocityPositivePr, velocityPositivePi, lengthPositive;
10781082
velocityPositivePr = velocityPositivePi = lengthPositive = o2::aod::v0data::kNoTOFValue;
10791083
if (calculationMethod.value == 0) {
@@ -1093,7 +1097,9 @@ struct strangenesstofpid {
10931097
const o2::math_utils::Point3D<float> trackVertex{trackCollision.posX(), trackCollision.posY(), trackCollision.posZ()};
10941098
o2::track::TrackLTIntegral ltIntegral;
10951099
bool successPropag = o2::base::Propagator::Instance()->propagateToDCA(trackVertex, posTrack, d_bz, 2.f, o2::base::Propagator::MatCorrType::USEMatCorrNONE, nullptr, &ltIntegral);
1096-
histos.fill(HIST("hPropagationBookkeeping"), kPropagPosCasc, static_cast<float>(successPropag));
1100+
if (doQA) {
1101+
histos.fill(HIST("hPropagationBookkeeping"), kPropagPosCasc, static_cast<float>(successPropag));
1102+
}
10971103
if (successPropag) {
10981104
lengthPositive = pTof.length - ltIntegral.getL();
10991105
casctof.posFlightPr = o2::framework::pid::tof::MassToExpTime(pTof.tofExpMom, pTof.length - ltIntegral.getL(), o2::constants::physics::MassProton * o2::constants::physics::MassProton);
@@ -1162,7 +1168,7 @@ struct strangenesstofpid {
11621168
}
11631169
} // end positive
11641170

1165-
if (nTof.hasTOF && nTof.hasITS && nTof.tofEvTime > -1e+5 && nValidTOF) {
1171+
if (nTof.hasTOF && nTof.tofEvTime > -1e+5 && nValidTOF) {
11661172
float velocityNegativePr, velocityNegativePi, lengthNegative;
11671173
velocityNegativePr = velocityNegativePi = lengthNegative = o2::aod::v0data::kNoTOFValue;
11681174
// method 0: legacy standalone without use of primary particle TOF
@@ -1183,7 +1189,9 @@ struct strangenesstofpid {
11831189
const o2::math_utils::Point3D<float> trackVertex{trackCollision.posX(), trackCollision.posY(), trackCollision.posZ()};
11841190
o2::track::TrackLTIntegral ltIntegral;
11851191
bool successPropag = o2::base::Propagator::Instance()->propagateToDCA(trackVertex, negTrack, d_bz, 2.f, o2::base::Propagator::MatCorrType::USEMatCorrNONE, nullptr, &ltIntegral);
1186-
histos.fill(HIST("hPropagationBookkeeping"), kPropagNegCasc, static_cast<float>(successPropag));
1192+
if (doQA) {
1193+
histos.fill(HIST("hPropagationBookkeeping"), kPropagNegCasc, static_cast<float>(successPropag));
1194+
}
11871195
if (successPropag) {
11881196
lengthNegative = nTof.length - ltIntegral.getL();
11891197
casctof.negFlightPr = o2::framework::pid::tof::MassToExpTime(nTof.tofExpMom, nTof.length - ltIntegral.getL(), o2::constants::physics::MassProton * o2::constants::physics::MassProton);
@@ -1252,7 +1260,7 @@ struct strangenesstofpid {
12521260
}
12531261
} // end negative
12541262

1255-
if (bTof.hasTOF && bTof.hasITS && bTof.tofEvTime > -1e+5 && bValidTOF) {
1263+
if (bTof.hasTOF && bTof.tofEvTime > -1e+5 && bValidTOF) {
12561264
float velocityBachelorKa, velocityBachelorPi, lengthBachelor;
12571265
velocityBachelorKa = velocityBachelorPi = lengthBachelor = o2::aod::v0data::kNoTOFValue;
12581266
// method 0: legacy standalone without use of primary particle TOF
@@ -1273,7 +1281,9 @@ struct strangenesstofpid {
12731281
const o2::math_utils::Point3D<float> trackVertex{trackCollision.posX(), trackCollision.posY(), trackCollision.posZ()};
12741282
o2::track::TrackLTIntegral ltIntegral;
12751283
bool successPropag = o2::base::Propagator::Instance()->propagateToDCA(trackVertex, bachTrack, d_bz, 2.f, o2::base::Propagator::MatCorrType::USEMatCorrNONE, nullptr, &ltIntegral);
1276-
histos.fill(HIST("hPropagationBookkeeping"), kPropagBachCasc, static_cast<float>(successPropag));
1284+
if (doQA) {
1285+
histos.fill(HIST("hPropagationBookkeeping"), kPropagBachCasc, static_cast<float>(successPropag));
1286+
}
12771287
if (successPropag) {
12781288
lengthBachelor = bTof.length - ltIntegral.getL();
12791289
casctof.bachFlightPi = o2::framework::pid::tof::MassToExpTime(bTof.tofExpMom, bTof.length - ltIntegral.getL(), o2::constants::physics::MassPionCharged * o2::constants::physics::MassPionCharged);

0 commit comments

Comments
 (0)