Esempio n. 1
0
	def plotTruthL1Together(self):
		c = TCanvas('cTimeWindowTruthL1',"Time Window Truth L1")
		effL1Muon3x3 = self.fileHandler.getHistogram('efficiency/L1MuonTruth3x3_Efficiency')
		effL1Muon3x3TW = self.fileHandler.getHistogram('efficiency/L1MuonTruthTimeWindow3x3_Efficiency')

		effL1Muon3x3.SetMarkerStyle(22)
		effL1Muon3x3.SetMarkerColor(colorRwthDarkBlue)
		effL1Muon3x3.SetLineColor(colorRwthDarkBlue)
		effL1Muon3x3.SetTitle('Efficiency Truth in 3x3 grid;p_{T} / GeV;rel. fraction')
		effL1Muon3x3.Draw()
		c.Update()
		effL1Muon3x3.GetPaintedGraph().GetXaxis().SetRangeUser(0,40)
		#effL1Muon3x3.GetPaintedGraph().GetYaxis().SetRangeUser(0.996,1.001)
		effL1Muon3x3TW.SetMarkerStyle(23)
		effL1Muon3x3TW.SetMarkerColor(colorRwthMagenta)
		effL1Muon3x3TW.SetLineColor(colorRwthMagenta)
		effL1Muon3x3TW.Draw('same')
		
		setupAxes(effL1Muon3x3)
		
		legend = TLegend(0.55,0.1,0.9,0.3)
		legend.AddEntry(effL1Muon3x3,'Matches to L1 Truth in 3x3 grid','ep')
		legend.AddEntry(effL1Muon3x3TW,'Matches to L1 Truth in 3x3 grid and time window','ep')
		legend.Draw()
		
		label = None
		if self.data:
			label = drawLabelCmsPrivateData()
		else:
			label = drawLabelCmsPrivateSimulation()
					
		c.Update()
		return c, label, effL1Muon3x3, effL1Muon3x3TW, legend
Esempio n. 2
0
	def plotTruthL1Together(self):
		c = TCanvas('cTimeWindowTruthL1',"Time Window Truth L1")
		effL1Muon3x3 = self.fileHandler.getHistogram('hoMuonAnalyzer/efficiency/L1MuonTruth3x3_Efficiency')
		effL1Muon3x3TW = self.fileHandler.getHistogram('hoMuonAnalyzer/efficiency/L1MuonTruthTimeWindow3x3_Efficiency')

		effL1Muon3x3.SetMarkerStyle(22)
		effL1Muon3x3.SetMarkerColor(colorRwthDarkBlue)
		effL1Muon3x3.SetLineColor(colorRwthDarkBlue)
		effL1Muon3x3.SetTitle('Efficiency Truth in 3x3 grid;p_{T} / GeV;rel. fraction')
		effL1Muon3x3.Draw()
		c.Update()
		effL1Muon3x3.GetPaintedGraph().GetXaxis().SetRangeUser(0,40)
		#effL1Muon3x3.GetPaintedGraph().GetYaxis().SetRangeUser(0.996,1.001)
		effL1Muon3x3TW.SetMarkerStyle(23)
		effL1Muon3x3TW.SetMarkerColor(colorRwthMagenta)
		effL1Muon3x3TW.SetLineColor(colorRwthMagenta)
		effL1Muon3x3TW.Draw('same')
		
		setupAxes(effL1Muon3x3)
		
		legend = TLegend(0.55,0.1,0.9,0.3)
		legend.AddEntry(effL1Muon3x3,'Matches to L1 Truth in 3x3 grid','ep')
		legend.AddEntry(effL1Muon3x3TW,'Matches to L1 Truth in 3x3 grid and time window','ep')
		legend.Draw()
		
		label = None
		if self.data:
			label = drawLabelCmsPrivateData()
		else:
			label = drawLabelCmsPrivateSimulation()
					
		c.Update()
		return c, label, effL1Muon3x3, effL1Muon3x3TW, legend
