2 from drawHistoAllChambers
import drawHisto
5 start = (station - 1)*12
8 def plot(fileName,sl,option="HISTOP",draw=True):
11 slStr =
"SL%d" % slType
14 ROOT.TH1.AddDirectory(
False)
16 file = ROOT.TFile(fileName,
'read')
18 wheels = (-2,-1,0,1,2)
23 histoName =
'Wheel%d_%s_VDrift' % (wh,slStr)
24 print "Accessing",histoName
25 histosWheel[wh] = file.Get(histoName)
30 if slType == 2: nBins = 180
31 histo = ROOT.TH1F(
"h_VDriftAll",
"VDrift",nBins,0,nBins)
34 if st == 4: nSectors = 14
35 if st == 4
and slType == 2:
continue
36 if verbose:
print "Station",st
38 if verbose:
print "Wheel",wh
39 for sec
in range(1,nSectors+1):
40 if verbose:
print "Sector",sec
42 if verbose:
print "Bin from histos:",binHisto
43 value = histosWheel[wh].GetBinContent(binHisto)
47 binHistoNew = (st - 1)*60 + (wh + 2)*nSectors + sec
48 if verbose:
print "Bin final",binHistoNew
49 histo.SetBinContent(binHistoNew,value)
52 label =
"Wheel %d" % wh
53 if wh == -2: label +=
" MB%d" % st
54 histo.GetXaxis().SetBinLabel(binHistoNew,label)
57 title=
"v_{drift} (#mum/ns)",
58 ymin=53,ymax=57,option=option,draw=draw)
64 colors = (2,4,12,44,55)
65 markers = (24,25,26,27)
71 for fileName
in fileNames:
73 if not idx: draw =
True
75 objs =
plot(fileName,sl,option,draw)
79 histos.append(objs[1])
83 histos[-1].SetLineColor(colors[ (idx - 1) % len(colors) ])
84 histos[-1].SetMarkerColor(colors[ (idx - 1) % len(colors) ])
85 histos[-1].SetMarkerStyle(markers[ (idx - 1) % len(markers) ])
87 histos[-1].Draw(option +
"SAME")
91 return (canvas,histos,objects)