Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions PWGLF/DataModel/LFStrangenessPIDTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,16 @@
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

//**********************************************************************
// Defines TOF PID tables for strangeness.
// Entries calculated per candidate, tables are joinable with v0/cascdata tables.
//**********************************************************************

//**********************************************************************
// Nota bene: when using, do not check track.hasTOF! That conditional may not match
// the calculation of strangeness TOF, which requires e.g. a successful calculation
// of the collision time for the reassociated collision
//**********************************************************************

#ifndef PWGLF_DATAMODEL_LFSTRANGENESSPIDTABLES_H_
#define PWGLF_DATAMODEL_LFSTRANGENESSPIDTABLES_H_
Expand Down Expand Up @@ -74,21 +82,21 @@
namespace dautrack_legacy
{
// ==== LEGACY TPC INFORMATION (full size tables) ===
DECLARE_SOA_COLUMN(TPCNSigmaEl, tpcNSigmaEl, float); //! Nsigma proton

Check failure on line 85 in PWGLF/DataModel/LFStrangenessPIDTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
DECLARE_SOA_COLUMN(TPCNSigmaPi, tpcNSigmaPi, float); //! Nsigma proton

Check failure on line 86 in PWGLF/DataModel/LFStrangenessPIDTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
DECLARE_SOA_COLUMN(TPCNSigmaKa, tpcNSigmaKa, float); //! Nsigma proton

Check failure on line 87 in PWGLF/DataModel/LFStrangenessPIDTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
DECLARE_SOA_COLUMN(TPCNSigmaPr, tpcNSigmaPr, float); //! Nsigma proton

Check failure on line 88 in PWGLF/DataModel/LFStrangenessPIDTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
DECLARE_SOA_COLUMN(TPCNSigmaHe, tpcNSigmaHe, float); //! Nsigma proton

Check failure on line 89 in PWGLF/DataModel/LFStrangenessPIDTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
} // namespace dautrack_legacy