Esempio n. 3
0
	def drawLabel(self):
		label = None
		if self.data:
			label = drawLabelCmsPrivateData()
		else:
			label = drawLabelCmsPrivateSimulation()
		return label
Esempio n. 4
0
	def plot3x3MatchQualityCodes(self):
		c = TCanvas('cMatchQC3x3','Match QC 3x3',0,0,900,700)
		c.SetLogz()
		hist = self.fileHandler.getHistogram('hoMuonAnalyzer/qualityCode/L1Muon3x3Match_QcVsPt')
		hist.SetStats(0)
		hist.Scale(1,'width')
		hist.Draw('colz')
		c.Update()
		setupPalette(hist)
		c.Update()
				
		label = None
		if self.data:
			label = drawLabelCmsPrivateData()
		else:
			label = drawLabelCmsPrivateSimulation()
		
		c.Update()
		
		box = TBox(0,6.5,180,7.5)
		box.SetLineColor(3)
		box.SetLineWidth(2)
		box.Draw()
		
		c.Update()
		
		return hist,c,label,box
Esempio n. 5
0
 def drawLabel(self, x1ndc=0.6, y1ndc=0.90, x2ndc=0.9, y2ndc=0.93):
     label = None
     if self.data:
         label = drawLabelCmsPrivateData(x1ndc, y1ndc, x2ndc, y2ndc)
     else:
         label = drawLabelCmsPrivateSimulation(x1ndc, y1ndc, x2ndc, y2ndc)
     return label
Esempio n. 6
0
	def plotBxidVsPtMatch(self):
		c = TCanvas('cBxidVsPtMatch','BxidVsPtMatch',800,1200)
		c.Divide(1,2)
		c.cd(1).SetLogz()
		hist = self.fileHandler.getHistogram('hoMuonAnalyzer/time/L1Muon3x3Match_BxIdVsPt')
		hist.SetStats(0)
		setupAxes(hist)
		hist.SetTitle('Successful matching in 3x3;p_{T} / GeV;BX ID;# entries')
		hist.GetYaxis().SetRangeUser(-3,3)
		
		histCopy = hist.DrawCopy('colz')
		c.Update()
		setupPalette(histCopy)
		c.Update()
		
		label = None
		if self.data:
			label = drawLabelCmsPrivateData()
		else:
			label = drawLabelCmsPrivateSimulation()
			
		c.cd(2).SetLogz()
		hist.Scale(1,'width')
		hist.SetTitle(hist.GetTitle() + ', by bin width')
		hist.GetZaxis().SetTitle('# entries / GeV')
		hist.Draw('colz')
		c.Update()
		setupPalette(hist)
		c.Update()
		
		labelBottom = None
		if self.data:
			labelBottom = drawLabelCmsPrivateData()
		else:
			labelBottom = drawLabelCmsPrivateSimulation()
		
		c.Update()
		c.SaveAs('plots/efficiencyWithTime/bxIdVsPt3x3Match.gif')
		
		return c, hist,label,labelBottom
Esempio n. 7
0
	def plotBxidVsPtMatch(self):
		c = TCanvas('cBxidVsPtMatch','BxidVsPtMatch',800,1200)
		c.Divide(1,2)
		c.cd(1).SetLogz()
		hist = self.fileHandler.getHistogram('time/L1Muon3x3Match_BxIdVsPt')
		hist.SetStats(0)
		setupAxes(hist)
		hist.SetTitle('Successful matching in 3x3;p_{T} / GeV;BX ID;# entries')
		hist.GetYaxis().SetRangeUser(-3,3)
		
		histCopy = hist.DrawCopy('colz')
		c.Update()
		setupPalette(histCopy)
		c.Update()
		
		label = None
		if self.data:
			label = drawLabelCmsPrivateData()
		else:
			label = drawLabelCmsPrivateSimulation()
			
		c.cd(2).SetLogz()
		hist.Scale(1,'width')
		hist.SetTitle(hist.GetTitle() + ', by bin width')
		hist.GetZaxis().SetTitle('# entries / GeV')
		hist.Draw('colz')
		c.Update()
		setupPalette(hist)
		c.Update()
		
		labelBottom = None
		if self.data:
			labelBottom = drawLabelCmsPrivateData()
		else:
			labelBottom = drawLabelCmsPrivateSimulation()
		
		c.Update()
		c.SaveAs('plots/efficiencyWithTime/bxIdVsPt3x3Match.gif')
		
		return c, hist,label,labelBottom
