Exemplo n.º 1
0
	def plotAverageEMaxAroundL1(self):
		canvas = TCanvas('canvasAverageEMax','Average EMax',1200,1200)
		canvas.cd().SetLogz()
		
		hSum = self.fileHandler.getHistogram('hoMuonAnalyzer/deltaEtaDeltaPhiEnergy/averageEMaxAroundPoint' + self.key + '_2dSummedWeights')
		hCounter = self.fileHandler.getHistogram('hoMuonAnalyzer/deltaEtaDeltaPhiEnergy/averageEMaxAroundPoint' + self.key + '_2dCounter')
		
		hSum = setupEAvplot(hSum, hCounter,same=True,limitForAll=0.3)
		hSum.SetTitle('Mean E_{Max} in HO tiles around L1 direction')
		hSum.SetMaximum(2)
		hSum.Draw('colz')
		setupEAvplot(hCounter,same=True,limitForAll=0.3).Draw('same,text')
	
		label = getLabelCmsPrivateSimulation()
		label.Draw()
		
		canvas.Update()		
				
		setupPalette(hSum)
		
		canvas.Update()
		self.storeCanvas(canvas, 'averageEmax')
		hCounter.SaveAs('histogramEMaxCounter.root')
		
		return canvas,hSum,label,hCounter
Exemplo n.º 2
0
	def plotAverageEMaxAroundL1(self):
		canvas = TCanvas('canvasAverageEMax','Average EMax',1200,1200)
		canvas.cd().SetLogz()
		
		hSum = self.fileHandler.getHistogram('deltaEtaDeltaPhiEnergy/averageEMaxAroundPoint' + self.key + '_2dSummedWeights')
		hCounter = self.fileHandler.getHistogram('deltaEtaDeltaPhiEnergy/averageEMaxAroundPoint' + self.key + '_2dCounter')
		
		hSum = setupEAvplot(hSum, hCounter,same=True,limitForAll=0.3)
		hSum.SetTitle('Mean E_{Max} in HO tiles around L1 direction')
		hSum.SetMaximum(2)
		hSum.Draw('colz')
		setupEAvplot(hCounter,same=True,limitForAll=0.3).Draw('same,text')
	
		label = getLabelCmsPrivateSimulation()
		label.Draw()
		
		canvas.Update()		
				
		setupPalette(hSum)
		
		canvas.Update()
		self.storeCanvas(canvas, 'averageEmax')
		hCounter.SaveAs('histogramEMaxCounter.root')
		
		return canvas,hSum,label,hCounter
Exemplo n.º 3
0
	def plotEAveragePerWheel(self):
		canvas = TCanvas('cEAvPerWheel',"E Average per Wheel",1800,800)
		canvas.Divide(3,1)
	
		hM1Energy = self.fileHandler.getHistogram('averageEnergy/wh1m/averageEnergyAroundPoint' + self.key + '_wh-1SummedEnergy')
		hM1Counter = self.fileHandler.getHistogram('averageEnergy/wh1m/averageEnergyAroundPoint' + self.key + '_wh-1Counter')
		hM1Energy = setupEAvplot(hM1Energy, hM1Counter)
		hM1Energy.SetStats(0)
	
		h0Energy = self.fileHandler.getHistogram('averageEnergy/wh0/averageEnergyAroundPoint' + self.key + '_wh0SummedEnergy')
		h0Counter = self.fileHandler.getHistogram('averageEnergy/wh0/averageEnergyAroundPoint' + self.key + '_wh0Counter')
		h0Energy = setupEAvplot(h0Energy, h0Counter)
		h0Energy.SetStats(0)
	
		hP1Energy = self.fileHandler.getHistogram('averageEnergy/wh1p/averageEnergyAroundPoint' + self.key + '_wh1SummedEnergy')
		hP1Counter = self.fileHandler.getHistogram('averageEnergy/wh1p/averageEnergyAroundPoint' + self.key + '_wh1Counter')
		hP1Energy = setupEAvplot(hP1Energy, hP1Counter)
		hP1Energy.SetStats(0)
	
		canvas.cd(1).SetLogz()
		setupAxes(hM1Energy)
		hM1Energy.SetMaximum(1.2)
		hM1Energy.SetMinimum(5e-3)
		hM1Energy.Draw('colz')
		canvas.Update()
		setupPalette(hM1Energy)
		label1 = self.drawLabel()

		canvas.cd(2).SetLogz()
		setupAxes(h0Energy)
		h0Energy.SetMaximum(1.2)
		h0Energy.SetMinimum(5e-3)
		h0Energy.Draw('colz')
		#h0Counter.Draw('same,text')
		canvas.Update()
		setupPalette(h0Energy)
		label2 = self.drawLabel()
		
		canvas.cd(3).SetLogz()
		setupAxes(hP1Energy)
		hP1Energy.SetMaximum(1.2)
		hP1Energy.SetMinimum(5e-3)
		hP1Energy.Draw('colz')
		canvas.Update()
		setupPalette(hP1Energy)
		label3 = self.drawLabel()
	
		canvas.Update()
		self.storeCanvas(canvas,'eAveragePerWheel')
		
		return hM1Energy,canvas,h0Energy,hP1Energy,h0Counter,label1,label2,label3
