Exemplo n.º 1
0
	def __init__(self,filename,debug,data = False):
		self.commandLine = CommandLineHandler('[TimeWindow] ')
		self.fileHandler = RootFileHandler(filename)
		self.fileHandler.printStatus()
		if( not os.path.exists('plots')):
			os.mkdir('plots')
		if( not os.path.exists('plots/efficiencyWithTime')):
			os.mkdir('plots/efficiencyWithTime')
		setPlotStyle()
		self.data = data
Exemplo n.º 2
0
	def __init__(self,filename,data = False):
		self.commandLine = CommandLineHandler('[TimeWindow] ')
		self.fileHandler = RootFileHandler(filename)
		self.fileHandler.printStatus()
		if( not os.path.exists('plots')):
			os.mkdir('plots')
		if( not os.path.exists('plots/efficiencyWithTime')):
			os.mkdir('plots/efficiencyWithTime')
		setPlotStyle()
		self.data = data
Exemplo n.º 3
0
	def __init__(self,filename,data =False):
		self.commandLine = CommandLineHandler('[QualityCode] ')
		self.fileHandler = RootFileHandler(filename)
		self.fileHandler.printStatus()
		if( not os.path.exists('plots')):
			os.mkdir('plots')
		if( not os.path.exists('plots/qualityCode')):
			os.mkdir('plots/qualityCode')
		setPlotStyle()
		self.data = data
Exemplo n.º 4
0
#!/usr/bin/python
from ROOT import ROOT,gROOT,TCanvas,TFile,TH1D,TH2D,TLegend,THStack,TPaveText, TMarker,TLine,gPad,TF1,TF2,TGraph,Double,TPad
import sys,os,math
from plotting.PlotStyle import calcSigma,setPlotStyle,colorRwthDarkBlue,colorRwthMagenta,drawLabelCmsPrivateSimulation
from plotting.RootFileHandler import RootFileHandler

DEBUG = 1
prefix = '[plotEfficiency] '

markerpairs = [	[20,24],[21,25],[22,26],[23,32],[34,28] ]

if len(sys.argv) < 2:
	print 'First argument has to be the file name scheme!'
fileHandler = RootFileHandler(sys.argv[1])
fileHandler.printStatus()

if( not os.path.exists('plots')):
	os.mkdir('plots')
if( not os.path.exists('plots/efficiency')):
	os.mkdir('plots/efficiency')

setPlotStyle()

def plotEfficiencyForPt(folder,pt):
	if(DEBUG):
		print prefix + 'was called'
	
	#Set plot style
	
	if(DEBUG):
		print prefix + "Getting histogram: %s" % ("hoMuonAnalyzer/efficiency/GenAndL1MuonPt" + str(pt) + "_Efficiency")
Exemplo n.º 5
0
	def createFileHandler(self,filename):
		fh = RootFileHandler(filename,debug=self.DEBUG)
		fh.printStatus()
		return fh