Esempio n. 8
0
	def plot3x3FailQualityCodes(self):
		c = TCanvas('cFailQC3x3','Fail QC 3x3',910,0,900,700)
		c.SetLogz()
		hist = self.fileHandler.getHistogram('hoMuonAnalyzer/qualityCode/L1Muon3x3Fail_QcVsPt')
		hist.SetStats(0)
		hist.Scale(1,'width')
		hist.Draw('colz')
		c.Update()
		setupPalette(hist)
		c.Update()

		label = None
		if self.data:
			label = drawLabelCmsPrivateData()
		else:
			label = drawLabelCmsPrivateSimulation()		

		c.Update()

		return hist,c,label
		
Esempio n. 9
0
	def plotTimeWindowAlone(self):
		c = TCanvas('cTimeWindowAlone',"Time Window Alone")
		effL1Muon3x3Truth = self.fileHandler.getHistogram('efficiency/L1MuonTruthTimeWindow3x3_Efficiency')
		effL1Muon3x3 = self.fileHandler.getHistogram('efficiency/L1MuonTimeWindow3x3_Efficiency')
		
		effL1Muon3x3.SetMarkerStyle(22)
		effL1Muon3x3.SetMarkerColor(colorRwthDarkBlue)
		effL1Muon3x3.SetLineColor(colorRwthDarkBlue)
		effL1Muon3x3.SetTitle('Efficiency in 3x3 grid with time window;p_{T} / GeV;rel. fraction')
		effL1Muon3x3.Draw()
		c.Update()
		effL1Muon3x3.GetPaintedGraph().GetXaxis().SetRangeUser(0,40)
		#effL1Muon3x3.GetPaintedGraph().GetYaxis().SetRangeUser(0.996,1.001)
		effL1Muon3x3Truth.SetMarkerStyle(23)
		effL1Muon3x3Truth.SetMarkerColor(colorRwthMagenta)
		effL1Muon3x3Truth.SetLineColor(colorRwthMagenta)
		effL1Muon3x3Truth.Draw('same')
		
		setupAxes(effL1Muon3x3)
		
		legend = TLegend(0.55,0.1,0.9,0.3)
		legend.AddEntry(effL1Muon3x3,'Matches in 3x3 grid','ep')
		legend.AddEntry(effL1Muon3x3Truth,'Matches  to truth in 3x3 grid','ep')
		legend.Draw()
		
		label = None
		if self.data:
			label = drawLabelCmsPrivateData()
		else:
			label = drawLabelCmsPrivateSimulation()
		
		c.Update()

		c.SaveAs('plots/efficiencyWithTime/allL1AndL1Truth3x3.gif')

		return c, effL1Muon3x3,effL1Muon3x3Truth,label,legend
Esempio n. 10
0
	def drawLabel(self,labelPosition = {'x1ndc' : 0.6, 'y1ndc' : 0.95, 'x2ndc' : 0.9, 'y2ndc' : 0.98}):
		if self.data:
			label = drawLabelCmsPrivateData(labelPosition['x1ndc'],labelPosition['y1ndc'],labelPosition['x2ndc'],labelPosition['y2ndc'])
		else:
			label = drawLabelCmsPrivateSimulation(labelPosition['x1ndc'],labelPosition['y1ndc'],labelPosition['x2ndc'],labelPosition['y2ndc'])
		return label
