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)
def plot(fileName, sl, option="HISTOP", draw=True)
def binNumber(station, sector)
def drawHisto(histo, title, ymin, ymax, option="HISTOP", draw=True)