namespace dautrack
{
// ==== COMPACT TPC INFORMATION (full size tables) ===
DECLARE_SOA_COLUMN(TPCSignal, tpcSignal, float); //! track TPC signal

Check failure on line 95 in PWGLF/DataModel/LFStrangenessPIDTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
DECLARE_SOA_COLUMN(PackedTPCNSigmaEl, packedTpcNSigmaEl, int8_t); //! Nsigma proton

Check failure on line 96 in PWGLF/DataModel/LFStrangenessPIDTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
DECLARE_SOA_COLUMN(PackedTPCNSigmaPi, packedTpcNSigmaPi, int8_t); //! Nsigma proton

Check failure on line 97 in PWGLF/DataModel/LFStrangenessPIDTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
DECLARE_SOA_COLUMN(PackedTPCNSigmaKa, packedTpcNSigmaKa, int8_t); //! Nsigma proton

Check failure on line 98 in PWGLF/DataModel/LFStrangenessPIDTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
DECLARE_SOA_COLUMN(PackedTPCNSigmaPr, packedTpcNSigmaPr, int8_t); //! Nsigma proton

Check failure on line 99 in PWGLF/DataModel/LFStrangenessPIDTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.

DECLARE_SOA_DYNAMIC_COLUMN(TPCNSigmaEl, tpcNSigmaEl, //! unpacked TPC nsigma
[](int8_t nsigma_packed) -> float { return o2::aod::dautrack::packing::unpackInt8(nsigma_packed); });
Expand Down Expand Up @@ -203,6 +211,25 @@
DECLARE_SOA_COLUMN(TOFNSigmaK0PiPlus, tofNSigmaK0PiPlus, float); //! positive track NSigma from pion <- k0short expectation
DECLARE_SOA_COLUMN(TOFNSigmaK0PiMinus, tofNSigmaK0PiMinus, float); //! negative track NSigma from pion <- k0short expectation

// dynamics to replace hasTOF (note: that condition does not match track hasTOF!)
// note: only single hypothesis check necessary; other hypotheses will always be valid
DECLARE_SOA_DYNAMIC_COLUMN(PositiveHasTOF, positiveHasTOF, //! positive daughter TOF calculation valid
[](float TOFNSigmaLaPr) -> bool {
bool returnStatus = true;
if (std::abs(TOFNSigmaLaPr - kNoTOFValue) < kEpsilon) {
returnStatus = false;
}
return returnStatus;
});
DECLARE_SOA_DYNAMIC_COLUMN(NegativeHasTOF, negativeHasTOF, //! negative daughter TOF calculation valid
[](float TOFNSigmaALaPr) -> bool {
bool returnStatus = true;
if (std::abs(TOFNSigmaALaPr - kNoTOFValue) < kEpsilon) {
returnStatus = false;
}
return returnStatus;
});

// dynamics based on n-sigmas with use-only-if-tof-present logic
DECLARE_SOA_DYNAMIC_COLUMN(TofLambdaCompatibility, tofLambdaCompatibility, //! compatibility with being lambda, checked only if TOF present. Argument: number of sigmas
[](float tofNSigmaLaPr, float tofNSigmaLaPi, float nsigma) -> float {
Expand Down Expand Up @@ -284,6 +311,8 @@
v0data::TOFNSigmaLaPr, v0data::TOFNSigmaLaPi,
v0data::TOFNSigmaALaPr, v0data::TOFNSigmaALaPi,
v0data::TOFNSigmaK0PiPlus, v0data::TOFNSigmaK0PiMinus,
v0data::PositiveHasTOF<v0data::TOFNSigmaLaPr>,
v0data::NegativeHasTOF<v0data::TOFNSigmaALaPr>,
v0data::TofLambdaCompatibility<v0data::TOFNSigmaLaPr, v0data::TOFNSigmaLaPi>,
v0data::TofAntiLambdaCompatibility<v0data::TOFNSigmaALaPr, v0data::TOFNSigmaALaPi>,
v0data::TofK0ShortCompatibility<v0data::TOFNSigmaK0PiPlus, v0data::TOFNSigmaK0PiMinus>);
Expand Down Expand Up @@ -325,6 +354,33 @@
DECLARE_SOA_COLUMN(TOFNSigmaOmLaPr, tofNSigmaOmLaPr, float); //! baryon track NSigma from proton <- lambda <- om expectation
DECLARE_SOA_COLUMN(TOFNSigmaOmKa, tofNSigmaOmKa, float); //! bachelor track NSigma from kaon <- om expectation

// dynamics to replace hasTOF (note: that condition does not match track hasTOF!)
// note: only single hypothesis check necessary; other hypotheses will always be valid
DECLARE_SOA_DYNAMIC_COLUMN(PositiveHasTOF, positiveHasTOF, //! positive daughter TOF calculation valid
[](float PosTOFDeltaTXiPr) -> bool {
bool returnStatus = true;
if (std::abs(PosTOFDeltaTXiPr - kNoTOFValue) < kEpsilon) {
returnStatus = false;
}
return returnStatus;
});
DECLARE_SOA_DYNAMIC_COLUMN(NegativeHasTOF, negativeHasTOF, //! positive daughter TOF calculation valid
[](float NegTOFDeltaTXiPr) -> bool {
bool returnStatus = true;
if (std::abs(NegTOFDeltaTXiPr - kNoTOFValue) < kEpsilon) {
returnStatus = false;
}
return returnStatus;
});
DECLARE_SOA_DYNAMIC_COLUMN(BachelorHasTOF, bachelorHasTOF, //! bachelor daughter TOF calculation valid
[](float BachTOFDeltaTXiPi) -> bool {
bool returnStatus = true;
if (std::abs(BachTOFDeltaTXiPi - kNoTOFValue) < kEpsilon) {
returnStatus = false;
}
return returnStatus;
});

// dynamics based on n-sigmas with use-only-if-tof-present logic
DECLARE_SOA_DYNAMIC_COLUMN(TofXiCompatibility, tofXiCompatibility, //! compatibility with being lambda, checked only if TOF present. Argument: number of sigmas
[](float tofNSigmaXiLaPr, float tofNSigmaXiLaPi, float tofNSigmaXiPi, float nsigma) -> float {
Expand Down Expand Up @@ -376,6 +432,9 @@
DECLARE_SOA_TABLE(CascTOFNSigmas, "AOD", "CascTOFNSigmas", // Nsigmas for cascades
cascdata::TOFNSigmaXiLaPi, cascdata::TOFNSigmaXiLaPr, cascdata::TOFNSigmaXiPi,
cascdata::TOFNSigmaOmLaPi, cascdata::TOFNSigmaOmLaPr, cascdata::TOFNSigmaOmKa,
cascdata::PositiveHasTOF<cascdata::PosTOFDeltaTXiPr>,
cascdata::NegativeHasTOF<cascdata::NegTOFDeltaTXiPr>,
cascdata::BachelorHasTOF<cascdata::BachTOFDeltaTXiPi>,
cascdata::TofXiCompatibility<cascdata::TOFNSigmaXiLaPr, cascdata::TOFNSigmaXiLaPi, cascdata::TOFNSigmaXiPi>,
cascdata::TofOmegaCompatibility<cascdata::TOFNSigmaOmLaPr, cascdata::TOFNSigmaOmLaPi, cascdata::TOFNSigmaOmKa>);
} // namespace o2::aod
Expand Down
30 changes: 20 additions & 10 deletions PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,7 @@ struct strangenesstofpid {
float velocityPositivePr, velocityPositivePi, lengthPositive;
velocityPositivePr = velocityPositivePi = lengthPositive = o2::aod::v0data::kNoTOFValue;

if (pTof.hasTOF && pTof.hasITS && pTof.tofEvTime > -1e+5 && pValidTOF) {
if (pTof.hasTOF && pTof.tofEvTime > -1e+5 && pValidTOF) {
// method 0: legacy standalone without use of primary particle TOF
if (calculationMethod.value == 0) {
velocityPositivePr = velocity(posTrack.getP(), o2::constants::physics::MassProton);
Expand All @@ -823,7 +823,9 @@ struct strangenesstofpid {
const o2::math_utils::Point3D<float> trackVertex{trackCollision.posX(), trackCollision.posY(), trackCollision.posZ()};
o2::track::TrackLTIntegral ltIntegral;
bool successPropag = o2::base::Propagator::Instance()->propagateToDCA(trackVertex, posTrack, d_bz, 2.f, o2::base::Propagator::MatCorrType::USEMatCorrNONE, nullptr, &ltIntegral);
histos.fill(HIST("hPropagationBookkeeping"), kPropagPosV0, static_cast<float>(successPropag));
if (doQA) {
histos.fill(HIST("hPropagationBookkeeping"), kPropagPosV0, static_cast<float>(successPropag));
}
if (successPropag) {
lengthPositive = pTof.length - ltIntegral.getL();
v0tof.timePositivePr = o2::framework::pid::tof::MassToExpTime(pTof.tofExpMom, lengthPositive, o2::constants::physics::MassProton * o2::constants::physics::MassProton);
Expand Down Expand Up @@ -880,7 +882,7 @@ struct strangenesstofpid {
}
float velocityNegativePr, velocityNegativePi, lengthNegative;
velocityNegativePr = velocityNegativePi = lengthNegative = o2::aod::v0data::kNoTOFValue;
if (nTof.hasTOF && nTof.hasITS && nTof.tofEvTime > -1e+5 && nValidTOF) {
if (nTof.hasTOF && nTof.tofEvTime > -1e+5 && nValidTOF) {
// method 0: legacy standalone without use of primary particle TOF
if (calculationMethod.value == 0) {
velocityNegativePr = velocity(negTrack.getP(), o2::constants::physics::MassProton);
Expand All @@ -899,7 +901,9 @@ struct strangenesstofpid {
const o2::math_utils::Point3D<float> trackVertex{trackCollision.posX(), trackCollision.posY(), trackCollision.posZ()};
o2::track::TrackLTIntegral ltIntegral;
bool successPropag = o2::base::Propagator::Instance()->propagateToDCA(trackVertex, negTrack, d_bz, 2.f, o2::base::Propagator::MatCorrType::USEMatCorrNONE, nullptr, &ltIntegral);
histos.fill(HIST("hPropagationBookkeeping"), kPropagNegV0, static_cast<float>(successPropag));
if (doQA) {
histos.fill(HIST("hPropagationBookkeeping"), kPropagNegV0, static_cast<float>(successPropag));
}
if (successPropag) {
lengthNegative = nTof.length - ltIntegral.getL();
v0tof.timeNegativePr = o2::framework::pid::tof::MassToExpTime(nTof.tofExpMom, lengthNegative, o2::constants::physics::MassProton * o2::constants::physics::MassProton);
Expand Down Expand Up @@ -1072,7 +1076,7 @@ struct strangenesstofpid {

//_____________________________________________________________________________________________
// Actual calculation
if (pTof.hasTOF && pTof.hasITS && pTof.tofEvTime > -1e+5 && pValidTOF) {
if (pTof.hasTOF && pTof.tofEvTime > -1e+5 && pValidTOF) {
float velocityPositivePr, velocityPositivePi, lengthPositive;
velocityPositivePr = velocityPositivePi = lengthPositive = o2::aod::v0data::kNoTOFValue;
if (calculationMethod.value == 0) {
Expand All @@ -1092,7 +1096,9 @@ struct strangenesstofpid {
const o2::math_utils::Point3D<float> trackVertex{trackCollision.posX(), trackCollision.posY(), trackCollision.posZ()};
o2::track::TrackLTIntegral ltIntegral;
bool successPropag = o2::base::Propagator::Instance()->propagateToDCA(trackVertex, posTrack, d_bz, 2.f, o2::base::Propagator::MatCorrType::USEMatCorrNONE, nullptr, &ltIntegral);
histos.fill(HIST("hPropagationBookkeeping"), kPropagPosCasc, static_cast<float>(successPropag));
if (doQA) {
histos.fill(HIST("hPropagationBookkeeping"), kPropagPosCasc, static_cast<float>(successPropag));
}
if (successPropag) {
lengthPositive = pTof.length - ltIntegral.getL();
casctof.posFlightPr = o2::framework::pid::tof::MassToExpTime(pTof.tofExpMom, pTof.length - ltIntegral.getL(), o2::constants::physics::MassProton * o2::constants::physics::MassProton);
Expand Down Expand Up @@ -1161,7 +1167,7 @@ struct strangenesstofpid {
}
} // end positive

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

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