ATLAS Offline Software
Public Member Functions | Public Attributes | Static Public Attributes | Static Private Attributes | List of all members
MuonFixedIdUnpack.MuonFixedIdUnpack Class Reference
Collaboration diagram for MuonFixedIdUnpack.MuonFixedIdUnpack:

Public Member Functions

def __init__ (self, iid=None, setUnusedBits=True)
 
def stationNameIndex (self)
 
def stationName (self)
 
def stationNameString (self)
 
def stationPhiIndex (self)
 
def stationPhi (self)
 
def stationEtaIndex (self)
 
def stationEta (self)
 
def mdtMultilayerIndex (self)
 
def mdtMultilayer (self)
 
def mdtTubeLayerIndex (self)
 
def mdtTubeLayer (self)
 
def mdtTubeIndex (self)
 
def mdtTube (self)
 
def mapToOffline (self, station, phi, eta, ml=1, ly=1, tb=1)
 
def InitByParam (self, station, phi, eta, ml=1, ly=1, tb=1)
 

Public Attributes

 setUnusedBits
 

Static Public Attributes

 identifier = None
 
 online_re = re.compile(__stationRe + '(?P<eta>[0-8][AC])(?P<phi>[0-1][0-9])' + __mlRe)
 
 offline_re = re.compile(__stationRe + '_(?P<phi>[1-8])_(?P<eta>\\-*[0-8])_{0,1}' + __mlRe)
 
 numeric_re = re.compile('[0-9]{7,9}')
 
bool setUnusedBits = True
 

Static Private Attributes

string __stationRe = '(?P<station>[BE][IEMO][MESLRFG])'
 
string __mlRe = '[-_]{0,1}(?P<ml>[12]){0,1}[-_]{0,1}(?P<ly>[1234]){0,1}[-_]{0,1}(?P<tb>[1-9][0-9]{0,2}){0,1}'
 
int __kMdtMultilayerMask = 1
 
int __kMdtMultilayerShift = 9
 
int __kMdtMultilayerMin = 1
 
int __kMdtTubeLayerMask = 3
 
int __kMdtTubeLayerShift = 7
 
int __kMdtTubeLayerMin = 1
 
int __kMdtTubeMask = 127
 
int __kMdtTubeShift = 0
 
int __kMdtTubeMin = 1
 
int __kStationNameMask = 63
 
int __kStationNameShift = 24
 
int __kStationNameMin = 1
 
int __kStationEtaMask = 31
 
int __kStationEtaShift = 19
 
int __kStationEtaMin = -8
 
int __kStationPhiMask = 63
 
int __kStationPhiShift = 13
 
int __kStationPhiMin = 1
 
int __kUnusedBits = 7168
 
list __kStationNameStrings = [ "BIL", "BIS", "BML", "BMS", "BOL", "BOS", "BEE", "BIR", "BMF", "BOF", "BOG", "BME", "BIM", "EIC", "EIL", "EEL", "EES", "EMC", "EML", "EMS", "EOC", "EOL", "EOS", "EIS", "T1F", "T1E", "T2F", "T2E", "T3F", "T3E", "T4F", "T4E", "CSS", "CSL", "BMG" ]
 
dictionary __kStationNameStringsMap = { "BIL" : 0,"BIS" : 1,"BML" : 2,"BMS" : 3,"BOL" : 4, "BOS" : 5,"BEE" : 6,"BIR" : 7,"BMF" : 8,"BOF" : 9,"BOG" : 10,"BME" : 11,"BIM" : 12,"EIC" : 13,"EIL" : 14,"EEL" : 15,"EES" : 16,"EMC" : 17,"EML" : 18,"EMS" : 19,"EOC" : 20,"EOL" : 21,"EOS" : 22,"EIS" : 23,"T1F" : 24,"T1E" : 25,"T2F" : 26,"T2E" : 27,"T3F" : 28,"T3E" : 29,"T4F" : 30,"T4E" : 31,"CSS" : 32,"CSL" : 33, "BMG" : 34 }
 