Exemplo n.º 4
0
	def plotEavPerWheelForTightMuons(self):
		canvas = TCanvas('canvasEavPerWheelTightMuons','EAv Per Wheel Tight muons',1800,800)
		canvas.Divide(3,1)
				
		hM1Energy = self.fileHandler.getHistogram('averageEnergy/wh1m/averageEnergyAroundPointpatTightToL1Muons_wh-1SummedEnergy')
		hM1Counter = self.fileHandler.getHistogram('averageEnergy/wh1m/averageEnergyAroundPointpatTightToL1Muons_wh-1Counter')
		hM1Energy = setupEAvplot(hM1Energy, hM1Counter)
		hM1Energy.SetStats(0)
	
		h0Energy = self.fileHandler.getHistogram('averageEnergy/wh0/averageEnergyAroundPointpatTightToL1Muons_wh0SummedEnergy')
		h0Counter = self.fileHandler.getHistogram('averageEnergy/wh0/averageEnergyAroundPointpatTightToL1Muons_wh0Counter')
		h0Energy = setupEAvplot(h0Energy, h0Counter)
		h0Energy.SetStats(0)
	
		hP1Energy = self.fileHandler.getHistogram('averageEnergy/wh1p/averageEnergyAroundPointpatTightToL1Muons_wh1SummedEnergy')
		hP1Counter = self.fileHandler.getHistogram('averageEnergy/wh1p/averageEnergyAroundPointpatTightToL1Muons_wh1Counter')
		hP1Energy = setupEAvplot(hP1Energy, hP1Counter)
		hP1Energy.SetStats(0)
	
		canvas.cd(1).SetLogz()
		setupAxes(hM1Energy)
		hM1Energy.SetMaximum(1.2)
		hM1Energy.SetMinimum(5e-3)
		hM1Energy.Draw('colz')
		canvas.Update()
		setupPalette(hM1Energy)
		label1 = self.drawLabel()
		
		canvas.cd(2).SetLogz()
		setupAxes(h0Energy)
		h0Energy.SetMaximum(1.2)
		h0Energy.SetMinimum(5e-3)
		h0Energy.Draw('colz')
		canvas.Update()
		setupPalette(h0Energy)
		label2 = self.drawLabel()
		
		canvas.cd(3).SetLogz()
		setupAxes(hP1Energy)
		hP1Energy.SetMaximum(1.2)
		hP1Energy.SetMinimum(5e-3)
		hP1Energy.Draw('colz')
		canvas.Update()
		setupPalette(hP1Energy)
		label3 = self.drawLabel()
	
		canvas.Update()
		
		self.storeCanvas(canvas,'eAveragePerWheelTightMuons')
		
		return hM1Energy,canvas,h0Energy,hP1Energy,h0Counter,label1,label2,label3
