Skip to content

Commit 4a70c85

Browse files
committed
A3: add expected times
1 parent 53ce330 commit 4a70c85

File tree

2 files changed

+42
-7
lines changed

2 files changed

+42
-7
lines changed

ALICE3/DataModel/OTFTOF.h

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,26 @@ DECLARE_SOA_COLUMN(NSigmaKaonInnerTOF, nSigmaKaonInnerTOF, float); //!
4141
DECLARE_SOA_COLUMN(NSigmaProtonInnerTOF, nSigmaProtonInnerTOF, float); //! NSigma proton InnerTOF
4242
DECLARE_SOA_COLUMN(InnerTOFTrackTimeReco, innerTOFTrackTimeReco, float); //! Track time measured at the InnerTOF
4343
DECLARE_SOA_COLUMN(InnerTOFTrackLengthReco, innerTOFTrackLengthReco, float); //! track length for calculation of InnerTOF (reconstructed)
44+
45+
DECLARE_SOA_COLUMN(InnerTOFExpectedTimeEl, innerTOFExpectedTimeEl, float); //! Reconstructed expected time at the InnerTOF for the Electron mass hypotheses
46+
DECLARE_SOA_COLUMN(InnerTOFExpectedTimeMu, innerTOFExpectedTimeMu, float); //! Reconstructed expected time at the InnerTOF for the Muon mass hypotheses
47+
DECLARE_SOA_COLUMN(InnerTOFExpectedTimePi, innerTOFExpectedTimePi, float); //! Reconstructed expected time at the InnerTOF for the Pion mass hypotheses
48+
DECLARE_SOA_COLUMN(InnerTOFExpectedTimeKa, innerTOFExpectedTimeKa, float); //! Reconstructed expected time at the InnerTOF for the Kaon mass hypotheses
49+
DECLARE_SOA_COLUMN(InnerTOFExpectedTimePr, innerTOFExpectedTimePr, float); //! Reconstructed expected time at the InnerTOF for the Proton mass hypotheses
50+
4451
DECLARE_SOA_COLUMN(NSigmaElectronOuterTOF, nSigmaElectronOuterTOF, float); //! NSigma electron OuterTOF
4552
DECLARE_SOA_COLUMN(NSigmaMuonOuterTOF, nSigmaMuonOuterTOF, float); //! NSigma muon OuterTOF
4653
DECLARE_SOA_COLUMN(NSigmaPionOuterTOF, nSigmaPionOuterTOF, float); //! NSigma pion OuterTOF
4754
DECLARE_SOA_COLUMN(NSigmaKaonOuterTOF, nSigmaKaonOuterTOF, float); //! NSigma kaon OuterTOF
4855
DECLARE_SOA_COLUMN(NSigmaProtonOuterTOF, nSigmaProtonOuterTOF, float); //! NSigma proton OuterTOF
4956
DECLARE_SOA_COLUMN(OuterTOFTrackTimeReco, outerTOFTrackTimeReco, float); //! Track time measured at the OuterTOF
5057
DECLARE_SOA_COLUMN(OuterTOFTrackLengthReco, outerTOFTrackLengthReco, float); //! track length for calculation of OuterTOF (reconstructed)
58+
59+
DECLARE_SOA_COLUMN(OuterTOFExpectedTimeEl, outerTOFExpectedTimeEl, float); //! Reconstructed expected time at the OuterTOF for the Electron mass hypotheses
60+
DECLARE_SOA_COLUMN(OuterTOFExpectedTimeMu, outerTOFExpectedTimeMu, float); //! Reconstructed expected time at the OuterTOF for the Muon mass hypotheses
61+
DECLARE_SOA_COLUMN(OuterTOFExpectedTimePi, outerTOFExpectedTimePi, float); //! Reconstructed expected time at the OuterTOF for the Pion mass hypotheses
62+
DECLARE_SOA_COLUMN(OuterTOFExpectedTimeKa, outerTOFExpectedTimeKa, float); //! Reconstructed expected time at the OuterTOF for the Kaon mass hypotheses
63+
DECLARE_SOA_COLUMN(OuterTOFExpectedTimePr, outerTOFExpectedTimePr, float); //! Reconstructed expected time at the OuterTOF for the Proton mass hypotheses
5164
} // namespace upgrade_tof
5265

5366
DECLARE_SOA_TABLE(UpgradeTofMCs, "AOD", "UPGRADETOFMC",
@@ -74,8 +87,21 @@ DECLARE_SOA_TABLE(UpgradeTofs, "AOD", "UPGRADETOF",
7487
upgrade_tof::OuterTOFTrackTimeReco,
7588
upgrade_tof::OuterTOFTrackLengthReco);
7689

77-
using UpgradeTof = UpgradeTofs::iterator;
90+
DECLARE_SOA_TABLE(UpgradeTofExpectedTimes, "AOD", "UPGRADETOFEXPT",
91+
upgrade_tof::InnerTOFExpectedTimeEl,
92+
upgrade_tof::InnerTOFExpectedTimeMu,
93+
upgrade_tof::InnerTOFExpectedTimePi,
94+
upgrade_tof::InnerTOFExpectedTimeKa,
95+
upgrade_tof::InnerTOFExpectedTimePr,
96+
upgrade_tof::OuterTOFExpectedTimeEl,
97+
upgrade_tof::OuterTOFExpectedTimeMu,
98+
upgrade_tof::OuterTOFExpectedTimePi,
99+
upgrade_tof::OuterTOFExpectedTimeKa,
100+
upgrade_tof::OuterTOFExpectedTimePr);
101+
78102
using UpgradeTofMC = UpgradeTofMCs::iterator;
103+
using UpgradeTof = UpgradeTofs::iterator;
104+
using UpgradeTofExpectedTime = UpgradeTofExpectedTimes::iterator;
79105

80106
} // namespace o2::aod
81107

