From 3a18ff7baf4d5b8afa2915647c5404c87b39fc4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Sun, 2 Nov 2025 11:53:23 +0100 Subject: [PATCH] [TOF] Add dynamic Nsigma and Sigma tables - Make possibility to ask the TOF response from the dynamic tables --- Common/DataModel/PIDResponseTOF.h | 76 +++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/Common/DataModel/PIDResponseTOF.h b/Common/DataModel/PIDResponseTOF.h index 23f266228b8..16ad2e8bf35 100644 --- a/Common/DataModel/PIDResponseTOF.h +++ b/Common/DataModel/PIDResponseTOF.h @@ -21,6 +21,7 @@ #define COMMON_DATAMODEL_PIDRESPONSETOF_H_ #include "Common/Core/PID/PIDTOF.h" +#include "Common/Core/PID/PIDTOFParamService.h" #include #include @@ -331,8 +332,83 @@ DECLARE_SOA_COLUMN(TOFNSigmaTr, tofNSigmaTr, float); //! Nsigma separation with DECLARE_SOA_COLUMN(TOFNSigmaHe, tofNSigmaHe, float); //! Nsigma separation with the TOF detector for helium3 DECLARE_SOA_COLUMN(TOFNSigmaAl, tofNSigmaAl, float); //! Nsigma separation with the TOF detector for alpha +//! Expected resolution with the TOF detector for electron (computed on the fly) +#define PERSPECIES_TOF_SIGMA_COLUMN(name, id) \ + DECLARE_SOA_DYNAMIC_COLUMN(TOFExpSigma##name##Imp, tofExpSigmaDyn##name, \ + [](float tofSignal, \ + float tofExpMom, \ + float momentum, \ + float eta, \ + float tofEvTimeErr) -> float { \ + return o2::pid::tof::TOFResponseImpl::expectedSigma(tofSignal, \ + tofExpMom, \ + momentum, \ + eta, \ + tofEvTimeErr); \ + }); + +PERSPECIES_TOF_SIGMA_COLUMN(El, o2::track::PID::Electron); +PERSPECIES_TOF_SIGMA_COLUMN(Mu, o2::track::PID::Muon); +PERSPECIES_TOF_SIGMA_COLUMN(Pi, o2::track::PID::Pion); +PERSPECIES_TOF_SIGMA_COLUMN(Ka, o2::track::PID::Kaon); +PERSPECIES_TOF_SIGMA_COLUMN(Pr, o2::track::PID::Proton); +PERSPECIES_TOF_SIGMA_COLUMN(De, o2::track::PID::Deuteron); +PERSPECIES_TOF_SIGMA_COLUMN(Tr, o2::track::PID::Triton); +PERSPECIES_TOF_SIGMA_COLUMN(He, o2::track::PID::Helium3); +PERSPECIES_TOF_SIGMA_COLUMN(Al, o2::track::PID::Alpha); +#undef PERSPECIES_TOF_SIGMA_COLUMN + +#define PERSPECIES_TOF_SEPARATION_COLUMN(name, id) \ + DECLARE_SOA_DYNAMIC_COLUMN(TOFNSigma##name##Imp, tofNSigmaDyn##name, \ + [](const float tofSignal, \ + const float tofExpMom, \ + const float length, \ + const float momentum, \ + const float eta, \ + const float tofEvTime, \ + const float tofEvTimeErr) -> float { \ + return o2::pid::tof::TOFResponseImpl::nSigma(tofSignal, \ + tofExpMom, \ + length, \ + momentum, \ + eta, \ + tofEvTime, \ + tofEvTimeErr); \ + }); + +PERSPECIES_TOF_SEPARATION_COLUMN(El, o2::track::PID::Electron); +PERSPECIES_TOF_SEPARATION_COLUMN(Mu, o2::track::PID::Muon); +PERSPECIES_TOF_SEPARATION_COLUMN(Pi, o2::track::PID::Pion); +PERSPECIES_TOF_SEPARATION_COLUMN(Ka, o2::track::PID::Kaon); +PERSPECIES_TOF_SEPARATION_COLUMN(Pr, o2::track::PID::Proton); +PERSPECIES_TOF_SEPARATION_COLUMN(De, o2::track::PID::Deuteron); +PERSPECIES_TOF_SEPARATION_COLUMN(Tr, o2::track::PID::Triton); +PERSPECIES_TOF_SEPARATION_COLUMN(He, o2::track::PID::Helium3); +PERSPECIES_TOF_SEPARATION_COLUMN(Al, o2::track::PID::Alpha); +#undef PERSPECIES_TOF_SEPARATION_COLUMN + } // namespace pidtof +using TOFExpSigmaDynEl = pidtof::TOFExpSigmaElImp; +using TOFExpSigmaDynMu = pidtof::TOFExpSigmaMuImp; +using TOFExpSigmaDynPi = pidtof::TOFExpSigmaPiImp; +using TOFExpSigmaDynKa = pidtof::TOFExpSigmaKaImp; +using TOFExpSigmaDynPr = pidtof::TOFExpSigmaPrImp; +using TOFExpSigmaDynDe = pidtof::TOFExpSigmaDeImp; +using TOFExpSigmaDynTr = pidtof::TOFExpSigmaTrImp; +using TOFExpSigmaDynHe = pidtof::TOFExpSigmaHeImp; +using TOFExpSigmaDynAl = pidtof::TOFExpSigmaAlImp; + +using TOFNSigmaDynEl = pidtof::TOFNSigmaElImp; +using TOFNSigmaDynMu = pidtof::TOFNSigmaMuImp; +using TOFNSigmaDynPi = pidtof::TOFNSigmaPiImp; +using TOFNSigmaDynKa = pidtof::TOFNSigmaKaImp; +using TOFNSigmaDynPr = pidtof::TOFNSigmaPrImp; +using TOFNSigmaDynDe = pidtof::TOFNSigmaDeImp; +using TOFNSigmaDynTr = pidtof::TOFNSigmaTrImp; +using TOFNSigmaDynHe = pidtof::TOFNSigmaHeImp; +using TOFNSigmaDynAl = pidtof::TOFNSigmaAlImp; + namespace pidtof_tiny { struct binning {