dictionary __hardwareStationMaps = { "BOE" : "BOL" }
 
dictionary __BOFMAP = {1:1, 3:2, 5:3, 7:4}
 
dictionary __BOGMAP = {0:0, 2:1, 4:2, 6:3, 8:4}
 
dictionary __hardwareEtaMaps
 
dictionary __hardwareSideMap = { "A": "", "C": "-"}
 

Detailed Description

Definition at line 8 of file MuonFixedIdUnpack.py.

Constructor & Destructor Documentation

◆ __init__()

def MuonFixedIdUnpack.MuonFixedIdUnpack.__init__ (   self,
  iid = None,
  setUnusedBits = True 
)

Definition at line 30 of file MuonFixedIdUnpack.py.

30  def __init__(self, iid=None, setUnusedBits=True):
31  self.setUnusedBits = setUnusedBits
32  if iid is None:
33  return
34  if (self.numeric_re.match(str(iid)) is not None):
35  self.identifier=int(iid)
36  else:
37  idmatch = self.offline_re.match(str(iid))
38  if (idmatch is not None):
39  # default to 1 for groups not participating in match (same as method defaults if last three arguments not provided)
40  idgroups = idmatch.groupdict(1)
41  self.InitByParam(idgroups['station'], idgroups['phi'], idgroups['eta'],idgroups['ml'],idgroups['ly'],idgroups['tb'])
42  else:
43  idmatch = self.online_re.match(str(iid))
44  if(idmatch is not None):
45  idgroups = idmatch.groupdict(1)
46  swid = self.mapToOffline(idgroups['station'],idgroups['phi'], idgroups['eta'],idgroups['ml'],idgroups['ly'],idgroups['tb'])
47  self.InitByParam(swid['station'],swid['phi'], swid['eta'], swid['ml'],swid['ly'],swid['tb'])
48  else:
49  raise MdtIdError("MDT id format does not match any known type")
50 

Member Function Documentation

◆ InitByParam()

def MuonFixedIdUnpack.MuonFixedIdUnpack.InitByParam (   self,
  station,
  phi,
  eta,
  ml = 1,
  ly = 1,
  tb = 1 
)

Definition at line 143 of file MuonFixedIdUnpack.py.

143  def InitByParam(self, station, phi, eta, ml=1, ly=1, tb=1):
144  loc_station=station
145  if isinstance(station, str):
146  loc_station = self.__kStationNameStringsMap[station] + 1
147  loc_station -= self.__kStationNameMin
148  loc_station &= self.__kStationNameMask
149  loc_eta = (int(eta) - self.__kStationEtaMin) & self.__kStationEtaMask
150  loc_phi = (int(phi) - self.__kStationPhiMin) & self.__kStationPhiMask
151  loc_ml = (int(ml) - self.__kMdtMultilayerMin) & self.__kMdtMultilayerMask
152  loc_ly = (int(ly) - self.__kMdtTubeLayerMin) & self.__kMdtTubeLayerMask
153  loc_tb = (int(tb) - self.__kMdtTubeMin) & self.__kMdtTubeMask
154  self.identifier = (loc_station << self.__kStationNameShift) | (loc_eta << self.__kStationEtaShift) | (loc_phi << self.__kStationPhiShift) | (loc_ml << self.__kMdtMultilayerShift) | (loc_ly << self.__kMdtTubeLayerShift) | (loc_tb << self.__kMdtTubeShift)
155  if self.setUnusedBits:
156  self.identifier = self.identifier | self.__kUnusedBits
157 
158 
159 

◆ mapToOffline()

def MuonFixedIdUnpack.MuonFixedIdUnpack.mapToOffline (   self,
  station,
  phi,
  eta,
  ml = 1,
  ly = 1,
  tb = 1 
)

Definition at line 121 of file MuonFixedIdUnpack.py.

