ATLAS Offline Software
Public Member Functions | Public Attributes | List of all members
PlotCalibrationHV.L1CaloHVReader Class Reference
Collaboration diagram for PlotCalibrationHV.L1CaloHVReader:

Public Member Functions

def __init__ (self, file_name)
 
def read_corrections (self, file_name)
 
def read_geometry (self, file_name)
 
def GetMeanCorections (self)
 
def GetCorLayer1 (self)
 
def GetCorLayer2 (self)
 
def GetCorLayer3 (self)
 
def GetCorLayer4 (self)
 
def GetAffectedCells1 (self)
 
def GetAffectedCells2 (self)
 
def GetAffectedCells3 (self)
 
def GetAffectedCells4 (self)
 
def GetNCells1 (self)
 
def GetNCells2 (self)
 
def GetNCells3 (self)
 
def GetNCells4 (self)
 
def GetNLayers (self)
 
def GetName1 (self)
 
def GetName2 (self)
 
def GetName3 (self)
 
def GetName4 (self)
 

Public Attributes

 NLayers
 
 MeanCorr
 
 CorrLayer1
 
 CorrLayer2
 
 CorrLayer3
 
 CorrLayer4
 
 AffectedCells1
 
 AffectedCells2
 
 AffectedCells3
 
 AffectedCells4
 
 NCells1
 
 NCells2
 
 NCells3
 
 NCells4
 
 Name1
 
 Name2
 
 Name3
 
 Name4
 
 UNIX2COOL
 

Detailed Description

Definition at line 120 of file PlotCalibrationHV.py.

Constructor & Destructor Documentation

◆ __init__()

def PlotCalibrationHV.L1CaloHVReader.__init__ (   self,
  file_name 
)

Definition at line 122 of file PlotCalibrationHV.py.

122  def __init__(self,file_name):
123 
124  self.NLayers = {}
125  self.MeanCorr = {}
126 
127  self.CorrLayer1 = {}
128  self.CorrLayer2 = {}
129  self.CorrLayer3 = {}
130  self.CorrLayer4 = {}
131 
132  self.AffectedCells1 = {}
133  self.AffectedCells2 = {}
134  self.AffectedCells3 = {}
135  self.AffectedCells4 = {}
136 
137  self.NCells1 = {}
138  self.NCells2 = {}
139  self.NCells3 = {}
140  self.NCells4 = {}
141 
142  self.Name1 = {}
143  self.Name2 = {}
144  self.Name3 = {}
145  self.Name4 = {}
146 
147  self.NLayers = {}
148 
149  self.UNIX2COOL = 1000000000
150 
151  self.read_corrections(file_name)
152  self.read_geometry(file_name)
153 

Member Function Documentation

◆ GetAffectedCells1()

def PlotCalibrationHV.L1CaloHVReader.GetAffectedCells1 (   self)

Definition at line 267 of file PlotCalibrationHV.py.

267  def GetAffectedCells1(self):
268  return self.AffectedCells1
269 

◆ GetAffectedCells2()

def PlotCalibrationHV.L1CaloHVReader.GetAffectedCells2 (   self)

Definition at line 270 of file PlotCalibrationHV.py.

270  def GetAffectedCells2(self):
271  return self.AffectedCells2
272 

◆ GetAffectedCells3()

def PlotCalibrationHV.L1CaloHVReader.GetAffectedCells3 (   self)

Definition at line 273 of file PlotCalibrationHV.py.

273  def GetAffectedCells3(self):
274  return self.AffectedCells3
275 

◆ GetAffectedCells4()

def PlotCalibrationHV.L1CaloHVReader.GetAffectedCells4 (   self)

Definition at line 276 of file PlotCalibrationHV.py.

276  def GetAffectedCells4(self):
277  return self.AffectedCells4
278 

◆ GetCorLayer1()

def PlotCalibrationHV.L1CaloHVReader.GetCorLayer1 (   self)