Esempio n. 11
0
	def buildTripleCanvasWithResiduals(self,hSimHo, hSimPuHo, hDataHo,canvasName = 'cTripleCanvas',legendPostix = 'HO Only',ylabel = '# entries'):
		canvas = TCanvas(canvasName,canvasName,1800,1000)
		canvas.Divide(3,1)
		##
		#	Sim No PU and Data
		##
		hSimHo.SetLineColor(colorRwthDarkBlue)
		hSimHo.SetStats(0)
		hSimHo.SetTitle('No PU and Data compared;E_{HO} / a.u.;' + ylabel)
		
		hDataHo.SetLineColor(colorRwthMagenta)
		hSimPuHo.SetLineColor(colorRwthTuerkis)
		
		pad1 = makeResidualsPad(canvas.cd(1))
		pad1.cd(1).SetLogy()
		pad1.cd(2).SetLogy()
		pad1.cd(1)
		hSimHo.Draw()
		hDataHo.DrawCopy('same')
		
		label = drawLabelCmsPrivateData()

		legend = getLegend(x1=.5,y1 = 0.75,y2=.9)
		legend.AddEntry(hSimHo,'Sim No PU, ' + legendPostix,'l')
		legend.AddEntry(hDataHo,'Data, ' + legendPostix,'l')
		legend.Draw()
		
		setupAxes(hSimHo)

		##
		#	Sim PU52 and Data
		##		
		pad2 = makeResidualsPad(canvas.cd(2))
		pad2.cd(1).SetLogy()
		pad2.cd(2).SetLogy()
		pad2.cd(1)
		setupAxes(hSimPuHo)
		hSimPuHo.SetStats(0)
		hSimPuHo.SetTitle('PU52 and Data compared;E_{HO} / a.u.;' + ylabel)
		hSimPuHo.DrawCopy('')
		hDataHo.DrawCopy('same')
		
		label2 = drawLabelCmsPrivateData()

		legend2 = getLegend(x1=.5,y1 = 0.75,y2=.9)
		legend2.AddEntry(hSimPuHo,'Sim PU52, ' + legendPostix,'l')
		legend2.AddEntry(hDataHo,'Data, ' + legendPostix,'l')
		legend2.Draw()
		
		##
		#	Sim No PU and Sim PU 52
		##
		pad3 = makeResidualsPad(canvas.cd(3))
		pad3.cd(1).SetLogy()
		pad3.cd(2).SetLogy()
		pad3.cd(1)
		hSimPuHo.SetStats(0)
		setupAxes(hSimPuHo)
		hSimPuHo.SetTitle('PU52 and No PU Simulation compared;E_{HO} / a.u.;' + ylabel)
		hSimPuHo.Draw('')
		hSimHo.DrawCopy('same')
		
		label3 = drawLabelCmsPrivateData()

		legend3 = getLegend(x1=.5,y1 = 0.75,y2=.9)
		legend3.AddEntry(hSimPuHo,'Sim PU52, ' + legendPostix,'l')
		legend3.AddEntry(hSimHo,'Sim No PU, ' + legendPostix,'l')
		legend3.Draw()
				
		#Do the ratio
		pad1.cd(2)
		cloneData = hSimHo.Clone('cloneData')
		cloneData.SetTitle(';E_{HO} / a.u.;Sim/Data')
		cloneData.Sumw2()
		setupAxes(cloneData)
		cloneData.GetYaxis().SetTitleSize(0.05)
		cloneData.GetYaxis().SetLabelSize(0.05)
		cloneData.GetXaxis().SetTitleSize(0.05)
		cloneData.GetXaxis().SetLabelSize(0.05)
		cloneData.GetYaxis().CenterTitle()
		cloneData.Divide(hDataHo)
		cloneData.SetLineWidth(1)
		cloneData.SetMarkerStyle(6)
		cloneData.SetMarkerColor(colorRwthMagenta)
		cloneData.SetLineColor(colorRwthMagenta)
		cloneData.Draw('ep')
		
		pad2.cd(2)
		clonePuAndData = hSimPuHo.Clone('clonePuAndData')
		setupAxes(clonePuAndData)
		clonePuAndData.GetYaxis().SetTitleSize(0.05)
		clonePuAndData.GetYaxis().SetLabelSize(0.05)
		clonePuAndData.GetXaxis().SetTitleSize(0.05)
		clonePuAndData.GetXaxis().SetLabelSize(0.05)
		clonePuAndData.GetYaxis().CenterTitle()
		clonePuAndData.SetTitle(';E_{HO} / a.u.;Sim/Data')
		clonePuAndData.Sumw2()
		clonePuAndData.Divide(hDataHo)
		clonePuAndData.SetLineWidth(1)
		clonePuAndData.SetMarkerStyle(6)
		clonePuAndData.SetMarkerColor(colorRwthTuerkis)
		clonePuAndData.SetLineColor(colorRwthTuerkis)
		clonePuAndData.Draw('ep')
		
		pad3.cd(2)
		clonePuAndNoPu = hSimHo.Clone('clonePuAndNoPu')
		setupAxes(clonePuAndNoPu)
		clonePuAndNoPu.GetYaxis().SetTitleSize(0.05)
		clonePuAndNoPu.GetYaxis().SetLabelSize(0.05)
		clonePuAndNoPu.GetXaxis().SetTitleSize(0.05)
		clonePuAndNoPu.GetXaxis().SetLabelSize(0.05)
		clonePuAndNoPu.GetYaxis().CenterTitle()
		clonePuAndNoPu.SetTitle(';E_{HO} / a.u.;Sim No PU/Sim PU52')
		clonePuAndNoPu.Sumw2()
		clonePuAndNoPu.Divide(hSimPuHo)
		clonePuAndNoPu.SetLineWidth(1)
		clonePuAndNoPu.SetMarkerStyle(6)
		clonePuAndNoPu.SetMarkerColor(colorRwthDarkBlue)
		clonePuAndNoPu.SetLineColor(colorRwthDarkBlue)
		clonePuAndNoPu.Draw('ep')
		return canvas, hSimHo,hDataHo,hSimPuHo,cloneData,clonePuAndData,clonePuAndNoPu, legend,legend2,legend3, label2, label3 ,label
