|
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 13 of file mergeEnergyRamps.py.
◆ __init__()
def mergeEnergyRamps.L1CaloGeometryConvertor.__init__ |
( |
|
self | ) |
|
Definition at line 15 of file mergeEnergyRamps.py.
16 self.coolIdPath=ROOT.PathResolver.find_calib_file(
"TrigT1Calo/COOLIdDump_v1.txt")
17 input =
open(self.coolIdPath)
18 self.list_of_channels_em={}
19 self.list_of_channels_had={}
21 for line
in input.readlines():
22 parts = line.split(
' ')
23 emCool = parts[4].rstrip()
24 hadCool = parts[5].rstrip()
25 self.list_of_channels_em[(parts[0],parts[1])] =
'0x'+emCool
26 self.list_of_channels_had[(parts[0],parts[1])] =
'0x'+hadCool
◆ getCoolEm()
def mergeEnergyRamps.L1CaloGeometryConvertor.getCoolEm |
( |
|
self, |
|
|
|
i_eta, |
|
|
|
i_phi |
|
) |
| |
Definition at line 111 of file mergeEnergyRamps.py.
111 def getCoolEm(self,i_eta,i_phi):
112 if (
str(i_eta),
str(i_phi))
in self.list_of_channels_em:
113 cool = self.list_of_channels_em[(
str(i_eta),
str(i_phi))]
◆ getCoolHad()
def mergeEnergyRamps.L1CaloGeometryConvertor.getCoolHad |
( |
|
self, |
|
|
|
i_eta, |
|
|
|
i_phi |
|
) |
| |
Definition at line 121 of file mergeEnergyRamps.py.
121 def getCoolHad(self,i_eta,i_phi):
122 if (
str(i_eta),
str(i_phi))
in self.list_of_channels_had:
123 cool = self.list_of_channels_had[(
str(i_eta),
str(i_phi))]
◆ getEtaBin()
def mergeEnergyRamps.L1CaloGeometryConvertor.getEtaBin |
( |
|
self, |
|
|
|
CoolId |
|
) |
| |
Definition at line 136 of file mergeEnergyRamps.py.
136 def getEtaBin(self,CoolId):
137 if self.isCoolEm(CoolId):
138 channel = [item[0]
for item
in self.list_of_channels_em.
items()
if item[1]==CoolId]
139 return int(channel[0][0])
140 elif self.isCoolHad(CoolId):
141 channel = [item[0]
for item
in self.list_of_channels_had.
items()
if item[1]==CoolId]
142 return int(channel[0][0])
◆ getFCAL23RecEta()
def mergeEnergyRamps.L1CaloGeometryConvertor.getFCAL23RecEta |
( |
|
self, |
|
|
|
RecCoolId |
|
) |
| |
Definition at line 215 of file mergeEnergyRamps.py.
215 def getFCAL23RecEta(self,RecCoolId):
217 ppm_id = self.getPPMfromReceiver(RecCoolId)
219 if (
not self.isPPMFCAL(ppm_id))
or (
not self.isCoolHad(ppm_id)):
221 eta_bin = self.getEtaBin(ppm_id)
223 RecCoolInt =
int(RecCoolId,16)
224 if RecCoolInt%2 == 1:
◆ getMissingReceiverChannels()
def mergeEnergyRamps.L1CaloGeometryConvertor.getMissingReceiverChannels |
( |
|
self, |
|
|
|
channel_list |
|
) |
| |
Definition at line 156 of file mergeEnergyRamps.py.
156 def getMissingReceiverChannels(self, channel_list):
158 missing_channels= [channel
for channel
in self.receiver_to_ppm_map.
keys()
if channel
not in channel_list]
159 return missing_channels
◆ getOverlapLayer()
def mergeEnergyRamps.L1CaloGeometryConvertor.getOverlapLayer |
( |
|
self, |
|
|
|
RecCoolId |
|
) |
| |
Definition at line 197 of file mergeEnergyRamps.py.
197 def getOverlapLayer(self,RecCoolId):
199 ppm_id = self.getPPMfromReceiver(RecCoolId)
201 if not self.isPPMOverlap(ppm_id):
204 cabling = self.getReceiverCMCP(RecCoolId)
207 elif cabling[2] == 0:
209 elif cabling[2] == 2:
212 print (
"Error in GetOverlapLayer, can't determine layer!")
◆ getPhiBin()
def mergeEnergyRamps.L1CaloGeometryConvertor.getPhiBin |
( |
|
self, |
|
|
|
CoolId |
|
) |
| |
Definition at line 146 of file mergeEnergyRamps.py.
146 def getPhiBin(self,CoolId):
147 if self.isCoolEm(CoolId):
148 channel = [item[0]
for item
in self.list_of_channels_em.
items()
if item[1]==CoolId]
149 return int(channel[0][1])
150 elif self.isCoolHad(CoolId):
151 channel = [item[0]
for item
in self.list_of_channels_had.
items()
if item[1]==CoolId]
152 return int(channel[0][1])
◆ getPPMfromReceiver()
def mergeEnergyRamps.L1CaloGeometryConvertor.getPPMfromReceiver |
( |
|
self, |
|
|
|
ReceiverId |
|
) |
| |
Definition at line 71 of file mergeEnergyRamps.py.
71 def getPPMfromReceiver(self,ReceiverId):
73 if ReceiverId
in self.receiver_to_ppm_map:
74 return self.receiver_to_ppm_map[ReceiverId]
◆ getReceiverCMCP()
def mergeEnergyRamps.L1CaloGeometryConvertor.getReceiverCMCP |
( |
|
self, |
|
|
|
ReceiverId |
|
) |
| |
Definition at line 162 of file mergeEnergyRamps.py.
162 def getReceiverCMCP(self,ReceiverId):
164 recI=
int(ReceiverId,16)
167 recI = recI - crate*1024
170 recI = recI - module*64
173 recI = recI - conn*16
177 return [crate,module,conn,pair]
◆ getReceiverfromPPM()
def mergeEnergyRamps.L1CaloGeometryConvertor.getReceiverfromPPM |
( |
|
self, |
|
|
|
PPMId, |
|
|
|
strategy_string = None |
|
) |
| |
Definition at line 78 of file mergeEnergyRamps.py.
78 def getReceiverfromPPM(self,PPMId,strategy_string=None):
80 ReceiverChannels = [item[0]
for item
in self.receiver_to_ppm_map.
items()
if item[1]==PPMId]
82 if strategy_string
is None:
83 print (
" Warning! in getReceiverfromPPM no runtype give, using default!")
84 return ReceiverChannels[0]
86 if self.isPPMFCAL(PPMId)
and self.isCoolHad(PPMId):
88 if strategy_string ==
"GainOneOvEmbFcalHighEta":
89 for channel
in ReceiverChannels:
90 if self.getFCAL23RecEta(channel) ==
'HighEta':
92 if strategy_string ==
"GainOneOvEmecFcalLowEta":
93 for channel
in ReceiverChannels:
94 if self.getFCAL23RecEta(channel) ==
'LowEta':
97 elif self.isPPMOverlap(PPMId):
99 if strategy_string ==
"GainOneOvEmbFcalHighEta":
100 for channel
in ReceiverChannels:
101 if self.getOverlapLayer(channel) ==
'EMB':
103 if strategy_string ==
"GainOneOvEmecFcalLowEta":
104 for channel
in ReceiverChannels:
105 if self.getOverlapLayer(channel) ==
'EMEC':
109 return ReceiverChannels[0]
◆ isCoolEm()
def mergeEnergyRamps.L1CaloGeometryConvertor.isCoolEm |
( |
|
self, |
|
|
|
CoolId |
|
) |
| |
◆ isCoolHad()
def mergeEnergyRamps.L1CaloGeometryConvertor.isCoolHad |
( |
|
self, |
|
|
|
CoolId |
|
) |
| |
Definition at line 133 of file mergeEnergyRamps.py.
133 def isCoolHad(self,CoolId):
134 return (CoolId
in self.list_of_channels_had.
values())
◆ isPPMFCAL()
def mergeEnergyRamps.L1CaloGeometryConvertor.isPPMFCAL |
( |
|
self, |
|
|
|
CoolId |
|
) |
| |
Definition at line 179 of file mergeEnergyRamps.py.
179 def isPPMFCAL(self,CoolId):
181 eta_bin = self.getEtaBin(CoolId)
183 if eta_bin >= 32
or eta_bin <= -36:
◆ isPPMOverlap()
def mergeEnergyRamps.L1CaloGeometryConvertor.isPPMOverlap |
( |
|
self, |
|
|
|
CoolId |
|
) |
| |
Definition at line 189 of file mergeEnergyRamps.py.
189 def isPPMOverlap(self,CoolId):
191 eta_bin = self.getEtaBin(CoolId)
192 if self.isCoolEm(CoolId)
is True and (eta_bin == 14
or eta_bin == -15):
◆ LoadReceiverPPMMap()
def mergeEnergyRamps.L1CaloGeometryConvertor.LoadReceiverPPMMap |
( |
|
self | ) |
|
Definition at line 30 of file mergeEnergyRamps.py.
30 def LoadReceiverPPMMap(self):
32 self.receiver_to_ppm_map={}
33 self.UNIX2COOL = 1000000000
36 dbSvc = cool.DatabaseSvcFactory.databaseService()
38 dbString =
'oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_TRIGGER;dbname=CONDBR2'
40 db = dbSvc.openDatabase(dbString,
False)
41 except Exception
as e:
42 print (
'Error: Problem opening database', e)
45 folder_name =
"/TRIGGER/Receivers/RxPpmIdMap"
46 folder=db.getFolder(folder_name)
48 startUtime =
int(time.time())
49 endUtime =
int(time.time())
50 startValKey = startUtime * self.UNIX2COOL
51 endValKey = endUtime * self.UNIX2COOL
52 chsel = cool.ChannelSelection(0,sys.maxsize)
55 itr=folder.browseObjects(startValKey, endValKey, chsel)
56 except Exception
as e:
61 ReceiverId = hex(
int(row.channelId()))
62 payload = row.payload()
63 PPMId = hex(
int(payload[
'ppmid']))
64 self.receiver_to_ppm_map[ReceiverId]= PPMId
◆ coolIdPath
mergeEnergyRamps.L1CaloGeometryConvertor.coolIdPath |
◆ list_of_channels_em
mergeEnergyRamps.L1CaloGeometryConvertor.list_of_channels_em |
◆ list_of_channels_had
mergeEnergyRamps.L1CaloGeometryConvertor.list_of_channels_had |
◆ receiver_to_ppm_map
mergeEnergyRamps.L1CaloGeometryConvertor.receiver_to_ppm_map |
◆ UNIX2COOL
mergeEnergyRamps.L1CaloGeometryConvertor.UNIX2COOL |
The documentation for this class was generated from the following file: