forked from AliceO2Group/AliceO2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHit.h
More file actions
108 lines (91 loc) · 2.98 KB
/
Hit.h
File metadata and controls
108 lines (91 loc) · 2.98 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
// Copyright 2019-2024 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 ALICEO2_FVD_HIT_H_
#define ALICEO2_FVD_HIT_H_
#include "SimulationDataFormat/BaseHits.h" // for BasicXYZEHit
#include "CommonUtils/ShmAllocator.h"
#include "TVector3.h"
namespace o2
{
namespace fvd
{
class Hit : public o2::BasicXYZEHit<Float_t, Float_t>
{
public:
Hit() = default;
inline Hit(int trackID,
int cellID,
const math_utils::Point3D<float>& startPos,
const math_utils::Point3D<float>& endPos,
const math_utils::Vector3D<float>& startMom,
double startE,
double endTime,
double eLoss,
int particlePdg);
// Entrance position getters
math_utils::Point3D<Float_t> const& GetPosStart() const { return mPositionStart; }
Float_t GetStartX() const { return mPositionStart.X(); }
Float_t GetStartY() const { return mPositionStart.Y(); }
Float_t GetStartZ() const { return mPositionStart.Z(); }
template <typename F>
void GetStartPosition(F& x, F& y, F& z) const
{
x = GetStartX();
y = GetStartY();
z = GetStartZ();
}
// Momentum getters
math_utils::Vector3D<Float_t> const& GetMomentum() const { return mMomentumStart; }
math_utils::Vector3D<Float_t>& GetMomentum() { return mMomentumStart; }
Float_t GetPx() const { return mMomentumStart.X(); }
Float_t GetPy() const { return mMomentumStart.Y(); }
Float_t GetPz() const { return mMomentumStart.Z(); }
Float_t GetE() const { return mEnergyStart; }
Float_t GetTotalEnergyAtEntrance() const { return GetE(); }
int GetParticlePdg() const {return mParticlePdg;}
void Print(const Option_t* opt) const;
private:
int mParticlePdg;
float mEnergyStart;
math_utils::Vector3D<float> mMomentumStart; ///< momentum at entrance
math_utils::Point3D<float> mPositionStart;
ClassDefNV(Hit, 1);
};
Hit::Hit(int trackID,
int detID,
const math_utils::Point3D<float>& startPos,
const math_utils::Point3D<float>& endPos,
const math_utils::Vector3D<float>& startMom,
double startE,
double endTime,
double eLoss,
Int_t particlePdg)
: BasicXYZEHit(endPos.X(),
endPos.Y(),
endPos.Z(),
endTime,
eLoss,
trackID,
detID)
{
}
} // namespace fvd
} // namespace o2
#ifdef USESHM
namespace std
{
template <>
class allocator<o2::fvd::Hit> : public o2::utils::ShmAllocator<o2::fvd::Hit>
{
};
} // namespace std
#endif
#endif