ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
PlotCalibrationGains.py
Go to the documentation of this file.
1 #!/bin/env python
2 
3 # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
4 
5 import ROOT
6 import sys
7 import time
8 
9 from array import array
10 from PyCool import cool
11 from optparse import OptionParser
12 from math import fabs
13 
14 def setAxisSizes(histos, tsize=0.05, lsize=0.05, zsize=0.05):
15  for h in histos:
16  h.GetXaxis().SetTitleSize(tsize)
17  h.GetXaxis().SetLabelSize(lsize)
18  h.GetYaxis().SetTitleSize(tsize)
19  h.GetYaxis().SetLabelSize(lsize)
20 
21  if h.GetZaxis():
22  h.GetZaxis().SetTitleSize(zsize)
23  h.GetZaxis().SetLabelSize(zsize)
24 
25 def setAxisTitles(histos, xtit, ytit, ztit="foo", xoff=0, yoff=0, zoff=0):
26  for h in histos:
27  h.GetXaxis().SetTitle(xtit)
28  h.GetYaxis().SetTitle(ytit)
29  if ztit != "foo":
30  h.GetZaxis().SetTitle(ztit)
31 
32  if xoff!=0: h.GetXaxis().SetTitleOffset(xoff)
33  if yoff!=0: h.GetYaxis().SetTitleOffset(yoff)
34  if zoff!=0: h.GetZaxis().SetTitleOffset(zoff)
35 
36 
37 class L1CaloMap:
38  Counter = 0
39  def __init__(self,title,XaxisTitle="",YaxisTitle=""):
40 
41  self.nxbins = 66
42  self.xbins = array('d',[-49.5,-44.5,-40.50,-36.5,-32.5,-31.5,-29.5,
43  -27.5,-25.5,-24.5,-23.5,-22.5,-21.5,-20.5,-19.5,
44  -18.5,-17.5,-16.5,-15.5,-14.5,-13.5,-12.5,-11.5,
45  -10.5,-9.5,-8.5,-7.5,-6.5,-5.5,-4.5,-3.5,
46  -2.5,-1.5,-0.5,0.5,1.5,2.5,3.5,4.5,5.5,6.5,
47  7.5,8.5,9.5,10.5,11.5,12.5,13.5,14.5,15.5,16.5,
48  17.5,18.5,19.5,20.5,21.5,22.5,23.5,24.5,26.5,28.5,
49  30.5,31.5,35.5,39.5,43.5,47.5])
50 
51  # Maintain a counter of instances to assign unique names,
52  L1CaloMap.Counter += 1
53  hname = "GainTTsMap_%d" % L1CaloMap.Counter
54  htitle = title
55  self.h_1 = ROOT.TH2F(hname,htitle,self.nxbins,self.xbins,64,0.,64)
56  setAxisTitles( [self.h_1], XaxisTitle, YaxisTitle )
57  setAxisSizes( [self.h_1], 0.048, 0.040, 0.032)
58 
59  def Draw(self):
60  self.h_1.SetStats(0)
61  self.h_1.DrawCopy("colz")
62  ROOT.gPad.RedrawAxis()
63 
64  def Fill(self,eta,phi,gain=1):
65 
66  if eta >= 32 or eta < -32:
67  self.h_1.Fill(eta,phi+3.5,gain)
68  self.h_1.Fill(eta,phi+2.5,gain)
69  self.h_1.Fill(eta,phi+1.5,gain)
70  self.h_1.Fill(eta,phi+0.5,gain)
71  elif eta >= 25 or eta < -25:
72  self.h_1.Fill(eta,phi+1.5,gain)
73  self.h_1.Fill(eta,phi+0.5,gain)
74  else:
75  self.h_1.Fill(eta,phi+0.5,gain)
76 
77  def SetMinimum(self,minimum):
78  self.h_1.SetMinimum(minimum)
79 
80  def SetMaximum(self,maximum):
81  self.h_1.SetMaximum(maximum)
82 
84 
85  def __init__(self):
86  self.coolIdPath=ROOT.PathResolver.find_calib_file("TrigT1Calo/COOLIdDump_v1.txt")
87  input = open(self.coolIdPath)
90 
91  for line in input.readlines():
92  parts = line.split(' ')
93  emCool = parts[4].rstrip()
94  hadCool = parts[5].rstrip()
95  self.list_of_channels_em[(parts[0],parts[1])] = '0x'+emCool
96  self.list_of_channels_had[(parts[0],parts[1])] = '0x'+hadCool
97 
98  input.close()
99 
101 
103  self.UNIX2COOL = 1000000000
104 
105  # get database service and open database
106  dbSvc = cool.DatabaseSvcFactory.databaseService()
107  dbString = 'oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_TRIGGER;dbname=CONDBR2'
108  try:
109  db = dbSvc.openDatabase(dbString, False)
110  except Exception as e:
111  print ('Error: Problem opening database', e)
112  sys.exit(1)
113 
114  folder_name = "/TRIGGER/Receivers/RxPpmIdMap"
115  folder=db.getFolder(folder_name)
116 
117  startUtime = int(time.time())
118  endUtime = int(time.time())
119  startValKey = startUtime * self.UNIX2COOL
120  endValKey = endUtime * self.UNIX2COOL
121  chsel = cool.ChannelSelection(0,sys.maxsize)
122 
123  try:
124  itr=folder.browseObjects(startValKey, endValKey, chsel)
125  except Exception as e:
126  print (e)
127  sys.exit(1)
128 
129  for row in itr:
130  ReceiverId = hex(int(row.channelId()))
131  payload = row.payload()
132  PPMId = hex(int(payload['ppmid']))
133  self.receiver_to_ppm_map[ReceiverId]= PPMId
134 
135  # close database
136  db.closeDatabase()
137 
138  def getPPMfromReceiver(self,ReceiverId):
139  if ReceiverId in self.receiver_to_ppm_map:
140  return self.receiver_to_ppm_map[ReceiverId]
141  else:
142  return None
143 
144  def getReceiverfromPPM(self,PPMId,strategy_string=None):
145 
146  ReceiverChannels = [item[0] for item in self.receiver_to_ppm_map.items() if item[1]==PPMId]
147 
148  if strategy_string is None:
149  print (" Warning! in getReceiverfromPPM no runtype given, using default!")
150  return ReceiverChannels[0]
151 
152  if self.isPPMFCAL(PPMId) and self.isCoolHad(PPMId): # pick correct FCAL23 channel
153 
154  if strategy_string == "GainOneOvEmbFcalHighEta":
155  for channel in ReceiverChannels:
156  if self.getFCAL23RecEta(channel) == 'HighEta':
157  return channel
158  if strategy_string == "GainOneOvEmecFcalLowEta":
159  for channel in ReceiverChannels:
160  if self.getFCAL23RecEta(channel) == 'LowEta':
161  return channel
162 
163  elif self.isPPMOverlap(PPMId):
164  if strategy_string == "GainOneOvEmbFcalHighEta":
165  for channel in ReceiverChannels:
166  if self.getOverlapLayer(channel) == 'EMB':
167  return channel
168  if strategy_string == "GainOneOvEmecFcalLowEta":
169  for channel in ReceiverChannels:
170  if self.getOverlapLayer(channel) == 'EMEC':
171  return channel
172 
173  else:
174  return ReceiverChannels[0]
175 
176  def getCoolEm(self,i_eta,i_phi):
177  if (str(i_eta),str(i_phi)) in self.list_of_channels_em:
178  cool = self.list_of_channels_em[(str(i_eta),str(i_phi))]
179  cool.rstrip()
180  cool.lstrip()
181  return (cool)
182  else:
183  return ('')
184 
185  def getCoolHad(self,i_eta,i_phi):
186  if (str(i_eta),str(i_phi)) in self.list_of_channels_had:
187  cool = self.list_of_channels_had[(str(i_eta),str(i_phi))]
188  cool.rstrip()
189  cool.lstrip()
190  return (cool)
191  else:
192  return ('')
193 
194  def isCoolEm(self,CoolId):
195  return (CoolId in self.list_of_channels_em.values())
196 
197  def isCoolHad(self,CoolId):
198  return (CoolId in self.list_of_channels_had.values())
199 
200  def getEtaBin(self,CoolId):
201  if self.isCoolEm(CoolId):
202  channel = [item[0] for item in self.list_of_channels_em.items() if item[1]==CoolId]
203  return int(channel[0][0])
204  elif self.isCoolHad(CoolId):
205  channel = [item[0] for item in self.list_of_channels_had.items() if item[1]==CoolId]
206  return int(channel[0][0])
207  else:
208  return -1
209 
210  def getPhiBin(self,CoolId):
211  if self.isCoolEm(CoolId):
212  channel = [item[0] for item in self.list_of_channels_em.items() if item[1]==CoolId]
213  return int(channel[0][1])
214  elif self.isCoolHad(CoolId):
215  channel = [item[0] for item in self.list_of_channels_had.items() if item[1]==CoolId]
216  return int(channel[0][1])
217  else:
218  return -1
219 
220  def getMissingReceiverChannels(self, channel_list):
221  missing_channels= [channel for channel in self.receiver_to_ppm_map.keys() if channel not in channel_list]
222  return missing_channels
223 
224  def getReceiverCMCP(self,ReceiverId):
225  recI=int(ReceiverId,16)
226 
227  crate = recI/1024
228  recI = recI - crate*1024
229 
230  module = recI/64
231  recI = recI - module*64
232 
233  conn = recI/16
234  recI = recI - conn*16
235 
236  pair = recI
237 
238  return [crate,module,conn,pair]
239 
240  def isPPMFCAL(self,CoolId):
241  eta_bin = self.getEtaBin(CoolId)
242  if eta_bin >= 32 or eta_bin <= -36:
243  return True
244  else:
245  return False
246 
247  def isPPMOverlap(self,CoolId):
248  eta_bin = self.getEtaBin(CoolId)
249  if self.isCoolEm(CoolId) is True and (eta_bin == 14 or eta_bin == -15):
250  return True
251  else:
252  return False
253 
254  def getOverlapLayer(self,RecCoolId):
255  ppm_id = self.getPPMfromReceiver(RecCoolId)
256 
257  if not self.isPPMOverlap(ppm_id):
258  return None
259 
260  cabling = self.getReceiverCMCP(RecCoolId)
261  if cabling[0] < 2: # unconnected channel has barrel crate nr.
262  return 'Unconnected'
263  elif cabling[2] == 0:
264  return 'EMEC'
265  elif cabling[2] == 2:
266  return 'EMB'
267  else:
268  print ("Error in GetOverlapLayer, can't determine layer!")
269  return None
270 
271  def getFCAL23RecEta(self,RecCoolId):
272  ppm_id = self.getPPMfromReceiver(RecCoolId)
273 
274  if (not self.isPPMFCAL(ppm_id)) or (not self.isCoolHad(ppm_id)):
275  return None
276  eta_bin = self.getEtaBin(ppm_id)
277 
278  RecCoolInt = int(RecCoolId,16)
279  if RecCoolInt%2 == 1:
280  isRecOdd = True
281  else:
282  isRecOdd = False
283 
284  if eta_bin>0:
285  if isRecOdd:
286  return 'LowEta'
287  else:
288  return 'HighEta'
289  else:
290  if isRecOdd:
291  return 'HighEta'
292  else:
293  return 'LowEta'
294 
295 
297 
298  def __init__(self):
299 
304  self.UNIX2COOL = 1000000000
305 
306  self.run_nr=None
307  self.strategy=None
308 
309  def LoadGainsXml(self,name):
310 
311  input_file = open(name)
312 
313  for line in input_file.readlines():
314  parts = line.split(' ')
315  if parts[0] == '<Channel':
316  list_cool=parts[1].split('\'')
317  cool_id=list_cool[1]
318 
319  list_gain=parts[2].split('\'')
320  gain=list_gain[1]
321  self.measured_gains[cool_id]=gain
322 
323  list_offset=parts[3].split('\'')
324  offset=list_offset[1]
325  self.measured_offset[cool_id]=offset
326 
327  list_chi2=parts[4].split('\'')
328  chi2=list_chi2[1]
329  self.measured_chi2[cool_id]=chi2
330 
331  input_file.close()
332 
333  def LoadReferenceXml(self,name):
334 
335  input_gains_reference = open(name)
336 
337  for line in input_gains_reference.readlines():
338  parts = line.split(' ')
339  if parts[0] == '<Channel':
340  list_cool=parts[1].split('\'')
341  cool_id=list_cool[1]
342 
343  list_gain=parts[2].split('\'')
344  gain=list_gain[1]
345  self.reference_gains[cool_id]=gain
346 
347 
348  def LoadGainsSqlite(self,name):
349 
350  # get database service and open database
351  dbSvc = cool.DatabaseSvcFactory.databaseService()
352 
353  dbString='sqlite://;schema='+name+';dbname=L1CALO'
354  try:
355  db = dbSvc.openDatabase(dbString, False)
356  except Exception as e:
357  print ('Error: Problem opening database', e)
358  sys.exit(1)
359 
360  folder_name = '/TRIGGER/L1Calo/V1/Results/EnergyScanResults'
361  folder=db.getFolder(folder_name)
362 
363  startUtime = int(time.time())
364  endUtime = int(time.time())
365  startValKey = startUtime * self.UNIX2COOL
366  endValKey = endUtime * self.UNIX2COOL
367  chsel = cool.ChannelSelection(0,sys.maxsize)
368 
369  try:
370  itr=folder.browseObjects(startValKey, endValKey, chsel)
371  except Exception as e:
372  print (e)
373  sys.exit(1)
374 
375  for row in itr:
376  CoolId = hex(int(row.channelId()))
377  payload = row.payload()
378  self.measured_gains[CoolId] = payload['Slope']
379  self.measured_chi2[CoolId] = payload['Chi2']
380  self.measured_offset[CoolId] = payload['Offset']
381 
382  folder_gen_name = '/TRIGGER/L1Calo/V1/Results/EnergyScanRunInfo'
383  folder_gen=db.getFolder(folder_gen_name)
384 
385  try:
386  itr=folder_gen.browseObjects(startValKey, endValKey, chsel)
387  for row in itr:
388  payload = row.payload()
389  self.run_nr = payload['RunNumber']
390  self.strategy = payload['GainStrategy']
391  if (self.strategy == ''): self.strategy='NA'
392  print ( ("Run nr. = %d, Strategy = %s") % (self.run_nr, self.strategy) )
393 
394  except Exception: # Doesn't seem to catch C++ exceptions :-(
395  print ("Warning, in LoadGainsSqlite can't get runtype info! Hope this is not serious!")
396 
397  # close database
398  db.closeDatabase()
399 
400  def LoadReferenceSqlite(self,name):
401 
402  # get database service and open database
403  dbSvc = cool.DatabaseSvcFactory.databaseService()
404 
405  dbString='sqlite://;schema='+name+';dbname=L1CALO'
406  try:
407  db = dbSvc.openDatabase(dbString, False)
408  except Exception as e:
409  print ('Error: Problem opening database', e)
410  sys.exit(1)
411 
412  folder_name = '/TRIGGER/L1Calo/V1/Results/EnergyScanResults'
413  folder=db.getFolder(folder_name)
414 
415  startUtime = int(time.time())
416  endUtime = int(time.time())
417  startValKey = startUtime * self.UNIX2COOL
418  endValKey = endUtime * self.UNIX2COOL
419  chsel = cool.ChannelSelection(0,sys.maxsize)
420 
421  try:
422  itr=folder.browseObjects(startValKey, endValKey, chsel)
423  except Exception as e:
424  print (e)
425  sys.exit(1)
426 
427  for row in itr:
428  CoolId = hex(int(row.channelId()))
429  payload = row.payload()
430  self.reference_gains[CoolId]=payload['Slope']
431 
432  # close database
433  db.closeDatabase()
434 
435 
436  def LoadReferenceOracle(self,mapping_tool):
437 
438  # get database service and open database
439  dbSvc = cool.DatabaseSvcFactory.databaseService()
440 
441  dbString = 'oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_TRIGGER;dbname=CONDBR2'
442  try:
443  db = dbSvc.openDatabase(dbString, False)
444  except Exception as e:
445  print ('Error: Problem opening database', e)
446  sys.exit(1)
447 
448  folder_name = "/TRIGGER/Receivers/Factors/CalibGains"
449  folder=db.getFolder(folder_name)
450 
451  startUtime = int(time.time())
452  endUtime = int(time.time())
453  startValKey = startUtime * self.UNIX2COOL
454  endValKey = endUtime * self.UNIX2COOL
455  chsel = cool.ChannelSelection(0,sys.maxsize)
456 
457  try:
458  itr=folder.browseObjects(startValKey, endValKey, chsel)
459  except Exception as e:
460  print (e)
461  sys.exit(1)
462 
463  for row in itr:
464  ReceiverId = hex(int(row.channelId()))
465  PPMId = mapping_tool.getPPMfromReceiver(ReceiverId)
466  payload = row.payload()
467  gain = payload['factor']
468 
469  if PPMId is not None:
470  if self.strategy is None: #run type not known
471  self.reference_gains[PPMId]=gain
472  else:
473  if mapping_tool.getReceiverfromPPM(PPMId,self.strategy) == ReceiverId: # correct receiver?
474  #print ("Using receiver nr.", ReceiverId, "for PPM nr.",PPMId)
475  self.reference_gains[PPMId]=gain
476  #else:
477  # print ("Skipping receiver nr.", ReceiverId, "for PPM nr.",PPMId)
478 
479  # close database
480  db.closeDatabase()
481 
482  def getGain(self,coolId):
483  if (coolId in self.measured_gains):
484  return float(self.measured_gains[coolId])
485  else:
486  return ''
487 
488  def getChi2(self,coolId):
489  if (coolId in self.measured_chi2):
490  return float(self.measured_chi2[coolId])
491  else:
492  return ''
493 
494  def getOffset(self,coolId):
495  if (coolId in self.measured_offset):
496  return float(self.measured_offset[coolId])
497  else:
498  return ''
499 
500  def getReferenceGain(self,coolId):
501  if (coolId in self.reference_gains):
502  return float(self.reference_gains[coolId])
503  else:
504  return ''
505 
506  def passesSelection(self,coolId):
507  if ((coolId in self.measured_gains) and
508  (self.getGain(coolId) > 0.5 and self.getGain(coolId)<1.6) and
509  #(self.getGain(coolId) > 0.5 and self.getGain(coolId)<2.1) and
510  #(self.getOffset(coolId) > -2 and self.getOffset(coolId) < 2)):
511  (self.getOffset(coolId) > -10 and self.getOffset(coolId) < 10)):
512  return True
513  else:
514  return False
515 
516 
518  Counter = 0
519  def __init__(self,name,nbins=40,minimum=0.,maximum=2.,XaxisTitle="",YaxisTitle=""):
520 
521  self.nPartitions=5
522  self.ext = ["all","00_15","15_25","25_32","32_50"]
523  self.name = ["all","EMB","EMEC outer","EMEC Inner","FCAL 1"]
524 
525  # Maintain a counter of instances to assign unique histogram names
526  EmPartitionPlots.Counter += 1
527  self.his_partitions = []
528 
529  for i_em_partition in range(0,self.nPartitions):
530  hname = ("GainTTEm_%d"%EmPartitionPlots.Counter) + self.ext[i_em_partition]
531  htitle = name+" for "+self.name[i_em_partition]
532  self.his_partitions.append(ROOT.TH1F(hname,htitle,nbins,minimum,maximum))
533 
534  setAxisTitles( self.his_partitions, XaxisTitle, YaxisTitle )
535  setAxisSizes( self.his_partitions, 0.05, 0.04 )
536 
537  def get_partition_number(self,eta_bin):
538  indem = -1
539  if ( -9 <= eta_bin and eta_bin <= 8):
540  indem = 1
541  elif ((eta_bin>8 and eta_bin<=14) or (eta_bin>=-15 and eta_bin<-9)):
542  #elif ((eta_bin>8 and eta_bin<14) or (eta_bin>-15 and eta_bin<-9)): # cut out overlap
543  indem = 1
544  elif ((eta_bin>14 and eta_bin<=24) or (eta_bin>=-25 and eta_bin<-15)):
545  indem = 2
546  elif ((eta_bin>24 and eta_bin<=31) or (eta_bin>=-32 and eta_bin<-25)):
547  indem = 3
548  elif ((eta_bin>31) or (eta_bin<-32)):
549  indem = 4
550 
551  return indem
552 
553  def Fill(self,eta_bin,gain):
554  partition=self.get_partition_number(eta_bin)
555 
556  if partition > 0:
557  self.his_partitions[0].Fill(gain)
558  self.his_partitions[partition].Fill(gain)
559  else:
560  print ("Warning in EmPartitionPlots, nonexisting partition!" )
561 
563  Counter = 0
564  def __init__(self,name,nbins=40,minimum=0.,maximum=2.,XaxisTitle="",YaxisTitle=""):
565 
566  self.nPartitions=6
567  self.ext = ["all","00_09","09_15","15_25","25_32","32_50"]
568  self.name = ["all","Tile LB","Tile EB","HEC outer", "HEC inner","FCAL 2/3"]
569 
570  self.his_partitions = []
571 
572  # Maintain a counter of instances to assign unique histogram names
573  HadPartitionPlots.Counter += 1
574  for i_had_partition in range(0,self.nPartitions):
575  hname = ("GainTTHad_%d"%HadPartitionPlots.Counter) + self.ext[i_had_partition]
576  htitle = name+" for "+self.name[i_had_partition]
577  self.his_partitions.append(ROOT.TH1F(hname,htitle,nbins,minimum,maximum))
578 
579  setAxisTitles( self.his_partitions, XaxisTitle, YaxisTitle )
580  setAxisSizes( self.his_partitions, 0.05, 0.04 )
581 
582  def get_partition_number(self,eta_bin):
583  indhad = -1
584  if ( -9 <= eta_bin and eta_bin <= 8):
585  indhad = 1
586  elif ((eta_bin>8 and eta_bin<=14) or (eta_bin>=-15 and eta_bin<-9)):
587  #elif ((eta_bin>8 and eta_bin<14) or (eta_bin>-15 and eta_bin<-9)): # cut out overlap
588  indhad = 2
589  elif ((eta_bin>14 and eta_bin<=24) or (eta_bin>=-25 and eta_bin<-15)):
590  indhad = 3
591  elif ((eta_bin>24 and eta_bin<=31) or (eta_bin>=-32 and eta_bin<-25)):
592  indhad = 4
593  elif ((eta_bin>31) or (eta_bin<-32)):
594  indhad = 5
595 
596  return indhad
597 
598  def Fill(self,eta_bin,gain):
599  partition=self.get_partition_number(eta_bin)
600 
601  if partition > 0:
602  self.his_partitions[0].Fill(gain)
603  self.his_partitions[partition].Fill(gain)
604  else:
605  print ("Warning in HadPartitionPlots, nonexisting partition!" )
606 
607 
608 def PlotCalibrationGains(input_file_name="",reference_file_name="",
609  isInputXml=False,isInputSqlite=False,
610  isRefXml=False,isRefSqlite=False,isRefOracle=False,
611  isTileOnly=False):
612 
613  ROOT.gROOT.SetBatch( True )
614  ROOT.gStyle.SetPalette(1)
615  ROOT.gStyle.SetOptStat(111111)
616  ROOT.gStyle.SetCanvasColor(10)
617 
618  ROOT.gStyle.SetPadTopMargin(0.12)
619  ROOT.gStyle.SetPadBottomMargin(0.12)
620  ROOT.gStyle.SetPadRightMargin(0.12)
621  ROOT.gStyle.SetPadLeftMargin(0.12)
622 
623  canvas = ROOT.TCanvas('canvas','Gains',0,0,600,800)
624  canvas.SetBatch(True)
625 
626  h_gains_em = L1CaloMap("EM receiver gains","#eta bin","#phi bin")
627  h_gains_had = L1CaloMap("HAD receiver gains","#eta bin","#phi bin")
628 
629  h_gains_em_fselect = L1CaloMap("EM gains that failed selection","#eta bin","#phi bin")
630  h_gains_had_fselect = L1CaloMap("HAD gains that failed selection","#eta bin","#phi bin")
631 
632  h_chi2_em = L1CaloMap("EM fit Chi2","#eta bin","#phi bin")
633  h_chi2_had = L1CaloMap("HAD fit Chi2","#eta bin","#phi bin")
634 
635  h_offset_em = L1CaloMap("EM fit offsets","#eta bin","#phi bin")
636  h_offset_had = L1CaloMap("HAD fit offsets","#eta bin","#phi bin")
637 
638  h_unfitted_em = L1CaloMap("EM failed fits","#eta bin","#phi bin")
639  h_unfitted_had = L1CaloMap("HAD failed fits","#eta bin","#phi bin")
640 
641  h_drifted_em = L1CaloMap("EM TTs that drifted by more than 10%","#eta bin","#phi bin")
642  h_drifted_had = L1CaloMap("HAD TTs that drifted by more than 10%","#eta bin","#phi bin")
643 
644  h_gains_em_reference = L1CaloMap("EM (gain-reference)","#eta bin","#phi bin")
645  h_gains_had_reference = L1CaloMap("HAD (gain-reference)","#eta bin","#phi bin")
646 
647  h_gains_em_reference_rel = L1CaloMap("EM (gain-reference)/reference","#eta bin","#phi bin")
648  h_gains_had_reference_rel = L1CaloMap("HAD (gain-reference)/reference","#eta bin","#phi bin")
649  em_partition_gains = EmPartitionPlots(" EM gains",40,0.6,1.4,"gain","Entries")
650  had_partition_gains = HadPartitionPlots(" HAD gains",40,0.5,2.5,"gain","Entries")
651 
652  em_partition_gains_ref = EmPartitionPlots(" EM (gains-reference)",40,-0.2,0.2,"gain-reference","Entries")
653  had_partition_gains_ref = HadPartitionPlots(" HAD (gains-reference)",40,-1.,1.,"gain-reference","Entries")
654 
655  em_partition_gains_ref_rel = EmPartitionPlots(" EM (gains-reference)/reference",40,-0.2,0.2,"(gain-reference)/reference","Entries")
656  had_partition_gains_ref_rel = HadPartitionPlots(" HAD (gains-reference)/reference",40,-1.,1.,"(gain-reference)/reference","Entries")
657 
658  threshold_change = 0.1
659 
660  geometry_convertor = L1CaloGeometryConvertor()
661  receiver_gains = GainReader()
662 
663  bad_gain_file = open('bad_gains.txt','w')
664  drifted_towers_file = open('drifted_towers.txt','w')
665 
666  if isInputXml is True:
667  print ("Taking input from xml file: ", input_file_name)
668  receiver_gains.LoadGainsXml(input_file_name)
669  elif isInputSqlite is True:
670  print ("Taking input from Sqlite file: ", input_file_name)
671  receiver_gains.LoadGainsSqlite(input_file_name)
672  else:
673  print ("No option for input file selected, assuming sqlite file energyscanresults.sqlite")
674  receiver_gains.LoadGainsSqlite("energyscanresults.sqlite")
675 
676  if isRefXml is True:
677  print ("Taking reference from Xml file: ",reference_file_name)
678  receiver_gains.LoadReferenceXml(reference_file_name)
679  elif isRefSqlite is True:
680  print ("Taking reference from Sqlite file: ",reference_file_name)
681  receiver_gains.LoadReferenceSqlite(reference_file_name)
682  elif isRefOracle is True:
683  print ("Taking reference from Oracle")
684  geometry_convertor.LoadReceiverPPMMap()
685  receiver_gains.LoadReferenceOracle(geometry_convertor)
686  else:
687  print (" No option for reference file, assuming Oracle")
688  geometry_convertor.LoadReceiverPPMMap()
689  receiver_gains.LoadReferenceOracle(geometry_convertor)
690 
691  for i_eta in range(-49,45):
692  for i_phi in range(0,64):
693  coolEm = geometry_convertor.getCoolEm(i_eta,i_phi)
694  coolHad = geometry_convertor.getCoolHad(i_eta,i_phi)
695 
696  if not coolEm == '': # there is a channel for this eta-phi
697  gain = receiver_gains.getGain(coolEm)
698  chi2 = receiver_gains.getChi2(coolEm)
699  offset = receiver_gains.getOffset(coolEm)
700  reference_gain = receiver_gains.getReferenceGain(coolEm)
701  passes_selection = receiver_gains.passesSelection(coolEm)
702 
703  if (not gain == '') and (not reference_gain == ''): # both gains should be available
704 
705  if gain == -1. :
706  h_unfitted_em.Fill(i_eta,i_phi)
707  bad_gain_file.write('%i %i %s EM gain= %.3f \n' % (i_eta,i_phi,coolEm,float(gain)))
708  h_gains_em_reference.Fill(i_eta,i_phi,-100.)
709  h_gains_em_reference_rel.Fill(i_eta,i_phi,-100.)
710  else:
711  h_gains_em.Fill(i_eta,i_phi,gain)
712  h_chi2_em.Fill(i_eta,i_phi,chi2)
713  h_offset_em.Fill(i_eta,i_phi,offset)
714  em_partition_gains.Fill(i_eta,gain)
715  em_partition_gains_ref.Fill(i_eta,gain-reference_gain)
716  h_gains_em_reference.Fill(i_eta,i_phi,gain-reference_gain)
717 
718  if passes_selection is False:
719  h_gains_em_fselect.Fill(i_eta,i_phi)
720  bad_gain_file.write('%i %i %s EM gain= %.3f chi2= %.3f offset= %.3f \n' %
721  (i_eta,i_phi,coolEm,float(gain),float(chi2),float(offset)))
722  #h_gains_em_reference.Fill(i_eta,i_phi,-100.)
723  #h_gains_em_reference_rel.Fill(i_eta,i_phi,-100.)
724 
725  if reference_gain > 0:
726  em_partition_gains_ref_rel.Fill(i_eta,(gain-reference_gain)/reference_gain)
727  h_gains_em_reference_rel.Fill(i_eta,i_phi,(gain-reference_gain)/reference_gain)
728  if fabs((gain-reference_gain)/reference_gain) > threshold_change:
729  h_drifted_em.Fill(i_eta,i_phi)
730  drifted_towers_file.write('%i %i %s EM gain= %.3f refGain= %.3f (%.3f %%) \n' %
731  (i_eta,i_phi,coolEm,float(gain),float(reference_gain),
732  (gain-reference_gain)*100/reference_gain))
733 
734 
735  if not coolHad == '': # there is a channel for this eta-phi
736  gain = receiver_gains.getGain(coolHad)
737  chi2 = receiver_gains.getChi2(coolHad)
738  offset = receiver_gains.getOffset(coolHad)
739  reference_gain = receiver_gains.getReferenceGain(coolHad)
740  passes_selection = receiver_gains.passesSelection(coolHad)
741 
742  if (not gain == '') and (not reference_gain == ''): # both gains should be available
743 
744  if gain == -1. :
745  h_unfitted_had.Fill(i_eta,i_phi)
746  bad_gain_file.write('%i %i %s HAD gain= %.3f \n' % (i_eta,i_phi,coolHad,float(gain)))
747  h_gains_had_reference.Fill(i_eta,i_phi,-100.)
748  h_gains_had_reference_rel.Fill(i_eta,i_phi,-100.)
749  else:
750  h_gains_had.Fill(i_eta,i_phi,gain)
751  h_chi2_had.Fill(i_eta,i_phi,chi2)
752  h_offset_had.Fill(i_eta,i_phi,offset)
753  had_partition_gains.Fill(i_eta,gain)
754  had_partition_gains_ref.Fill(i_eta,gain-reference_gain)
755  h_gains_had_reference.Fill(i_eta,i_phi,gain-reference_gain)
756 
757  if passes_selection is False:
758  h_gains_had_fselect.Fill(i_eta,i_phi)
759  bad_gain_file.write( '%i %i %s HAD gain= %.3f chi2= %.3f offset= %.3f \n' %
760  (i_eta,i_phi,coolHad,float(gain),float(chi2),float(offset)))
761  #h_gains_had_reference.Fill(i_eta,i_phi,-100.)
762  #h_gains_had_reference_rel.Fill(i_eta,i_phi,-100.)
763 
764  if reference_gain > 0:
765  had_partition_gains_ref_rel.Fill(i_eta,(gain-reference_gain)/reference_gain)
766  h_gains_had_reference_rel.Fill(i_eta,i_phi,(gain-reference_gain)/reference_gain)
767  if fabs((gain-reference_gain)/reference_gain) > threshold_change:
768  h_drifted_had.Fill(i_eta,i_phi)
769  drifted_towers_file.write('%i %i %s HAD gain= %.3f refGain= %.3f (%.3f %%) \n' %
770  (i_eta,i_phi,coolHad,float(gain),float(reference_gain),
771  (gain-reference_gain)*100/reference_gain))
772 
773  # start the plotting
774  pdfFileName = "Gains.pdf"
775  canvas.Print( pdfFileName + "[" )
776 
777  # new page: EM gains and drifts
778  if not isTileOnly:
779  canvas.Clear()
780  canvas.Divide(1,2)
781  canvas.cd(1)
782  ROOT.gPad.SetLogy(0)
783  h_gains_em.SetMinimum(0.6)
784  h_gains_em.SetMaximum(1.4)
785  h_gains_em.Draw()
786  canvas.cd(2)
787  h_drifted_em.Draw()
788  canvas.Print( pdfFileName )
789 
790  # new page: EM gains that failed selection and failed fits
791  if not isTileOnly:
792  canvas.Clear()
793  canvas.Divide(1,2)
794  canvas.cd(1)
795  ROOT.gPad.SetLogy(0)
796  h_gains_em_fselect.Draw()
797  canvas.cd(2)
798  h_unfitted_em.Draw()
799  canvas.Print( pdfFileName )
800 
801  # new page: HAD gains and drifts
802  canvas.Clear()
803  canvas.Divide(1,2)
804  canvas.cd(1)
805  ROOT.gPad.SetLogy(0)
806  h_gains_had.SetMinimum(0.6)
807  h_gains_had.SetMaximum(1.4)
808  h_gains_had.Draw()
809  canvas.cd(2)
810  h_drifted_had.Draw()
811  canvas.Print( pdfFileName )
812 
813  # new page: HAD gains that failed selection and failed fits
814  canvas.Clear()
815  canvas.Divide(1,2)
816  canvas.cd(1)
817  h_gains_had_fselect.Draw()
818  canvas.cd(2)
819  h_unfitted_had.Draw()
820  canvas.Print( pdfFileName )
821 
822  # new page: EM gains relative references
823  if not isTileOnly:
824  canvas.Clear()
825  canvas.Divide(1,2)
826  canvas.cd(1)
827  ROOT.gPad.SetLogy(0)
828  h_gains_em_reference_rel.SetMinimum(-0.5)
829  h_gains_em_reference_rel.SetMaximum(0.5)
830  h_gains_em_reference_rel.Draw()
831  canvas.cd(2)
832  h_gains_em_reference_rel.SetMinimum(-0.1)
833  h_gains_em_reference_rel.SetMaximum(0.1)
834  h_gains_em_reference_rel.Draw()
835  canvas.Print( pdfFileName )
836 
837  # new page: HAD gains relative references
838  canvas.Clear()
839  canvas.Divide(1,2)
840  canvas.cd(1)
841  ROOT.gPad.SetLogy(0)
842  h_gains_had_reference_rel.SetMinimum(-0.5)
843  h_gains_had_reference_rel.SetMaximum(0.5)
844  h_gains_had_reference_rel.Draw()
845  canvas.cd(2)
846  h_gains_had_reference_rel.SetMinimum(-0.1)
847  h_gains_had_reference_rel.SetMaximum(0.1)
848  h_gains_had_reference_rel.Draw()
849  canvas.Print( pdfFileName )
850 
851  # new page: EM gains absolute references
852  if not isTileOnly:
853  canvas.Clear()
854  canvas.Divide(1,2)
855  canvas.cd(1)
856  ROOT.gPad.SetLogy(0)
857  h_gains_em_reference.SetMinimum(-0.5)
858  h_gains_em_reference.SetMaximum(0.5)
859  h_gains_em_reference.Draw()
860  canvas.cd(2)
861  ROOT.gPad.SetLogy(0)
862  h_gains_em_reference.SetMinimum(-0.1)
863  h_gains_em_reference.SetMaximum(0.1)
864  h_gains_em_reference.Draw()
865  canvas.Print( pdfFileName )
866 
867  # new page: HAD gains absolute references
868  canvas.Clear()
869  canvas.Divide(1,2)
870  canvas.cd(1)
871  ROOT.gPad.SetLogy(0)
872  h_gains_had_reference.SetMinimum(-0.5)
873  h_gains_had_reference.SetMaximum(0.5)
874  h_gains_had_reference.Draw()
875  canvas.cd(2)
876  ROOT.gPad.SetLogy(0)
877  h_gains_had_reference.SetMinimum(-0.1)
878  h_gains_had_reference.SetMaximum(0.1)
879  h_gains_had_reference.Draw()
880  canvas.Print( pdfFileName )
881 
882  # new page: EM chi2 and offsets
883  if not isTileOnly:
884  canvas.Clear()
885  canvas.Divide(1,2)
886  canvas.cd(1)
887  ROOT.gPad.SetLogy(0)
888  h_chi2_em.SetMinimum(0.1)
889  h_chi2_em.SetMaximum(100)
890  h_chi2_em.Draw()
891  canvas.cd(2)
892  ROOT.gPad.SetLogy(0)
893  h_offset_em.SetMinimum(-1.)
894  h_offset_em.SetMaximum(1.)
895  h_offset_em.Draw()
896  canvas.Print( pdfFileName )
897 
898  # new page: HAD chi2 and offsets
899  canvas.Clear()
900  canvas.Divide(1,2)
901  canvas.cd(1)
902  ROOT.gPad.SetLogy(0)
903  h_chi2_had.SetMinimum(0.1)
904  h_chi2_had.SetMaximum(100)
905  h_chi2_had.Draw()
906  canvas.cd(2)
907  ROOT.gPad.SetLogy(0)
908  h_offset_had.SetMinimum(-1.)
909  h_offset_had.SetMaximum(1.)
910  h_offset_had.Draw()
911  canvas.Print( pdfFileName )
912 
913  # new page: EM 1D gains per layer
914  if not isTileOnly:
915  canvas.Clear()
916  canvas.Divide(2,3)
917  for i_p in range(0,em_partition_gains.nPartitions):
918  canvas.cd(i_p+1)
919  ROOT.gPad.SetLogy() if em_partition_gains.his_partitions[i_p].GetEntries()>0 else ROOT.gPad.SetLogy(0)
920  em_partition_gains.his_partitions[i_p].Draw()
921  canvas.Print( pdfFileName )
922 
923  # new page: HAD 1D gains per layer
924  canvas.Clear()
925  canvas.Divide(2,3)
926  for i_p in range(0,had_partition_gains.nPartitions):
927  if (isTileOnly and i_p>2): break
928  canvas.cd(i_p+1)
929  ROOT.gPad.SetLogy() if had_partition_gains.his_partitions[i_p].GetEntries()>0 else ROOT.gPad.SetLogy(0)
930  had_partition_gains.his_partitions[i_p].Draw()
931  canvas.Print( pdfFileName )
932 
933  # new page: EM 1D gains absolute references per layer
934  if not isTileOnly:
935  canvas.Clear()
936  canvas.Divide(2,3)
937  for i_p in range(0,em_partition_gains_ref.nPartitions):
938  canvas.cd(i_p+1)
939  ROOT.gPad.SetLogy() if em_partition_gains_ref.his_partitions[i_p].GetEntries()>0 else ROOT.gPad.SetLogy(0)
940  em_partition_gains_ref.his_partitions[i_p].Draw()
941  canvas.Print( pdfFileName )
942 
943  # new page: HAD 1D gains absolute references per layer
944  canvas.Clear()
945  canvas.Divide(2,3)
946  for i_p in range(0,had_partition_gains_ref.nPartitions):
947  if (isTileOnly and i_p>2): break
948  canvas.cd(i_p+1)
949  ROOT.gPad.SetLogy() if had_partition_gains_ref.his_partitions[i_p].GetEntries()>0 else ROOT.gPad.SetLogy(0)
950  had_partition_gains_ref.his_partitions[i_p].Draw()
951  canvas.Print( pdfFileName )
952 
953  # new page: EM 1D gains relative references per layer
954  if not isTileOnly:
955  canvas.Clear()
956  canvas.Divide(2,3)
957  for i_p in range(0,em_partition_gains_ref_rel.nPartitions):
958  canvas.cd(i_p+1)
959  ROOT.gPad.SetLogy() if em_partition_gains_ref_rel.his_partitions[i_p].GetEntries()>0 else ROOT.gPad.SetLogy(0)
960  em_partition_gains_ref_rel.his_partitions[i_p].Draw()
961  canvas.Print( pdfFileName )
962 
963  # new page: HAD 1D gains relative references per layer
964  canvas.Clear()
965  canvas.Divide(2,3)
966  for i_p in range(0,had_partition_gains_ref_rel.nPartitions):
967  if (isTileOnly and i_p>2): break
968  canvas.cd(i_p+1)
969  ROOT.gPad.SetLogy() if had_partition_gains_ref_rel.his_partitions[i_p].GetEntries()>0 else ROOT.gPad.SetLogy(0)
970  had_partition_gains_ref_rel.his_partitions[i_p].Draw()
971  canvas.Print( pdfFileName )
972 
973  # Closing files
974  canvas.Print( pdfFileName + "]" )
975  bad_gain_file.close()
976  drifted_towers_file.close()
977  print ("finished!")
978 
979 
980 if __name__ == "__main__":
981 
982  print ("Starting plot_gains_xml")
983 
984  parser = OptionParser()
985  parser.add_option("-f","--InputFile",action="store",type="string",dest="input_file_name",help="Name of input file")
986  parser.add_option("-r","--ReferenceFile",action="store",type="string",dest="reference_file_name",help="Name of reference file")
987  parser.add_option("--InputXml",action="store_true",dest="isInputXml",help="Input is .xml file")
988  parser.add_option("--InputSqlite",action="store_true",dest="isInputSqlite",help="Input is .sqlite file")
989  parser.add_option("--RefXml",action="store_true",dest="isRefXml",help="Reference is .xml file")
990  parser.add_option("--RefSqlite",action="store_true",dest="isRefSqlite",help="Reference is .sqlite file")
991  parser.add_option("--RefOracle",action="store_true",dest="isRefOracle",help="Reference is from Oracle")
992  parser.add_option("--TileOnly",action="store_true",dest="isTileOnly",help="Show only Tile",default=True)
993 
994  (options, args) = parser.parse_args()
995 
996  PlotCalibrationGains(options.input_file_name, options.reference_file_name, options.isInputXml,
997  options.isInputSqlite, options.isRefXml, options.isRefSqlite, options.isRefOracle,
998  options.isTileOnly)
PlotCalibrationGains.HadPartitionPlots.name
name
Definition: PlotCalibrationGains.py:568
PlotCalibrationGains.L1CaloGeometryConvertor.LoadReceiverPPMMap
def LoadReceiverPPMMap(self)
Definition: PlotCalibrationGains.py:100
PlotCalibrationGains.L1CaloGeometryConvertor.isCoolEm
def isCoolEm(self, CoolId)
Definition: PlotCalibrationGains.py:194
PlotCalibrationGains.EmPartitionPlots.name
name
Definition: PlotCalibrationGains.py:523
PlotCalibrationGains.GainReader.LoadReferenceOracle
def LoadReferenceOracle(self, mapping_tool)
Definition: PlotCalibrationGains.py:436
PlotCalibrationGains.EmPartitionPlots.get_partition_number
def get_partition_number(self, eta_bin)
Definition: PlotCalibrationGains.py:537
PlotCalibrationGains.HadPartitionPlots.get_partition_number
def get_partition_number(self, eta_bin)
Definition: PlotCalibrationGains.py:582
PlotCalibrationGains.HadPartitionPlots.his_partitions
his_partitions
Definition: PlotCalibrationGains.py:570
PlotCalibrationGains.GainReader.__init__
def __init__(self)
Definition: PlotCalibrationGains.py:298
PlotCalibrationGains.L1CaloMap.Fill
def Fill(self, eta, phi, gain=1)
Definition: PlotCalibrationGains.py:64
PlotCalibrationGains.L1CaloMap.__init__
def __init__(self, title, XaxisTitle="", YaxisTitle="")
Definition: PlotCalibrationGains.py:39
PlotCalibrationGains.L1CaloGeometryConvertor.getCoolHad
def getCoolHad(self, i_eta, i_phi)
Definition: PlotCalibrationGains.py:185
PlotCalibrationGains.GainReader.getOffset
def getOffset(self, coolId)
Definition: PlotCalibrationGains.py:494
GetEntries
TGraphErrors * GetEntries(TH2F *histo)
Definition: TRTCalib_makeplots.cxx:4019
PlotCalibrationGains.L1CaloGeometryConvertor.UNIX2COOL
UNIX2COOL
Definition: PlotCalibrationGains.py:103
PlotCalibrationGains.L1CaloGeometryConvertor.__init__
def __init__(self)
Definition: PlotCalibrationGains.py:85
PlotCalibrationGains.EmPartitionPlots.Fill
def Fill(self, eta_bin, gain)
Definition: PlotCalibrationGains.py:553
PlotCalibrationGains.L1CaloMap.xbins
xbins
Definition: PlotCalibrationGains.py:42
dumpHVPathFromNtuple.append
bool append
Definition: dumpHVPathFromNtuple.py:91
PlotCalibrationGains.L1CaloGeometryConvertor.getOverlapLayer
def getOverlapLayer(self, RecCoolId)
Definition: PlotCalibrationGains.py:254
python.Bindings.values
values
Definition: Control/AthenaPython/python/Bindings.py:805
PlotCalibrationGains.L1CaloMap.SetMinimum
def SetMinimum(self, minimum)
Definition: PlotCalibrationGains.py:77
PlotCalibrationGains.HadPartitionPlots.Fill
def Fill(self, eta_bin, gain)
Definition: PlotCalibrationGains.py:598
PlotCalibrationGains.L1CaloGeometryConvertor.isPPMOverlap
def isPPMOverlap(self, CoolId)
Definition: PlotCalibrationGains.py:247
PlotCalibrationGains.EmPartitionPlots.__init__
def __init__(self, name, nbins=40, minimum=0., maximum=2., XaxisTitle="", YaxisTitle="")
Definition: PlotCalibrationGains.py:519
PlotCalibrationGains.HadPartitionPlots.__init__
def __init__(self, name, nbins=40, minimum=0., maximum=2., XaxisTitle="", YaxisTitle="")
Definition: PlotCalibrationGains.py:564
PlotCalibrationGains.HadPartitionPlots.nPartitions
nPartitions
Definition: PlotCalibrationGains.py:566
PlotCalibrationGains.GainReader.measured_gains
measured_gains
Definition: PlotCalibrationGains.py:300
PlotCalibrationGains.GainReader.LoadReferenceSqlite
def LoadReferenceSqlite(self, name)
Definition: PlotCalibrationGains.py:400
PlotCalibrationGains.L1CaloGeometryConvertor.isCoolHad
def isCoolHad(self, CoolId)
Definition: PlotCalibrationGains.py:197
PlotCalibrationGains.L1CaloGeometryConvertor.getEtaBin
def getEtaBin(self, CoolId)
Definition: PlotCalibrationGains.py:200
python.LArMinBiasAlgConfig.int
int
Definition: LArMinBiasAlgConfig.py:59
PlotCalibrationGains.L1CaloMap.Draw
def Draw(self)
Definition: PlotCalibrationGains.py:59
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
PlotCalibrationGains.L1CaloGeometryConvertor
Definition: PlotCalibrationGains.py:83
PlotCalibrationGains.GainReader.measured_chi2
measured_chi2
Definition: PlotCalibrationGains.py:302
PlotCalibrationGains.GainReader
Definition: PlotCalibrationGains.py:296
PlotCalibrationGains.GainReader.UNIX2COOL
UNIX2COOL
Definition: PlotCalibrationGains.py:304
PlotCalibrationGains.L1CaloGeometryConvertor.list_of_channels_had
list_of_channels_had
Definition: PlotCalibrationGains.py:89
PlotCalibrationGains.EmPartitionPlots
Definition: PlotCalibrationGains.py:517
PlotCalibrationGains.GainReader.getChi2
def getChi2(self, coolId)
Definition: PlotCalibrationGains.py:488
PlotCalibrationGains.EmPartitionPlots.nPartitions
nPartitions
Definition: PlotCalibrationGains.py:521
PlotCalibrationGains.GainReader.strategy
strategy
Definition: PlotCalibrationGains.py:307
array
PlotCalibrationGains.PlotCalibrationGains
def PlotCalibrationGains(input_file_name="", reference_file_name="", isInputXml=False, isInputSqlite=False, isRefXml=False, isRefSqlite=False, isRefOracle=False, isTileOnly=False)
Definition: PlotCalibrationGains.py:608
PlotCalibrationGains.GainReader.run_nr
run_nr
Definition: PlotCalibrationGains.py:306
PlotCalibrationGains.L1CaloMap.h_1
h_1
Definition: PlotCalibrationGains.py:55
PlotCalibrationGains.L1CaloMap.SetMaximum
def SetMaximum(self, maximum)
Definition: PlotCalibrationGains.py:80
PlotCalibrationGains.GainReader.LoadGainsSqlite
def LoadGainsSqlite(self, name)
Definition: PlotCalibrationGains.py:348
PlotCalibrationGains.L1CaloGeometryConvertor.coolIdPath
coolIdPath
Definition: PlotCalibrationGains.py:86
TrigJetMonitorAlgorithm.items
items
Definition: TrigJetMonitorAlgorithm.py:71
PlotCalibrationGains.GainReader.getReferenceGain
def getReferenceGain(self, coolId)
Definition: PlotCalibrationGains.py:500
PlotCalibrationGains.L1CaloGeometryConvertor.getReceiverCMCP
def getReceiverCMCP(self, ReceiverId)
Definition: PlotCalibrationGains.py:224
PlotCalibrationGains.L1CaloGeometryConvertor.getPPMfromReceiver
def getPPMfromReceiver(self, ReceiverId)
Definition: PlotCalibrationGains.py:138
PlotCalibrationGains.setAxisTitles
def setAxisTitles(histos, xtit, ytit, ztit="foo", xoff=0, yoff=0, zoff=0)
Definition: PlotCalibrationGains.py:25
PlotCalibrationGains.EmPartitionPlots.ext
ext
Definition: PlotCalibrationGains.py:522
Trk::open
@ open
Definition: BinningType.h:40
PlotCalibrationGains.L1CaloGeometryConvertor.list_of_channels_em
list_of_channels_em
Definition: PlotCalibrationGains.py:88
PlotCalibrationGains.L1CaloGeometryConvertor.getFCAL23RecEta
def getFCAL23RecEta(self, RecCoolId)
Definition: PlotCalibrationGains.py:271
PlotCalibrationGains.L1CaloGeometryConvertor.getMissingReceiverChannels
def getMissingReceiverChannels(self, channel_list)
Definition: PlotCalibrationGains.py:220
PlotCalibrationGains.GainReader.LoadReferenceXml
def LoadReferenceXml(self, name)
Definition: PlotCalibrationGains.py:333
PlotCalibrationGains.L1CaloMap.nxbins
nxbins
Definition: PlotCalibrationGains.py:41
PlotCalibrationGains.HadPartitionPlots.ext
ext
Definition: PlotCalibrationGains.py:567
PlotCalibrationGains.L1CaloGeometryConvertor.receiver_to_ppm_map
receiver_to_ppm_map
Definition: PlotCalibrationGains.py:102
PlotCalibrationGains.GainReader.reference_gains
reference_gains
Definition: PlotCalibrationGains.py:301
PlotCalibrationGains.L1CaloGeometryConvertor.getPhiBin
def getPhiBin(self, CoolId)
Definition: PlotCalibrationGains.py:210
PlotCalibrationGains.L1CaloGeometryConvertor.getCoolEm
def getCoolEm(self, i_eta, i_phi)
Definition: PlotCalibrationGains.py:176
PlotCalibrationGains.L1CaloGeometryConvertor.getReceiverfromPPM
def getReceiverfromPPM(self, PPMId, strategy_string=None)
Definition: PlotCalibrationGains.py:144
str
Definition: BTagTrackIpAccessor.cxx:11
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
PlotCalibrationGains.setAxisSizes
def setAxisSizes(histos, tsize=0.05, lsize=0.05, zsize=0.05)
Definition: PlotCalibrationGains.py:14
PlotCalibrationGains.EmPartitionPlots.his_partitions
his_partitions
Definition: PlotCalibrationGains.py:527
PlotCalibrationGains.HadPartitionPlots
Definition: PlotCalibrationGains.py:562
PlotCalibrationGains.GainReader.LoadGainsXml
def LoadGainsXml(self, name)
Definition: PlotCalibrationGains.py:309
PlotCalibrationGains
Definition: PlotCalibrationGains.py:1
Trk::split
@ split
Definition: LayerMaterialProperties.h:38
PlotCalibrationGains.L1CaloGeometryConvertor.isPPMFCAL
def isPPMFCAL(self, CoolId)
Definition: PlotCalibrationGains.py:240
PlotCalibrationGains.GainReader.getGain
def getGain(self, coolId)
Definition: PlotCalibrationGains.py:482
PlotCalibrationGains.L1CaloMap
Definition: PlotCalibrationGains.py:37
PlotCalibrationGains.GainReader.measured_offset
measured_offset
Definition: PlotCalibrationGains.py:303
python.LArMinBiasAlgConfig.float
float
Definition: LArMinBiasAlgConfig.py:65
PlotCalibrationGains.GainReader.passesSelection
def passesSelection(self, coolId)
Definition: PlotCalibrationGains.py:506