Exemplo n.º 5
0
	def plotEAveragePerWheel(self):
		canvas = TCanvas('cEAvPerWheel',"E Average per Wheel",1800,800)
		canvas.Divide(3,1)
	
		hM1Energy = self.fileHandler.getHistogram('averageEnergy/wh1m/averageEnergyAroundPoint' + self.key + '_wh-1SummedEnergy')
		hM1Counter = self.fileHandler.getHistogram('averageEnergy/wh1m/averageEnergyAroundPoint' + self.key + '_wh-1Counter')
		hM1Energy = setupEAvplot(hM1Energy, hM1Counter)
		hM1Energy.SetStats(0)
	
		h0Energy = self.fileHandler.getHistogram('averageEnergy/wh0/averageEnergyAroundPoint' + self.key + '_wh0SummedEnergy')
		h0Counter = self.fileHandler.getHistogram('averageEnergy/wh0/averageEnergyAroundPoint' + self.key + '_wh0Counter')
		h0Energy = setupEAvplot(h0Energy, h0Counter)
		h0Energy.SetStats(0)
	
		hP1Energy = self.fileHandler.getHistogram('averageEnergy/wh1p/averageEnergyAroundPoint' + self.key + '_wh1SummedEnergy')
		hP1Counter = self.fileHandler.getHistogram('averageEnergy/wh1p/averageEnergyAroundPoint' + self.key + '_wh1Counter')
		hP1Energy = setupEAvplot(hP1Energy, hP1Counter)
		hP1Energy.SetStats(0)
	
		canvas.cd(1).SetLogz()
		setupAxes(hM1Energy)
		hM1Energy.SetMaximum(1.2)
		hM1Energy.SetMinimum(5e-3)
		hM1Energy.Draw('colz')
		canvas.Update()
		setupPalette(hM1Energy)
		label1 = self.drawLabel()

		canvas.cd(2).SetLogz()
		setupAxes(h0Energy)
		h0Energy.SetMaximum(1.2)
		h0Energy.SetMinimum(5e-3)
		h0Energy.Draw('colz')
		#h0Counter.Draw('same,text')
		canvas.Update()
		setupPalette(h0Energy)
		label2 = self.drawLabel()
		
		canvas.cd(3).SetLogz()
		setupAxes(hP1Energy)
		hP1Energy.SetMaximum(1.2)
		hP1Energy.SetMinimum(5e-3)
		hP1Energy.Draw('colz')
		canvas.Update()
		setupPalette(hP1Energy)
		label3 = self.drawLabel()
	
		canvas.Update()
		self.storeCanvas(canvas,'eAveragePerWheel')
		
		return hM1Energy,canvas,h0Energy,hP1Energy,h0Counter,label1,label2,label3
Exemplo n.º 6
0
	def plotEavPerWheelForTightMuons(self):
		canvas = TCanvas('canvasEavPerWheelTightMuons','EAv Per Wheel Tight muons',1800,800)
		canvas.Divide(3,1)
				
		hM1Energy = self.fileHandler.getHistogram('averageEnergy/wh1m/averageEnergyAroundPointpatTightToL1Muons_wh-1SummedEnergy')
		hM1Counter = self.fileHandler.getHistogram('averageEnergy/wh1m/averageEnergyAroundPointpatTightToL1Muons_wh-1Counter')
		hM1Energy = setupEAvplot(hM1Energy, hM1Counter)
		hM1Energy.SetStats(0)
	
		h0Energy = self.fileHandler.getHistogram('averageEnergy/wh0/averageEnergyAroundPointpatTightToL1Muons_wh0SummedEnergy')
		h0Counter = self.fileHandler.getHistogram('averageEnergy/wh0/averageEnergyAroundPointpatTightToL1Muons_wh0Counter')
		h0Energy = setupEAvplot(h0Energy, h0Counter)
		h0Energy.SetStats(0)
	
		hP1Energy = self.fileHandler.getHistogram('averageEnergy/wh1p/averageEnergyAroundPointpatTightToL1Muons_wh1SummedEnergy')
		hP1Counter = self.fileHandler.getHistogram('averageEnergy/wh1p/averageEnergyAroundPointpatTightToL1Muons_wh1Counter')
		hP1Energy = setupEAvplot(hP1Energy, hP1Counter)
		hP1Energy.SetStats(0)
	
		canvas.cd(1).SetLogz()
		setupAxes(hM1Energy)
		hM1Energy.SetMaximum(1.2)
		hM1Energy.SetMinimum(5e-3)
		hM1Energy.Draw('colz')
		canvas.Update()
		setupPalette(hM1Energy)
		label1 = self.drawLabel()
		
		canvas.cd(2).SetLogz()
		setupAxes(h0Energy)
		h0Energy.SetMaximum(1.2)
		h0Energy.SetMinimum(5e-3)
		h0Energy.Draw('colz')
		canvas.Update()
		setupPalette(h0Energy)
		label2 = self.drawLabel()
		
		canvas.cd(3).SetLogz()
		setupAxes(hP1Energy)
		hP1Energy.SetMaximum(1.2)
		hP1Energy.SetMinimum(5e-3)
		hP1Energy.Draw('colz')
		canvas.Update()
		setupPalette(hP1Energy)
		label3 = self.drawLabel()
	
		canvas.Update()
		
		self.storeCanvas(canvas,'eAveragePerWheelTightMuons')
		
		return hM1Energy,canvas,h0Energy,hP1Energy,h0Counter,label1,label2,label3
