Skip to content

Commit 63f4400

Browse files
committed
Last adjustments
1 parent aceb0b1 commit 63f4400

File tree

2 files changed

+49
-41
lines changed

2 files changed

+49
-41
lines changed

PWGLF/DataModel/LFStrangenessPIDTables.h

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ DECLARE_SOA_TABLE(DauTrackTOFPIDs, "AOD", "DAUTRACKTOFPID", // raw table (for po
4747

4848
namespace v0data
4949
{
50+
// define constants for NSigma operation
51+
const float kNoTOFValue = -1e+6;
52+
const float kEpsilon = 1e-4;
53+
5054
// ==== TOF INFORMATION ===
5155
// lengths as stored in the AO2D for TOF calculations
5256
DECLARE_SOA_COLUMN(PosTOFLengthToPV, posTOFLengthToPV, float); //! positive track length to PV
@@ -83,10 +87,10 @@ DECLARE_SOA_COLUMN(TOFNSigmaK0PiMinus, tofNSigmaK0PiMinus, float); //! negative
8387
DECLARE_SOA_DYNAMIC_COLUMN(TofLambdaCompatibility, tofLambdaCompatibility, //! compatibility with being lambda, checked only if TOF present. Argument: number of sigmas
8488
[](float tofNSigmaLaPr, float tofNSigmaLaPi, float nsigma) -> float {
8589
bool compatible = true;
86-
if(std::abs(tofNSigmaLaPr+1000.0f)>1e-3 && std::abs(tofNSigmaLaPr)>nsigma){
90+
if(std::abs(tofNSigmaLaPr-kNoTOFValue)>kEpsilon && std::abs(tofNSigmaLaPr)>nsigma){
8791
compatible = false; // reject only if info present and incompatible
8892
}
89-
if(std::abs(tofNSigmaLaPi+1000.0f)>1e-3 && std::abs(tofNSigmaLaPi)>nsigma){
93+
if(std::abs(tofNSigmaLaPi-kNoTOFValue)>kEpsilon && std::abs(tofNSigmaLaPi)>nsigma){
9094
compatible = false; // reject only if info present and incompatible
9195
}
9296
return compatible;
@@ -96,10 +100,10 @@ DECLARE_SOA_DYNAMIC_COLUMN(TofLambdaCompatibility, tofLambdaCompatibility, //! c
96100
DECLARE_SOA_DYNAMIC_COLUMN(TofAntiLambdaCompatibility, tofAntiLambdaCompatibility, //! compatibility with being lambda, checked only if TOF present. Argument: number of sigmas
97101
[](float tofNSigmaALaPr, float tofNSigmaALaPi, float nsigma) -> float {
98102
bool compatible = true;
99-
if(std::abs(tofNSigmaALaPr+1000.0f)>1e-3 && std::abs(tofNSigmaALaPr)>nsigma){
103+
if(std::abs(tofNSigmaALaPr-kNoTOFValue)>kEpsilon && std::abs(tofNSigmaALaPr)>nsigma){
100104
compatible = false; // reject only if info present and incompatible
101105
}
102-
if(std::abs(tofNSigmaALaPi+1000.0f)>1e-3 && std::abs(tofNSigmaALaPi)>nsigma){
106+
if(std::abs(tofNSigmaALaPi-kNoTOFValue)>kEpsilon && std::abs(tofNSigmaALaPi)>nsigma){
103107
compatible = false; // reject only if info present and incompatible
104108
}
105109
return compatible;
@@ -109,10 +113,10 @@ DECLARE_SOA_DYNAMIC_COLUMN(TofAntiLambdaCompatibility, tofAntiLambdaCompatibilit
109113
DECLARE_SOA_DYNAMIC_COLUMN(TofK0ShortCompatibility, tofK0ShortCompatibility, //! compatibility with being lambda, checked only if TOF present. Argument: number of sigmas
110114
[](float tofNSigmaK0PiPlus, float tofNSigmaK0PiMinus, float nsigma) -> float {
111115
bool compatible = true;
112-
if(std::abs(tofNSigmaK0PiPlus+1000.0f)>1e-3 && std::abs(tofNSigmaK0PiPlus)>nsigma){
116+
if(std::abs(tofNSigmaK0PiPlus-kNoTOFValue)>kEpsilon && std::abs(tofNSigmaK0PiPlus)>nsigma){
113117
compatible = false; // reject only if info present and incompatible
114118
}
115-
if(std::abs(tofNSigmaK0PiMinus+1000.0f)>1e-3 && std::abs(tofNSigmaK0PiMinus)>nsigma){
119+
if(std::abs(tofNSigmaK0PiMinus-kNoTOFValue)>kEpsilon && std::abs(tofNSigmaK0PiMinus)>nsigma){
116120
compatible = false; // reject only if info present and incompatible
117121
}
118122
return compatible;
@@ -166,6 +170,10 @@ DECLARE_SOA_TABLE(V0TOFNSigmas, "AOD", "V0TOFNSIGMA", // processed NSigma table
166170

167171
namespace cascdata
168172
{
173+
// define constants for NSigma operation
174+
const float kNoTOFValue = -1e+6;
175+
const float kEpsilon = 1e-4;
176+
169177
// lengths as stored in the AO2D for TOF calculations
170178
DECLARE_SOA_COLUMN(PosTOFLengthToPV, posTOFLengthToPV, float); //! positive track length
171179
DECLARE_SOA_COLUMN(NegTOFLengthToPV, negTOFLengthToPV, float); //! negative track length
@@ -201,13 +209,13 @@ DECLARE_SOA_COLUMN(TOFNSigmaOmKa, tofNSigmaOmKa, float); //! bachelor track
201209
DECLARE_SOA_DYNAMIC_COLUMN(TofXiCompatibility, tofXiCompatibility, //! compatibility with being lambda, checked only if TOF present. Argument: number of sigmas
202210
[](float tofNSigmaXiLaPr, float tofNSigmaXiLaPi, float tofNSigmaXiPi, float nsigma) -> float {
203211
bool compatible = true;
204-
if(std::abs(tofNSigmaXiLaPr+1000000.0f)>1e-3 && std::abs(tofNSigmaXiLaPr)>nsigma){
212+
if(std::abs(tofNSigmaXiLaPr-kNoTOFValue)>kEpsilon && std::abs(tofNSigmaXiLaPr)>nsigma){
205213
compatible = false; // reject only if info present and incompatible
206214
}
207-
if(std::abs(tofNSigmaXiLaPi+1000000.0f)>1e-3 && std::abs(tofNSigmaXiLaPi)>nsigma){
215+
if(std::abs(tofNSigmaXiLaPi-kNoTOFValue)>kEpsilon && std::abs(tofNSigmaXiLaPi)>nsigma){
208216
compatible = false; // reject only if info present and incompatible
209217
}
210-
if(std::abs(tofNSigmaXiPi+1000000.0f)>1e-3 && std::abs(tofNSigmaXiPi)>nsigma){
218+
if(std::abs(tofNSigmaXiPi-kNoTOFValue)>kEpsilon && std::abs(tofNSigmaXiPi)>nsigma){
211219
compatible = false; // reject only if info present and incompatible
212220
}
213221
return compatible;
@@ -216,13 +224,13 @@ DECLARE_SOA_DYNAMIC_COLUMN(TofXiCompatibility, tofXiCompatibility, //! compatibi
216224
DECLARE_SOA_DYNAMIC_COLUMN(TofOmCompatibility, tofOmCompatibility, //! compatibility with being lambda, checked only if TOF present. Argument: number of sigmas
217225
[](float tofNSigmaOmLaPr, float tofNSigmaOmLaPi, float tofNSigmaOmKa, float nsigma) -> float {
218226
bool compatible = true;
219-
if(std::abs(tofNSigmaOmLaPr+1000000.0f)>1e-3 && std::abs(tofNSigmaOmLaPr)>nsigma){
227+
if(std::abs(tofNSigmaOmLaPr-kNoTOFValue)>kEpsilon && std::abs(tofNSigmaOmLaPr)>nsigma){
220228
compatible = false; // reject only if info present and incompatible
221229
}
222-
if(std::abs(tofNSigmaOmLaPi+1000000.0f)>1e-3 && std::abs(tofNSigmaOmLaPi)>nsigma){
230+
if(std::abs(tofNSigmaOmLaPi-kNoTOFValue)>kEpsilon && std::abs(tofNSigmaOmLaPi)>nsigma){
223231
compatible = false; // reject only if info present and incompatible
224232
}
225-
if(std::abs(tofNSigmaOmKa+1000000.0f)>1e-3 && std::abs(tofNSigmaOmKa)>nsigma){
233+
if(std::abs(tofNSigmaOmKa-kNoTOFValue)>kEpsilon && std::abs(tofNSigmaOmKa)>nsigma){
226234
compatible = false; // reject only if info present and incompatible
227235
}
228236
return compatible;

PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -544,19 +544,19 @@ struct strangenesstofpid {
544544
o2::track::TrackPar posTrack = o2::track::TrackPar({v0.x(), v0.y(), v0.z()}, {v0.pxpos(), v0.pypos(), v0.pzpos()}, +1);
545545
o2::track::TrackPar negTrack = o2::track::TrackPar({v0.x(), v0.y(), v0.z()}, {v0.pxneg(), v0.pyneg(), v0.pzneg()}, -1);
546546

547-
float deltaTimePositiveLambdaPi = -1e+6;
548-
float deltaTimeNegativeLambdaPi = -1e+6;
549-
float deltaTimePositiveLambdaPr = -1e+6;
550-
float deltaTimeNegativeLambdaPr = -1e+6;
551-
float deltaTimePositiveK0ShortPi = -1e+6;
552-
float deltaTimeNegativeK0ShortPi = -1e+6;
553-
554-
float nSigmaPositiveLambdaPi = -1e+3;
555-
float nSigmaPositiveLambdaPr = -1e+3;
556-
float nSigmaNegativeLambdaPi = -1e+3;
557-
float nSigmaNegativeLambdaPr = -1e+3;
558-
float nSigmaPositiveK0ShortPi = -1e+3;
559-
float nSigmaNegativeK0ShortPi = -1e+3;
547+
float deltaTimePositiveLambdaPi = o2::aod::v0data::kNoTOFValue;
548+
float deltaTimeNegativeLambdaPi = o2::aod::v0data::kNoTOFValue;
549+
float deltaTimePositiveLambdaPr = o2::aod::v0data::kNoTOFValue;
550+
float deltaTimeNegativeLambdaPr = o2::aod::v0data::kNoTOFValue;
551+
float deltaTimePositiveK0ShortPi = o2::aod::v0data::kNoTOFValue;
552+
float deltaTimeNegativeK0ShortPi = o2::aod::v0data::kNoTOFValue;
553+
554+
float nSigmaPositiveLambdaPi = o2::aod::v0data::kNoTOFValue;
555+
float nSigmaPositiveLambdaPr = o2::aod::v0data::kNoTOFValue;
556+
float nSigmaNegativeLambdaPi = o2::aod::v0data::kNoTOFValue;
557+
float nSigmaNegativeLambdaPr = o2::aod::v0data::kNoTOFValue;
558+
float nSigmaPositiveK0ShortPi = o2::aod::v0data::kNoTOFValue;
559+
float nSigmaNegativeK0ShortPi = o2::aod::v0data::kNoTOFValue;
560560

561561
float velocityPositivePr = velocity(posTrack.getP(), o2::constants::physics::MassProton);
562562
float velocityPositivePi = velocity(posTrack.getP(), o2::constants::physics::MassPionCharged);
@@ -614,9 +614,9 @@ struct strangenesstofpid {
614614
float decayTimeAntiLambda = 0.5f * ((pTra.tofSignal() - timePositivePi) + (nTra.tofSignal() - timeNegativePr)) - evTimeMean;
615615
float decayTimeK0Short = 0.5f * ((pTra.tofSignal() - timePositivePi) + (nTra.tofSignal() - timeNegativePi)) - evTimeMean;
616616

617-
float betaLambda = -1e+6;
618-
float betaAntiLambda = -1e+6;
619-
float betaK0Short = -1e+6;
617+
float betaLambda = o2::aod::cascdata::kNoTOFValue;;
618+
float betaAntiLambda = o2::aod::cascdata::kNoTOFValue;;
619+
float betaK0Short = o2::aod::cascdata::kNoTOFValue;;
620620

621621
if (nTra.hasTOF() && pTra.hasTOF()) {
622622
betaLambda = (lengthV0 / decayTimeLambda) / 0.0299792458;
@@ -736,7 +736,7 @@ struct strangenesstofpid {
736736

737737
// calculate mother lengths
738738
float lengthV0 = std::hypot(cascade.xlambda() - cascade.x(), cascade.ylambda() - cascade.y(), cascade.zlambda() - cascade.z());
739-
float lengthCascade = -1e+6;
739+
float lengthCascade = o2::aod::cascdata::kNoTOFValue;;
740740
const o2::math_utils::Point3D<float> collVtx{collision.getX(), collision.getY(), collision.getZ()};
741741
bool successPropag = o2::base::Propagator::Instance()->propagateToDCA(collVtx, cascTrack, d_bz, 2.f, o2::base::Propagator::MatCorrType::USEMatCorrNONE);
742742
float d = -1.0f, d3d = 0.0f;
@@ -772,12 +772,12 @@ struct strangenesstofpid {
772772
float bachFlightKa = lengthBachelor / velocityBachelorKa;
773773

774774
// initialize delta-times (actual PID variables)
775-
float posDeltaTimeAsXiPi = -1e+6, posDeltaTimeAsXiPr = -1e+6;
776-
float negDeltaTimeAsXiPi = -1e+6, negDeltaTimeAsXiPr = -1e+6;
777-
float bachDeltaTimeAsXiPi = -1e+6;
778-
float posDeltaTimeAsOmPi = -1e+6, posDeltaTimeAsOmPr = -1e+6;
779-
float negDeltaTimeAsOmPi = -1e+6, negDeltaTimeAsOmPr = -1e+6;
780-
float bachDeltaTimeAsOmKa = -1e+6;
775+
float posDeltaTimeAsXiPi = o2::aod::cascdata::kNoTOFValue, posDeltaTimeAsXiPr = o2::aod::cascdata::kNoTOFValue;
776+
float negDeltaTimeAsXiPi = o2::aod::cascdata::kNoTOFValue, negDeltaTimeAsXiPr = o2::aod::cascdata::kNoTOFValue;
777+
float bachDeltaTimeAsXiPi = o2::aod::cascdata::kNoTOFValue;
778+
float posDeltaTimeAsOmPi = o2::aod::cascdata::kNoTOFValue, posDeltaTimeAsOmPr = o2::aod::cascdata::kNoTOFValue;
779+
float negDeltaTimeAsOmPi = o2::aod::cascdata::kNoTOFValue, negDeltaTimeAsOmPr = o2::aod::cascdata::kNoTOFValue;
780+
float bachDeltaTimeAsOmKa = o2::aod::cascdata::kNoTOFValue;
781781

782782
if (pTra.hasTOF()) {
783783
posDeltaTimeAsXiPi = (pTra.tofSignal() - pTra.tofEvTime()) - (xiFlight + lambdaFlight + posFlightPi);
@@ -800,12 +800,12 @@ struct strangenesstofpid {
800800
posDeltaTimeAsXiPi, posDeltaTimeAsXiPr, negDeltaTimeAsXiPi, negDeltaTimeAsXiPr, bachDeltaTimeAsXiPi,
801801
posDeltaTimeAsOmPi, posDeltaTimeAsOmPr, negDeltaTimeAsOmPi, negDeltaTimeAsOmPr, bachDeltaTimeAsOmKa);
802802

803-
float nSigmaXiLaPr = -1e+6;
804-
float nSigmaXiLaPi = -1e+6;
805-
float nSigmaXiPi = -1e+6;
806-
float nSigmaOmLaPr = -1e+6;
807-
float nSigmaOmLaPi = -1e+6;
808-
float nSigmaOmKa = -1e+6;
803+
float nSigmaXiLaPr = o2::aod::cascdata::kNoTOFValue;;
804+
float nSigmaXiLaPi = o2::aod::cascdata::kNoTOFValue;;
805+
float nSigmaXiPi = o2::aod::cascdata::kNoTOFValue;;
806+
float nSigmaOmLaPr = o2::aod::cascdata::kNoTOFValue;;
807+
float nSigmaOmLaPi = o2::aod::cascdata::kNoTOFValue;;
808+
float nSigmaOmKa = o2::aod::cascdata::kNoTOFValue;;
809809

810810
// go for Nsigma values if requested
811811
if (doNSigmas && nSigmaCalibLoaded) {

0 commit comments

Comments
 (0)