121  def mapToOffline(self,station,phi,eta,ml=1, ly=1, tb=1):
122  swconv = {}
123 
124  try:
125  swconv['station'] = self.__hardwareStationMaps[station]
126  except KeyError:
127  swconv['station'] = station
128 
129  etasign = self.__hardwareSideMap[eta[1]]
130  swconv['phi'] = int(math.ceil(float(phi) / float(2)))
131 
132  try:
133  swconv['eta'] = int(etasign + str(self.__hardwareEtaMaps[station][int(phi)][int(eta[0])]))
134  except KeyError:
135  swconv['eta'] = int(etasign + eta[0])
136 
137  swconv['ml'] = int(ml)
138  swconv['ly'] = int(ly)
139  swconv['tb'] = int(tb)
140  return swconv
141 

◆ mdtMultilayer()

def MuonFixedIdUnpack.MuonFixedIdUnpack.mdtMultilayer (   self)

Definition at line 94 of file MuonFixedIdUnpack.py.

94  def mdtMultilayer(self):
95  if self.identifier:
96  return self.mdtMultilayerIndex() + self.__kMdtMultilayerMin
97 
98 

◆ mdtMultilayerIndex()

def MuonFixedIdUnpack.MuonFixedIdUnpack.mdtMultilayerIndex (   self)

Definition at line 90 of file MuonFixedIdUnpack.py.

90  def mdtMultilayerIndex(self):
91  if self.identifier:
92  return (self.identifier >> self.__kMdtMultilayerShift) & self.__kMdtMultilayerMask
93 

◆ mdtTube()

def MuonFixedIdUnpack.MuonFixedIdUnpack.mdtTube (   self)

Definition at line 114 of file MuonFixedIdUnpack.py.

114  def mdtTube(self):
115  if self.identifier:
116  return self.mdtTubeIndex() + self.__kMdtTubeMin
117 
118 

◆ mdtTubeIndex()

def MuonFixedIdUnpack.MuonFixedIdUnpack.mdtTubeIndex (   self)

Definition at line 110 of file MuonFixedIdUnpack.py.

110  def mdtTubeIndex(self):
111  if self.identifier:
112  return (self.identifier >> self.__kMdtTubeShift) & self.__kMdtTubeMask
113 

◆ mdtTubeLayer()

def MuonFixedIdUnpack.MuonFixedIdUnpack.mdtTubeLayer (   self)

Definition at line 104 of file MuonFixedIdUnpack.py.

104  def mdtTubeLayer(self):
105  if self.identifier:
106  return self.mdtTubeLayerIndex() + self.__kMdtTubeLayerMin
107 
108 

◆ mdtTubeLayerIndex()

def MuonFixedIdUnpack.MuonFixedIdUnpack.mdtTubeLayerIndex (   self)

Definition at line 100 of file MuonFixedIdUnpack.py.

100  def mdtTubeLayerIndex(self):
101  if self.identifier:
102  return (self.identifier >> self.__kMdtTubeLayerShift) & self.__kMdtTubeLayerMask
103 

◆ stationEta()

def MuonFixedIdUnpack.MuonFixedIdUnpack.stationEta (   self)

Definition at line 84 of file MuonFixedIdUnpack.py.

84  def stationEta(self):
85  if self.identifier:
86  return self.stationEtaIndex() + self.__kStationEtaMin
87 
88 

◆ stationEtaIndex()

def MuonFixedIdUnpack.MuonFixedIdUnpack.stationEtaIndex (   self)

Definition at line 80 of file MuonFixedIdUnpack.py.

80  def stationEtaIndex(self):
81  if self.identifier:
82  return (self.identifier >> self.__kStationEtaShift) & self.__kStationEtaMask
83 

◆ stationName()

def MuonFixedIdUnpack.MuonFixedIdUnpack.stationName (   self)

Definition at line 56 of file MuonFixedIdUnpack.py.

56  def stationName(self):
57  if self.identifier:
58  return self.stationNameIndex() + self.__kStationNameMin
59 
60 

◆ stationNameIndex()