Exemplo n.º 7
0
	def compareHistogramMethods(self):
		canvas = TCanvas('cComparison','Comparison btween histograms')
		
	#	canvas.Divide(2,1)
		
		histNormal = self.fileHandler.getHistogram('averageEnergy/averageEnergyAroundPoint' + self.key + '_SummedEnergy')
		histNormalCounter = self.fileHandler.getHistogram('averageEnergy/averageEnergyAroundPoint' + self.key + '_Counter')
		
		histNormal = setupEAvplot(histNormal, histNormalCounter,same=True,limitForAll=0.6)
		
	#	histNew = self.fileHandler.getHistogram('deltaEtaDeltaPhiEnergy/averageEnergyAroundPoint_2dSummedWeightsIEtaIPhi')
	#	histNewCounter = self.fileHandler.getHistogram('deltaEtaDeltaPhiEnergy/averageEnergyAroundPoint_2dCounterIEtaIPhi')
		
		canvas.cd(1).SetLogz()
		
		histNormal.SetTitle('Average Energy in HO tiles around L1 direction, i#eta by binning')
		histNormal.SetStats(1)
		histNormal.Draw('colz')
		
		label = getLabelCmsPrivateSimulation()
		label.Draw()
		
	#	canvas.cd(2).SetLogz()
		
	#	histNew = average2DHistogramBinwise(histNew, histNewCounter)
	#	histNew.GetXaxis().SetRangeUser(-8,8)
	#	histNew.GetYaxis().SetRangeUser(-8,8)
	#	histNew.GetXaxis().SetTitle('#Delta#eta')
	#	histNew.GetYaxis().SetTitle('#Delta#phi')
	#	histNew.GetZaxis().SetTitle('Reconstructed Energy / GeV')
	#	histNew.SetTitle('Mean Energy in HO tiles around L1 direction, i#eta by binning')
	#	histNew.Draw('colz')
			
	#	label2 = getLabelCmsPrivateSimulation()
	#	label2.Draw()
		
		canvas.Update()
		
		#Setup plot style
		setStatBoxOptions(histNormal,1100)
		setStatBoxPosition(histNormal)
		setupPalette(histNormal)
		
	#	setupAxes(histNew)	
	#	setStatBoxOptions(histNew,1100)
	#	setStatBoxPosition(histNew)
	#	setupPalette(histNew)
	
		canvas.Update()
		
		#TODO: Print the bin contents subtracted
		
		return canvas, histNormal,label#,histNew,label2
