forked from AliceO2Group/AliceO2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTrackLTIntegral.cxx
More file actions
58 lines (52 loc) · 1.71 KB
/
TrackLTIntegral.cxx
File metadata and controls
58 lines (52 loc) · 1.71 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
// 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.
#ifndef GPUCA_GPUCODE_DEVICE
#include <cstdint>
#endif
#include "ReconstructionDataFormats/TrackLTIntegral.h"
#include "CommonConstants/PhysicsConstants.h"
#include "MathUtils/Utils.h"
namespace o2
{
namespace track
{
//_____________________________________________________
GPUd() void TrackLTIntegral::print() const
{
#ifndef GPUCA_GPUCODE_DEVICE
printf("L(cm): %6.2f, X2X0: %e XRho: %e TOF(ps): ", getL(), getX2X0(), getXRho());
if (isTimeNotNeeded()) {
printf(" Times not filled");
} else {
for (int i = 0; i < getNTOFs(); i++) {
printf(" %7.1f |", getTOF(i));
}
}
printf("\n");
#endif
}
//_____________________________________________________
GPUd() void TrackLTIntegral::addStep(float dL, float q2p2)
{
///< add step in cm to integrals, q2p2 is (q/p)^2.
mL += dL;
if (isTimeNotNeeded()) {
return;
}
const float dTns = dL * 1000.f / o2::constants::physics::LightSpeedCm2NS; // time change in ps for beta = 1 particle
for (int id = 0; id < getNTOFs(); id++) {
const float m2z = track::PID::getMass2Z(id);
const float betaInv = math_utils::sqrt(1.f + m2z * m2z * q2p2);
mT[id] += dTns * betaInv;
}
}
} // namespace track
} // namespace o2