def MuonFixedIdUnpack.MuonFixedIdUnpack.stationNameIndex (   self)

Definition at line 52 of file MuonFixedIdUnpack.py.

52  def stationNameIndex(self):
53  if self.identifier:
54  return (self.identifier >> self.__kStationNameShift) & self.__kStationNameMask
55 

◆ stationNameString()

def MuonFixedIdUnpack.MuonFixedIdUnpack.stationNameString (   self)

Definition at line 61 of file MuonFixedIdUnpack.py.

61  def stationNameString(self):
62  if self.identifier:
63  idx=self.stationName() - 1
64  if idx >= len(self.__kStationNameStrings):
65  return "XXX"
66  return self.__kStationNameStrings[ idx ]
67 
68 

◆ stationPhi()

def MuonFixedIdUnpack.MuonFixedIdUnpack.stationPhi (   self)

Definition at line 74 of file MuonFixedIdUnpack.py.

74  def stationPhi(self):
75  if self.identifier:
76  return self.stationPhiIndex() + self.__kStationPhiMin
77 
78 

◆ stationPhiIndex()

def MuonFixedIdUnpack.MuonFixedIdUnpack.stationPhiIndex (   self)

Definition at line 70 of file MuonFixedIdUnpack.py.

70  def stationPhiIndex(self):
71  if self.identifier:
72  return (self.identifier >> self.__kStationPhiShift) & self.__kStationPhiMask
73 

Member Data Documentation

◆ __BOFMAP

dictionary MuonFixedIdUnpack.MuonFixedIdUnpack.__BOFMAP = {1:1, 3:2, 5:3, 7:4}
staticprivate

Definition at line 194 of file MuonFixedIdUnpack.py.

◆ __BOGMAP

dictionary MuonFixedIdUnpack.MuonFixedIdUnpack.__BOGMAP = {0:0, 2:1, 4:2, 6:3, 8:4}
staticprivate

Definition at line 195 of file MuonFixedIdUnpack.py.

◆ __hardwareEtaMaps

dictionary MuonFixedIdUnpack.MuonFixedIdUnpack.__hardwareEtaMaps
staticprivate
Initial value:
= {
"EEL" : { 5 : { 2:1 } },
"BML" : { 13 : { 5:4, 6:5 } },
"BOE" : { 13: { 3:7 } },
"BME" : { 13 : { 4:1 } },
"BOF" : { 12 : __BOFMAP, 14 : __BOFMAP },
"BOG" : { 12 : __BOGMAP, 14 : __BOGMAP }
}

Definition at line 197 of file MuonFixedIdUnpack.py.

◆ __hardwareSideMap

dictionary MuonFixedIdUnpack.MuonFixedIdUnpack.__hardwareSideMap = { "A": "", "C": "-"}
staticprivate

Definition at line 205 of file MuonFixedIdUnpack.py.

◆ __hardwareStationMaps

dictionary MuonFixedIdUnpack.MuonFixedIdUnpack.__hardwareStationMaps = { "BOE" : "BOL" }
staticprivate

Definition at line 193 of file MuonFixedIdUnpack.py.

◆ __kMdtMultilayerMask

int MuonFixedIdUnpack.MuonFixedIdUnpack.__kMdtMultilayerMask = 1
staticprivate

Definition at line 160 of file MuonFixedIdUnpack.py.

◆ __kMdtMultilayerMin

int MuonFixedIdUnpack.MuonFixedIdUnpack.__kMdtMultilayerMin = 1
staticprivate

Definition at line 162 of file MuonFixedIdUnpack.py.

◆ __kMdtMultilayerShift

int MuonFixedIdUnpack.MuonFixedIdUnpack.__kMdtMultilayerShift = 9
staticprivate

Definition at line 161 of file MuonFixedIdUnpack.py.

◆ __kMdtTubeLayerMask

int MuonFixedIdUnpack.MuonFixedIdUnpack.__kMdtTubeLayerMask = 3
staticprivate

