1 from __future__
import print_function
3 from drawHistoAllChambers
import drawHisto
6 start = (station - 1)*12
9 def plot(fileName,sl,option="HISTOP",draw=True):
12 slStr =
"SL%d" % slType
15 ROOT.TH1.AddDirectory(
False)
17 file = ROOT.TFile(fileName,
'read')
19 wheels = (-2,-1,0,1,2)
24 histoName =
'Wheel%d_%s_VDrift' % (wh,slStr)
25 print(
"Accessing",histoName)
26 histosWheel[wh] = file.Get(histoName)
31 if slType == 2: nBins = 180
32 histo = ROOT.TH1F(
"h_VDriftAll",
"VDrift",nBins,0,nBins)
35 if st == 4: nSectors = 14
36 if st == 4
and slType == 2:
continue 37 if verbose:
print(
"Station",st)
39 if verbose:
print(
"Wheel",wh)
40 for sec
in range(1,nSectors+1):
41 if verbose:
print(
"Sector",sec)
43 if verbose:
print(
"Bin from histos:",binHisto)
44 value = histosWheel[wh].GetBinContent(binHisto)
48 binHistoNew = (st - 1)*60 + (wh + 2)*nSectors + sec
49 if verbose:
print(
"Bin final",binHistoNew)
50 histo.SetBinContent(binHistoNew,value)
53 label =
"Wheel %d" % wh
54 if wh == -2: label +=
" MB%d" % st
55 histo.GetXaxis().SetBinLabel(binHistoNew,label)
58 title=
"v_{drift} (#mum/ns)",
59 ymin=53,ymax=57,option=option,draw=draw)
65 colors = (2,4,12,44,55)
66 markers = (24,25,26,27)
72 for fileName
in fileNames:
74 if not idx: draw =
True 76 objs =
plot(fileName,sl,option,draw)
80 histos.append(objs[1])
84 histos[-1].SetLineColor(colors[ (idx - 1) % len(colors) ])
85 histos[-1].SetMarkerColor(colors[ (idx - 1) % len(colors) ])
86 histos[-1].SetMarkerStyle(markers[ (idx - 1) % len(markers) ])
88 histos[-1].Draw(option +
"SAME")
92 return (canvas,histos,objects)
def plot(fileName, sl, option="HISTOP", draw=True)
def binNumber(station, sector)
S & print(S &os, JobReport::InputFile const &f)
def compare(fileNames, sl)
def drawHisto(histo, title, ymin, ymax, option="HISTOP", draw=True)