Esempio n. 12
0
	def compareEnergyPerWheel(self):	

		namesHo = [
				'energy/perWheel/horeco_Energy_M1',
				'energy/perWheel/horeco_Energy_M0',
				'energy/perWheel/horeco_Energy_P0',
				'energy/perWheel/horeco_Energy_P1'
				]
		
		namesMatched = [
				'energy/perWheel/L1MuonWithHoMatchAboveThr_Energy_M1',
				'energy/perWheel/L1MuonWithHoMatchAboveThr_Energy_M0',
				'energy/perWheel/L1MuonWithHoMatchAboveThr_Energy_P0',
				'energy/perWheel/L1MuonWithHoMatchAboveThr_Energy_P1'
				]
				
		canvas = TCanvas('compareCanvas','comparison',1800,500)
		canvas.Divide(4,1)
		
		objectStorage = []
		
		for i in range (0,4):
			canvas.cd(i+1).SetLogy()
			
			hSimHo = self.fileHandlerSimulation.getHistogram(namesHo[i])
			hSimHo.SetLineColor(colorRwthDarkBlue)
			
			hSimMatch = self.fileHandlerSimulation.getHistogram(namesMatched[i])
			hSimMatch.SetLineColor(colorRwthDarkBlue)
			hSimMatch.SetLineStyle(7)
		
			hDataHo = self.fileHandler.getHistogram(namesHo[i])
			hDataHo.SetLineColor(colorRwthMagenta)
			
			hDataMatch = self.fileHandler.getHistogram(namesMatched[i])
			hDataMatch.SetLineColor(colorRwthMagenta)
			hDataMatch.SetLineStyle(7)
			
			hSimPuHo = self.fileHandlerSimulationPu.getHistogram(namesHo[i])
			hSimPuHo.SetLineColor(colorRwthTuerkis)
			
			hSimPuMatch = self.fileHandlerSimulationPu.getHistogram(namesMatched[i])
			hSimPuMatch.SetLineColor(colorRwthTuerkis)
			hSimPuMatch.SetLineStyle(7)
			
			hSimHo.Draw()
			hSimMatch.Draw('same')
			hDataHo.Draw('same')
			hDataMatch.Draw('same')
			hSimPuHo.Draw('same')
			hSimPuMatch.Draw('same')
			
			legend = getLegend(y1 =.6,y2=.9)
			legend.AddEntry(hSimHo,'Sim, HO Only','l').SetTextFont(62)
			legend.AddEntry(hSimMatch,'Sim, HO matched','l').SetTextFont(62)
			legend.AddEntry(hDataHo,'Data, HO Only','l').SetTextFont(62)
			legend.AddEntry(hDataMatch,'Data HO Matched','l').SetTextFont(62)
			legend.AddEntry(hSimPuHo,'Sim PU52, HO Only','l').SetTextFont(62)
			legend.AddEntry(hSimPuMatch,'Sim PU52 HO Matched','l').SetTextFont(62)
			legend.Draw()
			
			label = drawLabelCmsPrivateData()
			
			objectStorage.append([hSimHo,hSimMatch,hDataHo,hDataMatch,hSimPuHo,hSimPuMatch,legend,label])
		
		canvas.Update()
		self.storeCanvas(canvas,'energyComparison/energyPerWheelDataAndSimNormed')
		return canvas,objectStorage