Definition at line 164 of file MuonFixedIdUnpack.py.

◆ __kMdtTubeLayerMin

int MuonFixedIdUnpack.MuonFixedIdUnpack.__kMdtTubeLayerMin = 1
staticprivate

Definition at line 166 of file MuonFixedIdUnpack.py.

◆ __kMdtTubeLayerShift

int MuonFixedIdUnpack.MuonFixedIdUnpack.__kMdtTubeLayerShift = 7
staticprivate

Definition at line 165 of file MuonFixedIdUnpack.py.

◆ __kMdtTubeMask

int MuonFixedIdUnpack.MuonFixedIdUnpack.__kMdtTubeMask = 127
staticprivate

Definition at line 168 of file MuonFixedIdUnpack.py.

◆ __kMdtTubeMin

int MuonFixedIdUnpack.MuonFixedIdUnpack.__kMdtTubeMin = 1
staticprivate

Definition at line 170 of file MuonFixedIdUnpack.py.

◆ __kMdtTubeShift

int MuonFixedIdUnpack.MuonFixedIdUnpack.__kMdtTubeShift = 0
staticprivate

Definition at line 169 of file MuonFixedIdUnpack.py.

◆ __kStationEtaMask

int MuonFixedIdUnpack.MuonFixedIdUnpack.__kStationEtaMask = 31
staticprivate

Definition at line 176 of file MuonFixedIdUnpack.py.

◆ __kStationEtaMin

int MuonFixedIdUnpack.MuonFixedIdUnpack.__kStationEtaMin = -8
staticprivate

Definition at line 178 of file MuonFixedIdUnpack.py.

◆ __kStationEtaShift

int MuonFixedIdUnpack.MuonFixedIdUnpack.__kStationEtaShift = 19
staticprivate

Definition at line 177 of file MuonFixedIdUnpack.py.

◆ __kStationNameMask

int MuonFixedIdUnpack.MuonFixedIdUnpack.__kStationNameMask = 63
staticprivate

Definition at line 172 of file MuonFixedIdUnpack.py.

◆ __kStationNameMin

int MuonFixedIdUnpack.MuonFixedIdUnpack.__kStationNameMin = 1
staticprivate

Definition at line 174 of file MuonFixedIdUnpack.py.

◆ __kStationNameShift

int MuonFixedIdUnpack.MuonFixedIdUnpack.__kStationNameShift = 24
staticprivate

Definition at line 173 of file MuonFixedIdUnpack.py.

◆ __kStationNameStrings

list MuonFixedIdUnpack.MuonFixedIdUnpack.__kStationNameStrings = [ "BIL", "BIS", "BML", "BMS", "BOL", "BOS", "BEE", "BIR", "BMF", "BOF", "BOG", "BME", "BIM", "EIC", "EIL", "EEL", "EES", "EMC", "EML", "EMS", "EOC", "EOL", "EOS", "EIS", "T1F", "T1E", "T2F", "T2E", "T3F", "T3E", "T4F", "T4E", "CSS", "CSL", "BMG" ]
staticprivate

Definition at line 186 of file MuonFixedIdUnpack.py.

◆ __kStationNameStringsMap

dictionary MuonFixedIdUnpack.MuonFixedIdUnpack.__kStationNameStringsMap = { "BIL" : 0,"BIS" : 1,"BML" : 2,"BMS" : 3,"BOL" : 4, "BOS" : 5,"BEE" : 6,"BIR" : 7,"BMF" : 8,"BOF" : 9,"BOG" : 10,"BME" : 11,"BIM" : 12,"EIC" : 13,"EIL" : 14,"EEL" : 15,"EES" : 16,"EMC" : 17,"EML" : 18,"EMS" : 19,"EOC" : 20,"EOL" : 21,"EOS" : 22,"EIS" : 23,"T1F" : 24,"T1E" : 25,"T2F" : 26,"T2E" : 27,"T3F" : 28,"T3E" : 29,"T4F" : 30,"T4E" : 31,"CSS" : 32,"CSL" : 33, "BMG" : 34 }
staticprivate

