Skip to content

Commit 5720f82

Browse files
committed
[PWGLF] StraTOF: Addition of hasTOF functionality
1 parent b8954b6 commit 5720f82

File tree

2 files changed

+80
-10
lines changed

2 files changed

+80
-10
lines changed

PWGLF/DataModel/LFStrangenessPIDTables.h

Lines changed: 60 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,34 @@ 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+
384+
328385
// dynamics based on n-sigmas with use-only-if-tof-present logic
329386
DECLARE_SOA_DYNAMIC_COLUMN(TofXiCompatibility, tofXiCompatibility, //! compatibility with being lambda, checked only if TOF present. Argument: number of sigmas
330387
[](float tofNSigmaXiLaPr, float tofNSigmaXiLaPi, float tofNSigmaXiPi, float nsigma) -> float {
@@ -376,6 +433,9 @@ DECLARE_SOA_TABLE(CascTOFPIDs, "AOD", "CASCTOFPID", // processed information for
376433
DECLARE_SOA_TABLE(CascTOFNSigmas, "AOD", "CascTOFNSigmas", // Nsigmas for cascades
377434
cascdata::TOFNSigmaXiLaPi, cascdata::TOFNSigmaXiLaPr, cascdata::TOFNSigmaXiPi,
378435
cascdata::TOFNSigmaOmLaPi, cascdata::TOFNSigmaOmLaPr, cascdata::TOFNSigmaOmKa,
436+
cascdata::PositiveHasTOF<cascdata::PosTOFDeltaTXiPr>,
437+
cascdata::NegativeHasTOF<cascdata::NegTOFDeltaTXiPr>,
438+
cascdata::BachelorHasTOF<cascdata::BachTOFDeltaTXiPi>,
379439
cascdata::TofXiCompatibility<cascdata::TOFNSigmaXiLaPr, cascdata::TOFNSigmaXiLaPi, cascdata::TOFNSigmaXiPi>,
380440
cascdata::TofOmegaCompatibility<cascdata::TOFNSigmaOmLaPr, cascdata::TOFNSigmaOmLaPi, cascdata::TOFNSigmaOmKa>);
381441
} // namespace o2::aod

PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx

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

807-
if (pTof.hasTOF && pTof.hasITS && pTof.tofEvTime > -1e+5 && pValidTOF) {
807+
if (pTof.hasTOF && pTof.tofEvTime > -1e+5 && pValidTOF) {
808808
// method 0: legacy standalone without use of primary particle TOF
809809
if (calculationMethod.value == 0) {
810810
velocityPositivePr = velocity(posTrack.getP(), o2::constants::physics::MassProton);
@@ -823,7 +823,9 @@ struct strangenesstofpid {
823823
const o2::math_utils::Point3D<float> trackVertex{trackCollision.posX(), trackCollision.posY(), trackCollision.posZ()};
824824
o2::track::TrackLTIntegral ltIntegral;
825825
bool successPropag = o2::base::Propagator::Instance()->propagateToDCA(trackVertex, posTrack, d_bz, 2.f, o2::base::Propagator::MatCorrType::USEMatCorrNONE, nullptr, &ltIntegral);
826-
histos.fill(HIST("hPropagationBookkeeping"), kPropagPosV0, static_cast<float>(successPropag));
826+
if(doQA){
827+
histos.fill(HIST("hPropagationBookkeeping"), kPropagPosV0, static_cast<float>(successPropag));
828+
}
827829
if (successPropag) {
828830
lengthPositive = pTof.length - ltIntegral.getL();
829831
v0tof.timePositivePr = o2::framework::pid::tof::MassToExpTime(pTof.tofExpMom, lengthPositive, o2::constants::physics::MassProton * o2::constants::physics::MassProton);
@@ -880,7 +882,7 @@ struct strangenesstofpid {
880882
}
881883
float velocityNegativePr, velocityNegativePi, lengthNegative;
882884
velocityNegativePr = velocityNegativePi = lengthNegative = o2::aod::v0data::kNoTOFValue;
883-
if (nTof.hasTOF && nTof.hasITS && nTof.tofEvTime > -1e+5 && nValidTOF) {
885+
if (nTof.hasTOF && nTof.tofEvTime > -1e+5 && nValidTOF) {
884886
// method 0: legacy standalone without use of primary particle TOF
885887
if (calculationMethod.value == 0) {
886888
velocityNegativePr = velocity(negTrack.getP(), o2::constants::physics::MassProton);
@@ -899,7 +901,9 @@ struct strangenesstofpid {
899901
const o2::math_utils::Point3D<float> trackVertex{trackCollision.posX(), trackCollision.posY(), trackCollision.posZ()};
900902
o2::track::TrackLTIntegral ltIntegral;
901903
bool successPropag = o2::base::Propagator::Instance()->propagateToDCA(trackVertex, negTrack, d_bz, 2.f, o2::base::Propagator::MatCorrType::USEMatCorrNONE, nullptr, &ltIntegral);
902-
histos.fill(HIST("hPropagationBookkeeping"), kPropagNegV0, static_cast<float>(successPropag));
904+
if(doQA){
905+
histos.fill(HIST("hPropagationBookkeeping"), kPropagNegV0, static_cast<float>(successPropag));
906+
}
903907
if (successPropag) {
904908
lengthNegative = nTof.length - ltIntegral.getL();
905909
v0tof.timeNegativePr = o2::framework::pid::tof::MassToExpTime(nTof.tofExpMom, lengthNegative, o2::constants::physics::MassProton * o2::constants::physics::MassProton);
@@ -1072,7 +1076,7 @@ struct strangenesstofpid {
10721076

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

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

1254-
if (bTof.hasTOF && bTof.hasITS && bTof.tofEvTime > -1e+5 && bValidTOF) {
1262+
if (bTof.hasTOF && bTof.tofEvTime > -1e+5 && bValidTOF) {
12551263
float velocityBachelorKa, velocityBachelorPi, lengthBachelor;
12561264
velocityBachelorKa = velocityBachelorPi = lengthBachelor = o2::aod::v0data::kNoTOFValue;
12571265
// method 0: legacy standalone without use of primary particle TOF
@@ -1272,7 +1280,9 @@ struct strangenesstofpid {
12721280
const o2::math_utils::Point3D<float> trackVertex{trackCollision.posX(), trackCollision.posY(), trackCollision.posZ()};
12731281
o2::track::TrackLTIntegral ltIntegral;
12741282
bool successPropag = o2::base::Propagator::Instance()->propagateToDCA(trackVertex, bachTrack, d_bz, 2.f, o2::base::Propagator::MatCorrType::USEMatCorrNONE, nullptr, &ltIntegral);
1275-
histos.fill(HIST("hPropagationBookkeeping"), kPropagBachCasc, static_cast<float>(successPropag));
1283+
if(doQA){
1284+
histos.fill(HIST("hPropagationBookkeeping"), kPropagBachCasc, static_cast<float>(successPropag));
1285+
}
12761286
if (successPropag) {
12771287
lengthBachelor = bTof.length - ltIntegral.getL();
12781288
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)