コード例 #1
0
algorithms = [ 'shrinkingCone', 'TaNC', 'hps', 'calo' ]

if __name__ == "__main__":
    ROOT.gROOT.SetBatch(True)
    ROOT.gROOT.SetStyle("Plain")
    ROOT.gStyle.SetOptStat(0)

    # Get ZTT samples
    ztt = samples.zttPU156bx_mc # particleFlow

    # Build the plot manager.  The plot manager keeps track of all the samples
    # and ensures they are correctly normalized w.r.t. luminosity.  See 
    # samples.py for available samples.

    plotter = PlotManager()

    # Add each sample we want to plot/compare
    plotter.add_sample(ztt, "Z #rightarrow #ell #ell, BX156", **style.QCD_MC_STYLE_HIST)

    # Normalize everything to the data luminosity
    plotter.set_integrated_lumi(samples.data_wjets.effective_luminosity())

    # Get the ntuple we produced
    ntuple_manager = ztt.build_ntuple_manager("tauIdEffNtuple")

    # Get generator level tau ntuple
    genTaus = ntuple_manager.get_ntuple("tauGenJets")

    # Get ntuple with vertex information
    vertex = ntuple_manager.get_ntuple("offlinePrimaryVertices")
コード例 #2
0
        custom_LUMI_LABEL_UPPER_LEFT = copy.deepcopy(style.LUMI_LABEL_UPPER_LEFT)
        custom_LUMI_LABEL_UPPER_LEFT.SetTextSize(0.0375)
        custom_LUMI_LABEL_UPPER_LEFT.Clear()
        custom_LUMI_LABEL_UPPER_LEFT.AddText("Data, L = 8.4nb^{-1}")
        custom_LUMI_LABEL_UPPER_LEFT.Draw()
        style.SQRTS_LABEL_UPPER_LEFT.Draw()
        for extra_label in fakerate_results['calo'][x_var]['extra_labels']:
            extra_label.Draw()
        
        # Save the plot
        canvas.SaveAs("plots/%s.png" % '_'.join(['fakerate_algo_comparison', 'vs', x_var]))
        canvas.SaveAs("plots/%s.pdf" % '_'.join(['fakerate_algo_comparison', 'vs', x_var]))
                    
