Skip to content
Merged
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
76 changes: 76 additions & 0 deletions Common/DataModel/PIDResponseTOF.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#define COMMON_DATAMODEL_PIDRESPONSETOF_H_

#include "Common/Core/PID/PIDTOF.h"
#include "Common/Core/PID/PIDTOFParamService.h"

#include <Framework/ASoA.h>
#include <Framework/AnalysisDataModel.h>
Expand Down Expand Up @@ -226,7 +227,7 @@
}

DECLARE_SOA_COLUMN(GoodTOFMatch, goodTOFMatch, bool); //! Bool for the TOF PID information on the single track information
DECLARE_SOA_COLUMN(TOFFlags, tofFlags, uint8_t); //! Flag for the complementary TOF PID information for the event time

Check failure on line 230 in Common/DataModel/PIDResponseTOF.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(IsEvTimeDefined, isEvTimeDefined, //! True if the Event Time was computed with any method i.e. there is a usable event time
[](uint8_t flags) -> bool { return (flags > 0); });
DECLARE_SOA_DYNAMIC_COLUMN(IsEvTimeTOF, isEvTimeTOF, //! True if the Event Time was computed with the TOF
Expand All @@ -250,7 +251,7 @@

namespace pidtofsignal
{
DECLARE_SOA_COLUMN(TOFSignal, tofSignal, float); //! TOF signal from track time

Check failure on line 254 in Common/DataModel/PIDResponseTOF.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(EventCollisionTime, eventCollisionTime, //! Event collision time used for the track. Needs the TOF
[](float signal, float tMinusTexp, float texp) -> float { return texp + tMinusTexp - signal; });

Expand All @@ -262,8 +263,8 @@

namespace pidtofevtime
{
DECLARE_SOA_COLUMN(TOFEvTime, tofEvTime, float); //! event time for TOF signal. Can be obtained via a combination of detectors e.g. TOF, FT0A, FT0C

Check failure on line 266 in Common/DataModel/PIDResponseTOF.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(TOFEvTimeErr, tofEvTimeErr, float); //! event time error for TOF. Can be obtained via a combination of detectors e.g. TOF, FT0A, FT0C

Check failure on line 267 in Common/DataModel/PIDResponseTOF.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 pidtofevtime

DECLARE_SOA_TABLE(TOFEvTime, "AOD", "TOFEvTime", //! Table of the TOF event time. One entry per track.
Expand All @@ -273,17 +274,17 @@
namespace pidtof
{
// Expected signals
DECLARE_SOA_DYNAMIC_COLUMN(TOFExpSignalEl, tofExpSignalEl, //! Expected time for electron

Check failure on line 277 in Common/DataModel/PIDResponseTOF.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.
[](float nsigma, float sigma, float tofsignal) -> float { return tofsignal - nsigma * sigma; });
DECLARE_SOA_DYNAMIC_COLUMN(TOFExpSignalMu, tofExpSignalMu, //! Expected time for muon

Check failure on line 279 in Common/DataModel/PIDResponseTOF.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.
[](float nsigma, float sigma, float tofsignal) -> float { return tofsignal - nsigma * sigma; });
DECLARE_SOA_DYNAMIC_COLUMN(TOFExpSignalPi, tofExpSignalPi, //! Expected time for pion

Check failure on line 281 in Common/DataModel/PIDResponseTOF.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.
[](float nsigma, float sigma, float tofsignal) -> float { return tofsignal - nsigma * sigma; });
DECLARE_SOA_DYNAMIC_COLUMN(TOFExpSignalKa, tofExpSignalKa, //! Expected time for kaon

Check failure on line 283 in Common/DataModel/PIDResponseTOF.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.
[](float nsigma, float sigma, float tofsignal) -> float { return tofsignal - nsigma * sigma; });
DECLARE_SOA_DYNAMIC_COLUMN(TOFExpSignalPr, tofExpSignalPr, //! Expected time for proton

Check failure on line 285 in Common/DataModel/PIDResponseTOF.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.
[](float nsigma, float sigma, float tofsignal) -> float { return tofsignal - nsigma * sigma; });
DECLARE_SOA_DYNAMIC_COLUMN(TOFExpSignalDe, tofExpSignalDe, //! Expected time for deuteron

Check failure on line 287 in Common/DataModel/PIDResponseTOF.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.
[](float nsigma, float sigma, float tofsignal) -> float { return tofsignal - nsigma * sigma; });
DECLARE_SOA_DYNAMIC_COLUMN(TOFExpSignalTr, tofExpSignalTr, //! Expected time for triton
[](float nsigma, float sigma, float tofsignal) -> float { return tofsignal - nsigma * sigma; });
Expand Down Expand Up @@ -331,8 +332,83 @@
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<id>(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<id>(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<pidtofsignal::TOFSignal, track::TOFExpMom, track::P, track::Eta, pidtofevtime::TOFEvTimeErr>;
using TOFExpSigmaDynMu = pidtof::TOFExpSigmaMuImp<pidtofsignal::TOFSignal, track::TOFExpMom, track::P, track::Eta, pidtofevtime::TOFEvTimeErr>;
using TOFExpSigmaDynPi = pidtof::TOFExpSigmaPiImp<pidtofsignal::TOFSignal, track::TOFExpMom, track::P, track::Eta, pidtofevtime::TOFEvTimeErr>;
using TOFExpSigmaDynKa = pidtof::TOFExpSigmaKaImp<pidtofsignal::TOFSignal, track::TOFExpMom, track::P, track::Eta, pidtofevtime::TOFEvTimeErr>;
using TOFExpSigmaDynPr = pidtof::TOFExpSigmaPrImp<pidtofsignal::TOFSignal, track::TOFExpMom, track::P, track::Eta, pidtofevtime::TOFEvTimeErr>;
using TOFExpSigmaDynDe = pidtof::TOFExpSigmaDeImp<pidtofsignal::TOFSignal, track::TOFExpMom, track::P, track::Eta, pidtofevtime::TOFEvTimeErr>;
using TOFExpSigmaDynTr = pidtof::TOFExpSigmaTrImp<pidtofsignal::TOFSignal, track::TOFExpMom, track::P, track::Eta, pidtofevtime::TOFEvTimeErr>;
using TOFExpSigmaDynHe = pidtof::TOFExpSigmaHeImp<pidtofsignal::TOFSignal, track::TOFExpMom, track::P, track::Eta, pidtofevtime::TOFEvTimeErr>;
using TOFExpSigmaDynAl = pidtof::TOFExpSigmaAlImp<pidtofsignal::TOFSignal, track::TOFExpMom, track::P, track::Eta, pidtofevtime::TOFEvTimeErr>;

using TOFNSigmaDynEl = pidtof::TOFNSigmaElImp<pidtofsignal::TOFSignal, track::TOFExpMom, track::Length, track::P, track::Eta, pidtofevtime::TOFEvTime, pidtofevtime::TOFEvTimeErr>;
using TOFNSigmaDynMu = pidtof::TOFNSigmaMuImp<pidtofsignal::TOFSignal, track::TOFExpMom, track::Length, track::P, track::Eta, pidtofevtime::TOFEvTime, pidtofevtime::TOFEvTimeErr>;
using TOFNSigmaDynPi = pidtof::TOFNSigmaPiImp<pidtofsignal::TOFSignal, track::TOFExpMom, track::Length, track::P, track::Eta, pidtofevtime::TOFEvTime, pidtofevtime::TOFEvTimeErr>;
using TOFNSigmaDynKa = pidtof::TOFNSigmaKaImp<pidtofsignal::TOFSignal, track::TOFExpMom, track::Length, track::P, track::Eta, pidtofevtime::TOFEvTime, pidtofevtime::TOFEvTimeErr>;
using TOFNSigmaDynPr = pidtof::TOFNSigmaPrImp<pidtofsignal::TOFSignal, track::TOFExpMom, track::Length, track::P, track::Eta, pidtofevtime::TOFEvTime, pidtofevtime::TOFEvTimeErr>;
using TOFNSigmaDynDe = pidtof::TOFNSigmaDeImp<pidtofsignal::TOFSignal, track::TOFExpMom, track::Length, track::P, track::Eta, pidtofevtime::TOFEvTime, pidtofevtime::TOFEvTimeErr>;
using TOFNSigmaDynTr = pidtof::TOFNSigmaTrImp<pidtofsignal::TOFSignal, track::TOFExpMom, track::Length, track::P, track::Eta, pidtofevtime::TOFEvTime, pidtofevtime::TOFEvTimeErr>;
using TOFNSigmaDynHe = pidtof::TOFNSigmaHeImp<pidtofsignal::TOFSignal, track::TOFExpMom, track::Length, track::P, track::Eta, pidtofevtime::TOFEvTime, pidtofevtime::TOFEvTimeErr>;
using TOFNSigmaDynAl = pidtof::TOFNSigmaAlImp<pidtofsignal::TOFSignal, track::TOFExpMom, track::Length, track::P, track::Eta, pidtofevtime::TOFEvTime, pidtofevtime::TOFEvTimeErr>;

namespace pidtof_tiny
{
struct binning {
Expand Down
Loading