9 print (
"=======================Harware coordinates :",h.GetName()[0:h.GetName().
find(
"Phi")-1])
10 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])
16 for ix
in range(61,h.GetNbinsX()+2):
17 nbEvts20GeV = nbEvts20GeV+h.GetBinContent(ix)
18 meanE = meanE + h.GetBinContent(ix)*h.GetBinCenter(ix)
19 meanE = meanE / nbEvts20GeV/ 1000
23 for ix
in range(11,q.GetNbinsX()+2):
24 nbEvts4000 = nbEvts4000 + q.GetBinContent(ix)
29 for ix
in range(1,hLB.GetNbinsX()+1):
31 for iy
in range(61,hLB.GetNbinsY()+2):
32 if hLB.GetBinContent(ix,iy) != 0:
35 nbLB20GeV = nbLB20GeV+1
36 allLBs = allLBs +
" %d"%ix
38 print (
"# of events: E>20GeV / E>20GeV && q>4000 : %d / %d"%(nbEvts4000,nbEvts20GeV))
39 print (
"Mean energy above 20geV: %.2f GeV"%meanE)
40 print (nbLB20GeV,
" LBs contains energetic events: ", allLBs )
50 gStyle.SetOptStat(100110)
69 print (
"python -i extractSporadic.py 159041 x29_m545 EMBA [FT29Sl2Ch68]")
70 print (
"If no channel is specified, displays all with more than 20 events above 20 GeV")
76 from ROOT
import gROOT, gDirectory
77 from ROOT
import gStyle, TCanvas
78 from ROOT
import TRFIOFile
83 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"
84 nameDir =
"run_"+sys.argv[1]+
"/CaloMonitoring/LArCellMon_NoTrigSel/Sporadic20GeV/"+sys.argv[3]
86 myFile = TRFIOFile(nameFile)
89 hNbEvts = myFile.Get(
"run_"+sys.argv[1]+
"/LAr/FEBMon/perPartitionData/Eventtype")
90 print (
"This stream contains %d events"%hNbEvts.GetEntries())
95 if len(sys.argv) == 4:
99 listOfKeys = gDirectory.GetListOfKeys()
100 for key
in listOfKeys:
102 type = key.GetClassName()
103 if type ==
"TH1F" and name.find(
"EN") != -1 :
104 h.append(myFile.Get(nameDir+
"/"+name))
105 if type ==
"TH1F" and name.find(
"Quality") != -1 :
106 q.append(myFile.Get(nameDir+
"/"+name))
107 if type ==
"TH2F" and name.find(
"ENLB") != -1 :
108 hLB.append(myFile.Get(nameDir+
"/"+name))
111 print (
"retrieved %i histos"%nhists)
113 for i
in range(0, nhists):
114 if h[i].Integral(61,h[i].GetNbinsX()+1) >= 20:
118 if len(sys.argv) == 5:
119 nameHisto = sys.argv[4]
120 listOfKeys = gDirectory.GetListOfKeys()
121 for key
in listOfKeys:
123 type = key.GetClassName()
124 if type ==
"TH1F" and name.find(
"EN") != -1
and name.find(nameHisto) != -1:
125 h = myFile.Get(nameDir+
"/"+name)
126 if type ==
"TH2F" and name.find(
"ENLB") != -1
and name.find(nameHisto) != -1:
127 hLB = myFile.Get(nameDir+
"/"+name)
128 if type ==
"TH1F" and name.find(
"Quality") != -1
and name.find(nameHisto) != -1:
129 q = myFile.Get(nameDir+
"/"+name)
133 c1 = TCanvas(
'c1',
'c1',1000,600)