|
def | __init__ (self) |
|
def | LoadReceiverPPMMap (self) |
|
def | getPPMfromReceiver (self, ReceiverId) |
|
def | getReceiverfromPPM (self, PPMId, strategy_string=None) |
|
def | getCoolEm (self, i_eta, i_phi) |
|
def | getCoolHad (self, i_eta, i_phi) |
|
def | isCoolEm (self, CoolId) |
|
def | isCoolHad (self, CoolId) |
|
def | getEtaBin (self, CoolId) |
|
def | getPhiBin (self, CoolId) |
|
def | getMissingReceiverChannels (self, channel_list) |
|
def | getReceiverCMCP (self, ReceiverId) |
|
def | isPPMFCAL (self, CoolId) |
|
def | isPPMOverlap (self, CoolId) |
|
def | getOverlapLayer (self, RecCoolId) |
|
def | getFCAL23RecEta (self, RecCoolId) |
|
Definition at line 59 of file PlotCalibrationGains.py.
◆ __init__()
def PlotCalibrationGains.L1CaloGeometryConvertor.__init__ |
( |
|
self | ) |
|
Definition at line 61 of file PlotCalibrationGains.py.
62 self.coolIdPath=ROOT.PathResolver.find_calib_file(
"TrigT1Calo/COOLIdDump_v1.txt")
63 input =
open(self.coolIdPath)
64 self.list_of_channels_em={}
65 self.list_of_channels_had={}
67 for line
in input.readlines():
68 parts = line.split(
' ')
69 emCool = parts[4].rstrip()
70 hadCool = parts[5].rstrip()
71 self.list_of_channels_em[(parts[0],parts[1])] =
'0x'+emCool
72 self.list_of_channels_had[(parts[0],parts[1])] =
'0x'+hadCool
◆ getCoolEm()
def PlotCalibrationGains.L1CaloGeometryConvertor.getCoolEm |
( |
|
self, |
|
|
|
i_eta, |
|
|
|
i_phi |
|
) |
| |
Definition at line 157 of file PlotCalibrationGains.py.
157 def getCoolEm(self,i_eta,i_phi):
158 if (
str(i_eta),
str(i_phi))
in self.list_of_channels_em:
159 cool = self.list_of_channels_em[(
str(i_eta),
str(i_phi))]
◆ getCoolHad()
def PlotCalibrationGains.L1CaloGeometryConvertor.getCoolHad |
( |
|
self, |
|
|
|
i_eta, |
|
|
|
i_phi |
|
) |
| |
Definition at line 167 of file PlotCalibrationGains.py.
167 def getCoolHad(self,i_eta,i_phi):
168 if (
str(i_eta),
str(i_phi))
in self.list_of_channels_had:
169 cool = self.list_of_channels_had[(
str(i_eta),
str(i_phi))]
◆ getEtaBin()
def PlotCalibrationGains.L1CaloGeometryConvertor.getEtaBin |
( |
|
self, |
|
|
|
CoolId |
|
) |
| |
Definition at line 182 of file PlotCalibrationGains.py.
182 def getEtaBin(self,CoolId):
183 if self.isCoolEm(CoolId):
184 channel = [item[0]
for item
in self.list_of_channels_em.
items()
if item[1]==CoolId]
185 return int(channel[0][0])
186 elif self.isCoolHad(CoolId):
187 channel = [item[0]
for item
in self.list_of_channels_had.
items()
if item[1]==CoolId]
188 return int(channel[0][0])
◆ getFCAL23RecEta()
def PlotCalibrationGains.L1CaloGeometryConvertor.getFCAL23RecEta |
( |
|
self, |
|
|
|
RecCoolId |
|
) |
| |
Definition at line 261 of file PlotCalibrationGains.py.
261 def getFCAL23RecEta(self,RecCoolId):
263 ppm_id = self.getPPMfromReceiver(RecCoolId)
265 if (
not self.isPPMFCAL(ppm_id))
or (
not self.isCoolHad(ppm_id)):
267 eta_bin = self.getEtaBin(ppm_id)
269 RecCoolInt =
int(RecCoolId,16)
270 if RecCoolInt%2 == 1:
◆ getMissingReceiverChannels()
def PlotCalibrationGains.L1CaloGeometryConvertor.getMissingReceiverChannels |
( |
|
self, |
|
|
|
channel_list |
|
) |
| |
Definition at line 202 of file PlotCalibrationGains.py.
202 def getMissingReceiverChannels(self, channel_list):
204 missing_channels= [channel
for channel
in self.receiver_to_ppm_map.
keys()
if channel
not in channel_list]
205 return missing_channels
◆ getOverlapLayer()
def PlotCalibrationGains.L1CaloGeometryConvertor.getOverlapLayer |
( |
|
self, |
|
|
|
RecCoolId |
|
) |
| |
Definition at line 243 of file PlotCalibrationGains.py.
243 def getOverlapLayer(self,RecCoolId):
245 ppm_id = self.getPPMfromReceiver(RecCoolId)
247 if not self.isPPMOverlap(ppm_id):
250 cabling = self.getReceiverCMCP(RecCoolId)
253 elif cabling[2] == 0:
255 elif cabling[2] == 2:
258 print (
"Error in GetOverlapLayer, can't determine layer!")
◆ getPhiBin()
def PlotCalibrationGains.L1CaloGeometryConvertor.getPhiBin |
( |
|
self, |
|
|
|
CoolId |
|
) |
| |
Definition at line 192 of file PlotCalibrationGains.py.
192 def getPhiBin(self,CoolId):
193 if self.isCoolEm(CoolId):
194 channel = [item[0]
for item
in self.list_of_channels_em.
items()
if item[1]==CoolId]
195 return int(channel[0][1])
196 elif self.isCoolHad(CoolId):
197 channel = [item[0]
for item
in self.list_of_channels_had.
items()
if item[1]==CoolId]
198 return int(channel[0][1])
◆ getPPMfromReceiver()
def PlotCalibrationGains.L1CaloGeometryConvertor.getPPMfromReceiver |
( |
|
self, |
|
|
|
ReceiverId |
|
) |
| |
Definition at line 116 of file PlotCalibrationGains.py.
116 def getPPMfromReceiver(self,ReceiverId):
118 if ReceiverId
in self.receiver_to_ppm_map:
119 return self.receiver_to_ppm_map[ReceiverId]
◆ getReceiverCMCP()
def PlotCalibrationGains.L1CaloGeometryConvertor.getReceiverCMCP |
( |
|
self, |
|
|
|
ReceiverId |
|
) |
| |
Definition at line 208 of file PlotCalibrationGains.py.
208 def getReceiverCMCP(self,ReceiverId):
210 recI=
int(ReceiverId,16)
213 recI = recI - crate*1024
216 recI = recI - module*64
219 recI = recI - conn*16
223 return [crate,module,conn,pair]
◆ getReceiverfromPPM()
def PlotCalibrationGains.L1CaloGeometryConvertor.getReceiverfromPPM |
( |
|
self, |
|
|
|
PPMId, |
|
|
|
strategy_string = None |
|
) |
| |
Definition at line 123 of file PlotCalibrationGains.py.
123 def getReceiverfromPPM(self,PPMId,strategy_string=None):
125 ReceiverChannels = [item[0]
for item
in self.receiver_to_ppm_map.
items()
if item[1]==PPMId]
127 if strategy_string
is None:
128 print (
" Warning! in getReceiverfromPPM no runtype given, using default!")
129 return ReceiverChannels[0]
131 if self.isPPMFCAL(PPMId)
and self.isCoolHad(PPMId):
133 if strategy_string ==
"GainOneOvEmbFcalHighEta":
134 for channel
in ReceiverChannels:
135 if self.getFCAL23RecEta(channel) ==
'HighEta':
137 if strategy_string ==
"GainOneOvEmecFcalLowEta":
138 for channel
in ReceiverChannels:
139 if self.getFCAL23RecEta(channel) ==
'LowEta':
142 elif self.isPPMOverlap(PPMId):
144 if strategy_string ==
"GainOneOvEmbFcalHighEta":
145 for channel
in ReceiverChannels:
146 if self.getOverlapLayer(channel) ==
'EMB':
148 if strategy_string ==
"GainOneOvEmecFcalLowEta":
149 for channel
in ReceiverChannels:
150 if self.getOverlapLayer(channel) ==
'EMEC':
154 return ReceiverChannels[0]
◆ isCoolEm()
def PlotCalibrationGains.L1CaloGeometryConvertor.isCoolEm |
( |
|
self, |
|
|
|
CoolId |
|
) |
| |
◆ isCoolHad()
def PlotCalibrationGains.L1CaloGeometryConvertor.isCoolHad |
( |
|
self, |
|
|
|
CoolId |
|
) |
| |
◆ isPPMFCAL()
def PlotCalibrationGains.L1CaloGeometryConvertor.isPPMFCAL |
( |
|
self, |
|
|
|
CoolId |
|
) |
| |
Definition at line 225 of file PlotCalibrationGains.py.
225 def isPPMFCAL(self,CoolId):
227 eta_bin = self.getEtaBin(CoolId)
229 if eta_bin >= 32
or eta_bin <= -36:
◆ isPPMOverlap()
def PlotCalibrationGains.L1CaloGeometryConvertor.isPPMOverlap |
( |
|
self, |
|
|
|
CoolId |
|
) |
| |
Definition at line 235 of file PlotCalibrationGains.py.
235 def isPPMOverlap(self,CoolId):
237 eta_bin = self.getEtaBin(CoolId)
238 if self.isCoolEm(CoolId)
is True and (eta_bin == 14
or eta_bin == -15):
◆ LoadReceiverPPMMap()
def PlotCalibrationGains.L1CaloGeometryConvertor.LoadReceiverPPMMap |
( |
|
self | ) |
|
Definition at line 76 of file PlotCalibrationGains.py.
76 def LoadReceiverPPMMap(self):
78 self.receiver_to_ppm_map={}
79 self.UNIX2COOL = 1000000000
82 dbSvc = cool.DatabaseSvcFactory.databaseService()
83 dbString =
'oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_TRIGGER;dbname=CONDBR2'
85 db = dbSvc.openDatabase(dbString,
False)
86 except Exception
as e:
87 print (
'Error: Problem opening database', e)
90 folder_name =
"/TRIGGER/Receivers/RxPpmIdMap"
91 folder=db.getFolder(folder_name)
93 startUtime =
int(time.time())
94 endUtime =
int(time.time())
95 startValKey = startUtime * self.UNIX2COOL
96 endValKey = endUtime * self.UNIX2COOL
97 chsel = cool.ChannelSelection(0,sys.maxsize)
100 itr=folder.browseObjects(startValKey, endValKey, chsel)
101 except Exception
as e:
106 ReceiverId = hex(
int(row.channelId()))
107 payload = row.payload()
108 PPMId = hex(
int(payload[
'ppmid']))
109 self.receiver_to_ppm_map[ReceiverId]= PPMId
◆ coolIdPath
PlotCalibrationGains.L1CaloGeometryConvertor.coolIdPath |
◆ list_of_channels_em
PlotCalibrationGains.L1CaloGeometryConvertor.list_of_channels_em |
◆ list_of_channels_had
PlotCalibrationGains.L1CaloGeometryConvertor.list_of_channels_had |
◆ receiver_to_ppm_map
PlotCalibrationGains.L1CaloGeometryConvertor.receiver_to_ppm_map |
◆ UNIX2COOL
PlotCalibrationGains.L1CaloGeometryConvertor.UNIX2COOL |
The documentation for this class was generated from the following file: