forked from AliceO2Group/AliceO2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTrackLTIntegral.h
More file actions
91 lines (74 loc) · 2.5 KB
/
TrackLTIntegral.h
File metadata and controls
91 lines (74 loc) · 2.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
/// \file TrackLTIntegral.h
/// \brief Track Length and TOF integral
/// \author ruben.shahoyan@cern.ch
#ifndef ALICEO2_TRACK_LTINTEGRAL_H_
#define ALICEO2_TRACK_LTINTEGRAL_H_
#include "GPUCommonRtypes.h"
#include "GPUCommonDef.h"
#include "ReconstructionDataFormats/PID.h"
namespace o2
{
namespace track
{
class TrackLTIntegral
{
public:
static constexpr float NeglectTime = -1.; // if 1st mT slot contains this, don't fill time
GPUdDefault() TrackLTIntegral() = default;
GPUdDefault() TrackLTIntegral(const TrackLTIntegral& stc) = default;
GPUdDefault() ~TrackLTIntegral() = default;
GPUd() static constexpr int getNTOFs() { return o2::track::PID::NIDs; }
GPUd() float getL() const { return mL; }
GPUd() float getX2X0() const { return mX2X0; }
GPUd() float getXRho() const { return mXRho; }
GPUd() float getTOF(int id) const { return mT[id]; }
GPUd() void clear()
{
mL = 0.f;
mX2X0 = 0.f;
mXRho = 0.f;
for (int i = getNTOFs(); i--;) {
mT[i] = 0.f;
}
}
GPUd() void clearFast()
{
mL = 0.f;
mX2X0 = 0.f;
mXRho = 0.f;
if (!isTimeNotNeeded()) {
for (int i = getNTOFs(); i--;) {
mT[i] = 0.f;
}
}
}
GPUd() void addStep(float dL, float q2p2);
GPUd() void addX2X0(float d) { mX2X0 += d; }
GPUd() void addXRho(float d) { mXRho += d; }
GPUd() void setL(float l) { mL = l; }
GPUd() void setX2X0(float x) { mX2X0 = x; }
GPUd() void setXRho(float x) { mXRho = x; }
GPUd() void setTOF(float t, int id) { mT[id] = t; }
GPUd() void setTimeNotNeeded() { mT[0] = NeglectTime; }
GPUd() bool isTimeNotNeeded() const { return mT[0] == NeglectTime; }
GPUd() void print() const;
private:
float mL = 0.; // length in cm
float mX2X0 = 0.; // integrated X/X0
float mXRho = 0.; // average X*rho
float mT[o2::track::PID::NIDs] = {0.}; // TOF in ps
ClassDefNV(TrackLTIntegral, 2);
};
}; // namespace track
}; // namespace o2
#endif