ATLAS Offline Software
PlotCalibrationHV.py
Go to the documentation of this file.
1 #!/bin/env python
2 
3 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
4 
5 import ROOT
6 import sys
7 import time
8 import os
9 import struct
10 
11 from PyCool import cool
12 from optparse import OptionParser
13 
14 from PlotCalibrationGains import L1CaloMap, L1CaloGeometryConvertor
15 
16 
17 def isEmPresampler(layerName):
18 
19 # layer name 0 in EMB and overlap, name 4 in EMEC
20 
21  if layerName == 0 or layerName == 4:
22  return True
23  else:
24  return False
25 
26 
27 def isEmFront(layerName,isOverlap):
28 
29 # layer name 1 in EMB and overlap, name 5 in EMEC (name 5 in overlap goes with back layer)
30 # EM overlap has layer names 0, 1, 2 (EMB) and 5,6 (EMEC)
31 
32  isAccepted = False
33 
34  if isOverlap:
35  if layerName == 1:
36  isAccepted = True
37  else:
38  if layerName == 1 or layerName == 5:
39  isAccepted = True
40 
41  return isAccepted
42 
43 def isEmMiddle(layerName,isOverlap):
44 
45 # layer name 2 in EMB and overlap, name 6 in EMEC and 21 in FCAL0 (name 6 in overlap goes alone)
46  isAccepted = False
47 
48  if isOverlap:
49  if layerName == 2:
50  isAccepted = True
51  else:
52  if layerName == 2 or layerName == 6 or layerName == 21:
53  isAccepted = True
54 
55  return isAccepted
56 
57 
58 def isEmBack(layerName,isOverlap):
59 
60 # layer number 3 in EMB and overlap, layer number 7 in EMEC, layer nr. 5 in overlap
61  isAccepted = False
62 
63  if isOverlap:
64  if layerName == 5:
65  isAccepted = True
66  else:
67  if layerName == 3 or layerName == 7:
68  isAccepted = True
69 
70  return isAccepted
71 
72 
73 def isEmOverlapBack(layerName,isOverlap):
74 
75 # layer number 6 in EM overlap, this one doesn't fit anywhere else...
76  isAccepted = False
77 
78  if isOverlap and layerName == 6:
79  isAccepted = True
80 
81  return isAccepted
82 
83 
84 def isHadFirstLayer(layerName,TT_part):
85 
86 # layer number 8 in HEC, low eta part of 22 (FCAL2)
87  isAccepted = False
88  if layerName == 8 or (layerName == 22 and TT_part == 'EmecFcalLowEta'):
89  isAccepted = True
90 
91  return isAccepted
92 
93 def isHadSecondLayer(layerName,TT_part):
94 
95 # layer number 9 in HEC, high eta part of 22 (FCAL2)
96  isAccepted = False
97  if layerName == 9 or (layerName == 22 and TT_part == 'EmbFcalHighEta'):
98  isAccepted = True
99 
100  return isAccepted
101 
102 def isHadThirdLayer(layerName,TT_part):
103 
104 # layer number 10 in HEC, low eta part of 23 (FCAL3)
105  isAccepted = False
106  if layerName == 10 or (layerName == 23 and TT_part == 'EmecFcalLowEta'):
107  isAccepted = True
108 
109  return isAccepted
110 
111 def isHadFourthLayer(layerName,TT_part):
112 
113 # layer number 11 in HEC, high eta part of 23 (FCAL3)
114  isAccepted = False
115  if layerName == 11 or (layerName == 23 and TT_part == 'EmbFcalHighEta'):
116  isAccepted = True
117 
118  return isAccepted
119 
121 
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 
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 
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 
252  def GetMeanCorections(self):
253  return self.MeanCorr
254 
255  def GetCorLayer1(self):
256  return self.CorrLayer1
257 
258  def GetCorLayer2(self):
259  return self.CorrLayer2
260 
261  def GetCorLayer3(self):
262  return self.CorrLayer3
263 
264  def GetCorLayer4(self):
265  return self.CorrLayer4
266 
267  def GetAffectedCells1(self):
268  return self.AffectedCells1
269 
270  def GetAffectedCells2(self):
271  return self.AffectedCells2
272 
273  def GetAffectedCells3(self):
274  return self.AffectedCells3
275 
276  def GetAffectedCells4(self):
277  return self.AffectedCells4
278 
279  def GetNCells1(self):
280  return self.NCells1
281 
282  def GetNCells2(self):
283  return self.NCells2
284 
285  def GetNCells3(self):
286  return self.NCells3
287 
288  def GetNCells4(self):
289  return self.NCells4
290 
291  def GetNLayers(self):
292  return self.NLayers
293 
294  def GetName1(self):
295  return self.Name1
296 
297  def GetName2(self):
298  return self.Name2
299 
300  def GetName3(self):
301  return self.Name3
302 
303  def GetName4(self):
304  return self.Name4
305 
306 
307 def PlotCalibrationHV(input_file_name=None):
308 
309  HVCutAverage = 1.05 # lower cut on TT-averaged HV corrections
310 # HVCutAverage = 1.01 # lower cut on TT-averaged HV corrections
311  HVCutLayers = 1.001 # lower cut on layer-by-layer corrections
312 
313  ROOT.gStyle.SetPalette(1)
314  ROOT.gStyle.SetOptStat(111111)
315  ROOT.gStyle.SetCanvasColor(10)
316 
317  c1 = ROOT.TCanvas('c1','Example',200,10,700,500)
318 
319  h_MeanCorrEmecFcalLowEta_em = L1CaloMap("Mean HV corrections for EM (EMEC in overlap) ","#eta bin","#phi bin")
320  h_MeanCorrEmecFcalLowEta_had = L1CaloMap("Mean HV corrections for HAD (FCAL low #eta)","#eta bin","#phi bin")
321 
322  h_MeanCorrEmbFcalHighEta_em = L1CaloMap("Mean HV corrections for EM overlap (EMB)","#eta bin","#phi bin")
323  h_MeanCorrEmbFcalHighEta_had = L1CaloMap("Mean HV corrections for HAD FCAL (high #eta)","#eta bin","#phi bin")
324 
325 
326  h_LayerCorr_presampler = L1CaloMap("HV corrections for EM presampler ","#eta bin","#phi bin")
327  h_CellFraction_presampler = L1CaloMap("Fraction of HV affected cells in EM presampler","#eta bin","#phi bin")
328  h_LayerCorr_em_front = L1CaloMap("HV corrections for EM front layer ","#eta bin","#phi bin")
329  h_CellFraction_em_front = L1CaloMap("Fraction of HV affected cells in EM front layer","#eta bin","#phi bin")
330  h_LayerCorr_em_middle = L1CaloMap("HV corrections for EM middle layer ","#eta bin","#phi bin")
331  h_CellFraction_em_middle = L1CaloMap("Fraction of HV affected cells in EM middle layer","#eta bin","#phi bin")
332  h_LayerCorr_em_back = L1CaloMap("HV corrections for EM back layer","#eta bin","#phi bin")
333  h_CellFraction_em_back = L1CaloMap("Fraction of HV affected cells in EM back layer","#eta bin","#phi bin")
334 
335  h_LayerCorr_em_overlap_back = L1CaloMap("HV corrections for EM overlap back layer","#eta bin","#phi bin")
336  h_CellFraction_em_overlap_back = L1CaloMap("Fraction of HV affected cells in EM overlap back layer","#eta bin","#phi bin")
337 
338  h_LayerCorr_had_first = L1CaloMap("HV corrections for first HAD layer (low #eta FCAL2)","#eta bin","#phi bin")
339  h_CellFraction_had_first = L1CaloMap("Fraction of HV affected cells in first HAD layer (low #eta FCAL2)","#eta bin","#phi bin")
340  h_LayerCorr_had_second = L1CaloMap("HV corrections for second HAD layer (high #eta FCAL2)","#eta bin","#phi bin")
341  h_CellFraction_had_second = L1CaloMap("Fraction of HV affected cells in second HAD layer (high #eta FCAL2)","#eta bin","#phi bin")
342  h_LayerCorr_had_third = L1CaloMap("HV corrections for third HAD layer (low #eta FCAL3)","#eta bin","#phi bin")
343  h_CellFraction_had_third = L1CaloMap("Fraction of HV affected cells in third HAD layer (low #eta FCAL3)","#eta bin","#phi bin")
344  h_LayerCorr_had_fourth = L1CaloMap("HV corrections for fourth HAD layer (high #eta FCAL3)","#eta bin","#phi bin")
345  h_CellFraction_had_fourth = L1CaloMap("Fraction of HV affected cells in fourth HAD layer (high #eta FCAL3)","#eta bin","#phi bin")
346 
347 
348 
349  geometry_convertor = L1CaloGeometryConvertor()
350  geometry_convertor.LoadReceiverPPMMap()
351 
352 
353  input_file = input_file_name
354  print(("Taking HV information from file",input_file ))
355 
356  hv_status = L1CaloHVReader(input_file)
357 
358  large_hv_file = open('large_hv_corr.txt','w')
359 
360  for ReceiverId in list(hv_status.GetMeanCorections().keys()):
361 
362  MeanHVCorrection = (hv_status.GetMeanCorections())[ReceiverId]
363  CorrLayers = [0,0,0,0]
364  CorrLayers[0] = (hv_status.GetCorLayer1())[ReceiverId]
365  CorrLayers[1] = (hv_status.GetCorLayer2())[ReceiverId]
366  CorrLayers[2] = (hv_status.GetCorLayer3())[ReceiverId]
367  CorrLayers[3] = (hv_status.GetCorLayer4())[ReceiverId]
368 
369  NLayers = (hv_status.GetNLayers())[ReceiverId]
370 
371  AffectedCells = [0,0,0,0]
372  AffectedCells[0] = (hv_status.GetAffectedCells1())[ReceiverId]
373  AffectedCells[1] = (hv_status.GetAffectedCells2())[ReceiverId]
374  AffectedCells[2] = (hv_status.GetAffectedCells3())[ReceiverId]
375  AffectedCells[3] = (hv_status.GetAffectedCells4())[ReceiverId]
376 
377  NCells = [0,0,0,0]
378  NCells[0] = (hv_status.GetNCells1())[ReceiverId]
379  NCells[1] = (hv_status.GetNCells2())[ReceiverId]
380  NCells[2] = (hv_status.GetNCells3())[ReceiverId]
381  NCells[3] = (hv_status.GetNCells4())[ReceiverId]
382 
383  LayerName = [0,0,0,0]
384  LayerName[0] = (hv_status.GetName1())[ReceiverId]
385  LayerName[1] = (hv_status.GetName2())[ReceiverId]
386  LayerName[2] = (hv_status.GetName3())[ReceiverId]
387  LayerName[3] = (hv_status.GetName4())[ReceiverId]
388 
389  PPM_ID = geometry_convertor.getPPMfromReceiver(ReceiverId)
390  eta_bin = geometry_convertor.getEtaBin(PPM_ID)
391  phi_bin = geometry_convertor.getPhiBin(PPM_ID)
392 
393  TT_part = 'EmecFcalLowEta'
394  if geometry_convertor.isPPMFCAL(PPM_ID) and geometry_convertor.getFCAL23RecEta(ReceiverId)=='HighEta':
395  TT_part = 'EmbFcalHighEta'
396  if geometry_convertor.isPPMOverlap(PPM_ID) and geometry_convertor.getOverlapLayer(ReceiverId)=='EMB':
397  TT_part = 'EmbFcalHighEta'
398 
399 # if geometry_convertor.isPPMOverlap(PPM_ID):
400 # print ("Overlap tower COOL Id=%s Rx=%s layer=%s" % (PPM_ID,ReceiverId,geometry_convertor.getOverlapLayer(ReceiverId)))
401 
402 # if geometry_convertor.isPPMFCAL(PPM_ID):
403 # print ("Overlap tower COOL Id=%s Rx=%s layer=%s" % (PPM_ID,ReceiverId,TT_part))
404 
405 # Mean corrections
406 
407  if MeanHVCorrection > HVCutAverage and TT_part == 'EmecFcalLowEta':
408  if geometry_convertor.isCoolEm(PPM_ID):
409  h_MeanCorrEmecFcalLowEta_em.Fill(eta_bin,phi_bin,MeanHVCorrection)
410  large_hv_file.write("%3i %3i EM %12s Rx=%7s %.3f (%.3f %.3f %.3f %.3f) \n" % (eta_bin,phi_bin,PPM_ID,ReceiverId,MeanHVCorrection,CorrLayers[0],CorrLayers[1],CorrLayers[2],CorrLayers[3]))
411 
412  if geometry_convertor.isCoolHad(PPM_ID):
413  h_MeanCorrEmecFcalLowEta_had.Fill(eta_bin,phi_bin,MeanHVCorrection)
414  large_hv_file.write("%3i %3i HAD %12s Rx=%7s %.3f (%.3f %.3f %.3f %.3f) \n" % (eta_bin,phi_bin,PPM_ID,ReceiverId,MeanHVCorrection,CorrLayers[0],CorrLayers[1],CorrLayers[2],CorrLayers[3]))
415 
416  if MeanHVCorrection > HVCutAverage and TT_part == 'EmbFcalHighEta':
417  if geometry_convertor.isCoolEm(PPM_ID):
418  h_MeanCorrEmbFcalHighEta_em.Fill(eta_bin,phi_bin,MeanHVCorrection)
419  large_hv_file.write("%3i %3i EM %12s Rx=%7s %.3f (%.3f %.3f %.3f %.3f) \n" % (eta_bin,phi_bin,PPM_ID,ReceiverId,MeanHVCorrection,CorrLayers[0],CorrLayers[1],CorrLayers[2],CorrLayers[3]))
420 
421  if geometry_convertor.isCoolHad(PPM_ID):
422  h_MeanCorrEmbFcalHighEta_had.Fill(eta_bin,phi_bin,MeanHVCorrection)
423  large_hv_file.write("%3i %3i HAD %12s Rx=%7s %.3f (%.3f %.3f %.3f %.3f) \n" % (eta_bin,phi_bin,PPM_ID,ReceiverId,MeanHVCorrection,CorrLayers[0],CorrLayers[1],CorrLayers[2],CorrLayers[3]))
424 
425 # Now go layer-by-layer
426 
427  for ilayer in range(NLayers):
428 
429 # EM layers
430 
431  if isEmPresampler(LayerName[ilayer]):
432  if CorrLayers[ilayer] > HVCutLayers:
433  h_LayerCorr_presampler.Fill(eta_bin,phi_bin,CorrLayers[ilayer])
434  h_CellFraction_presampler.Fill(eta_bin,phi_bin,float(AffectedCells[ilayer])/float(NCells[ilayer]))
435 
436  if isEmFront(LayerName[ilayer],geometry_convertor.isPPMOverlap(PPM_ID)):
437  if CorrLayers[ilayer] > HVCutLayers:
438  h_LayerCorr_em_front.Fill(eta_bin,phi_bin,CorrLayers[ilayer])
439  h_CellFraction_em_front.Fill(eta_bin,phi_bin,float(AffectedCells[ilayer])/float(NCells[ilayer]))
440 
441  if isEmMiddle(LayerName[ilayer],geometry_convertor.isPPMOverlap(PPM_ID)):
442  if CorrLayers[ilayer] > HVCutLayers:
443  h_LayerCorr_em_middle.Fill(eta_bin,phi_bin,CorrLayers[ilayer])
444  h_CellFraction_em_middle.Fill(eta_bin,phi_bin,float(AffectedCells[ilayer])/float(NCells[ilayer]))
445 
446  if isEmBack(LayerName[ilayer],geometry_convertor.isPPMOverlap(PPM_ID)):
447  if CorrLayers[ilayer] > HVCutLayers:
448  h_LayerCorr_em_back.Fill(eta_bin,phi_bin,CorrLayers[ilayer])
449  h_CellFraction_em_back.Fill(eta_bin,phi_bin,float(AffectedCells[ilayer])/float(NCells[ilayer]))
450 
451  if isEmOverlapBack(LayerName[ilayer],geometry_convertor.isPPMOverlap(PPM_ID)):
452  if CorrLayers[ilayer] > HVCutLayers:
453  h_LayerCorr_em_overlap_back.Fill(eta_bin,phi_bin,CorrLayers[ilayer])
454  h_CellFraction_em_overlap_back.Fill(eta_bin,phi_bin,float(AffectedCells[ilayer])/float(NCells[ilayer]))
455 
456 # HAD layers
457 
458  if isHadFirstLayer(LayerName[ilayer],TT_part):
459  if CorrLayers[ilayer] > HVCutLayers:
460  h_LayerCorr_had_first.Fill(eta_bin,phi_bin,CorrLayers[ilayer])
461  h_CellFraction_had_first.Fill(eta_bin,phi_bin,float(AffectedCells[ilayer])/float(NCells[ilayer]))
462 
463  if isHadSecondLayer(LayerName[ilayer],TT_part):
464  if CorrLayers[ilayer] > HVCutLayers:
465  h_LayerCorr_had_second.Fill(eta_bin,phi_bin,CorrLayers[ilayer])
466  h_CellFraction_had_second.Fill(eta_bin,phi_bin,float(AffectedCells[ilayer])/float(NCells[ilayer]))
467 
468  if isHadThirdLayer(LayerName[ilayer],TT_part):
469  if CorrLayers[ilayer] > HVCutLayers:
470  h_LayerCorr_had_third.Fill(eta_bin,phi_bin,CorrLayers[ilayer])
471  h_CellFraction_had_third.Fill(eta_bin,phi_bin,float(AffectedCells[ilayer])/float(NCells[ilayer]))
472 
473  if isHadFourthLayer(LayerName[ilayer],TT_part):
474  if CorrLayers[ilayer] > HVCutLayers:
475  h_LayerCorr_had_fourth.Fill(eta_bin,phi_bin,CorrLayers[ilayer])
476  h_CellFraction_had_fourth.Fill(eta_bin,phi_bin,float(AffectedCells[ilayer])/float(NCells[ilayer]))
477 
478 
479  large_hv_file.close()
480 
481  # Draw mean corrections
482 
483  h_MeanCorrEmecFcalLowEta_em.SetMinimum(1.)
484  h_MeanCorrEmecFcalLowEta_em.SetMaximum(2.1)
485  h_MeanCorrEmecFcalLowEta_em.Draw()
486  c1.Print("HVStatus.ps(")
487 
488  h_MeanCorrEmecFcalLowEta_had.SetMinimum(1.)
489  h_MeanCorrEmecFcalLowEta_had.SetMaximum(2.1)
490  h_MeanCorrEmecFcalLowEta_had.Draw()
491  c1.Print("HVStatus.ps")
492 
493 
494  h_MeanCorrEmbFcalHighEta_em.SetMinimum(1.)
495  h_MeanCorrEmbFcalHighEta_em.SetMaximum(2.1)
496  h_MeanCorrEmbFcalHighEta_em.Draw()
497  c1.Print("HVStatus.ps")
498 
499  h_MeanCorrEmbFcalHighEta_had.SetMinimum(1.)
500  h_MeanCorrEmbFcalHighEta_had.SetMaximum(2.1)
501  h_MeanCorrEmbFcalHighEta_had.Draw()
502  c1.Print("HVStatus.ps")
503 
504 
505  # Now EM layer-by-layer corrections
506 
507  h_LayerCorr_presampler.SetMinimum(1.)
508  h_LayerCorr_presampler.SetMaximum(2.1)
509  h_LayerCorr_presampler.Draw()
510  c1.Print("HVStatus.ps")
511 
512  h_CellFraction_presampler.SetMinimum(0.)
513  h_CellFraction_presampler.SetMaximum(1.1)
514  h_CellFraction_presampler .Draw()
515  c1.Print("HVStatus.ps")
516 
517  h_LayerCorr_em_front.SetMinimum(1.)
518  h_LayerCorr_em_front.SetMaximum(2.1)
519  h_LayerCorr_em_front.Draw()
520  c1.Print("HVStatus.ps")
521 
522  h_CellFraction_em_front.SetMinimum(0.)
523  h_CellFraction_em_front.SetMaximum(1.1)
524  h_CellFraction_em_front.Draw()
525  c1.Print("HVStatus.ps")
526 
527  h_LayerCorr_em_middle.SetMinimum(1.)
528  h_LayerCorr_em_middle.SetMaximum(2.1)
529  h_LayerCorr_em_middle.Draw()
530  c1.Print("HVStatus.ps")
531 
532  h_CellFraction_em_middle.SetMinimum(0.)
533  h_CellFraction_em_middle.SetMaximum(1.1)
534  h_CellFraction_em_middle.Draw()
535  c1.Print("HVStatus.ps")
536 
537  h_LayerCorr_em_back.SetMinimum(1.)
538  h_LayerCorr_em_back.SetMaximum(2.1)
539  h_LayerCorr_em_back.Draw()
540  c1.Print("HVStatus.ps")
541 
542  h_CellFraction_em_back.SetMinimum(0.)
543  h_CellFraction_em_back.SetMaximum(1.1)
544  h_CellFraction_em_back.Draw()
545  c1.Print("HVStatus.ps")
546 
547  h_LayerCorr_em_overlap_back.SetMinimum(1.)
548  h_LayerCorr_em_overlap_back.SetMaximum(2.1)
549  h_LayerCorr_em_overlap_back.Draw()
550  c1.Print("HVStatus.ps")
551 
552  h_CellFraction_em_overlap_back.SetMinimum(0.)
553  h_CellFraction_em_overlap_back.SetMaximum(1.1)
554  h_CellFraction_em_overlap_back.Draw()
555  c1.Print("HVStatus.ps")
556 
557 
558  h_LayerCorr_had_first.SetMinimum(1.)
559  h_LayerCorr_had_first.SetMaximum(2.1)
560  h_LayerCorr_had_first.Draw()
561  c1.Print("HVStatus.ps")
562 
563  h_CellFraction_had_first.SetMinimum(0.)
564  h_CellFraction_had_first.SetMaximum(1.1)
565  h_CellFraction_had_first.Draw()
566  c1.Print("HVStatus.ps")
567 
568  h_LayerCorr_had_second.SetMinimum(1.)
569  h_LayerCorr_had_second.SetMaximum(2.1)
570  h_LayerCorr_had_second.Draw()
571  c1.Print("HVStatus.ps")
572 
573  h_CellFraction_had_second.SetMinimum(0.)
574  h_CellFraction_had_second.SetMaximum(1.1)
575  h_CellFraction_had_second.Draw()
576  c1.Print("HVStatus.ps")
577 
578  h_LayerCorr_had_third.SetMinimum(1.)
579  h_LayerCorr_had_third.SetMaximum(2.1)
580  h_LayerCorr_had_third.Draw()
581  c1.Print("HVStatus.ps")
582 
583  h_CellFraction_had_third.SetMinimum(0.)
584  h_CellFraction_had_third.SetMaximum(1.1)
585  h_CellFraction_had_third.Draw()
586  c1.Print("HVStatus.ps")
587 
588  h_LayerCorr_had_fourth.SetMinimum(1.)
589  h_LayerCorr_had_fourth .SetMaximum(2.1)
590  h_LayerCorr_had_fourth.Draw()
591  c1.Print("HVStatus.ps")
592 
593  h_CellFraction_had_fourth.SetMinimum(0.)
594  h_CellFraction_had_fourth.SetMaximum(1.1)
595  h_CellFraction_had_fourth.Draw()
596  c1.Print("HVStatus.ps)")
597 
598 
599  os.system("ps2pdf HVStatus.ps")
600  # os.system("cp HVStatus.pdf /home/jb/public_web/tmp ")
601 
602 
603  print ("Done!")
604 
605 if __name__ == "__main__":
606 
607  print ("Starting PlotCalibrationHV")
608 
609  parser = OptionParser()
610 
611  parser.add_option("-f","--InputFile",action="store",type="string",dest="input_file_name",help="Name of input file")
612 
613  (options, args) = parser.parse_args()
614 
615  PlotCalibrationHV(options.input_file_name)
PlotCalibrationHV.L1CaloHVReader.GetName2
def GetName2(self)
Definition: PlotCalibrationHV.py:297
PlotCalibrationHV.L1CaloHVReader.Name1
Name1
Definition: PlotCalibrationHV.py:142
PlotCalibrationHV.L1CaloHVReader.read_geometry
def read_geometry(self, file_name)
Definition: PlotCalibrationHV.py:203
PlotCalibrationHV.L1CaloHVReader.read_corrections
def read_corrections(self, file_name)
Definition: PlotCalibrationHV.py:154
PlotCalibrationHV.L1CaloHVReader.GetCorLayer3
def GetCorLayer3(self)
Definition: PlotCalibrationHV.py:261
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
PlotCalibrationHV.L1CaloHVReader.GetNCells4
def GetNCells4(self)
Definition: PlotCalibrationHV.py:288
PlotCalibrationHV.L1CaloHVReader.GetNCells3
def GetNCells3(self)
Definition: PlotCalibrationHV.py:285
PlotCalibrationHV.L1CaloHVReader.CorrLayer3
CorrLayer3
Definition: PlotCalibrationHV.py:129
PlotCalibrationHV.L1CaloHVReader
Definition: PlotCalibrationHV.py:120
PlotCalibrationHV.L1CaloHVReader.CorrLayer4
CorrLayer4
Definition: PlotCalibrationHV.py:130
PlotCalibrationHV.L1CaloHVReader.GetNCells1
def GetNCells1(self)
Definition: PlotCalibrationHV.py:279
PlotCalibrationHV.L1CaloHVReader.NCells3
NCells3
Definition: PlotCalibrationHV.py:139
PlotCalibrationHV.L1CaloHVReader.GetName4
def GetName4(self)
Definition: PlotCalibrationHV.py:303
PlotCalibrationHV.L1CaloHVReader.GetCorLayer1
def GetCorLayer1(self)
Definition: PlotCalibrationHV.py:255
PlotCalibrationHV.L1CaloHVReader.AffectedCells1
AffectedCells1
Definition: PlotCalibrationHV.py:132
PlotCalibrationHV.isEmPresampler
def isEmPresampler(layerName)
Definition: PlotCalibrationHV.py:17
PlotCalibrationHV.L1CaloHVReader.GetAffectedCells1
def GetAffectedCells1(self)
Definition: PlotCalibrationHV.py:267
PlotCalibrationHV.isHadFirstLayer
def isHadFirstLayer(layerName, TT_part)
Definition: PlotCalibrationHV.py:84
PlotCalibrationHV.L1CaloHVReader.GetMeanCorections
def GetMeanCorections(self)
Definition: PlotCalibrationHV.py:252
PlotCalibrationHV.L1CaloHVReader.Name4
Name4
Definition: PlotCalibrationHV.py:145
PlotCalibrationHV.isHadSecondLayer
def isHadSecondLayer(layerName, TT_part)
Definition: PlotCalibrationHV.py:93
PlotCalibrationHV.L1CaloHVReader.GetAffectedCells2
def GetAffectedCells2(self)
Definition: PlotCalibrationHV.py:270
PlotCalibrationHV.L1CaloHVReader.NCells2
NCells2
Definition: PlotCalibrationHV.py:138
PlotCalibrationHV.L1CaloHVReader.MeanCorr
MeanCorr
Definition: PlotCalibrationHV.py:125
PlotCalibrationHV.L1CaloHVReader.CorrLayer1
CorrLayer1
Definition: PlotCalibrationHV.py:127
PlotCalibrationHV.L1CaloHVReader.GetAffectedCells4
def GetAffectedCells4(self)
Definition: PlotCalibrationHV.py:276
PlotCalibrationHV.isEmMiddle
def isEmMiddle(layerName, isOverlap)
Definition: PlotCalibrationHV.py:43
PlotCalibrationHV.isEmFront
def isEmFront(layerName, isOverlap)
Definition: PlotCalibrationHV.py:27
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
PlotCalibrationGains.L1CaloGeometryConvertor
Definition: PlotCalibrationGains.py:59
PlotCalibrationHV.L1CaloHVReader.GetAffectedCells3
def GetAffectedCells3(self)
Definition: PlotCalibrationHV.py:273
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
PlotCalibrationHV.L1CaloHVReader.UNIX2COOL
UNIX2COOL
Definition: PlotCalibrationHV.py:149
PlotCalibrationHV.L1CaloHVReader.GetName1
def GetName1(self)
Definition: PlotCalibrationHV.py:294
PlotCalibrationHV.L1CaloHVReader.GetNLayers
def GetNLayers(self)
Definition: PlotCalibrationHV.py:291
PlotCalibrationHV.L1CaloHVReader.AffectedCells4
AffectedCells4
Definition: PlotCalibrationHV.py:135
PlotCalibrationHV.L1CaloHVReader.__init__
def __init__(self, file_name)
Definition: PlotCalibrationHV.py:122
PlotCalibrationHV.L1CaloHVReader.CorrLayer2
CorrLayer2
Definition: PlotCalibrationHV.py:128
PlotCalibrationHV
Definition: PlotCalibrationHV.py:1
PlotCalibrationHV.isEmOverlapBack
def isEmOverlapBack(layerName, isOverlap)
Definition: PlotCalibrationHV.py:73
PlotCalibrationHV.L1CaloHVReader.AffectedCells3
AffectedCells3
Definition: PlotCalibrationHV.py:134
Trk::open
@ open
Definition: BinningType.h:40
PlotCalibrationHV.L1CaloHVReader.AffectedCells2
AffectedCells2
Definition: PlotCalibrationHV.py:133
Muon::print
std::string print(const MuPatSegment &)
Definition: MuonTrackSteering.cxx:28
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
PlotCalibrationHV.L1CaloHVReader.GetName3
def GetName3(self)
Definition: PlotCalibrationHV.py:300
PlotCalibrationHV.L1CaloHVReader.NLayers
NLayers
Definition: PlotCalibrationHV.py:124
PlotCalibrationHV.isHadThirdLayer
def isHadThirdLayer(layerName, TT_part)
Definition: PlotCalibrationHV.py:102
PlotCalibrationHV.L1CaloHVReader.Name2
Name2
Definition: PlotCalibrationHV.py:143
PlotCalibrationHV.PlotCalibrationHV
def PlotCalibrationHV(input_file_name=None)
Definition: PlotCalibrationHV.py:307
python.PerfMonSerializer.encode
def encode(data, use_base64=True)
Definition: PerfMonSerializer.py:375
PlotCalibrationHV.isEmBack
def isEmBack(layerName, isOverlap)
Definition: PlotCalibrationHV.py:58
PlotCalibrationHV.L1CaloHVReader.GetCorLayer2
def GetCorLayer2(self)
Definition: PlotCalibrationHV.py:258
readCCLHist.float
float
Definition: readCCLHist.py:83
PlotCalibrationHV.isHadFourthLayer
def isHadFourthLayer(layerName, TT_part)
Definition: PlotCalibrationHV.py:111
PlotCalibrationHV.L1CaloHVReader.GetCorLayer4
def GetCorLayer4(self)
Definition: PlotCalibrationHV.py:264
PlotCalibrationHV.L1CaloHVReader.Name3
Name3
Definition: PlotCalibrationHV.py:144
PlotCalibrationHV.L1CaloHVReader.NCells4
NCells4
Definition: PlotCalibrationHV.py:140
PlotCalibrationGains.L1CaloMap
Definition: PlotCalibrationGains.py:15
PlotCalibrationHV.L1CaloHVReader.GetNCells2
def GetNCells2(self)
Definition: PlotCalibrationHV.py:282
PlotCalibrationHV.L1CaloHVReader.NCells1
NCells1
Definition: PlotCalibrationHV.py:137