Exemplo n.º 8
0
	def compareHistogramMethods(self):
		canvas = TCanvas('cComparison','Comparison btween histograms')
		
	#	canvas.Divide(2,1)
		
		histNormal = self.fileHandler.getHistogram('averageEnergy/averageEnergyAroundPoint' + self.key + '_SummedEnergy')
		histNormalCounter = self.fileHandler.getHistogram('averageEnergy/averageEnergyAroundPoint' + self.key + '_Counter')
		
		histNormal = setupEAvplot(histNormal, histNormalCounter,same=True,limitForAll=0.6)
		
	#	histNew = self.fileHandler.getHistogram('deltaEtaDeltaPhiEnergy/averageEnergyAroundPoint_2dSummedWeightsIEtaIPhi')
	#	histNewCounter = self.fileHandler.getHistogram('deltaEtaDeltaPhiEnergy/averageEnergyAroundPoint_2dCounterIEtaIPhi')
		
		canvas.cd(1).SetLogz()
		
		histNormal.SetTitle('Average Energy in HO tiles around L1 direction, i#eta by binning')
		histNormal.SetStats(1)
		histNormal.Draw('colz')
		
		label = getLabelCmsPrivateSimulation()
		label.Draw()
		
	#	canvas.cd(2).SetLogz()
		
	#	histNew = average2DHistogramBinwise(histNew, histNewCounter)
	#	histNew.GetXaxis().SetRangeUser(-8,8)
	#	histNew.GetYaxis().SetRangeUser(-8,8)
	#	histNew.GetXaxis().SetTitle('#Delta#eta')
	#	histNew.GetYaxis().SetTitle('#Delta#phi')
	#	histNew.GetZaxis().SetTitle('Reconstructed Energy / GeV')
	#	histNew.SetTitle('Mean Energy in HO tiles around L1 direction, i#eta by binning')
	#	histNew.Draw('colz')
			
	#	label2 = getLabelCmsPrivateSimulation()
	#	label2.Draw()
		
		canvas.Update()
		
		#Setup plot style
		setStatBoxOptions(histNormal,1100)
		setStatBoxPosition(histNormal)
		setupPalette(histNormal)
		
	#	setupAxes(histNew)	
	#	setStatBoxOptions(histNew,1100)
	#	setStatBoxPosition(histNew)
	#	setupPalette(histNew)
	
		canvas.Update()
		
		#TODO: Print the bin contents subtracted
		
		return canvas, histNormal,label#,histNew,label2
Exemplo n.º 9
0
	def plotEavForTightMuons(self):
		canvas = TCanvas('canvasEavTightMuons','EAv Tight muons',800,800)
		canvas.cd().SetLogz()
			
		hSum = self.fileHandler.getHistogram('averageEnergy/averageEnergyAroundPointpatTightToL1Muons_SummedEnergy')
		hCounter = self.fileHandler.getHistogram('averageEnergy/averageEnergyAroundPointpatTightToL1Muons_Counter')
	
		hSum = setupEAvplot(hSum, hCounter,same=True,limitForAll=0.3)
		hSum.SetTitle('Average E_{Rec} in HO tiles around tight L1 direction')
		hSum.SetMaximum(1.2)
		hSum.SetMinimum(5e-3)
		hSum.Draw('colz')
		label = self.drawLabel()
		canvas.Update()		
		setupPalette(hSum)
		canvas.Update()
		#boxes = drawHoBoxes(canvas)
		self.storeCanvas(canvas,'eAverageTightMuons')
		return canvas,hSum,label#,boxes
Exemplo n.º 10
0
	def plotEavForTightMuons(self):
		canvas = TCanvas('canvasEavTightMuons','EAv Tight muons',1200,1200)
		canvas.cd().SetLogz()
			
		hSum = self.fileHandler.getHistogram('averageEnergy/averageEnergyAroundPointpatTightToL1Muons_SummedEnergy')
		hCounter = self.fileHandler.getHistogram('averageEnergy/averageEnergyAroundPointpatTightToL1Muons_Counter')
	
		hSum = setupEAvplot(hSum, hCounter,same=True,limitForAll=0.3)
		hSum.SetTitle('Average E_{Rec} in HO tiles around tight L1 direction')
		hSum.SetMaximum(1.2)
		hSum.SetMinimum(5e-3)
		hSum.Draw('colz')
		label = self.drawLabel()
		canvas.Update()		
		setupPalette(hSum)
		canvas.Update()
		#boxes = drawHoBoxes(canvas)
		self.storeCanvas(canvas,'eAverageTightMuons')
		return canvas,hSum,label#,boxes