Definition at line 188 of file MuonFixedIdUnpack.py.

◆ __kStationPhiMask

int MuonFixedIdUnpack.MuonFixedIdUnpack.__kStationPhiMask = 63
staticprivate

Definition at line 180 of file MuonFixedIdUnpack.py.

◆ __kStationPhiMin

int MuonFixedIdUnpack.MuonFixedIdUnpack.__kStationPhiMin = 1
staticprivate

Definition at line 182 of file MuonFixedIdUnpack.py.

◆ __kStationPhiShift

int MuonFixedIdUnpack.MuonFixedIdUnpack.__kStationPhiShift = 13
staticprivate

Definition at line 181 of file MuonFixedIdUnpack.py.

◆ __kUnusedBits

int MuonFixedIdUnpack.MuonFixedIdUnpack.__kUnusedBits = 7168
staticprivate

Definition at line 184 of file MuonFixedIdUnpack.py.

◆ __mlRe

string MuonFixedIdUnpack.MuonFixedIdUnpack.__mlRe = '[-_]{0,1}(?P<ml>[12]){0,1}[-_]{0,1}(?P<ly>[1234]){0,1}[-_]{0,1}(?P<tb>[1-9][0-9]{0,2}){0,1}'
staticprivate

Definition at line 16 of file MuonFixedIdUnpack.py.

◆ __stationRe

string MuonFixedIdUnpack.MuonFixedIdUnpack.__stationRe = '(?P<station>[BE][IEMO][MESLRFG])'
staticprivate

Definition at line 15 of file MuonFixedIdUnpack.py.

◆ identifier

MuonFixedIdUnpack.MuonFixedIdUnpack.identifier = None
static

Definition at line 12 of file MuonFixedIdUnpack.py.

◆ numeric_re

MuonFixedIdUnpack.MuonFixedIdUnpack.numeric_re = re.compile('[0-9]{7,9}')
static

Definition at line 21 of file MuonFixedIdUnpack.py.

◆ offline_re

MuonFixedIdUnpack.MuonFixedIdUnpack.offline_re = re.compile(__stationRe + '_(?P<phi>[1-8])_(?P<eta>\\-*[0-8])_{0,1}' + __mlRe)
static

Definition at line 20 of file MuonFixedIdUnpack.py.

◆ online_re

MuonFixedIdUnpack.MuonFixedIdUnpack.online_re = re.compile(__stationRe + '(?P<eta>[0-8][AC])(?P<phi>[0-1][0-9])' + __mlRe)
static

Definition at line 19 of file MuonFixedIdUnpack.py.

◆ setUnusedBits [1/2]

bool MuonFixedIdUnpack.MuonFixedIdUnpack.setUnusedBits = True
static

Definition at line 28 of file MuonFixedIdUnpack.py.

◆ setUnusedBits [2/2]

MuonFixedIdUnpack.MuonFixedIdUnpack.setUnusedBits

Definition at line 31 of file MuonFixedIdUnpack.py.


The documentation for this class was generated from the following file:
createDCubeDigitHistograms.mdtTubeLayer
mdtTubeLayer
Definition: createDCubeDigitHistograms.py:111
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
dumpTgcDigiDeadChambers.stationName
dictionary stationName
Definition: dumpTgcDigiDeadChambers.py:30
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18
if
if(febId1==febId2)
Definition: LArRodBlockPhysicsV0.cxx:567
createDCubeDigitHistograms.mdtMultilayer
mdtMultilayer
Definition: createDCubeDigitHistograms.py:112
str
Definition: BTagTrackIpAccessor.cxx:11
readCCLHist.float
float
Definition: readCCLHist.py:83
createDCubeDigitHistograms.mdtTube
mdtTube
Definition: createDCubeDigitHistograms.py:110
match
bool match(std::string s1, std::string s2)
match the individual directories of two strings
Definition: hcg.cxx:356