Project
Loading...
Searching...
No Matches
TrackLTIntegral.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
15
16#ifndef ALICEO2_TRACK_LTINTEGRAL_H_
17#define ALICEO2_TRACK_LTINTEGRAL_H_
18
19#include "GPUCommonRtypes.h"
20#include "GPUCommonDef.h"
22
23namespace o2
24{
25namespace track
26{
27
29{
30 public:
31 static constexpr float NeglectTime = -1.; // if 1st mT slot contains this, don't fill time
32
36
37 GPUd() static constexpr int getNTOFs() { return o2::track::PID::NIDs; }
38
39 GPUd() float getL() const { return mL; }
40 GPUd() float getX2X0() const { return mX2X0; }
41 GPUd() float getXRho() const { return mXRho; }
42 GPUd() float getTOF(int id) const { return mT[id]; }
43
45 {
46 mL = 0.f;
47 mX2X0 = 0.f;
48 mXRho = 0.f;
49 for (int i = getNTOFs(); i--;) {
50 mT[i] = 0.f;
51 }
52 }
53
54 GPUd() void clearFast()
55 {
56 mL = 0.f;
57 mX2X0 = 0.f;
58 mXRho = 0.f;
59 if (!isTimeNotNeeded()) {
60 for (int i = getNTOFs(); i--;) {
61 mT[i] = 0.f;
62 }
63 }
64 }
65
66 GPUd() void addStep(float dL, float p2Inv);
67 GPUd() void addX2X0(float d) { mX2X0 += d; }
68 GPUd() void addXRho(float d) { mXRho += d; }
69
70 GPUd() void setL(float l) { mL = l; }
71 GPUd() void setX2X0(float x) { mX2X0 = x; }
72 GPUd() void setXRho(float x) { mXRho = x; }
73 GPUd() void setTOF(float t, int id) { mT[id] = t; }
74
75 GPUd() void setTimeNotNeeded() { mT[0] = NeglectTime; }
76 GPUd() bool isTimeNotNeeded() const { return mT[0] == NeglectTime; }
77
78 GPUd() void print() const;
79
80 private:
81 float mL = 0.; // length in cm
82 float mX2X0 = 0.; // integrated X/X0
83 float mXRho = 0.; // average X*rho
84 float mT[o2::track::PID::NIDs] = {0.}; // TOF in ps
85
86 ClassDefNV(TrackLTIntegral, 2);
87};
88}; // namespace track
89}; // namespace o2
90
91#endif
particle ids, masses, names class definition
void print() const
int32_t i
static constexpr ID NIDs
number of defined IDs
Definition PID.h:106
GPUdDefault() TrackLTIntegral()=default
GPUd() void print() const
GPUd() float getXRho() const
GPUd() float getX2X0() const
GPUd() float getTOF(int id) const
GPUd() bool isTimeNotNeeded() const
GPUd() void addXRho(float d)
GPUd() void setX2X0(float x)
GPUd() void addStep(float dL
GPUd() void setL(float l)
GPUd() float getL() const
GPUd() void setTOF(float t
GPUd() static const expr int getNTOFs()
GPUd() void setTimeNotNeeded()
GPUd() void setXRho(float x)
static constexpr float NeglectTime
GLint GLenum GLint x
Definition glcorearb.h:403
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
const value_T x
Definition TrackUtils.h:136
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
vec clear()