if __name__ == "__main__":

    plotter = PlotManager()

    # Add each sample we want to plot/compare
    # Uncomment to add QCD
    plotter.add_sample(samples.qcddijet_mc, "Simulation", **style.QCD_MC_PYTHIA6_STYLE_HIST)

    plotter.add_sample(samples.data_dijet, "Data", **style.DATA_STYLE)

    # Normalize everything to the data luminosity
    plotter.set_integrated_lumi(samples.data_dijet.effective_luminosity())
    
    # Build the ntuple manager
    ntuple_manager = samples.data_dijet.build_ntuple_manager("tauIdEffNtuple")

    nTuples = {
        "shrinkingCone": ntuple_manager.get_ntuple("patPFTausDijetTagAndProbeShrinkingCone"),
コード例 #3
0
algorithms = ['shrinkingCone', 'TaNC', 'hps', 'calo']

if __name__ == "__main__":
    ROOT.gROOT.SetBatch(True)
    ROOT.gROOT.SetStyle("Plain")
    ROOT.gStyle.SetOptStat(0)

    # Get ZTT samples
    ztt = samples.zttPU156bx_mc  # particleFlow

    # Build the plot manager.  The plot manager keeps track of all the samples
    # and ensures they are correctly normalized w.r.t. luminosity.  See
    # samples.py for available samples.

    plotter = PlotManager()

    # Add each sample we want to plot/compare
    plotter.add_sample(ztt, "Z #rightarrow #ell #ell, BX156",
                       **style.QCD_MC_STYLE_HIST)

    # Normalize everything to the data luminosity
    plotter.set_integrated_lumi(samples.data_wjets.effective_luminosity())

    # Get the ntuple we produced
    ntuple_manager = ztt.build_ntuple_manager("tauIdEffNtuple")

    # Get generator level tau ntuple
    genTaus = ntuple_manager.get_ntuple("tauGenJets")

    # Get ntuple with vertex information
コード例 #4
0
    canvas_diff.cd()
    canvas_diff.Update()

    canvas_diff.SaveAs(outputFileName[:outputFileName.find(".")] +
                       "_%s_diff.png" % algorithm)
    canvas_diff.SaveAs(outputFileName[:outputFileName.find(".")] +
                       "_%s_diff.pdf" % algorithm)

    return result_algorithm


if __name__ == "__main__":

    # define PlotManagers for QCD Monte Carlo and data samples
    plotter_dijet_mc = PlotManager()
    plotter_dijet_mc.add_sample(sample_dijet_mc, "QCDj Simulation",
                                **custom_style_dijet_mc)
    plotters_dijet_data = {}
    for dijet_dataHLTpath in dijet_dataHLTpaths:
        plotter_dijet_data = PlotManager()
        plotter_dijet_data.add_sample(
            samples_dijet_data[dijet_dataHLTpath],
            "QCDj Data: %s" % dijet_dataHLTpath,
            **custom_styles_dijet_data[dijet_dataHLTpath])
        plotters_dijet_data[dijet_dataHLTpath] = plotter_dijet_data

    # Build the ntuple manager
    ntuple_manager = sample_dijet_mc.build_ntuple_manager("tauIdEffNtuple")

    nTuples = {
コード例 #5
0
    # Figure out how to get the information about the pileup information.  This
    # has to be determiend from one of the MC samples.

    ntuple_mananger_wPUinfo = sample_dijet_mc.build_ntuple_manager(
        "tauIdEffNtuple")

    # Define the expression which re-weights events for PU.
    puinfo_ntuple = ntuple_mananger_wPUinfo.get_ntuple("addPileupInfo")
    pu_reweight_expr = puinfo_ntuple.expr('$vtxMultReweight')
    # Uncomment following line to DISABLE reweighting
    # pu_reweight_expr = "1.0"

    # define PlotManagers for QCD multi-jet, QCD muon enriched and W + jets samples
    # For the MC samples, reweight according to PU vertices
    plotter_dijet = PlotManager()
    plotter_dijet.add_sample(sample_dijet_data, "QCDj Data",
                             **custom_style_dijet_data)
    plotter_dijet.add_sample(sample_dijet_mc,
                             "QCDj Simulation",
                             weight_expr=pu_reweight_expr,
                             **custom_style_dijet_mc)
    plotter_dijet.set_integrated_lumi(intLumiData)

    plotter_ppmux = PlotManager()
    plotter_ppmux.add_sample(sample_ppmux_data, "QCD#mu Data",
                             **custom_style_ppmux_data)
    plotter_ppmux.add_sample(sample_ppmux_mc,
                             "QCD#mu Simulation",
                             weight_expr=pu_reweight_expr,
                             **custom_style_ppmux_mc)
コード例 #6
0
#!/usr/bin/env python

import ROOT
from TauAnalysis.TauIdEfficiency.ntauples.PlotManager import PlotManager
import TauAnalysis.TauIdEfficiency.ntauples.styles as style

# Definition of input files.
import samples_cache as samples

plotter = PlotManager()

# Add each sample we want to plot/compare
# Uncomment to add QCD
plotter.add_sample(samples.qcd_mc_pythia8, "Simulation", **style.QCD_MC_PYTHIA8_STYLE_HIST)

#plotter.add_sample(samples.qcd_mc_pythia6, "QCD (Pythia 6)", **style.QCD_MC_PYTHIA6_STYLE_HIST)

#plotter.add_sample(samples.minbias_mc, "Minbias MC", **style.MINBIAS_MC_STYLE)

plotter.add_sample(samples.data, "Data", **style.DATA_STYLE)

# Normalize everything to the data luminosity
plotter.set_integrated_lumi(samples.data.effective_luminosity())

# Build the ntuple manager
ntuple_manager = samples.data.build_ntuple_manager("tauIdEffNtuple")

shrinking_ntuple = ntuple_manager.get_ntuple(
    "patPFTausDijetTagAndProbeShrinkingCone")

hlt = ntuple_manager.get_ntuple("TriggerResults")
コード例 #7
0
import ROOT
from TauAnalysis.TauIdEfficiency.ntauples.PlotManager import PlotManager
import TauAnalysis.TauIdEfficiency.ntauples.styles as style
import os
import samples_cache as samples

if __name__ == "__main__":
    ROOT.gROOT.SetBatch(True)

    if not os.path.isdir('plots_Control'):
        os.mkdir('plots_Control')

    # Build the plot manager.  The plot manager keeps track of all the samples
    # and ensures they are correctly normalized w.r.t. luminosity.  See
    # samples.py for available samples.
    plotter = PlotManager()

    plotter.add_sample(samples.qcd_mc_pythia6, "PYTHIA 6",
                       **style.QCD_MC_PYTHIA6_STYLE_DOTS)

    plotter.add_sample(samples.qcd_mc_pythia8, "PYTHIA 8",
                       **style.QCD_MC_PYTHIA8_STYLE_HIST)

    plotter.add_sample(samples.data, "Data", **style.DATA_STYLE)

    # Normalize everything to the data luminosity
    plotter.set_integrated_lumi(samples.data.effective_luminosity())

    # Build the ntuple maanger
    ntuple_manager = samples.data.build_ntuple_manager("tauIdEffNtuple")
コード例 #8
0
    # Figure out how to get the information about the pileup information.  This
    # has to be determiend from one of the MC samples.

    ntuple_mananger_wPUinfo = sample_dijet_mc.build_ntuple_manager(
        "tauIdEffNtuple")

    # Define the expression which re-weights events for PU.
    puinfo_ntuple = ntuple_mananger_wPUinfo.get_ntuple("addPileupInfo")
    pu_reweight_expr = puinfo_ntuple.expr('$vtxMultReweight')
    # Uncomment following line to DISABLE reweighting
    # pu_reweight_expr = "1.0"

    # define PlotManagers for QCD multi-jet, QCD muon enriched and W + jets samples
    # For the MC samples, reweight according to PU vertices
    plotter_dijet = PlotManager()
    plotter_dijet.add_sample(sample_dijet_data, "QCDj Data", **custom_style_dijet_data)
    plotter_dijet.add_sample(sample_dijet_mc, "QCDj Simulation",
                             weight_expr = pu_reweight_expr, **custom_style_dijet_mc)
    plotter_dijet.set_integrated_lumi(intLumiData)

    plotter_ppmux = PlotManager()
    plotter_ppmux.add_sample(sample_ppmux_data, "QCD#mu Data", **custom_style_ppmux_data)
    plotter_ppmux.add_sample(sample_ppmux_mc, "QCD#mu Simulation",
                             weight_expr = pu_reweight_expr, **custom_style_ppmux_mc)
    plotter_ppmux.set_integrated_lumi(intLumiData)

    plotter_wjets = PlotManager()
    plotter_wjets.add_sample(sample_wjets_data, "W #rightarrow #mu #nu Data", **custom_style_wjets_data)
    plotter_wjets.add_sample(sample_wjets_mc, "W #rightarrow #mu #nu Simulation",
                             weight_expr = pu_reweight_expr, **custom_style_wjets_mc)
コード例 #9
0
import TauAnalysis.TauIdEfficiency.ntauples.styles as style

# Defintion of input files.
import samples_cache as samples
import os

if __name__ == "__main__":
    ROOT.gROOT.SetBatch(True)

    if not os.path.isdir('plots'):
        os.mkdir('plots')

    # Build the plot manager.  The plot manager keeps track of all the samples
    # and ensures they are correctly normalized w.r.t. luminosity.  See
    # samples.py for available samples.
    plotter = PlotManager()

    # Add each sample we want to plot/compare
    # Uncomment to add QCD
    plotter.add_sample(samples.ztautau_mc, "Z->#tau#tau MC",
                       **style.QCD_MC_STYLE_HIST)

    # Normalize everything to the data luminosity
    plotter.set_integrated_lumi(samples.data.effective_luminosity())

    # Build the ntuple maanger
    ntuple_manager = samples.ztautau_mc.build_ntuple_manager("tauIdEffNtuple")

    # Get the shrinking ntuple
    shrinking_ntuple = ntuple_manager.get_ntuple(
        "patPFTausDijetTagAndProbeShrinkingCone")
コード例 #10
0
# Defintion of input files.
import samples as samples
import os
import sys


if __name__ == "__main__":
    ROOT.gROOT.SetBatch(True)

    if not os.path.isdir('plots'):
        os.mkdir('plots')

    # Build the plot manager.  The plot manager keeps track of all the samples
    # and ensures they are correctly normalized w.r.t. luminosity.  See 
    # samples.py for available samples.
    plotter = PlotManager()

    # Add each sample we want to plot/compare
    # Uncomment to add QCD
    plotter.add_sample(samples.ztautau_mc, "Z->#tau#tau MC", **style.QCD_MC_STYLE_HIST)

    # Normalize everything to the data luminosity
    plotter.set_integrated_lumi(samples.data.effective_luminosity())

    # Build the ntuple maanger
    ntuple_manager = samples.ztautau_mc.build_ntuple_manager("tauIdEffNtuple")

    # Get the shrinking ntuple
    hps_ntuple = ntuple_manager.get_ntuple(
        "patPFTausDijetTagAndProbeHPS")
        
コード例 #11
0
    canvas_diff.Update()    
    canvas_diff.SaveAs("plots/" + filename + "_diff.png")
    canvas_diff.SaveAs("plots/" + filename + "_diff.pdf")

    canvas_diff.IsA().Destructor(canvas_diff)

if __name__ == "__main__":
    ROOT.gROOT.SetBatch(True)

    if not os.path.isdir('plots'):
        os.mkdir('plots')

    # Build the plot manager.  The plot manager keeps track of all the samples
    # and ensures they are correctly normalized w.r.t. luminosity.  See 
    # samples.py for available samples.
    plotter = PlotManager()

    # Add each sample we want to plot/compare
    plotter.add_sample(sample_wjets_data, "W #rightarrow #mu #nu Data",       **custom_style_wjets_data)
    plotter.add_sample(sample_wjets_mc,   "W #rightarrow #mu #nu Simulation", **custom_style_wjets_mc)

    # Normalize everything to the data luminosity
    plotter.set_integrated_lumi(sample_wjets_data.effective_luminosity())

    # Build the ntuple manager
    ntuple_manager = sample_wjets_data.build_ntuple_manager("tauIdEffNtuple")

    # Get HLT trigger decisions
    hlt_ntuple = ntuple_manager.get_ntuple("patTriggerEvent")
 
    ######################################################
コード例 #12
0
    canvas_diff.SaveAs("plots/" + filename + "_diff.png")
    canvas_diff.SaveAs("plots/" + filename + "_diff.pdf")

    canvas_diff.IsA().Destructor(canvas_diff)


if __name__ == "__main__":
    ROOT.gROOT.SetBatch(True)

    if not os.path.isdir('plots'):
        os.mkdir('plots')

    # Build the plot manager.  The plot manager keeps track of all the samples
    # and ensures they are correctly normalized w.r.t. luminosity.  See
    # samples.py for available samples.
    plotter = PlotManager()

    # Add each sample we want to plot/compare
    plotter.add_sample(sample_wjets_data, "W #rightarrow #mu #nu Data",
                       **custom_style_wjets_data)
    plotter.add_sample(sample_wjets_mc, "W #rightarrow #mu #nu Simulation",
                       **custom_style_wjets_mc)

    # Normalize everything to the data luminosity
    plotter.set_integrated_lumi(sample_wjets_data.effective_luminosity())

    # Build the ntuple manager
    ntuple_manager = sample_wjets_data.build_ntuple_manager("tauIdEffNtuple")

    # Get HLT trigger decisions
    hlt_ntuple = ntuple_manager.get_ntuple("patTriggerEvent")
コード例 #13
0
# Defintion of input files.
import samples as samples
import os
import sys

if __name__ == "__main__":
    ROOT.gROOT.SetBatch(True)

    if not os.path.isdir('plots'):
        os.mkdir('plots')

    # Build the plot manager.  The plot manager keeps track of all the samples
    # and ensures they are correctly normalized w.r.t. luminosity.  See
    # samples.py for available samples.
    plotter = PlotManager()

    # Add each sample we want to plot/compare
    # Uncomment to add QCD
    plotter.add_sample(samples.qcd_mc_pythia8, "QCD MC",
                       **style.QCD_MC_STYLE_HIST)

    #plotter.add_sample(samples.minbias_mc, "Minbias MC", **style.MINBIAS_MC_STYLE)

    plotter.add_sample(samples.data, "Data (7 TeV)", **style.DATA_STYLE)

    # Normalize everything to the data luminosity
    plotter.set_integrated_lumi(samples.data.effective_luminosity())

    # Build the ntuple maanger
    ntuple_manager = samples.data.build_ntuple_manager("tauIdEffNtuple")
コード例 #14
0
        phi_resol['result'].GetXaxis().SetTitleOffset(1.2)

        # Make a pave text w/ mean rms
        stat_label = style.make_mean_rms_pave(
            phi_resol['samples']['mc_ztt']['plot'])
        stat_label.Draw()

        canvas.SaveAs("plots/%s%s_phi_resolution.png" %
                      (algorithm, selection["style_name"]))
        canvas.SaveAs("plots/%s%s_phi_resolution.pdf" %
                      (algorithm, selection["style_name"]))


if __name__ == "__main__":

    plotter = PlotManager()

    # Add each sample we want to plot/compare
    # Uncomment to add QCD
    plotter.add_sample(samples.ztautau_mc, "Z->#tau#tau MC",
                       **style.QCD_MC_STYLE_HIST)

    # Normalize everything to the data luminosity
    plotter.set_integrated_lumi(samples.data.effective_luminosity())

    # Build the ntuple manager
    ntuple_manager = samples.ztautau_mc.build_ntuple_manager("tauIdEffNtuple")

    nTuples = {
        "shrinkingCone":
        ntuple_manager.get_ntuple("patPFTausDijetTagAndProbeShrinkingCone"),
コード例 #15
0
# Defintion of input files.
import samples_cache as samples
import os
import sys


if __name__ == "__main__":
    ROOT.gROOT.SetBatch(True)

    if not os.path.isdir('plots'):
        os.mkdir('plots')

    # Build the plot manager.  The plot manager keeps track of all the samples
    # and ensures they are correctly normalized w.r.t. luminosity.  See 
    # samples.py for available samples.
    plotter = PlotManager()

    # Add each sample we want to plot/compare
   
    plotter.add_sample(samples.qcd_mc, "QCD MC", **style.QCD_MC_STYLE_HIST)

#    plotter.add_sample(samples.minbias_mc, "Minbias MC", **style.MINBIAS_MC_STYLE)

    plotter.add_sample(samples.data, "Data (7 TeV)", **style.DATA_STYLE)


    # Normalize everything to the data luminosity
    plotter.set_integrated_lumi(samples.data.effective_luminosity())

    # Build the ntuple maanger
    ntuple_manager = samples.data.build_ntuple_manager("tauIdEffNtuple")
コード例 #16
0
import ROOT
from TauAnalysis.TauIdEfficiency.ntauples.PlotManager import PlotManager
import TauAnalysis.TauIdEfficiency.ntauples.styles as style

# Definition of input files.
import samples_cache as samples
import os
import copy
import sys
from optparse import OptionParser

# Build the plot manager.  The plot manager keeps track of all the samples
# and ensures they are correctly normalized w.r.t. luminosity.  See
# samples.py for available samples.
plotter = PlotManager()

# Add each sample we want to plot/compare
# Uncomment to add QCD
plotter.add_sample(samples.qcd_mc_pythia8, "Pythia 8",
                   **style.QCD_MC_PYTHIA8_STYLE_HIST)

plotter.add_sample(samples.qcd_mc_pythia6, "Pythia 6",
                   **style.QCD_MC_PYTHIA6_STYLE_HIST)

#plotter.add_sample(samples.minbias_mc, "Minbias MC", **style.MINBIAS_MC_STYLE)

plotter.add_sample(samples.data, "Data", **style.DATA_STYLE)

# Normalize everything to the data luminosity
plotter.set_integrated_lumi(samples.data.effective_luminosity())
コード例 #17
0
# Defintion of input files.
import samples as samples
import os
import sys


if __name__ == "__main__":
    ROOT.gROOT.SetBatch(True)

    if not os.path.isdir('plots'):
        os.mkdir('plots')

    # Build the plot manager.  The plot manager keeps track of all the samples
    # and ensures they are correctly normalized w.r.t. luminosity.  See 
    # samples.py for available samples.
    plotter = PlotManager()

    # Add each sample we want to plot/compare
    # Uncomment to add QCD
    plotter.add_sample(samples.qcd_mc_pythia8, "QCD MC", **style.QCD_MC_STYLE_HIST)

    #plotter.add_sample(samples.minbias_mc, "Minbias MC", **style.MINBIAS_MC_STYLE)

    plotter.add_sample(samples.data, "Data (7 TeV)", **style.DATA_STYLE)


    # Normalize everything to the data luminosity
    plotter.set_integrated_lumi(samples.data.effective_luminosity())

    # Build the ntuple maanger
    ntuple_manager = samples.data.build_ntuple_manager("tauIdEffNtuple")
コード例 #18
0
    h_mcDen.Delete()
    h_mc2Den.Delete()
    h_mc0Den.Delete()

    canvas_diff.IsA().Destructor(canvas_diff)

if __name__ == "__main__":
    ROOT.gROOT.SetBatch(True)

    if not os.path.isdir('plots'):
        os.mkdir('plots')

    # Build the plot manager.  The plot manager keeps track of all the samples
    # and ensures they are correctly normalized w.r.t. luminosity.  See 
    # samples.py for available samples.
    plotter = PlotManager()

    # Add each sample we want to plot/compare
    plotter.add_sample(mySamples.data_ppmux_runs132440to145761, "Muon Data   ", **style.DATA_STYLE)
    plotter.add_sample(mySamples.ppmux_mc, "PPMuX MC", **style.QCD_MC_PYTHIA6_STYLE_HIST)
    plotter.add_sample(mySamples.data_dijet_runs132440to135802, "JetMETTau Data   ", **style.MINBIAS_MC_STYLE )
    plotter.add_sample(mySamples.qcddijet_mc, "QCD MC", **style.QCD_MC_PYTHIA8_STYLE_HIST)

    # Normalize everything to the data luminosity
    plotter.set_integrated_lumi(mySamples.data_ppmux_runs132440to145761.effective_luminosity())

    # Build the ntuple manager
    ntuple_manager = mySamples.data_ppmux_runs132440to145761.build_ntuple_manager("tauIdEffNtuple")

    # Get HLT trigger decisions
#    hlt = ntuple_manager.get_ntuple("TriggerResults")
コード例 #19
0
            logy = False
        )

        phi_resol['result'].GetXaxis().SetTitleOffset(1.2)

        # Make a pave text w/ mean rms
        stat_label = style.make_mean_rms_pave(phi_resol['samples']['mc_ztt']['plot'])
        stat_label.Draw()
    
        canvas.SaveAs("plots/%s%s_phi_resolution.png"%(algorithm,selection["style_name"]))
        canvas.SaveAs("plots/%s%s_phi_resolution.pdf"%(algorithm,selection["style_name"]))
    

if __name__ == "__main__":

    plotter = PlotManager()

    # Add each sample we want to plot/compare
    # Uncomment to add QCD
    plotter.add_sample(samples.ztautau_mc, "Z->#tau#tau MC", **style.QCD_MC_STYLE_HIST)

    # Normalize everything to the data luminosity
    plotter.set_integrated_lumi(samples.data.effective_luminosity())
    
    # Build the ntuple manager
    ntuple_manager = samples.ztautau_mc.build_ntuple_manager("tauIdEffNtuple")

    nTuples = {
        "shrinkingCone": ntuple_manager.get_ntuple("patPFTausDijetTagAndProbeShrinkingCone"),
        "fixedCone": ntuple_manager.get_ntuple("patPFTausDijetTagAndProbeFixedCone"),
        "TaNC": ntuple_manager.get_ntuple("patPFTausDijetTagAndProbeShrinkingCone"),
コード例 #20
0
    canvas_diff.Update()    
    canvas_diff.SaveAs("plots/" + filename + "_diff.png")
    canvas_diff.SaveAs("plots/" + filename + "_diff.pdf")

    canvas_diff.IsA().Destructor(canvas_diff)

if __name__ == "__main__":
    ROOT.gROOT.SetBatch(True)

    if not os.path.isdir('plots'):
        os.mkdir('plots')

    # Build the plot manager.  The plot manager keeps track of all the samples
    # and ensures they are correctly normalized w.r.t. luminosity.  See 
    # samples.py for available samples.
    plotter = PlotManager()

    # Add each sample we want to plot/compare
    plotter.add_sample(sample_qcddijet_mc,   "Simulation", **style.QCD_MC_STYLE_HIST)
    plotter.add_sample(sample_qcddijet_data, "Data",       **style.DATA_STYLE)

    # Normalize everything to the data luminosity
    plotter.set_integrated_lumi(sample_qcddijet_data.effective_luminosity())

    # Build the ntuple manager
    ntuple_manager = sample_qcddijet_data.build_ntuple_manager("tauIdEffNtuple")

    # Get HLT trigger decisions
    hlt_ntuple = ntuple_manager.get_ntuple("patTriggerEvent")
 
    ######################################################
コード例 #21
0
import ROOT
from TauAnalysis.TauIdEfficiency.ntauples.PlotManager import PlotManager
import TauAnalysis.TauIdEfficiency.ntauples.styles as style

# Definition of input files.
import samples_cache as samples
import os
import copy
import sys
from optparse import OptionParser

# Build the plot manager.  The plot manager keeps track of all the samples
# and ensures they are correctly normalized w.r.t. luminosity.  See 
# samples.py for available samples.
plotter = PlotManager()

# Add each sample we want to plot/compare
# Uncomment to add QCD
plotter.add_sample(samples.qcd_mc_pythia8, "Pythia 8", **style.QCD_MC_PYTHIA8_STYLE_HIST)

plotter.add_sample(samples.qcd_mc_pythia6, "Pythia 6", **style.QCD_MC_PYTHIA6_STYLE_HIST)

#plotter.add_sample(samples.minbias_mc, "Minbias MC", **style.MINBIAS_MC_STYLE)

plotter.add_sample(samples.data, "Data", **style.DATA_STYLE)

# Normalize everything to the data luminosity
plotter.set_integrated_lumi(samples.data.effective_luminosity())

# Build the ntuple manager
コード例 #22
0
        custom_LUMI_LABEL_UPPER_LEFT.AddText("Data, L = 8.4nb^{-1}")
        custom_LUMI_LABEL_UPPER_LEFT.Draw()
        style.SQRTS_LABEL_UPPER_LEFT.Draw()
        for extra_label in fakerate_results['calo'][x_var]['extra_labels']:
            extra_label.Draw()

        # Save the plot
        canvas.SaveAs("plots/%s.png" %
                      '_'.join(['fakerate_algo_comparison', 'vs', x_var]))
        canvas.SaveAs("plots/%s.pdf" %
                      '_'.join(['fakerate_algo_comparison', 'vs', x_var]))


if __name__ == "__main__":

    plotter = PlotManager()

    # Add each sample we want to plot/compare
    # Uncomment to add QCD
    plotter.add_sample(samples.qcddijet_mc, "Simulation",
                       **style.QCD_MC_PYTHIA6_STYLE_HIST)

    plotter.add_sample(samples.data_dijet, "Data", **style.DATA_STYLE)

    # Normalize everything to the data luminosity
    plotter.set_integrated_lumi(samples.data_dijet.effective_luminosity())

    # Build the ntuple manager
    ntuple_manager = samples.data_dijet.build_ntuple_manager("tauIdEffNtuple")

    nTuples = {
コード例 #23
0
import ROOT
from TauAnalysis.TauIdEfficiency.ntauples.PlotManager import PlotManager
import TauAnalysis.TauIdEfficiency.ntauples.styles as style
import os
import samples_cache as samples

if __name__ == "__main__":
    ROOT.gROOT.SetBatch(True)

    if not os.path.isdir('plots_Control'):
        os.mkdir('plots_Control')

    # Build the plot manager.  The plot manager keeps track of all the samples
    # and ensures they are correctly normalized w.r.t. luminosity.  See 
    # samples.py for available samples.
    plotter = PlotManager()

    plotter.add_sample(samples.qcd_mc_pythia6, "PYTHIA 6", ** style.QCD_MC_PYTHIA6_STYLE_DOTS)

    plotter.add_sample(samples.qcd_mc_pythia8, "PYTHIA 8", ** style.QCD_MC_PYTHIA8_STYLE_HIST)

    plotter.add_sample(samples.data, "Data", ** style.DATA_STYLE)


    # Normalize everything to the data luminosity
    plotter.set_integrated_lumi(samples.data.effective_luminosity())

    # Build the ntuple maanger
    ntuple_manager = samples.data.build_ntuple_manager("tauIdEffNtuple")

    # Get the shrinking ntuple
コード例 #24
0
    for dijet_dataHLTpath in dijet_dataHLTpaths:
        result_algorithm['%s_diff' % dijet_dataHLTpath]['samples'][samples_dijet_data[dijet_dataHLTpath].name].Draw("epsame")

    canvas_diff.cd()
    canvas_diff.Update()

    canvas_diff.SaveAs(outputFileName[:outputFileName.find(".")] + "_%s_diff.png" % algorithm)
    canvas_diff.SaveAs(outputFileName[:outputFileName.find(".")] + "_%s_diff.pdf" % algorithm)

    return result_algorithm
       
if __name__ == "__main__":

    # define PlotManagers for QCD Monte Carlo and data samples
    plotter_dijet_mc = PlotManager()
    plotter_dijet_mc.add_sample(sample_dijet_mc, "QCDj Simulation",
                                **custom_style_dijet_mc)
    plotters_dijet_data = {}
    for dijet_dataHLTpath in dijet_dataHLTpaths:
        plotter_dijet_data = PlotManager()
        plotter_dijet_data.add_sample(samples_dijet_data[dijet_dataHLTpath], "QCDj Data: %s" % dijet_dataHLTpath,
                                      **custom_styles_dijet_data[dijet_dataHLTpath])
        plotters_dijet_data[dijet_dataHLTpath] = plotter_dijet_data
    
    # Build the ntuple manager
    ntuple_manager = sample_dijet_mc.build_ntuple_manager("tauIdEffNtuple")

    nTuples = {
        "shrinkingCone" : ntuple_manager.get_ntuple("shrinking"),
        "fixedCone"     : ntuple_manager.get_ntuple("fixed"),