Esempio n. 13
0
    def compareEnergyPerWheel(self):

        namesHo = [
            'energy/perWheel/horeco_Energy_M1',
            'energy/perWheel/horeco_Energy_M0',
            'energy/perWheel/horeco_Energy_P0',
            'energy/perWheel/horeco_Energy_P1'
        ]

        namesMatched = [
            'energy/perWheel/L1MuonWithHoMatchAboveThr_Energy_M1',
            'energy/perWheel/L1MuonWithHoMatchAboveThr_Energy_M0',
            'energy/perWheel/L1MuonWithHoMatchAboveThr_Energy_P0',
            'energy/perWheel/L1MuonWithHoMatchAboveThr_Energy_P1'
        ]

        canvas = TCanvas('compareCanvas', 'comparison', 1800, 500)
        canvas.Divide(4, 1)

        objectStorage = []

        for i in range(0, 4):
            canvas.cd(i + 1).SetLogy()

            hSimHo = self.fileHandlerSimulation.getHistogram(namesHo[i])
            hSimHo.SetLineColor(colorRwthDarkBlue)

            hSimMatch = self.fileHandlerSimulation.getHistogram(
                namesMatched[i])
            hSimMatch.SetLineColor(colorRwthDarkBlue)
            hSimMatch.SetLineStyle(7)

            hDataHo = self.fileHandler.getHistogram(namesHo[i])
            hDataHo.SetLineColor(colorRwthMagenta)

            hDataMatch = self.fileHandler.getHistogram(namesMatched[i])
            hDataMatch.SetLineColor(colorRwthMagenta)
            hDataMatch.SetLineStyle(7)

            hSimPuHo = self.fileHandlerSimulationPu.getHistogram(namesHo[i])
            hSimPuHo.SetLineColor(colorRwthTuerkis)

            hSimPuMatch = self.fileHandlerSimulationPu.getHistogram(
                namesMatched[i])
            hSimPuMatch.SetLineColor(colorRwthTuerkis)
            hSimPuMatch.SetLineStyle(7)

            hSimHo.Draw()
            hSimMatch.Draw('same')
            hDataHo.Draw('same')
            hDataMatch.Draw('same')
            hSimPuHo.Draw('same')
            hSimPuMatch.Draw('same')

            legend = getLegend(y1=.6, y2=.9)
            legend.AddEntry(hSimHo, 'Sim, HO Only', 'l').SetTextFont(62)
            legend.AddEntry(hSimMatch, 'Sim, HO matched', 'l').SetTextFont(62)
            legend.AddEntry(hDataHo, 'Data, HO Only', 'l').SetTextFont(62)
            legend.AddEntry(hDataMatch, 'Data HO Matched', 'l').SetTextFont(62)
            legend.AddEntry(hSimPuHo, 'Sim PU52, HO Only', 'l').SetTextFont(62)
            legend.AddEntry(hSimPuMatch, 'Sim PU52 HO Matched',
                            'l').SetTextFont(62)
            legend.Draw()

            label = drawLabelCmsPrivateData()

            objectStorage.append([
                hSimHo, hSimMatch, hDataHo, hDataMatch, hSimPuHo, hSimPuMatch,
                legend, label
            ])

        canvas.Update()
        self.storeCanvas(canvas,
                         'energyComparison/energyPerWheelDataAndSimNormed')
        return canvas, objectStorage
