Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Data model] add expected times #13454

Merged
merged 3 commits into from
Sep 2, 2024
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
10 changes: 8 additions & 2 deletions Common/Constants/include/CommonConstants/PhysicsConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,14 @@ constexpr double MassLambda = MassLambda0;
constexpr double MassHyperhydrog4 = MassHyperHydrogen4;
constexpr double MassHyperhelium4 = MassHyperHelium4;

constexpr float LightSpeedCm2S = 299792458.e2; // C in cm/s
constexpr float LightSpeedCm2NS = LightSpeedCm2S * 1e-9; // C in cm/ns
// Light speed
constexpr float LightSpeedCm2S = 299792458.e2; // C in cm/s
constexpr float LightSpeedCm2NS = LightSpeedCm2S * 1e-9; // C in cm/ns
constexpr float LightSpeedCm2PS = LightSpeedCm2S * 1e-12; // C in cm/ps

// Light speed inverse
constexpr float invLightSpeedCm2PS = 1. / LightSpeedCm2PS; // 1/C in ps/cm

} // namespace o2::constants::physics

#endif
43 changes: 43 additions & 0 deletions Framework/Core/include/Framework/AnalysisDataModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,41 @@ DECLARE_SOA_EXPRESSION_COLUMN(DetectorMap, detectorMap, uint8_t, //! Detector ma
ifnode(aod::track::trdPattern > (uint8_t)0, static_cast<uint8_t>(o2::aod::track::TRD), (uint8_t)0x0) |
ifnode((aod::track::tofChi2 >= 0.f) && (aod::track::tofExpMom > 0.f), static_cast<uint8_t>(o2::aod::track::TOF), (uint8_t)0x0));

DECLARE_SOA_DYNAMIC_COLUMN(TOFExpTime, tofExpTime, //! Expected time for the track to reach the TOF
[](float length, float tofExpMom, float mMassZSqared) -> float {
if (tofExpMom <= 0.f) {
return -999.f;
}
return length * std::sqrt((mMassZSqared) + (tofExpMom * tofExpMom)) / (o2::constants::physics::LightSpeedCm2PS * tofExpMom);
});

DECLARE_SOA_DYNAMIC_COLUMN(TOFExpTimePi, tofExpTimePi, //! Expected time for the track to reach the TOF under the pion hypothesis
[](float length, float tofExpMom) -> float {
if (tofExpMom <= 0.f) {
return -999.f;
}
constexpr float mMassZSqared = o2::constants::physics::MassPionCharged * o2::constants::physics::MassPionCharged;
return length * std::sqrt((mMassZSqared) + (tofExpMom * tofExpMom)) / (o2::constants::physics::LightSpeedCm2PS * tofExpMom);
});

DECLARE_SOA_DYNAMIC_COLUMN(TOFExpTimeKa, tofExpTimeKa, //! Expected time for the track to reach the TOF under the kaon hypothesis
[](float length, float tofExpMom) -> float {
if (tofExpMom <= 0.f) {
return -999.f;
}
constexpr float mMassZSqared = o2::constants::physics::MassKaonCharged * o2::constants::physics::MassKaonCharged;
return length * std::sqrt((mMassZSqared) + (tofExpMom * tofExpMom)) / (o2::constants::physics::LightSpeedCm2PS * tofExpMom);
});

DECLARE_SOA_DYNAMIC_COLUMN(TOFExpTimePr, tofExpTimePr, //! Expected time for the track to reach the TOF under the proton hypothesis
[](float length, float tofExpMom) -> float {
if (tofExpMom <= 0.f) {
return -999.f;
}
constexpr float mMassZSqared = o2::constants::physics::MassProton * o2::constants::physics::MassProton;
return length * std::sqrt((mMassZSqared) + (tofExpMom * tofExpMom)) / (o2::constants::physics::LightSpeedCm2PS * tofExpMom);
});

namespace v001
{
DECLARE_SOA_EXPRESSION_COLUMN(DetectorMap, detectorMap, uint8_t, //! Detector map version 1, see enum DetectorMapEnum
Expand Down Expand Up @@ -500,6 +535,10 @@ DECLARE_SOA_TABLE_FULL(StoredTracksExtra_000, "TracksExtra", "AOD", "TRACKEXTRA"
track::HasTRD<track::DetectorMap>, track::HasTOF<track::DetectorMap>,
track::TPCNClsFound<track::TPCNClsFindable, track::TPCNClsFindableMinusFound>,
track::TPCNClsCrossedRows<track::TPCNClsFindable, track::TPCNClsFindableMinusCrossedRows>,
track::TOFExpTime<track::Length, track::TOFExpMom>,
track::TOFExpTimePi<track::Length, track::TOFExpMom>,
track::TOFExpTimeKa<track::Length, track::TOFExpMom>,
track::TOFExpTimePr<track::Length, track::TOFExpMom>,
track::ITSNCls<track::ITSClusterMap>, track::ITSNClsInnerBarrel<track::ITSClusterMap>,
track::TPCCrossedRowsOverFindableCls<track::TPCNClsFindable, track::TPCNClsFindableMinusCrossedRows>,
track::TPCFoundOverFindableCls<track::TPCNClsFindable, track::TPCNClsFindableMinusFound>,
Expand All @@ -521,6 +560,10 @@ DECLARE_SOA_TABLE_FULL_VERSIONED(StoredTracksExtra_001, "TracksExtra", "AOD", "T
track::v001::ITSClusterMap<track::ITSClusterSizes>, track::v001::ITSNCls<track::ITSClusterSizes>, track::v001::ITSNClsInnerBarrel<track::ITSClusterSizes>,
track::v001::ITSClsSizeInLayer<track::ITSClusterSizes>,
track::v001::IsITSAfterburner<track::v001::DetectorMap, track::ITSChi2NCl>,
track::TOFExpTime<track::Length, track::TOFExpMom>,
track::TOFExpTimePi<track::Length, track::TOFExpMom>,
track::TOFExpTimeKa<track::Length, track::TOFExpMom>,
track::TOFExpTimePr<track::Length, track::TOFExpMom>,
track::TPCCrossedRowsOverFindableCls<track::TPCNClsFindable, track::TPCNClsFindableMinusCrossedRows>,
track::TPCFoundOverFindableCls<track::TPCNClsFindable, track::TPCNClsFindableMinusFound>,
track::TPCFractionSharedCls<track::TPCNClsShared, track::TPCNClsFindable, track::TPCNClsFindableMinusFound>,
Expand Down
Loading