Skip to content

Commit ec2e0c5

Browse files
committed
Add option for ev time
1 parent eaa0ab0 commit ec2e0c5

File tree

1 file changed

+18
-20
lines changed

1 file changed

+18
-20
lines changed

ALICE3/TableProducer/OTF/onTheFlyTOFPID.cxx

Lines changed: 18 additions & 20 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

@@ -427,7 +423,7 @@ struct OnTheFlyTofPid {
427423

428424
std::array<float, 6> mcPvCov = {0.};
429425
o2::dataformats::VertexBase mcPvVtx({0.0f, 0.0f, 0.0f}, mcPvCov);
430-
const float eventCollisionTimePS = collision.collisionTime() * 1e3; // convert ns to ps
426+
const float eventCollisionTimePS = (considerEventTime.value ? collision.collisionTime() * 1e3 : 0.f); // convert ns to ps
431427
if (collision.has_mcCollision()) {
432428
auto mcCollision = collision.mcCollision();
433429
mcPvVtx.setX(mcCollision.posX());
@@ -519,9 +515,11 @@ struct OnTheFlyTofPid {
519515
// Now we compute the event time for the tracks
520516

521517
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";
518+
if (considerEventTime.value) {
519+
const bool etStatus = eventTime(tracksWithTime, tzero);
520+
if (!etStatus) {
521+
LOG(warning) << "Event time calculation failed with " << tracksWithTime.size() << " tracks";
522+
}
525523
}
526524

527525
if (plotsConfig.doQAplots) {

0 commit comments

Comments
 (0)