Project
Loading...
Searching...
No Matches
Hit.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
25
26
#ifndef ALICEO2_EXT_HIT_H
27
#define ALICEO2_EXT_HIT_H
28
29
#include "
SimulationDataFormat/BaseHits.h
"
// for BasicXYZEHit
30
#include "
CommonUtils/ShmAllocator.h
"
31
#include "Rtypes.h"
32
#include "TVector3.h"
33
#include <iosfwd>
34
35
namespace
o2::ext
36
{
37
38
class
Hit
:
public
o2::BasicXYZEHit
<float, float>
39
{
40
public
:
41
enum
HitStatus_t
{
42
kTrackEntering
= 0x1,
43
kTrackInside
= 0x1 << 1,
44
kTrackExiting
= 0x1 << 2,
45
kTrackOut
= 0x1 << 3,
46
kTrackStopped
= 0x1 << 4,
47
kTrackAlive
= 0x1 << 5
48
};
49
50
Hit
() =
default
;
51
64
Hit
(
int
trackID,
unsigned
short
sensorID,
const
TVector3& startPos,
const
TVector3& endPos,
65
const
TVector3& startMom,
double
startE,
double
endTime,
double
eLoss,
66
unsigned
char
startStatus,
unsigned
char
endStatus,
int
pdg = 0,
float
length
= 0.f)
67
:
BasicXYZEHit
(endPos.X(), endPos.Y(), endPos.Z(), endTime, eLoss, trackID, sensorID),
68
mMomentum(startMom.Px(), startMom.Py(), startMom.Pz()),
69
mPosStart(startPos.X(), startPos.Y(), startPos.Z()),
70
mE(startE),
71
mLength(
length
),
72
mPdg(pdg),
73
mTrackStatusEnd(endStatus),
74
mTrackStatusStart(startStatus)
75
{
76
}
77
78
// entrance position
79
math_utils::Point3D<float>
GetPosStart
()
const
{
return
mPosStart; }
80
float
GetStartX
()
const
{
return
mPosStart.X(); }
81
float
GetStartY
()
const
{
return
mPosStart.Y(); }
82
float
GetStartZ
()
const
{
return
mPosStart.Z(); }
83
void
SetPosStart
(
const
math_utils::Point3D<float>
& p) { mPosStart = p; }
84
85
// momentum / energy
86
math_utils::Vector3D<float>
GetMomentum
()
const
{
return
mMomentum; }
87
math_utils::Vector3D<float>
&
GetMomentum
() {
return
mMomentum; }
88
float
GetPx
()
const
{
return
mMomentum.X(); }
89
float
GetPy
()
const
{
return
mMomentum.Y(); }
90
float
GetPz
()
const
{
return
mMomentum.Z(); }
91
float
GetE
()
const
{
return
mE; }
92
float
GetTotalEnergy
()
const
{
return
mE; }
93
94
// extra bookkeeping
95
float
GetLength
()
const
{
return
mLength; }
96
void
SetLength
(
float
l) { mLength = l; }
97
int
GetPdg
()
const
{
return
mPdg; }
98
void
SetPdg
(
int
pdg) { mPdg = pdg; }
99
100
// status flags
101
unsigned
char
GetStatusStart
()
const
{
return
mTrackStatusStart; }
102
unsigned
char
GetStatusEnd
()
const
{
return
mTrackStatusEnd; }
103
bool
IsEntering
()
const
{
return
mTrackStatusEnd &
kTrackEntering
; }
104
bool
IsInside
()
const
{
return
mTrackStatusEnd &
kTrackInside
; }
105
bool
IsExiting
()
const
{
return
mTrackStatusEnd &
kTrackExiting
; }
106
bool
IsOut
()
const
{
return
mTrackStatusEnd &
kTrackOut
; }
107
bool
IsStopped
()
const
{
return
mTrackStatusEnd &
kTrackStopped
; }
108
bool
IsAlive
()
const
{
return
mTrackStatusEnd &
kTrackAlive
; }
109
110
friend
std::ostream&
operator<<
(std::ostream&
of
,
const
Hit
& point)
111
{
112
of
<<
"-I- o2::ext::Hit for track "
<< point.
GetTrackID
() <<
" in sensor "
<< point.
GetDetectorID
();
113
return
of
;
114
}
115
116
private
:
117
math_utils::Vector3D<float>
mMomentum;
118
math_utils::Point3D<float>
mPosStart;
119
float
mE;
120
float
mLength;
121
int
mPdg;
122
unsigned
char
mTrackStatusEnd;
123
unsigned
char
mTrackStatusStart;
124
125
ClassDefNV(
Hit
, 1);
126
};
127
128
}
// namespace o2::ext
129
130
#ifdef USESHM
131
namespace
std
132
{
133
template
<>
134
class
allocator<
o2
::ext::Hit> :
public
o2::utils::ShmAllocator
<o2::ext::Hit>
135
{
136
};
137
}
// namespace std
138
#endif
139
140
#endif
// ALICEO2_EXT_HIT_H
BaseHits.h
ShmAllocator.h
ROOT::Math::DisplacementVector3D
Definition
GPUROOTCartesianFwd.h:40
ROOT::Math::PositionVector3D
Definition
GPUROOTCartesianFwd.h:36
o2::BaseHit::GetTrackID
int GetTrackID() const
Definition
BaseHits.h:30
o2::BasicXYZEHit
Definition
BaseHits.h:99
o2::BasicXYZVHit::GetDetectorID
unsigned short GetDetectorID() const
Definition
BaseHits.h:73
o2::ext::Hit
Definition
Hit.h:39
o2::ext::Hit::HitStatus_t
HitStatus_t
Definition
Hit.h:41
o2::ext::Hit::kTrackOut
@ kTrackOut
Definition
Hit.h:45
o2::ext::Hit::kTrackExiting
@ kTrackExiting
Definition
Hit.h:44
o2::ext::Hit::kTrackInside
@ kTrackInside
Definition
Hit.h:43
o2::ext::Hit::kTrackEntering
@ kTrackEntering
Definition
Hit.h:42
o2::ext::Hit::kTrackAlive
@ kTrackAlive
Definition
Hit.h:47
o2::ext::Hit::kTrackStopped
@ kTrackStopped
Definition
Hit.h:46
o2::ext::Hit::GetMomentum
math_utils::Vector3D< float > GetMomentum() const
Definition
Hit.h:86
o2::ext::Hit::GetPosStart
math_utils::Point3D< float > GetPosStart() const
Definition
Hit.h:79
o2::ext::Hit::IsAlive
bool IsAlive() const
Definition
Hit.h:108
o2::ext::Hit::IsEntering
bool IsEntering() const
Definition
Hit.h:103
o2::ext::Hit::GetPdg
int GetPdg() const
Definition
Hit.h:97
o2::ext::Hit::SetLength
void SetLength(float l)
Definition
Hit.h:96
o2::ext::Hit::GetMomentum
math_utils::Vector3D< float > & GetMomentum()
Definition
Hit.h:87
o2::ext::Hit::IsInside
bool IsInside() const
Definition
Hit.h:104
o2::ext::Hit::GetStatusStart
unsigned char GetStatusStart() const
Definition
Hit.h:101
o2::ext::Hit::GetStatusEnd
unsigned char GetStatusEnd() const
Definition
Hit.h:102
o2::ext::Hit::operator<<
friend std::ostream & operator<<(std::ostream &of, const Hit &point)
Definition
Hit.h:110
o2::ext::Hit::GetLength
float GetLength() const
Definition
Hit.h:95
o2::ext::Hit::IsOut
bool IsOut() const
Definition
Hit.h:106
o2::ext::Hit::GetPy
float GetPy() const
Definition
Hit.h:89
o2::ext::Hit::GetE
float GetE() const
Definition
Hit.h:91
o2::ext::Hit::Hit
Hit(int trackID, unsigned short sensorID, const TVector3 &startPos, const TVector3 &endPos, const TVector3 &startMom, double startE, double endTime, double eLoss, unsigned char startStatus, unsigned char endStatus, int pdg=0, float length=0.f)
Definition
Hit.h:64
o2::ext::Hit::GetPx
float GetPx() const
Definition
Hit.h:88
o2::ext::Hit::GetStartZ
float GetStartZ() const
Definition
Hit.h:82
o2::ext::Hit::GetTotalEnergy
float GetTotalEnergy() const
Definition
Hit.h:92
o2::ext::Hit::GetStartY
float GetStartY() const
Definition
Hit.h:81
o2::ext::Hit::SetPdg
void SetPdg(int pdg)
Definition
Hit.h:98
o2::ext::Hit::GetPz
float GetPz() const
Definition
Hit.h:90
o2::ext::Hit::GetStartX
float GetStartX() const
Definition
Hit.h:80
o2::ext::Hit::IsExiting
bool IsExiting() const
Definition
Hit.h:105
o2::ext::Hit::SetPosStart
void SetPosStart(const math_utils::Point3D< float > &p)
Definition
Hit.h:83
o2::ext::Hit::IsStopped
bool IsStopped() const
Definition
Hit.h:107
o2::ext::Hit::Hit
Hit()=default
o2::utils::ShmAllocator
Definition
ShmAllocator.h:35
length
GLuint GLsizei GLsizei * length
Definition
glcorearb.h:790
o2::ext
Definition
ExternalDetector.h:53
o2::framework
Defining ITS Vertex explicitly as messageable.
Definition
Cartesian.h:288
o2
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
Definition
FlattenRestore.h:23
std
Definition
CcdbObjectInfo.h:121
Detectors
External
include
ExternalDetectors
Hit.h
Generated on Sun Aug 9 2026 21:00:11 for Project by
1.9.8