Definition at line 255 of file PlotCalibrationHV.py.

255  def GetCorLayer1(self):
256  return self.CorrLayer1
257 

◆ GetCorLayer2()

def PlotCalibrationHV.L1CaloHVReader.GetCorLayer2 (   self)

Definition at line 258 of file PlotCalibrationHV.py.

258  def GetCorLayer2(self):
259  return self.CorrLayer2
260 

◆ GetCorLayer3()

def PlotCalibrationHV.L1CaloHVReader.GetCorLayer3 (   self)

Definition at line 261 of file PlotCalibrationHV.py.

261  def GetCorLayer3(self):
262  return self.CorrLayer3
263 

◆ GetCorLayer4()

def PlotCalibrationHV.L1CaloHVReader.GetCorLayer4 (   self)

Definition at line 264 of file PlotCalibrationHV.py.

264  def GetCorLayer4(self):
265  return self.CorrLayer4
266 

◆ GetMeanCorections()

def PlotCalibrationHV.L1CaloHVReader.GetMeanCorections (   self)

Definition at line 252 of file PlotCalibrationHV.py.

252  def GetMeanCorections(self):
253  return self.MeanCorr
254 

◆ GetName1()

def PlotCalibrationHV.L1CaloHVReader.GetName1 (   self)

Definition at line 294 of file PlotCalibrationHV.py.

294  def GetName1(self):
295  return self.Name1
296 

◆ GetName2()

def PlotCalibrationHV.L1CaloHVReader.GetName2 (   self)

Definition at line 297 of file PlotCalibrationHV.py.

297  def GetName2(self):
298  return self.Name2
299 

◆ GetName3()

def PlotCalibrationHV.L1CaloHVReader.GetName3 (   self)

Definition at line 300 of file PlotCalibrationHV.py.

300  def GetName3(self):
301  return self.Name3
302 

◆ GetName4()

def PlotCalibrationHV.L1CaloHVReader.GetName4 (   self)

Definition at line 303 of file PlotCalibrationHV.py.

303  def GetName4(self):
304  return self.Name4
305 
306 

◆ GetNCells1()

def PlotCalibrationHV.L1CaloHVReader.GetNCells1 (   self)

Definition at line 279 of file PlotCalibrationHV.py.

279  def GetNCells1(self):
280  return self.NCells1
281 

◆ GetNCells2()

def PlotCalibrationHV.L1CaloHVReader.GetNCells2 (   self)

Definition at line 282 of file PlotCalibrationHV.py.

282  def GetNCells2(self):
283  return self.NCells2
284 

◆ GetNCells3()

def PlotCalibrationHV.L1CaloHVReader.GetNCells3 (   self)

Definition at line 285 of file PlotCalibrationHV.py.

285  def GetNCells3(self):
286  return self.NCells3
287 

◆ GetNCells4()

def PlotCalibrationHV.L1CaloHVReader.GetNCells4 (   self)

Definition at line 288 of file PlotCalibrationHV.py.

288  def GetNCells4(self):
289  return self.NCells4
290 

◆ GetNLayers()

def PlotCalibrationHV.L1CaloHVReader.GetNLayers (   self)

Definition at line 291 of file PlotCalibrationHV.py.

291  def GetNLayers(self):
292  return self.NLayers
293 

◆ read_corrections()

def PlotCalibrationHV.L1CaloHVReader.read_corrections (   self,
  file_name 
)

Definition at line 154 of file PlotCalibrationHV.py.