ALICE3/TableProducer/OTF/onTheFlyTOFPID.cxx

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ using namespace o2::framework;
6363
struct OnTheFlyTofPid {
6464
Produces<aod::UpgradeTofMC> upgradeTofMC;
6565
Produces<aod::UpgradeTof> upgradeTof;
66+
Produces<aod::UpgradeTofExpectedTime> upgradeTofExpectedTime;
6667

6768
// necessary for particle charges
6869
Service<o2::framework::O2DatabasePDG> pdg;
@@ -141,7 +142,7 @@ struct OnTheFlyTofPid {
141142
mapPdgLut.insert(std::make_pair(321, lutKaChar));
142143
mapPdgLut.insert(std::make_pair(2212, lutPrChar));
143144

144-
for (auto e : mapPdgLut) {
145+
for (const auto& e : mapPdgLut) {
145146
if (!mSmearer.loadTable(e.first, e.second)) {
146147
LOG(fatal) << "Having issue with loading the LUT " << e.first << " " << e.second;
147148
}
@@ -350,7 +351,7 @@ struct OnTheFlyTofPid {
350351
float sum = 0.;
351352
float sumw = 0.;
352353

353-
for (auto& track : tracks) {
354+
for (const auto& track : tracks) {
354355
auto pdgInfo = pdg->GetParticle(track.mPdgCode);
355356
if (pdgInfo == nullptr) {
356357
continue;
@@ -549,8 +550,9 @@ struct OnTheFlyTofPid {
549550
const float noSmearingPt = trkWithTime.mNoSmearingPt;
550551

551552
// Straight to Nsigma
552-
float deltaTimeInnerTOF[5], nSigmaInnerTOF[5];
553-
float deltaTimeOuterTOF[5], nSigmaOuterTOF[5];
553+
static std::array<float, 5> expectedTimeInnerTOF, expectedTimeOuterTOF;
554+
static std::array<float, 5> deltaTimeInnerTOF, deltaTimeOuterTOF;
555+
static std::array<float, 5> nSigmaInnerTOF, nSigmaOuterTOF;
554556
static constexpr int lpdg_array[5] = {kElectron, kMuonMinus, kPiPlus, kKPlus, kProton};
555557
float masses[5];
556558

@@ -576,8 +578,13 @@ struct OnTheFlyTofPid {
576578

577579
auto pdgInfoThis = pdg->GetParticle(lpdg_array[ii]);
578580
masses[ii] = pdgInfoThis->Mass();
579-
deltaTimeInnerTOF[ii] = trackLengthRecoInnerTOF / velocity(momentum, masses[ii]) - measuredTimeInnerTOF;
580-
deltaTimeOuterTOF[ii] = trackLengthRecoOuterTOF / velocity(momentum, masses[ii]) - measuredTimeOuterTOF;
581+
const float v = velocity(momentum, masses[ii]);
582+
583+
expectedTimeInnerTOF[ii] = trackLengthInnerTOF / v;
584+
expectedTimeOuterTOF[ii] = trackLengthOuterTOF / v;
585+
586+
deltaTimeInnerTOF[ii] = measuredTimeInnerTOF - expectedTimeInnerTOF[ii];
587+
deltaTimeOuterTOF[ii] = measuredTimeOuterTOF - expectedTimeInnerTOF[ii];
581588

582589
// Evaluate total sigma (layer + tracking resolution)
583590
float innerTotalTimeReso = simConfig.innerTOFTimeReso;
@@ -769,6 +776,8 @@ struct OnTheFlyTofPid {
769776
measuredTimeInnerTOF, trackLengthRecoInnerTOF,
770777
nSigmaOuterTOF[0], nSigmaOuterTOF[1], nSigmaOuterTOF[2], nSigmaOuterTOF[3], nSigmaOuterTOF[4],
771778
measuredTimeOuterTOF, trackLengthRecoOuterTOF);
779+
upgradeTofExpectedTime(expectedTimeInnerTOF[0], expectedTimeInnerTOF[1], expectedTimeInnerTOF[2], expectedTimeInnerTOF[3], expectedTimeInnerTOF[4],
780+
expectedTimeOuterTOF[0], expectedTimeOuterTOF[1], expectedTimeOuterTOF[2], expectedTimeOuterTOF[3], expectedTimeOuterTOF[4]);
772781
}
773782
}
774783
};

0 commit comments

Comments
 (0)