ATLAS Offline Software
HitIdentifier.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 
3 
4 
5 
7 
8  def __init__(self, stationIndex = -1, stationEta = -1, stationPhi = -1) -> None:
9  self.__stationIndex = stationIndex
10  self.__stationEta = stationEta if stationEta < 128 else stationEta - 255
11  self.__stationPhi = stationPhi
12 
13  def __lt__(self, other) -> bool:
14  if self.stationIndex() != other.stationIndex():
15  return self.stationIndex() < other.stationIndex()
16  if self.stationEta() != other.stationEta():
17  return self.stationEta() < other.stationEta()
18  return self.stationPhi() < other.stationPhi()
19  def __eq__(self, other) -> bool:
20  return self.stationIndex() == other.stationIndex() and \
21  self.stationEta() == other.stationEta() and \
22  self.stationPhi() == other.stationPhi()
23 
24  def __str__(self):
25  return "{stationName} eta: {stationEta:2} phi: {stationPhi: 2}".format(stationName = self.stationName(),
26  stationEta = self.stationEta(),
27  stationPhi = self.stationPhi())
28  def stationIndex(self) -> int:
29  return self.__stationIndex
30 
31 
32  def stationName(self) -> str:
33  __transDict = { 0: "BIL", 1: "BIS", 7: "BIR",
34  2: "BML", 3: "BMS", 8: "BMF", 53: "BME", 54: "BMG", 52: "BIM",
35  4: "BOL", 5: "BOS", 9: "BOF", 10: "BOG",
36  6: "BEE", 14: "EEL", 15: "EES",
37  13: "EIL",
38  17: "EML", 18: "EMS",
39  20: "EOL", 21: "EOS",
40  41: "T1F", 42: "T1E", 43: "T2F", 44: "T2E",
41  45: "T3F", 46: "T3E", 47: "T4F", 48: "T4E"
42  }
43  return __transDict[self.stationIndex()]
44  def stationEta(self)-> int:
45  return self.__stationEta
46 
47  def stationPhi(self) -> int:
48  return self.__stationPhi
49 
50 
52  def __init__(self, stationIndex=-1, stationEta=-1, stationPhi=-1,
53  doubletR = -1, doubletPhi = -1, doubletZ = -1,
54  gasGap =-1, measuresPhi = False, strip = -1) -> None:
55  super().__init__(stationIndex, stationEta, stationPhi)
56 
57  self.__doubletR = doubletR
58  self.__doubletPhi = doubletPhi
59  self.__doubletZ = doubletZ
60  self.__gasGap = gasGap
61  self.__measuresPhi = measuresPhi
62  self.__strip = strip
63 
64  def doubletR(self):
65  return self.__doubletR
66  def doubletPhi(self):
67  return self.__doubletPhi
68  def doubletZ(self):
69  return self.__doubletZ
70  def gasGap(self):
71  return self.__gasGap
72  def measuresPhi(self):
73  return self.__measuresPhi
74  def strip(self):
75  return self.__strip
76  def __str__(self):
77  rpcIdStr = StationIdentifier.__str__(self)
78  rpcIdStr+=" measuresPhi: {measPhi:2}".format(measPhi = "si" if self.measuresPhi() else "no")
79 
80  if self.doubletR() > 0: rpcIdStr+=" doubletR: {doubR:2}".format(doubR = self.doubletR())
81  if self.doubletZ() > 0: rpcIdStr+=" doubletZ: {doubZ:2}".format(doubZ = self.doubletZ())
82  if self.doubletPhi() > 0: rpcIdStr+=" doubletPhi: {doubPhi:2}".format(doubPhi = self.doubletPhi())
83  if self.gasGap() > 0: rpcIdStr+=" gasGap: {gasGap:2}".format(gasGap = self.gasGap())
84  if self.strip() > 0: rpcIdStr+=" strip: {strip:2}".format(strip = self.strip())
85  return rpcIdStr
86  def __lt__(self, other) -> bool:
87  if StationIdentifier.__lt__(self, other):
88  return True
89  if self.doubletR() != other.doubletR():
90  return self.doubletR() < other.doubletR()
91  if self.doubletZ() != other.doubletZ():
92  return self.doubletZ() < other.doubletZ()
93  if self.doubletPhi() != other.doubletPhi():
94  return self.doubletPhi() < other.doubletPhi()
95  if self.gasGap() != other.gasGap():
96  return self.gasGap() < other.gasGap()
97  if self.measuresPhi() != other.measuresPhi():
98  return self.measuresPhi()
99  return self.strip() < other.strip()
100 
101  def __eq__(self, other) -> bool:
102  return StationIdentifier.__eq__(self, other) and \
103  self.doubletR() == other.doubletR() and \
104  self.doubletZ() == other.doubletZ() and \
105  self.doubletPhi() == other.doubletPhi() and \
106  self.gasGap() == other.gasGap() and \
107  self.measuresPhi() == other.measuresPhi() and \
108  self.strip() == other.strip()
109 
110 
111  def gasGapID(self):
112  return RpcIdentifier(stationIndex= self.stationIndex(),
113  stationPhi = self.stationPhi(),
114  stationEta = self.stationEta(),
115  doubletR = self.doubletR(),
116  doubletPhi = self.doubletPhi(),
117  doubletZ = self.doubletZ(),
118  gasGap = self.gasGap(),
119  measuresPhi=self.measuresPhi())
HitIdentifier.RpcIdentifier.__init__
None __init__(self, stationIndex=-1, stationEta=-1, stationPhi=-1, doubletR=-1, doubletPhi=-1, doubletZ=-1, gasGap=-1, measuresPhi=False, strip=-1)
Definition: HitIdentifier.py:52
HitIdentifier.RpcIdentifier.__gasGap
__gasGap
Definition: HitIdentifier.py:58
vtune_athena.format
format
Definition: vtune_athena.py:14
HitIdentifier.RpcIdentifier.__str__
def __str__(self)
Definition: HitIdentifier.py:76
HitIdentifier.StationIdentifier.__stationEta
__stationEta
Definition: HitIdentifier.py:10
HitIdentifier.RpcIdentifier.strip
def strip(self)
Definition: HitIdentifier.py:74
HitIdentifier.StationIdentifier.__lt__
bool __lt__(self, other)
Definition: HitIdentifier.py:13
HitIdentifier.RpcIdentifier.__lt__
bool __lt__(self, other)
Definition: HitIdentifier.py:86
HitIdentifier.RpcIdentifier.gasGapID
def gasGapID(self)
Returns an Identifier ignoring the strip number.
Definition: HitIdentifier.py:111
HitIdentifier.StationIdentifier.stationName
str stationName(self)
Translates the stationIndex into the stationName
Definition: HitIdentifier.py:32
HitIdentifier.RpcIdentifier.__strip
__strip
Definition: HitIdentifier.py:60
HitIdentifier.StationIdentifier.__eq__
bool __eq__(self, other)
Definition: HitIdentifier.py:19
HitIdentifier.StationIdentifier.__stationPhi
__stationPhi
Definition: HitIdentifier.py:11
HitIdentifier.StationIdentifier.stationIndex
int stationIndex(self)
Definition: HitIdentifier.py:28
HitIdentifier.RpcIdentifier.doubletZ
def doubletZ(self)
Definition: HitIdentifier.py:68
HitIdentifier.StationIdentifier.__str__
def __str__(self)
Definition: HitIdentifier.py:24
HitIdentifier.StationIdentifier.stationEta
int stationEta(self)
Definition: HitIdentifier.py:44
HitIdentifier.RpcIdentifier.measuresPhi
def measuresPhi(self)
Definition: HitIdentifier.py:72
HitIdentifier.StationIdentifier
Basic class to represent a muon Identifier with the fields stationName, stationPhi,...
Definition: HitIdentifier.py:6
HitIdentifier.StationIdentifier.__stationIndex
__stationIndex
Definition: HitIdentifier.py:9
HitIdentifier.RpcIdentifier.doubletR
def doubletR(self)
Definition: HitIdentifier.py:64
HitIdentifier.RpcIdentifier.__eq__
bool __eq__(self, other)
Definition: HitIdentifier.py:101
HitIdentifier.RpcIdentifier.__measuresPhi
__measuresPhi
Definition: HitIdentifier.py:59
HitIdentifier.RpcIdentifier.__doubletZ
__doubletZ
Definition: HitIdentifier.py:57
HitIdentifier.StationIdentifier.__init__
None __init__(self, stationIndex=-1, stationEta=-1, stationPhi=-1)
basic constructor taking the stationIndex, stationPhi, station Eta of a muon identifier
Definition: HitIdentifier.py:8
HitIdentifier.RpcIdentifier.gasGap
def gasGap(self)
Definition: HitIdentifier.py:70
HitIdentifier.RpcIdentifier
Definition: HitIdentifier.py:51
pickleTool.object
object
Definition: pickleTool.py:30
HitIdentifier.RpcIdentifier.__doubletR
__doubletR
Definition: HitIdentifier.py:55
HitIdentifier.RpcIdentifier.__doubletPhi
__doubletPhi
Definition: HitIdentifier.py:56
HitIdentifier.StationIdentifier.stationPhi
int stationPhi(self)
Definition: HitIdentifier.py:47
HitIdentifier.RpcIdentifier.doubletPhi
def doubletPhi(self)
Definition: HitIdentifier.py:66