ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
InnerDetector
InDetSimEvent
src
TRTHitIdHelper.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
InDetSimEvent/TRTHitIdHelper.h
"
6
7
//
8
// private constructor
9
TRTHitIdHelper::TRTHitIdHelper
() :
HitIdHelper
() {
10
Initialize
();
11
}
12
13
const
TRTHitIdHelper
*
TRTHitIdHelper::GetHelper
() {
14
static
const
TRTHitIdHelper
helper;
15
return
&helper;
16
}
17
18
void
TRTHitIdHelper::Initialize
() {
19
InitializeField
(
"Straw"
,0,31);
20
InitializeField
(
"LayerPlane"
,0,31);
21
InitializeField
(
"PhiSector"
,0,31);
22
InitializeField
(
"RingWheel"
,0,31);
23
InitializeField
(
"PositiveNegative"
,0,1);
24
InitializeField
(
"BarrelEndcap"
,0,1);
25
}
26
27
// Info retrieval:
28
// Barrel or Endcap
29
bool
TRTHitIdHelper::isBarrel
(
const
int
& hid)
const
{
30
int
ps = this->
GetFieldValue
(
"BarrelEndcap"
, hid);
31
return
ps ==0;
32
}
33
34
bool
TRTHitIdHelper::isEndcap
(
const
int
& hid)
const
{
35
int
ps = this->
GetFieldValue
(
"BarrelEndcap"
, hid);
36
return
ps != 0;
37
}
38
39
// Positive or Negative
40
bool
TRTHitIdHelper::isPositive
(
const
int
& hid)
const
{
41
int
ps = this->
GetFieldValue
(
"PositiveNegative"
, hid);
42
return
ps ==0;
43
}
44
bool
TRTHitIdHelper::isNegative
(
const
int
& hid)
const
{
45
int
ps = this->
GetFieldValue
(
"PositiveNegative"
, hid);
46
return
ps != 0;
47
}
48
49
// Ring/Wheel
50
int
TRTHitIdHelper::getRingWheel
(
const
int
& hid)
const
{
51
return
this->
GetFieldValue
(
"RingWheel"
, hid);
52
}
53
54
// Phi Sector
55
int
TRTHitIdHelper::getPhiSector
(
const
int
& hid)
const
{
56
return
this->
GetFieldValue
(
"PhiSector"
, hid);
57
}
58
59
// layer/plane
60
int
TRTHitIdHelper::getLayerPlane
(
const
int
& hid)
const
{
61
return
this->
GetFieldValue
(
"LayerPlane"
, hid);
62
}
63
64
// straw
65
int
TRTHitIdHelper::getStraw
(
const
int
& hid)
const
{
66
return
this->
GetFieldValue
(
"Straw"
, hid);
67
}
68
69
70
//
71
// Info packing:
72
int
TRTHitIdHelper::buildHitId
(
const
int
BrlECap,
const
int
PosNeg,
const
int
RingWheel,
73
const
int
PhiS,
const
int
LayerPlane,
const
int
Straw)
const
{
74
int
theID(0);
75
this->
SetFieldValue
(
"BarrelEndcap"
, BrlECap, theID);
76
this->
SetFieldValue
(
"PositiveNegative"
, PosNeg, theID);
77
this->
SetFieldValue
(
"RingWheel"
, RingWheel, theID);
78
this->
SetFieldValue
(
"PhiSector"
, PhiS, theID);
79
this->
SetFieldValue
(
"LayerPlane"
, LayerPlane, theID);
80
this->
SetFieldValue
(
"Straw"
, Straw, theID);
81
return
theID;
82
}
TRTHitIdHelper.h
HitIdHelper::GetFieldValue
int GetFieldValue(const std::string &name, HitID targetID) const
Definition
HitIdHelper.cxx:47
HitIdHelper::HitIdHelper
HitIdHelper()
Definition
HitIdHelper.h:25
HitIdHelper::InitializeField
void InitializeField(const std::string &n, int vmn, int vmx)
Definition
HitIdHelper.cxx:10
HitIdHelper::SetFieldValue
void SetFieldValue(const std::string &name, int n, HitID &targetID) const
Definition
HitIdHelper.cxx:30
TRTHitIdHelper::isPositive
bool isPositive(const int &hid) const
Definition
TRTHitIdHelper.cxx:40
TRTHitIdHelper::getPhiSector
int getPhiSector(const int &hid) const
Definition
TRTHitIdHelper.cxx:55
TRTHitIdHelper::getRingWheel
int getRingWheel(const int &hid) const
Definition
TRTHitIdHelper.cxx:50
TRTHitIdHelper::isBarrel
bool isBarrel(const int &hid) const
Definition
TRTHitIdHelper.cxx:29
TRTHitIdHelper::getStraw
int getStraw(const int &hid) const
Definition
TRTHitIdHelper.cxx:65
TRTHitIdHelper::isEndcap
bool isEndcap(const int &hid) const
Definition
TRTHitIdHelper.cxx:34
TRTHitIdHelper::GetHelper
static const TRTHitIdHelper * GetHelper()
Definition
TRTHitIdHelper.cxx:13
TRTHitIdHelper::TRTHitIdHelper
TRTHitIdHelper()
Definition
TRTHitIdHelper.cxx:9
TRTHitIdHelper::Initialize
void Initialize()
Definition
TRTHitIdHelper.cxx:18
TRTHitIdHelper::buildHitId
int buildHitId(const int, const int, const int, const int, const int, const int) const
Definition
TRTHitIdHelper.cxx:72
TRTHitIdHelper::getLayerPlane
int getLayerPlane(const int &hid) const
Definition
TRTHitIdHelper.cxx:60
TRTHitIdHelper::isNegative
bool isNegative(const int &hid) const
Definition
TRTHitIdHelper.cxx:44
Generated on
for ATLAS Offline Software by
1.17.0