5 from __future__
import print_function
10 print (
"=======================Harware coordinates :",h.GetName()[0:h.GetName().
find(
"Phi")-1])
11 print (
"Coordinates : Eta = ",h.GetName()[h.GetName().
find(
"Eta")+3:h.GetName().
find(
"Eta")+7],
" Phi = ",h.GetName()[h.GetName().
find(
"Phi")+3:h.GetName().
find(
"Phi")+7])
17 for ix
in range(61,h.GetNbinsX()+2):
18 nbEvts20GeV = nbEvts20GeV+h.GetBinContent(ix)
19 meanE = meanE + h.GetBinContent(ix)*h.GetBinCenter(ix)
20 meanE = meanE / nbEvts20GeV/ 1000
24 for ix
in range(11,q.GetNbinsX()+2):
25 nbEvts4000 = nbEvts4000 + q.GetBinContent(ix)
30 for ix
in range(1,hLB.GetNbinsX()+1):
32 for iy
in range(61,hLB.GetNbinsY()+2):
33 if hLB.GetBinContent(ix,iy) != 0:
36 nbLB20GeV = nbLB20GeV+1
37 allLBs = allLBs +
" %d"%ix
39 print (
"# of events: E>20GeV / E>20GeV && q>4000 : %d / %d"%(nbEvts4000,nbEvts20GeV))
40 print (
"Mean energy above 20geV: %.2f GeV"%meanE)
41 print (nbLB20GeV,
" LBs contains energetic events: ", allLBs )
51 gStyle.SetOptStat(100110)
70 print (
"python -i extractSporadic.py 159041 x29_m545 EMBA [FT29Sl2Ch68]")
71 print (
"If no channel is specified, displays all with more than 20 events above 20 GeV")
77 from ROOT
import gROOT, gDirectory
78 from ROOT
import gStyle, TCanvas
79 from ROOT
import TRFIOFile
84 nameFile =
"/castor/cern.ch/grid/atlas/tzero/prod1/perm/data10_7TeV/physics_CosmicCalo/0"+sys.argv[1]+
"/data10_7TeV.00"+sys.argv[1]+
".physics_CosmicCalo.merge.HIST."+sys.argv[2]+
"/data10_7TeV.00"+sys.argv[1]+
".physics_CosmicCalo.merge.HIST."+sys.argv[2]+
"._0001.1"
85 nameDir =
"run_"+sys.argv[1]+
"/CaloMonitoring/LArCellMon_NoTrigSel/Sporadic20GeV/"+sys.argv[3]
87 myFile = TRFIOFile(nameFile)
90 hNbEvts = myFile.Get(
"run_"+sys.argv[1]+
"/LAr/FEBMon/perPartitionData/Eventtype")
91 print (
"This stream contains %d events"%hNbEvts.GetEntries())
96 if len(sys.argv) == 4:
100 listOfKeys = gDirectory.GetListOfKeys()
101 for key
in listOfKeys:
103 type = key.GetClassName()
104 if type ==
"TH1F" and name.find(
"EN") != -1 :
105 h.append(myFile.Get(nameDir+
"/"+name))
106 if type ==
"TH1F" and name.find(
"Quality") != -1 :
107 q.append(myFile.Get(nameDir+
"/"+name))
108 if type ==
"TH2F" and name.find(
"ENLB") != -1 :
109 hLB.append(myFile.Get(nameDir+
"/"+name))
112 print (
"retrieved %i histos"%nhists)
114 for i
in range(0, nhists):
115 if h[i].Integral(61,h[i].GetNbinsX()+1) >= 20:
119 if len(sys.argv) == 5:
120 nameHisto = sys.argv[4]
121 listOfKeys = gDirectory.GetListOfKeys()
122 for key
in listOfKeys:
124 type = key.GetClassName()
125 if type ==
"TH1F" and name.find(
"EN") != -1
and name.find(nameHisto) != -1:
126 h = myFile.Get(nameDir+
"/"+name)
127 if type ==
"TH2F" and name.find(
"ENLB") != -1
and name.find(nameHisto) != -1:
128 hLB = myFile.Get(nameDir+
"/"+name)
129 if type ==
"TH1F" and name.find(
"Quality") != -1
and name.find(nameHisto) != -1:
130 q = myFile.Get(nameDir+
"/"+name)
134 c1 = TCanvas(
'c1',
'c1',1000,600)