Exemplo n.º 6
0
class TimeWindow:
	
	def __init__(self,filename,data = False):
		self.commandLine = CommandLineHandler('[TimeWindow] ')
		self.fileHandler = RootFileHandler(filename)
		self.fileHandler.printStatus()
		if( not os.path.exists('plots')):
			os.mkdir('plots')
		if( not os.path.exists('plots/efficiencyWithTime')):
			os.mkdir('plots/efficiencyWithTime')
		setPlotStyle()
		self.data = data
			
	def plotTimeWindowAlone(self):
		c = TCanvas('cTimeWindowAlone',"Time Window Alone")
		effL1Muon3x3Truth = self.fileHandler.getHistogram('hoMuonAnalyzer/efficiency/L1MuonTruthTimeWindow3x3_Efficiency')
		effL1Muon3x3 = self.fileHandler.getHistogram('hoMuonAnalyzer/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
	
	def plotAllL1Together(self):
		c = TCanvas('cTimeWindowAllL1',"Time Window All L1")
		effL1Muon3x3 = self.fileHandler.getHistogram('hoMuonAnalyzer/efficiency/L1Muon3x3_Efficiency')
		effL1Muon3x3TW = self.fileHandler.getHistogram('hoMuonAnalyzer/efficiency/L1MuonTimeWindow3x3_Efficiency')

		effL1Muon3x3.SetMarkerStyle(22)
		effL1Muon3x3.SetMarkerColor(colorRwthDarkBlue)
		effL1Muon3x3.SetLineColor(colorRwthDarkBlue)
		effL1Muon3x3.SetTitle('Efficiency 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 in 3x3 grid','ep')
		legend.AddEntry(effL1Muon3x3TW,'Matches in 3x3 grid and time window','ep')
		legend.Draw()
		
		label = None
		if self.data:
			label = drawLabelCmsPrivateData()
		else:
			label = drawLabelCmsPrivateSimulation()
					
		c.Update()
		
		c.SaveAs('plots/efficiencyWithTime/allL13x3.gif')
		
		return c, label, effL1Muon3x3, effL1Muon3x3TW, legend
		
	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
	
	def plotBxidVsPtFails(self):
		c = TCanvas('cBxidVsPtFails','BxidVsPtFails',800,1200)
		c.Divide(1,2)
		c.cd(1).SetLogz()
		hist = self.fileHandler.getHistogram('hoMuonAnalyzer/time/L1Muon3x3Fail_BxIdVsPt')
		setupAxes(hist)
		hist.SetTitle('Failed matching in 3x3;p_{T} / GeV;BX ID;# entries')
		hist.SetStats(0)
		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/bxIdVsPt3x3Fail.gif')
		return c, hist,label,labelBottom
	
	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
Exemplo n.º 7
0
gROOT.Reset()

from plotting.PlotStyle import setPlotStyle, getLabelCmsPrivateSimulation, getTH2D, calcSigma, setupAxes
setPlotStyle()

from plotting.RootFileHandler import RootFileHandler

if (not os.path.exists('plots')):
    os.mkdir('plots')
if (not os.path.exists('plots/timeCorrelation')):
    os.mkdir('plots/timeCorrelation')

if len(sys.argv) < 2:
    print 'First argument has to be the file name scheme!'
fileHandler = RootFileHandler(sys.argv[1])
fileHandler.printStatus()
'''
Calculate the time slew for a given charge
'''


def getTimeSlew(charge):
    if charge < 1:
        charge = 1
    rawDelay = 23.97 - 3.18 * log(charge)
    timeSlew = 0 if rawDelay < 0 else (np.min([16, rawDelay]))
    return timeSlew


#plot the timing correlation between HO and L1 in general
Exemplo n.º 8
0
import sys
from ROOT import TCanvas, TLegend, THStack, TLegend
from plotting.RootFileHandler import RootFileHandler
from plotting.PlotStyle import setupAxes,setPlotStyle, colorRwthDarkBlue,\
 drawLabelCmsPrivateSimulation, colorRwthLightBlue, colorRwthGruen,\
 colorRwthTuerkis, colorRwthRot, colorRwthMagenta, setupPalette
from plotting.OutputModule import CommandLineHandler, CliColors
fileHandler = RootFileHandler(sys.argv[1])

setPlotStyle()
cli = CommandLineHandler('[QualityCodes] ')

qualityCodeDict = {
    1: 'Halo Muon',
    2: 'Very low qual. Type 1',
    3: 'Very low qual. Type 2',
    4: 'Very low qual. Type 3',
    5: 'unmatched RPC',
    6: 'unmatched DT or CSC',
    7: 'matched DT-RPC or CSC-RPC'
}

gridSizeDict = {0: 'Central', 1: '3x3', 2: '5x5'}


def plotQualityCodes():
    c = TCanvas('cQualityCodes')
    c.SetLogy()
    qualityCodes = fileHandler.getHistogram(
        'multiplicity/L1MuonQualityCodesCentral_Multiplicity')
    qualityCodesFail = fileHandler.getHistogram(
Exemplo n.º 9
0
	def createFileHandler(self,filename):
		fh = RootFileHandler(filename)
		fh.printStatus()
		return fh
Exemplo n.º 10
0
import matplotlib.pyplot as plt
import numpy as np
import math

if len(sys.argv) < 2:
	print 'First argument has to be the file name scheme!'
	
if( not os.path.exists('plots')):
	os.mkdir('plots')
if( not os.path.exists('plots/dataTreeAnalysis')):
	os.mkdir('plots/dataTreeAnalysis')
	
gROOT.ProcessLine(".L $HOMUONTRIGGER_BASE/python/loader.C+");
	
fileHandler = RootFileHandler(sys.argv[1])
dataChain = fileHandler.getTChain()
nEvents = dataChain.GetEntries()

eMaxMatches = getEMaxMatches(dataChain)
eMaxDeltaPhiList = getDeltaPhiList(eMaxMatches)
eMaxDeltaEtaList = getDeltaEtaList(eMaxMatches)

def histogramDeltaPhi():
	deltaPhiList = []
	eventCounter = 0
	for event in dataChain:
		eventCounter += 1
		if not eventCounter % 1000:
			commandLine.printProgress(eventCounter, nEvents)
		if(eventCounter == nEvents):
Exemplo n.º 11
0
class TimeWindow:
	
	def __init__(self,filename,debug,data = False):
		self.commandLine = CommandLineHandler('[TimeWindow] ')
		self.fileHandler = RootFileHandler(filename)
		self.fileHandler.printStatus()
		if( not os.path.exists('plots')):
			os.mkdir('plots')
		if( not os.path.exists('plots/efficiencyWithTime')):
			os.mkdir('plots/efficiencyWithTime')
		setPlotStyle()
		self.data = data
			
	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
	
	def plotAllL1Together(self):
		c = TCanvas('cTimeWindowAllL1',"Time Window All L1")
		effL1Muon3x3 = self.fileHandler.getHistogram('efficiency/L1Muon3x3_Efficiency')
		effL1Muon3x3TW = self.fileHandler.getHistogram('efficiency/L1MuonTimeWindow3x3_Efficiency')

		effL1Muon3x3.SetMarkerStyle(22)
		effL1Muon3x3.SetMarkerColor(colorRwthDarkBlue)
		effL1Muon3x3.SetLineColor(colorRwthDarkBlue)
		effL1Muon3x3.SetTitle('Efficiency 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 in 3x3 grid','ep')
		legend.AddEntry(effL1Muon3x3TW,'Matches in 3x3 grid and time window','ep')
		legend.Draw()
		
		label = None
		if self.data:
			label = drawLabelCmsPrivateData()
		else:
			label = drawLabelCmsPrivateSimulation()
					
		c.Update()
		
		c.SaveAs('plots/efficiencyWithTime/allL13x3.gif')
		
		return c, label, effL1Muon3x3, effL1Muon3x3TW, legend
		
	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
	
	def plotBxidVsPtFails(self):
		c = TCanvas('cBxidVsPtFails','BxidVsPtFails',800,1200)
		c.Divide(1,2)
		c.cd(1).SetLogz()
		hist = self.fileHandler.getHistogram('time/L1Muon3x3Fail_BxIdVsPt')
		setupAxes(hist)
		hist.SetTitle('Failed matching in 3x3;p_{T} / GeV;BX ID;# entries')
		hist.SetStats(0)
		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/bxIdVsPt3x3Fail.gif')
		return c, hist,label,labelBottom
	
	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
Exemplo n.º 12
0
class QualityCode:
	def __init__(self,filename,data =False):
		self.commandLine = CommandLineHandler('[QualityCode] ')
		self.fileHandler = RootFileHandler(filename)
		self.fileHandler.printStatus()
		if( not os.path.exists('plots')):
			os.mkdir('plots')
		if( not os.path.exists('plots/qualityCode')):
			os.mkdir('plots/qualityCode')
		setPlotStyle()
		self.data = data
		
	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
	
	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
		
Exemplo n.º 13
0
 def createFileHandler(self, filename):
     fh = RootFileHandler(filename, debug=self.DEBUG)
     fh.printStatus()
     return fh
Exemplo n.º 14
0
import matplotlib.pyplot as plt
import numpy as np
import math

if len(sys.argv) < 2:
    print 'First argument has to be the file name scheme!'

if (not os.path.exists('plots')):
    os.mkdir('plots')
if (not os.path.exists('plots/dataTreeAnalysis')):
    os.mkdir('plots/dataTreeAnalysis')

gROOT.ProcessLine(".L $HOMUONTRIGGER_BASE/python/loader.C+")

fileHandler = RootFileHandler(sys.argv[1])
dataChain = fileHandler.getTChain()
nEvents = dataChain.GetEntries()

eMaxMatches = getEMaxMatches(dataChain)
eMaxDeltaPhiList = getDeltaPhiList(eMaxMatches)
eMaxDeltaEtaList = getDeltaEtaList(eMaxMatches)


def histogramDeltaPhi():
    deltaPhiList = []
    eventCounter = 0
    for event in dataChain:
        eventCounter += 1
        if not eventCounter % 1000:
            commandLine.printProgress(eventCounter, nEvents)