00009 :
00010
00011 slType = sl
00012 slStr = "SL%d" % slType
00013 verbose = False
00014
00015 ROOT.TH1.AddDirectory(False)
00016
00017 file = ROOT.TFile(fileName,'read')
00018
00019 wheels = (-2,-1,0,1,2)
00020 stations = (1,2,3,4)
00021
00022 histosWheel = {}
00023 for wh in wheels:
00024 histoName = 'Wheel%d_%s_VDrift' % (wh,slStr)
00025 print "Accessing",histoName
00026 histosWheel[wh] = file.Get(histoName)
00027
00028
00029
00030 nBins = 250
00031 if slType == 2: nBins = 180
00032 histo = ROOT.TH1F("h_VDriftAll","VDrift",nBins,0,nBins)
00033 for st in stations:
00034 nSectors = 12
00035 if st == 4: nSectors = 14
00036 if st == 4 and slType == 2: continue
00037 if verbose: print "Station",st
00038 for wh in wheels:
00039 if verbose: print "Wheel",wh
00040 for sec in range(1,nSectors+1):
00041 if verbose: print "Sector",sec
00042 binHisto = binNumber(st,sec)
00043 if verbose: print "Bin from histos:",binHisto
00044 value = histosWheel[wh].GetBinContent(binHisto)
00045
00046 value *= 10000.
00047
00048 binHistoNew = (st - 1)*60 + (wh + 2)*nSectors + sec
00049 if verbose: print "Bin final",binHistoNew
00050 histo.SetBinContent(binHistoNew,value)
00051
00052 if sec == 1:
00053 label = "Wheel %d" % wh
00054 if wh == -2: label += " MB%d" % st
00055 histo.GetXaxis().SetBinLabel(binHistoNew,label)
00056
00057 objects = drawHisto(histo,
00058 title="v_{drift} (#mum/ns)",
00059 ymin=53,ymax=57,option=option,draw=draw)
00060
00061 return objects