Esempio n. 14
0
    def buildTripleCanvasWithResiduals(self,
                                       hSimHo,
                                       hSimPuHo,
                                       hDataHo,
                                       canvasName='cTripleCanvas',
                                       legendPostix='HO Only',
                                       ylabel='# entries'):
        canvas = TCanvas(canvasName, canvasName, 1800, 1000)
        canvas.Divide(3, 1)
        ##
        #	Sim No PU and Data
        ##
        hSimHo.SetLineColor(colorRwthDarkBlue)
        hSimHo.SetStats(0)
        hSimHo.SetTitle('No PU and Data compared;E_{HO} / a.u.;' + ylabel)

        hDataHo.SetLineColor(colorRwthMagenta)
        hSimPuHo.SetLineColor(colorRwthTuerkis)

        pad1 = makeResidualsPad(canvas.cd(1))
        pad1.cd(1).SetLogy()
        pad1.cd(2).SetLogy()
        pad1.cd(1)
        hSimHo.Draw()
        hDataHo.DrawCopy('same')

        label = drawLabelCmsPrivateData()

        legend = getLegend(x1=.5, y1=0.75, y2=.9)
        legend.AddEntry(hSimHo, 'Sim No PU, ' + legendPostix, 'l')
        legend.AddEntry(hDataHo, 'Data, ' + legendPostix, 'l')
        legend.Draw()

        setupAxes(hSimHo)

        ##
        #	Sim PU52 and Data
        ##
        pad2 = makeResidualsPad(canvas.cd(2))
        pad2.cd(1).SetLogy()
        pad2.cd(2).SetLogy()
        pad2.cd(1)
        setupAxes(hSimPuHo)
        hSimPuHo.SetStats(0)
        hSimPuHo.SetTitle('PU52 and Data compared;E_{HO} / a.u.;' + ylabel)
        hSimPuHo.DrawCopy('')
        hDataHo.DrawCopy('same')

        label2 = drawLabelCmsPrivateData()

        legend2 = getLegend(x1=.5, y1=0.75, y2=.9)
        legend2.AddEntry(hSimPuHo, 'Sim PU52, ' + legendPostix, 'l')
        legend2.AddEntry(hDataHo, 'Data, ' + legendPostix, 'l')
        legend2.Draw()

        ##
        #	Sim No PU and Sim PU 52
        ##
        pad3 = makeResidualsPad(canvas.cd(3))
        pad3.cd(1).SetLogy()
        pad3.cd(2).SetLogy()
        pad3.cd(1)
        hSimPuHo.SetStats(0)
        setupAxes(hSimPuHo)
        hSimPuHo.SetTitle('PU52 and No PU Simulation compared;E_{HO} / a.u.;' +
                          ylabel)
        hSimPuHo.Draw('')
        hSimHo.DrawCopy('same')

        label3 = drawLabelCmsPrivateData()

        legend3 = getLegend(x1=.5, y1=0.75, y2=.9)
        legend3.AddEntry(hSimPuHo, 'Sim PU52, ' + legendPostix, 'l')
        legend3.AddEntry(hSimHo, 'Sim No PU, ' + legendPostix, 'l')
        legend3.Draw()

        #Do the ratio
        pad1.cd(2)
        cloneData = hSimHo.Clone('cloneData')
        cloneData.SetTitle(';E_{HO} / a.u.;Sim/Data')
        cloneData.Sumw2()
        setupAxes(cloneData)
        cloneData.GetYaxis().SetTitleSize(0.05)
        cloneData.GetYaxis().SetLabelSize(0.05)
        cloneData.GetXaxis().SetTitleSize(0.05)
        cloneData.GetXaxis().SetLabelSize(0.05)
        cloneData.GetYaxis().CenterTitle()
        cloneData.Divide(hDataHo)
        cloneData.SetLineWidth(1)
        cloneData.SetMarkerStyle(6)
        cloneData.SetMarkerColor(colorRwthMagenta)
        cloneData.SetLineColor(colorRwthMagenta)
        cloneData.Draw('ep')

        pad2.cd(2)
        clonePuAndData = hSimPuHo.Clone('clonePuAndData')
        setupAxes(clonePuAndData)
        clonePuAndData.GetYaxis().SetTitleSize(0.05)
        clonePuAndData.GetYaxis().SetLabelSize(0.05)
        clonePuAndData.GetXaxis().SetTitleSize(0.05)
        clonePuAndData.GetXaxis().SetLabelSize(0.05)
        clonePuAndData.GetYaxis().CenterTitle()
        clonePuAndData.SetTitle(';E_{HO} / a.u.;Sim/Data')
        clonePuAndData.Sumw2()
        clonePuAndData.Divide(hDataHo)
        clonePuAndData.SetLineWidth(1)
        clonePuAndData.SetMarkerStyle(6)
        clonePuAndData.SetMarkerColor(colorRwthTuerkis)
        clonePuAndData.SetLineColor(colorRwthTuerkis)
        clonePuAndData.Draw('ep')

        pad3.cd(2)
        clonePuAndNoPu = hSimHo.Clone('clonePuAndNoPu')
        setupAxes(clonePuAndNoPu)
        clonePuAndNoPu.GetYaxis().SetTitleSize(0.05)
        clonePuAndNoPu.GetYaxis().SetLabelSize(0.05)
        clonePuAndNoPu.GetXaxis().SetTitleSize(0.05)
        clonePuAndNoPu.GetXaxis().SetLabelSize(0.05)
        clonePuAndNoPu.GetYaxis().CenterTitle()
        clonePuAndNoPu.SetTitle(';E_{HO} / a.u.;Sim No PU/Sim PU52')
        clonePuAndNoPu.Sumw2()
        clonePuAndNoPu.Divide(hSimPuHo)
        clonePuAndNoPu.SetLineWidth(1)
        clonePuAndNoPu.SetMarkerStyle(6)
        clonePuAndNoPu.SetMarkerColor(colorRwthDarkBlue)
        clonePuAndNoPu.SetLineColor(colorRwthDarkBlue)
        clonePuAndNoPu.Draw('ep')
        return canvas, hSimHo, hDataHo, hSimPuHo, cloneData, clonePuAndData, clonePuAndNoPu, legend, legend2, legend3, label2, label3, label