Skip to content

Commit e7060a0

Browse files
authored
[ALICE3] A3: Add option for ev time (AliceO2Group#11007)
- add comments - fix some linter errors
1 parent eaa0ab0 commit e7060a0

File tree

1 file changed

+28
-22
lines changed

1 file changed

+28
-22
lines changed

ALICE3/TableProducer/OTF/onTheFlyTOFPID.cxx

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,18 @@
88
// In applying this license CERN does not waive the privileges and immunities
99
// granted to it by virtue of its status as an Intergovernmental Organization
1010
// or submit itself to any jurisdiction.
11-
12-
//
13-
// Task to add a table of track parameters propagated to the primary vertex
14-
//
11+
/// \file onTheFlyTOFPID.cxx
12+
///
13+
/// \brief This task goes straight from a combination of track table and mcParticles
14+
/// and a custom TOF configuration to a table of TOF NSigmas for the particles
15+
/// being analysed. It currently contemplates 5 particle types:
16+
/// electrons, pions, kaons, protons and muons
17+
///
18+
/// More particles could be added but would have to be added to the LUT
19+
/// being used in the onTheFly tracker task.
20+
///
21+
/// \author David Dobrigkeit Chinellato, UNICAMP
22+
/// \author Nicola Nicassio, University and INFN Bari
1523

1624
#include <utility>
1725
#include <map>
@@ -45,18 +53,6 @@
4553
#include "TableHelper.h"
4654
#include "ALICE3/Core/DelphesO2TrackSmearer.h"
4755

48-
/// \file onTheFlyTOFPID.cxx
49-
///
50-
/// \brief This task goes straight from a combination of track table and mcParticles
51-
/// and a custom TOF configuration to a table of TOF NSigmas for the particles
52-
/// being analysed. It currently contemplates 5 particle types:
53-
/// electrons, pions, kaons, protons and muons
54-
///
55-
/// More particles could be added but would have to be added to the LUT
56-
/// being used in the onTheFly tracker task.
57-
///
58-
/// \author David Dobrigkeit Chinellato, UNICAMP, Nicola Nicassio, University and INFN Bari
59-
6056
using namespace o2;
6157
using namespace o2::framework;
6258

@@ -150,10 +146,13 @@ struct OnTheFlyTofPid {
150146
}
151147

152148
if (plotsConfig.doQAplots) {
149+
const AxisSpec axisdNdeta{200, 0.0f, 1000.0f, Form("dN/d#eta in |#eta| < %f", simConfig.multiplicityEtaRange.value)};
150+
151+
histos.add("h1dNdeta", "h2dNdeta", kTH1F, {axisdNdeta});
153152
histos.add("h2dEventTime", "h2dEventTime", kTH2F, {{200, -1000, 1000, "computed"}, {200, -1000, 1000, "generated"}});
154153
histos.add("h1dEventTimegen", "h1dEventTimegen", kTH1F, {{200, -1000, 1000, "generated"}});
155154
histos.add("h1dEventTimerec", "h1dEventTimerec", kTH1F, {{200, -1000, 1000, "computed"}});
156-
histos.add("h1dEventTimeres", "h1dEventTimeres", kTH1F, {{300, 0, 300, "resolution"}});
155+
histos.add("h2dEventTimeres", "h2dEventTimeres", kTH2F, {axisdNdeta, {300, 0, 300, "resolution"}});
157156

158157
const AxisSpec axisMomentum{static_cast<int>(plotsConfig.nBinsP), 0.0f, +10.0f, "#it{p} (GeV/#it{c})"};
159158
const AxisSpec axisMomentumSmall{static_cast<int>(plotsConfig.nBinsP), 0.0f, +1.0f, "#it{p} (GeV/#it{c})"};
@@ -351,6 +350,7 @@ struct OnTheFlyTofPid {
351350
float sum = 0.;
352351
float sumw = 0.;
353352

353+
// Todo: check the different mass hypothesis iteratively
354354
for (const auto& track : tracks) {
355355
auto pdgInfo = pdg->GetParticle(track.mPdgCode);
356356
if (pdgInfo == nullptr) {
@@ -427,7 +427,7 @@ struct OnTheFlyTofPid {
427427

428428
std::array<float, 6> mcPvCov = {0.};
429429
o2::dataformats::VertexBase mcPvVtx({0.0f, 0.0f, 0.0f}, mcPvCov);
430-
const float eventCollisionTimePS = collision.collisionTime() * 1e3; // convert ns to ps
430+
const float eventCollisionTimePS = (simConfig.considerEventTime.value ? collision.collisionTime() * 1e3 : 0.f); // convert ns to ps
431431
if (collision.has_mcCollision()) {
432432
auto mcCollision = collision.mcCollision();
433433
mcPvVtx.setX(mcCollision.posX());
@@ -459,6 +459,9 @@ struct OnTheFlyTofPid {
459459
dNdEta += 1.f;
460460
}
461461
}
462+
if (plotsConfig.doQAplots) {
463+
histos.fill(HIST("h1dNdeta"), dNdEta);
464+
}
462465

463466
tracksWithTime.clear(); // clear the vector of tracks with time to prepare the cache for the next event
464467
tracksWithTime.reserve(tracks.size());
@@ -519,16 +522,18 @@ struct OnTheFlyTofPid {
519522
// Now we compute the event time for the tracks
520523

521524
std::array<float, 2> tzero = {0.f, 0.f};
522-
const bool etStatus = eventTime(tracksWithTime, tzero);
523-
if (!etStatus) {
524-
LOG(warning) << "Event time calculation failed with " << tracksWithTime.size() << " tracks";
525+
if (simConfig.considerEventTime.value) {
526+
const bool etStatus = eventTime(tracksWithTime, tzero);
527+
if (!etStatus) {
528+
LOG(warning) << "Event time calculation failed with " << tracksWithTime.size() << " tracks";
529+
}
525530
}
526531

527532
if (plotsConfig.doQAplots) {
528533
histos.fill(HIST("h2dEventTime"), tzero[0], eventCollisionTimePS);
529534
histos.fill(HIST("h1dEventTimegen"), eventCollisionTimePS);
530535
histos.fill(HIST("h1dEventTimerec"), tzero[0]);
531-
histos.fill(HIST("h1dEventTimeres"), tzero[1]);
536+
histos.fill(HIST("h2dEventTimeres"), dNdEta, tzero[1]);
532537
}
533538

534539
// Then we do a second loop to compute the measured quantities with the measured event time
@@ -543,6 +548,7 @@ struct OnTheFlyTofPid {
543548
const float trackLengthRecoOuterTOF = trkWithTime.mTrackLengthOuterTOF.first;
544549
const float trackLengthInnerTOF = trkWithTime.mTrackLengthInnerTOF.second;
545550
const float trackLengthOuterTOF = trkWithTime.mTrackLengthOuterTOF.second;
551+
// Todo: remove the bias of the track used in the event time calculation for low multiplicity events
546552
const float measuredTimeInnerTOF = trkWithTime.mInnerTOFTime.first - tzero[0];
547553
const float measuredTimeOuterTOF = trkWithTime.mOuterTOFTime.first - tzero[0];
548554
const float momentum = trkWithTime.mMomentum.first;

0 commit comments

Comments
 (0)