154  def read_corrections(self,file_name):
155 
156  # get database service and open database
157  dbSvc = cool.DatabaseSvcFactory.databaseService()
158 
159  dbString='sqlite://;schema='+file_name+';dbname=L1CALO'
160  try:
161  db = dbSvc.openDatabase(dbString, False)
162  except Exception as e:
163  print(('Error: Problem opening database', e))
164  sys.exit(1)
165 
166  folder_name = '/TRIGGER/L1Calo/V1/Results/HVCorrections'
167  folder=db.getFolder(folder_name)
168 
169  startUtime = int(time.time())
170  endUtime = int(time.time())
171  startValKey = startUtime * self.UNIX2COOL
172  endValKey = endUtime * self.UNIX2COOL
173  chsel = cool.ChannelSelection(0,sys.maxsize)
174 
175  try:
176  itr=folder.browseObjects(startValKey, endValKey, chsel)
177  except Exception as e:
178  print (e)
179  sys.exit(1)
180 
181  for row in itr:
182  CoolId = hex(int(row.channelId()))
183  payload = row.payload()
184 
185  self.MeanCorr[CoolId] = payload['RxMean']
186 
187  self.CorrLayer1[CoolId] = payload['LayerMean1']
188  self.CorrLayer2[CoolId] = payload['LayerMean2']
189  self.CorrLayer3[CoolId] = payload['LayerMean3']
190  self.CorrLayer4[CoolId] = payload['LayerMean4']
191 
192  self.AffectedCells1[CoolId] = struct.unpack('B'.encode('utf-8'),payload['AffectedCells1'].encode('utf-8'))[0]
193  self.AffectedCells2[CoolId] = struct.unpack('B'.encode('utf-8'),payload['AffectedCells2'].encode('utf-8'))[0]
194  self.AffectedCells3[CoolId] = struct.unpack('B'.encode('utf-8'),payload['AffectedCells3'].encode('utf-8'))[0]
195  self.AffectedCells4[CoolId] = struct.unpack('B'.encode('utf-8'),payload['AffectedCells4'].encode('utf-8'))[0]
196 
197 # print ( " CoolId", CoolId ,"AffectedCells", struct.unpack('B',self.AffectedCells1[CoolId])[0])
198 
199 
200  # close database
201  db.closeDatabase()
202 

◆ read_geometry()

def PlotCalibrationHV.L1CaloHVReader.read_geometry (   self,
  file_name 
)

Definition at line 203 of file PlotCalibrationHV.py.

203  def read_geometry(self,file_name):
204 
205  # get database service and open database
206  dbSvc = cool.DatabaseSvcFactory.databaseService()
207 
208  dbString='sqlite://;schema='+file_name+';dbname=L1CALO'
209  try:
210  db = dbSvc.openDatabase(dbString, False)
211  except Exception as e:
212  print(('Error: Problem opening database', e))
213  sys.exit(1)
214 
215  folder_name = '/TRIGGER/L1Calo/V1/Results/RxLayers'
216  folder=db.getFolder(folder_name)
217 
218  startUtime = int(time.time())
219  endUtime = int(time.time())
220  startValKey = startUtime * self.UNIX2COOL
221  endValKey = endUtime * self.UNIX2COOL
222  chsel = cool.ChannelSelection(0,sys.maxsize)
223 
224  try:
225  itr=folder.browseObjects(startValKey, endValKey, chsel)
226  except Exception as e:
227  print (e)
228  sys.exit(1)
229 
230  for row in itr:
231  CoolId = hex(int(row.channelId()))
232  payload = row.payload()
233 
234  self.NCells1[CoolId] = struct.unpack('B'.encode('utf-8'),payload['NCells1'].encode('utf-8'))[0]
235  self.NCells2[CoolId] = struct.unpack('B'.encode('utf-8'),payload['NCells2'].encode('utf-8'))[0]
236  self.NCells3[CoolId] = struct.unpack('B'.encode('utf-8'),payload['NCells3'].encode('utf-8'))[0]
237  self.NCells4[CoolId] = struct.unpack('B'.encode('utf-8'),payload['NCells4'].encode('utf-8'))[0]
238 
239  self.NLayers[CoolId] = struct.unpack('B'.encode('utf-8'),payload['NLayers'].encode('utf-8'))[0]
240 
241  self.Name1[CoolId] = struct.unpack('B'.encode('utf-8'),payload['Name1'].encode('utf-8'))[0]
242  self.Name2[CoolId] = struct.unpack('B'.encode('utf-8'),payload['Name2'].encode('utf-8'))[0]
243  self.Name3[CoolId] = struct.unpack('B'.encode('utf-8'),payload['Name3'].encode('utf-8'))[0]
244  self.Name4[CoolId] = struct.unpack('B'.encode('utf-8'),payload['Name4'].encode('utf-8'))[0]
245 
246 
247 
248  # close database
249  db.closeDatabase()
250 
251 

