detectors = [ "ECAL", "HCAL", "ME11B", "ME11A", "ME12", "ME13", "ME21", "ME22", "ME31", "ME32", "ME41", "ME42" ] pBinSize = 500 maxP = 4000 pBins = [] for P in range(0, maxP + pBinSize, pBinSize): pBins.append(P) fits = [] for detector in detectors: can = p.Canvas(lumi='') for i in range(len(pBins) - 1): if (pBins[i] % 1000 == 0): continue h_name = "%s_energy%i_%i" % (detector, pBins[i], pBins[i + 1]) #detector + '_energy'+ pBins[i]+'_'+pBins[i+1] plot = p.Plot(h_name, f, '', legType='l', option='hist') fit = r.TF1("f%s_%i" % (detector, i), "landau", 0, 0.3 * plot.GetXaxis().GetXmax()) fits.append(fit) plot.legName = '#splitline{#bf{%4i #leq P < %4i}}{Entries: %i, Overflow: %i}' % ( pBins[i], pBins[i + 1], plot.GetEntries(), plot.GetBinContent(plot.GetXaxis().GetNbins() + 1))
import ROOT as r import sys sys.path.append("../") import Plotter as p f = r.TFile('../../dat/SingleMuon/zskim2018D/emulation.root') can = p.Canvas(True, lumi='') match_h = f.Get('emulationMatching') match = p.Plot(match_h, 'Emulation Matching', legType='', option='hist') can.addMainPlot(match, color=r.kBlue) #pt.GetXaxis().SetRangeUser(60.,120.) #can.makeLegend(pos='tl') can.cleanup('matching.pdf', mode='BOB') #
import ROOT as r import Plotter as p writePath = '~/Documents/Presentations/2018/181026-3LayerEff/' f = r.TFile('../data/SingleMuon/zskim2018D-full/CLCTLayerAnalysis-Full.root') can = p.Canvas(lumi='', logy=True) mep11a = 'me_p11a_11' mep11b = 'me_p11b_11' mem11a = 'me_m11a_11' mem11b = 'me_m11b_11' chambers = [mep11a, mep11b, mem11a, mem11b] for chamber in chambers: me11 = p.Plot('h_clctEff_cuts_' + chamber, f, '', legType='l', option='hist') me11.setTitles(X='') # if chamber is mep11a: me11.legName = '#splitline{#bf{ME+11A}}{Entries:%i}'%me11.GetEntries() # if chamber is mep11b: me11.legName = '#splitline{#bf{ME+11B}}{Entries:%i}'%me11.GetEntries() # if chamber is mem11a: me11.legName = '#splitline{#bf{ME-11A}}{Entries:%i}'%me11.GetEntries() # if chamber is mem11b: me11.legName = '#splitline{#bf{ME-11B}}{Entries:%i}'%me11.GetEntries() # if chamber is mep11a: me11.legName = '#bf{ME+11A}' if chamber is mep11b: me11.legName = '#bf{ME+11B}' if chamber is mem11a: me11.legName = '#bf{ME-11A}'
#den_h = f.Get('h_clctEff_den') #hasClct = f.Get('') #pt_h = f.Get('h_eventCuts') mep11a = 'me_p11a_11' mep11b = 'me_p11b_11' mem11a = 'me_m11a_11' mem11b = 'me_m11b_11' chambers = [mep11a, mep11b, mem11a, mem11b] for chamber in chambers: can = p.Canvas(logy=True, lumi='') den = p.Plot('h_clctEff_den_' + chamber, f, legName=chamber + ' Segments', legType='', option='hist') hasClct = p.Plot('h_clctEff_hasClct_' + chamber, f, legName='w/ CLCT ', legType='l', option='pe') has3LayClct = p.Plot('h_clctEff_has3layClct_' + chamber, f, legName='w/ 3Lay CLCT', legType='l',
import ROOT as r import Plotter as p import StatsTools as s #writePath ='~/Documents/Presentations/2018/181026-3LayerEff/' writePath = '~/Documents/Presentations/2018/181026-3LayerEff/pt10/' #f = r.TFile('../data/SingleMuon/zskim2018D-full/CLCTLayerAnalysis-Full.root') f = r.TFile('../data/SingleMuon/zskim2018D/CLCTLayerAnalysis-Pt10.root') can = p.Canvas(True, lumi='', ratioFactor=1. / 3) # pt_a_h = f.Get("h_mep11a_11_Pt") # pt_a_3_h = f.Get("h_mep11a_3Lay_11_Pt") # pt_b_h = f.Get("h_mep11b_11_Pt") # pt_b_3_h = f.Get("h_mep11b_3Lay_11_Pt") # pt_a_h.GetXaxis().SetTitle("Pt [GeV]") pt_a_h = f.Get("h_matchedPt_me_p11a_11") pt_a_3_h = f.Get("h_matchedPt_3Lay_me_p11a_11") pt_b_h = f.Get("h_matchedPt_me_p11b_11") pt_b_3_h = f.Get("h_matchedPt_3Lay_me_p11b_11") pt_a_h.GetXaxis().SetTitle("Pt [GeV]") rat_a_h = s.binomial_divide(pt_a_3_h, pt_a_h)[0] rat_b_h = s.binomial_divide(pt_b_3_h, pt_b_h)[0] pt_a = p.Plot(pt_a_h, legName='ME+1/1/11A', legType='l') pt_a_3 = p.Plot(pt_a_3_h, legName='ME+1/1/11A 3Lay', legType='l') pt_b = p.Plot(pt_b_h, legName='ME+1/1/11B', legType='l') pt_b_3 = p.Plot(pt_b_3_h, legName='ME+1/1/11B 3Lay', legType='l') rat_a = p.Plot(rat_a_h, legName='ME+11A', legType='l', option='pe')