8def checkHistoBinning(filename,runnumber):
9 nMultipleHits=0
10 nNoHit=0
11 f=ROOT.TFile.Open(filename)
12 layers=["EMBPA", "EMBPC", "EMB1A", "EMB1C", "EMB2A", "EMB2C", "EMB3A", "EMB3C",
13 "HEC0A", "HEC0C", "HEC1A", "HEC1C", "HEC2A", "HEC2C", "HEC3A", "HEC3C",
14 "EMECPA", "EMECPC", "EMEC1A", "EMEC1C", "EMEC2A", "EMEC2C", "EMEC3A", "EMEC3C",
15 "FCAL1A", "FCAL1C", "FCAL2A", "FCAL2C", "FCAL3A", "FCAL3C"]
16
17
18 for layer in layers:
19 histpath="run_%i/CaloMonitoring/LArCellMon_NoTrigSel/2d_Occupancy/CellOccupancyVsEtaPhi_%s_noEth_rndm_CSCveto"%(runnumber,layer)
20 hist=f.Get(histpath)
21 print ("Checking Histogram",hist)
22 print ("\tBinning x:",hist.GetNbinsX(),"y:",hist.GetNbinsY())
23 for x in range (hist.GetNbinsX()):
24 for y in range (hist.GetNbinsY()):
25 n=hist.GetBinContent(x,y)
26 if (n>1):
27 print ("ERROR multiple hits in ",layer,x,y,n)
28 nMultipleHits+=1
29 elif (n!=1):
30 nNoHit+=1
31 print ("WARNING no hit in ", layer,x,y,n)
32 print ("Summary")
33 print ("\tNumber of bins not corresponding to any cell:",nNoHit)
34 print ("\tNumber of bins corresponding to multiple cells:",nMultipleHits)
35
36 return nMultipleHits
37