Member Data Documentation

◆ AffectedCells1

PlotCalibrationHV.L1CaloHVReader.AffectedCells1

Definition at line 132 of file PlotCalibrationHV.py.

◆ AffectedCells2

PlotCalibrationHV.L1CaloHVReader.AffectedCells2

Definition at line 133 of file PlotCalibrationHV.py.

◆ AffectedCells3

PlotCalibrationHV.L1CaloHVReader.AffectedCells3

Definition at line 134 of file PlotCalibrationHV.py.

◆ AffectedCells4

PlotCalibrationHV.L1CaloHVReader.AffectedCells4

Definition at line 135 of file PlotCalibrationHV.py.

◆ CorrLayer1

PlotCalibrationHV.L1CaloHVReader.CorrLayer1

Definition at line 127 of file PlotCalibrationHV.py.

◆ CorrLayer2

PlotCalibrationHV.L1CaloHVReader.CorrLayer2

Definition at line 128 of file PlotCalibrationHV.py.

◆ CorrLayer3

PlotCalibrationHV.L1CaloHVReader.CorrLayer3

Definition at line 129 of file PlotCalibrationHV.py.

◆ CorrLayer4

PlotCalibrationHV.L1CaloHVReader.CorrLayer4

Definition at line 130 of file PlotCalibrationHV.py.

◆ MeanCorr

PlotCalibrationHV.L1CaloHVReader.MeanCorr

Definition at line 125 of file PlotCalibrationHV.py.

◆ Name1

PlotCalibrationHV.L1CaloHVReader.Name1

Definition at line 142 of file PlotCalibrationHV.py.

◆ Name2

PlotCalibrationHV.L1CaloHVReader.Name2

Definition at line 143 of file PlotCalibrationHV.py.

◆ Name3

PlotCalibrationHV.L1CaloHVReader.Name3

Definition at line 144 of file PlotCalibrationHV.py.

◆ Name4

PlotCalibrationHV.L1CaloHVReader.Name4

Definition at line 145 of file PlotCalibrationHV.py.

◆ NCells1

PlotCalibrationHV.L1CaloHVReader.NCells1

Definition at line 137 of file PlotCalibrationHV.py.

◆ NCells2

PlotCalibrationHV.L1CaloHVReader.NCells2

Definition at line 138 of file PlotCalibrationHV.py.

◆ NCells3

PlotCalibrationHV.L1CaloHVReader.NCells3

Definition at line 139 of file PlotCalibrationHV.py.

◆ NCells4

PlotCalibrationHV.L1CaloHVReader.NCells4

Definition at line 140 of file PlotCalibrationHV.py.

◆ NLayers

PlotCalibrationHV.L1CaloHVReader.NLayers

Definition at line 124 of file PlotCalibrationHV.py.

◆ UNIX2COOL

PlotCalibrationHV.L1CaloHVReader.UNIX2COOL

Definition at line 149 of file PlotCalibrationHV.py.


The documentation for this class was generated from the following file:
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18
Muon::print
std::string print(const MuPatSegment &)
Definition: MuonTrackSteering.cxx:28
python.PerfMonSerializer.encode
def encode(data, use_base64=True)
Definition: PerfMonSerializer.py:375