Ejemplo n.º 1
0
 def beginJob(self, histFile, histDirName):
     self.sd = ROOT.SoftDropWrapper(self.beta, self.zcut, self.R,
                                    self.ptmin)
     Module.beginJob(self, histFile, histDirName)
     self.addObject(
         ROOT.TH1F('h_ak8sdm_' + self.bname, 'h_ak8sdm_' + self.bname, 25,
                   0, 250))
Ejemplo n.º 2
0
    def beginJob(self, histFile=None, histDirName=None):
        Module.beginJob(self, histFile, histDirName)
        self.event = 0
        self.hists = {}
        self.hists["Nevents"] = ROOT.TH1F("Nevents", "Nevents", 1, 0, 1)
        #self.hists["Acceptance"] = ROOT.TH1F("Acceptance", "Acceptance", 5, -0.5, 4.5)
        #self.hists["genH_pt"] = ROOT.TH1F("genH_pt", ";generator H p_{T} (GeV)", 100, 0., 100.)
        #self.hists["genH_eta"] = ROOT.TH1F("genH_eta", ";generator H #eta", 100, -5., 5.)
        #self.hists["genH_phi"] = ROOT.TH1F("genH_phi", ";generator H #phi", 100, -3.15, 3.15)
        #self.hists["genH_mass"] = ROOT.TH1F("genH_mass", ";generator H mass", 300, 0., 150.)
        #self.hists["genJPsi_pt"] = ROOT.TH1F("genJPsi_pt", ";generator J/#Psi p_{T} (GeV)", 100, 0., 100.)
        #self.hists["genJPsi_eta"] = ROOT.TH1F("genJPsi_eta", ";generator J/#Psi #eta", 100, -5., 5.)
        #self.hists["genJPsi_phi"] = ROOT.TH1F("genJPsi_phi", ";generator J/#Psi #phi", 100, -3.15, 3.15)
        #self.hists["genJPsi_mass"] = ROOT.TH1F("genJPsi_mass", ";generator J/#Psi mass", 200, 0., 4.)
        #self.hists["genPhoton_pt"] = ROOT.TH1F("genPhoton_pt", ";generator #gamma p_{T} (GeV)", 100, 0., 100.)
        #self.hists["genPhoton_eta"] = ROOT.TH1F("genPhoton_eta", ";generator #gamma #eta", 100, -5., 5.)
        #self.hists["genMuon1_pt"] = ROOT.TH1F("genMuon1_pt", ";generator #mu^{-} p_{T} (GeV)", 100, 0., 100.)
        #self.hists["genMuon1_eta"] = ROOT.TH1F("genMuon1_eta", ";generator #mu^{-} #eta", 100, -5., 5.)
        #self.hists["genMuon2_pt"] = ROOT.TH1F("genMuon2_pt", ";generator #mu^{+} p_{T} (GeV)", 100, 0., 100.)
        #self.hists["genMuon2_eta"] = ROOT.TH1F("genMuon2_eta", ";generator #mu^{+} #eta", 100, -5., 5.)

        #self.hists["genCosThetaStar"] = ROOT.TH1F("genCosThetaStar", ";cos #theta^{*}", 100, -1., 1.)
        #self.hists["genCosTheta1"] = ROOT.TH1F("genCosTheta1", ";cos #theta_{1}", 100, -1., 1.)
        #self.hists["genPhi1"] = ROOT.TH1F("genPhi1", ";#Phi_{1}", 100, -3.1415, 3.1415)
        #self.hists["genCosThetaStarZtoMM"] = ROOT.TH1F("genCosThetaStarZtoMM", ";cos #theta^{*}", 100, -1., 1.)

        self.hists["Cutflow"] = ROOT.TH1F("Cutflow", "Cutflow", 10, -0.5, 9.5)
        self.hists["Cutflow"].GetXaxis().SetBinLabel(1, "All events")
        self.hists["Cutflow"].GetXaxis().SetBinLabel(2, "Acceptance")
        #        self.addObject(self.h_events)
        #        self.h_events.SetDirectory
        self.verbose = -1
Ejemplo n.º 3
0
    def beginJob(self, histFile=None, histDirName=None):
        Module.beginJob(self, histFile, histDirName)
        rbins = arr('f', (i * 0.01 for i in range(300)))
        ptbins = arr('f', (10, 20, 30, 40, 50, 60, 80, 100, 150, 200, 250, 300,
                           350, 400, 500, 600, 700, 800, 900, 1000, 2000))
        etabins = arr(
            'f', (-1.305, -1.218, -1.131, -1.044, -0.957, -0.879, -0.783,
                  -0.696, -0.609, -0.522, -0.435, -0.348, -0.261, -0.174,
                  -0.087, 0, 0.087, 0.174, 0.261, 0.348, 0.435, 0.522, 0.609,
                  0.696, 0.783, 0.879, 0.957, 1.044, 1.131, 1.218, 1.305))
        num_rbins = int(len(rbins) - 1)
        num_ptbins = int(len(ptbins) - 1)
        num_etabins = int(len(etabins) - 1)

        self.h_recoJetpT = ROOT.TH1F('recoJet_pT', 'recoJet_pT', 200, 0, 2000)
        self.addObject(self.h_recoJetpT)

        self.h_genJetpT = ROOT.TH1F('genJet_pT', 'genJet_pT', 200, 0, 2000)
        self.addObject(self.h_genJetpT)

        self.h_Response = ROOT.TH1F('Response', 'Response', 300, 0, 3)
        self.addObject(self.h_Response)

        self.h_pT_v_corrFac = ROOT.TH2F('pT_v_corrFac', 'pT_v_corrFac',
                                        num_ptbins, ptbins, num_rbins, rbins)
        self.addObject(self.h_pT_v_corrFac)

        self.h_genpT_v_R = ROOT.TH2F('genpT_v_R', 'genpT_v_R', num_ptbins,
                                     ptbins, num_rbins, rbins)
        self.addObject(self.h_genpT_v_R)

        self.h_recoEta_v_R = ROOT.TH2F('recoEta_v_R', 'recoEta_v_R',
                                       num_etabins, etabins, num_rbins, rbins)
        self.addObject(self.h_recoEta_v_R)
Ejemplo n.º 4
0
  def beginJob(self, histFile, histDirName):
    Module.beginJob(self, histFile, histDirName)
    self.h_cutflow_uw = ROOT.TH1F('h_cutflow_uw','h_cutflow_uw', 15, 0, 15)
    self.h_cutflow_uw.GetXaxis().SetBinLabel(1,"NoSelection")
    self.h_cutflow_uw.GetXaxis().SetBinLabel(2,"passPreselTrig")
    self.h_cutflow_uw.GetXaxis().SetBinLabel(3,"passPreselNMuon")
    self.h_cutflow_uw.GetXaxis().SetBinLabel(4,"pass2LooseMuons")
    self.h_cutflow_uw.GetXaxis().SetBinLabel(5,"pass2TightMuons")
    self.h_cutflow_uw.GetXaxis().SetBinLabel(6,"passTrigMatch")
    self.h_cutflow_uw.GetXaxis().SetBinLabel(7,"passKinCuts")
    self.h_cutflow_uw.GetXaxis().SetBinLabel(8,"passZBosonMass")
    self.h_cutflow_uw.GetXaxis().SetBinLabel(9,"passAtLeast1Jet")
    self.addObject(self.h_cutflow_uw)

    self.h_cutflow_w  = ROOT.TH1F('h_cutflow_w', 'h_cutflow_w',  15, 0, 15)
    self.h_cutflow_w.GetXaxis().SetBinLabel(1,"NoSelection")
    self.h_cutflow_w.GetXaxis().SetBinLabel(2,"passPreselTrig")
    self.h_cutflow_w.GetXaxis().SetBinLabel(3,"passPreselNMuon")
    self.h_cutflow_w.GetXaxis().SetBinLabel(4,"pass2LooseMuons")
    self.h_cutflow_w.GetXaxis().SetBinLabel(5,"pass2TightMuons")
    self.h_cutflow_w.GetXaxis().SetBinLabel(6,"passTrigMatch")
    self.h_cutflow_w.GetXaxis().SetBinLabel(7,"passKinCuts")
    self.h_cutflow_w.GetXaxis().SetBinLabel(8,"passZBosonMass")
    self.h_cutflow_w.GetXaxis().SetBinLabel(9,"passAtLeast1Jet")
    self.addObject(self.h_cutflow_w)
Ejemplo n.º 5
0
 def beginJob(self,histFile=None,histDirName=None):
     Module.beginJob(self,histFile,histDirName)
     
     self.h_lumiblock = ROOT.TH1I('h_lumiblock', 'lumiblock',   100, 0, 1000)
     self.addObject(self.h_lumiblock)
     self.h_run = ROOT.TH1D('h_run', 'runs', 100, 273.0, 280.0)
     self.addObject(self.h_run)
Ejemplo n.º 6
0
    def beginJob(self,histFile=None,histDirName=None):
        self.hName = histFile
        if histFile == None or histDirName == None:
            self.fillHists = False
            Module.beginJob(self, None, None)
        else:
            self.fillHists = True

            Module.beginJob(self,histFile,histDirName)
            self.stitchPlot_PCond_nGenJets = ROOT.TH1D("stitchPlot_PCond_nGenJets", "nGenJet (pt > 30) Pass condition; nGenJets; Events", 18, 2, 20)
            self.addObject(self.stitchPlot_PCond_nGenJets)
            self.stitchPlot_PCond_GenHT = ROOT.TH1D("stitchPlot_PCond_GenHT", "GenHT (pt > 30, |#eta| < 2.4) Pass condition; Gen HT (GeV); Events", 500, 200, 1200)
            self.addObject(self.stitchPlot_PCond_GenHT)
            self.stitchPlot_PCond_nGenLeps = ROOT.TH1D("stitchPlot_PCond_nGenLeps", "nGenLeps (LHE level) Pass condition; nGenLeps; Events", 10, 0, 10)
            self.addObject(self.stitchPlot_PCond_nGenLeps)
            self.stitchPlot_PCond_AllVar = ROOT.TH3D("stitchPlot_PCond_AllVar", "nGenLeps, nGenJets, GenHT Pass condition; nGenLeps; nGenJets; GenHT ", 
                                                 6, 0, 6, 6, 5, 12, 12, 300., 600.)
            self.addObject(self.stitchPlot_PCond_AllVar)

            self.stitchPlot_FCond_nGenJets = ROOT.TH1D("stitchPlot_FCond_nGenJets", "nGenJet (pt > 30) Fail condition; nGenJets; Events", 18, 2, 20)
            self.addObject(self.stitchPlot_FCond_nGenJets)
            self.stitchPlot_FCond_GenHT = ROOT.TH1D("stitchPlot_FCond_GenHT", "GenHT (pt > 30, |#eta| < 2.4) Fail condition; Gen HT (GeV); Events", 500, 200, 1200)
            self.addObject(self.stitchPlot_FCond_GenHT)
            self.stitchPlot_FCond_nGenLeps = ROOT.TH1D("stitchPlot_FCond_nGenLeps", "nGenLeps (LHE level) Fail condition; nGenLeps; Events", 10, 0, 10)
            self.addObject(self.stitchPlot_FCond_nGenLeps)
            self.stitchPlot_FCond_AllVar = ROOT.TH3D("stitchPlot_FCond_AllVar", "nGenLeps, nGenJets, GenHT  Fail condition; nGenLeps; nGenJets; GenHT ",
                                                 6, 0, 6, 6, 5, 12, 12, 300., 600.)
            self.addObject(self.stitchPlot_FCond_AllVar)
    def beginJob(self, histFile=None, histDirName=None):
        """ Initialise histograms to be used and saved in output file. """

        # - Run beginJob() of Module
        Module.beginJob(self, histFile, histDirName)
        for key , tg in self.trigLst.iteritems():
            for lep, lepton  in {"Mu":"Muon", "El":"Electron"}.iteritems():
                if lep == "El" and "Mu" in key : continue
                if lep == "Mu" and "El" in key : continue
                self.h[lep + key + "_HT"] =  ROOT.TH1D( "h_" + lep + "_HT_" + key, tg + " in " + lepton + "channel; H_{T} / GeVc^{-1} ;Number of Events", 300, 0, 3000)
                self.h[lep + key + "_pt"] = ROOT.TH1D( "h_" + lep + "_pt_" + key, tg + " in " + lepton + "channel; Lepton p_{T} / GeVc^{-1};Number of Events", 300, 0, 300)
                self.h[lep + key + "_lepEta"] = ROOT.TH1D( "h_" + lep + "_lepEta_" + key, tg + " in " + lepton + "channel;Jet #eta ;Number of Events", 100, -6, 8)
                self.h[lep + key + "_lepPhi"] = ROOT.TH1D( "h_" + lep + "_lepPhi_" + key, tg + " in " + lepton + "channel; Jet #phi;Number of Events", 100, -6, 8)
                self.h[lep + key + "_jetEta"] = ROOT.TH1D( "h_" + lep + "_jetEta_" + key, tg + " in " + lepton + "channel; Lepton #eta;Number of Events", 100, -6, 8)
                self.h[lep + key + "_jetPhi"] = ROOT.TH1D( "h_" + lep + "_jetPhi_" + key, tg + " in " + lepton + "channel; Lepton #phi;Number of Events", 100, -6, 8)
                self.h[lep + key + "_nJet"] = ROOT.TH1D( "h_" + lep + "_nJet_" + key, tg + " in " + lepton + "channel; Number of Jets;Number of Events", 20, 0, 20)
                self.h[lep + key + "_nBJet"] = ROOT.TH1D( "h_" + lep + "_nBJet_" + key, tg + " in " + lepton + "channel; Number of b-tagged Jets;Number of Events", 20, 0, 20)
                self.addObject(self.h[lep + key + "_HT"])
                self.addObject(self.h[lep + key + "_pt"])
                self.addObject(self.h[lep + key + "_lepEta"])
                self.addObject(self.h[lep + key + "_lepPhi"])
                self.addObject(self.h[lep + key + "_jetEta"])
                self.addObject(self.h[lep + key + "_jetPhi"])
                self.addObject(self.h[lep + key + "_nJet"])
                self.addObject(self.h[lep + key + "_nBJet"])
Ejemplo n.º 8
0
    def beginJob(self, histFile, histDirName):
        self.sd = ROOT.SoftDropWrapper(self.beta, self.zcut, self.R,
                                       self.ptmin)
        Module.beginJob(self, histFile, histDirName)
        #self.addObject(ROOT.TH1F('h_ak8sdm_'+self.bname,   'h_ak8sdm_'+self.bname, 25, 0, 250) )
        self.binsGen = array.array(
            'd',
            [0., 1., 5., 10., 15., 20., 25., 30., 35., 40., 45., 50., 100.])
        self.nGen = len(self.binsGen) - 1
        self.binsDet = array.array('d', [
            0., 0.5, 1., 3., 5., 7.5, 10., 12.5, 15., 17.5, 20., 22.5, 25.,
            27.5, 30., 32.5, 35., 37.5, 40., 42.5, 45., 47.5, 50., 75., 100.
        ])
        self.nDet = len(self.binsDet) - 1
        self.nDetSD = len(self.binsDet) - 1  #18
        self.nGenSD = len(self.binsGen) - 1  #9

        self.resp0 = ROOT.TH2D('h_response_' + self.bname,
                               'h_response_' + self.bname, self.nDetSD,
                               self.binsDet, self.nGenSD, self.binsGen)
        self.reco0 = ROOT.TH1D('h_reco_' + self.bname, 'h_reco_' + self.bname,
                               self.nDetSD, self.binsDet)
        self.gen0 = ROOT.TH1D('h_gen_' + self.bname, 'h_gen_' + self.bname,
                              self.nGenSD, self.binsGen)
        self.fake0 = ROOT.TH1D('h_fake_' + self.bname, 'h_fake_' + self.bname,
                               self.nDetSD, self.binsDet)
        self.miss0 = ROOT.TH1D('h_miss_' + self.bname, 'h_miss_' + self.bname,
                               self.nGenSD, self.binsGen)

        self.addObject(self.resp0)
        self.addObject(self.reco0)
        self.addObject(self.gen0)
        self.addObject(self.fake0)
        self.addObject(self.miss0)
        print "Create histograms"
Ejemplo n.º 9
0
 def beginJob(self,histFile=None,histDirName=None):
     Module.beginJob(self,histFile,histDirName)
     self.h_passreftrig  = ROOT.TH1F("h_passreftrig" , "; passed ref trigger" , 2 , 0. , 2. )
     self.h_met_all      = ROOT.TH1F("h_met_all" , "; E_{T}^{miss} [GeV]" , 40, 100., 500. )
     self.h_met_passtrig = ROOT.TH1F("h_met_passtrig" , "; E_{T}^{miss} [GeV]" , 40, 100., 500. )
     self.addObject(self.h_passreftrig )
     self.addObject(self.h_met_all )
     self.addObject(self.h_met_passtrig )
Ejemplo n.º 10
0
 def beginJob(self,histFile=None,histDirName=None):
     Module.beginJob(self,histFile,histDirName)
     self.h_PUDist = {}
     for subname in self.subnames:
         self.h_PUDist[subname]=ROOT.TH1F('h_PUDist_'+subname,   'Pileup Distribution ({0:s})'.format(subname),   200, 0, 200)
         self.h_PUDist[subname+'_v_True']=ROOT.TH2F('h_PUDist_'+subname+'_v_True',   'Pileup Distribution versus True Pileup ({0:s}); npvs; True Pileup'.format(subname),   200, 0, 200, 200, 0, 200)
         self.addObject(self.h_PUDist[subname])
         self.addObject(self.h_PUDist[subname+'_v_True'])
Ejemplo n.º 11
0
    def beginJob(self, histFile=None, histDirName=None):
        Module.beginJob(self, histFile, histDirName)

        self.h_rawmet = ROOT.TH1F('rawmet', 'rawmet', 25, 0, 500)
        self.h_pfmet = ROOT.TH1F('pfmet', 'pfmet', 25, 0, 500)
        self.h_puppimet = ROOT.TH1F('puppimet', 'puppimet', 25, 0, 500)
        self.addObject(self.h_rawmet)
        self.addObject(self.h_pfmet)
        self.addObject(self.h_puppimet)
Ejemplo n.º 12
0
 def beginJob(self, histFile, histDirName):
     """Book control histograms and the predictions for the background.
     The background is data-driven and estimated by weighting the 1-tag region
     by the mistag rate to extrapolate to the 2-tag region. 
     """
     Module.beginJob(self, histFile, histDirName)
     for itrig,jtrig in zip(self.triggerpaths,self.triggerprescale):
         self.addObject (ROOT.TH1F('h_ak4pt_' + itrig,                     'h_ak4pt_' + itrig,   5, 0, 1000) )
         self.addObject (ROOT.TH1F('h_ak4pt_' + itrig + '_eff_' + jtrig,   'h_ak4pt_' + jtrig,   5, 0, 1000) )
Ejemplo n.º 13
0
 def beginJob(self,histFile=None,histDirName=None):
     Module.beginJob(self,histFile,histDirName)
     self.h_genweight = ROOT.TH1F('h_genweight', 'h_genweight', 10, 0, 9)
     self.h_q2weight = ROOT.TH1F('h_q2weight', 'h_q2weight', 8, 0, 7)
     self.h_psweight = ROOT.TH1F('h_psweight', 'h_psweight', 4, 0, 3)
     self.h_PDFweight = ROOT.TH1F()
     self.addObject(self.h_genweight)
     self.addObject(self.h_q2weight)
     self.addObject(self.h_psweight)
     self.addObject(self.h_PDFweight)
Ejemplo n.º 14
0
    def beginJob(self,histFile=None,histDirName=None):
        Module.beginJob(self,histFile,histDirName)

        # --------------------------------------------------------------------------
        # here we can define some histograms
        # --------------------------------------------------------------------------

        self.h_lep_pt = ROOT.TH1F('lep_pt', '; Lepton p_{T} (GeV); Number of leptons', 100, 0, 100)
        self.h_lep_pt.SetLineColor(1)
        self.addObject(self.h_lep_pt)
Ejemplo n.º 15
0
    def beginJob(self, histFile, histDirName):
        Module.beginJob(self, histFile, histDirName)

        self.isttbar = False
        if 'TTJets_' in histFile:
            self.isttbar = True

        ### Set bins for Pt dependent scale factor calculation

        self.TopcandPtBins = [[200, 300], [300, 400], [400, 500], [500, -1]]
        # e.g. h_WcandSubjetpt_Tptbin0 is a 1D histogram for W candidate subjets (most massive SD subjet) within Top candidates of pt 200-300 GeV

        self.WcandPtBins = [[200, 300], [300 - 500], [500, -1]]
        # e.g. h_WcandSubjetpt_ptbin0 1D histogram is for W candidate subjets (most massive SD subjet) with pt 200-300 GeV

        self.minMupt = 53.
        self.maxMuEta = 2.4
        self.maxRelIso = 0.1
        self.minMuMETPt = 40.

        ### Figure our tree branch for HighPtMuon ???
        #is High Pt

        #remove  AK8 jet within 1.0 of lepton
        self.mindRLepJet = 1.0
        #veto:
        # High pT muon ID
        #pT > 20 GeV, eta < 2.4??
        #relIso < 0.1

        self.minElpt = 120.
        self.minElMETPt = 80.
        #self.goodElEta = if eta < 1.44, 1.56 < eta < 2.5
        # HEEP v7 + iso
        #veto
        # HEEP + iso pt > 35 remove ecal crack region eta < 1.44, 1.56 < eta < 2.5
        #

        self.minLepWPt = 150.

        self.minJetPt = 350.
        self.maxJetEta = 2.4
        self.minTopmass = 105.
        self.maxTopmass = 250.
        self.maxtau32Top = 0.7

        self.minBDisc = 0.8484
        ### Medium https://twiki.cern.ch/twiki/bin/view/CMS/BtagRecommendation80XReReco

        #>= 1 CSVmedium akt4 jet
        self.minAK4Pt = 50.

        ### 2-D cut ###
        self.mindRlepAK4 = 0.4
        self.minPtRel_lepAK4 = 30.
Ejemplo n.º 16
0
    def beginJob(self, histFile=None, histDirName=None):
        Module.beginJob(self, histFile, histDirName)
        self.h_cutflow_uw = ROOT.TH1F('h_cutflow_uw', 'h_cutflow_uw', 6, 0, 6)
        self.h_cutflow_w = ROOT.TH1F('h_cutflow_w', 'h_cutflow_w', 6, 0, 6)
        self.h_cutflow_uw.GetXaxis().SetBinLabel(1, "Cut0:NoSelection")
        self.h_cutflow_uw.GetXaxis().SetBinLabel(2, "Cut1:>=2LooseMuon")
        self.h_cutflow_w.GetXaxis().SetBinLabel(1, "Cut0:NoSelection")
        self.h_cutflow_w.GetXaxis().SetBinLabel(2, "Cut1:>=2LooseMuon")

        self.addObject(self.h_cutflow_uw)
        self.addObject(self.h_cutflow_w)
Ejemplo n.º 17
0
    def beginJob(self,histFile=None,histDirName=None):
        Module.beginJob(self,histFile,histDirName)

        pt_thresholds           = [200,300,400,500,600,2000]

        # 1D hists
        self.h_FatJet_pt_all    = ROOT.TH1F("FatJet_pt_all",    "", len(pt_thresholds)-1, array.array('d',pt_thresholds))
        self.h_FatJet_pt_pass   = ROOT.TH1F("FatJet_pt_pass",   "", len(pt_thresholds)-1, array.array('d',pt_thresholds))

        for o in [self.h_FatJet_pt_all, self.h_FatJet_pt_pass]:
            self.addObject(o)
Ejemplo n.º 18
0
    def beginJob(self, histFile, histDirName):
        """Book control histograms and the predictions for the background.

        The background is data-driven and estimated by weighting the 1-tag region
        by the mistag rate to extrapolate to the 2-tag region. 
        """
        Module.beginJob(self, histFile, histDirName)
        self.addObject(ROOT.TH1F('h_ak4ht', 'h_ak4ht', 25, 0, 5000))
        self.addObject(ROOT.TH1F('h_ak8pt', 'h_ak8pt', 25, 0, 2500))
        self.addObject(ROOT.TH1F('h_ak8msd', 'h_ak8msd', 25, 0, 500))
        self.addObject(ROOT.TH1F('h_ak8tau32', 'h_ak8tau32', 25, 0, 1.0))
        self.addObject(ROOT.TH1F('h_ak8n3b1', 'h_ak8n3b1', 25, 0, 5.0))
        self.addObject(ROOT.TH1F('h_mttbar', 'h_mttbar', 25, 0, 5000))
Ejemplo n.º 19
0
    def beginJob(self, histFile, histDirName):
        """Book control histograms and the predictions for the background.

        The background is data-driven and estimated by weighting the 1-tag region
        by the mistag rate to extrapolate to the 2-tag region. 
        """
        Module.beginJob(self, histFile, histDirName)
        for itrig,jtrig in self.trigTurnonList.iteritems():
            self.addObject (ROOT.TH1F('h_ak4ht_' + itrig,                     'h_ak4ht_' + itrig,   25, 0, 5000) )
            self.addObject (ROOT.TH1F('h_ak4ht_' + itrig + '_eff_' + jtrig,   'h_ak4ht_' + jtrig,   25, 0, 5000) )

        self.addObject (ROOT.TH1F('h_ak4ht_tot',     'h_ak4ht_' + itrig,   25, 0, 5000) )
        self.addObject (ROOT.TH1F('h_ak4ht_eff_tot', 'h_ak4ht_' + jtrig,   25, 0, 5000) )
Ejemplo n.º 20
0
 def beginJob(self, histFile=None, histDirName=None):
     Module.beginJob(self, histFile, histDirName)
     self.weightcounter = [0, 0]
     if histFile and histDirName:
         self.h_proc = ROOT.TH1I(
             'h_proc',
             'Initial pp interacting partons; interaction type; Events', 1,
             0, 1)
         self.addObject(self.h_proc)
         self.h_bfcount = ROOT.TH1I(
             'h_bfcount',
             'Count of first b quarks in event; number of b quarks descended from top quarks; frequency',
             10, 0, 10)
         self.addObject(self.h_bfcount)
         self.h_bfpcount = ROOT.TH1I(
             'h_bfpcount',
             'Count of first b quarks in event after pruning; number of b quarks descended from top quarks with sibling W; frequency',
             10, 0, 10)
         self.addObject(self.h_bfpcount)
         self.h_Wfcount = ROOT.TH1I(
             'h_Wfcount',
             'Count of first W bosons in event; number of W bosons directly descended from top quarks; frequency',
             10, 0, 10)
         self.addObject(self.h_Wfcount)
         self.h_TopSystemPt = {}
         self.h_bSystemCorr = {}
         self.h_bSystemCorrMom = {}
         for proc in ["qq", "gg", "All"]:
             self.h_TopSystemPt[proc] = {}
             self.h_bSystemCorr[proc] = {}
             self.h_bSystemCorrMom[proc] = {}
             for i in xrange(4):
                 self.h_TopSystemPt[proc][i] = ROOT.TH3F(
                     'h_TopSystemPt_{0:d}_{1:s}'.format(i + 1, proc),
                     'Top Sys Pt (R{0:d} t pt); Top_Pt (GeV); Bottom_Pt (GeV); W_Pt (GeV)'
                     .format(i + 1), 50, 0, 1000, 200, 0, 1000, 200, 0,
                     1000)
                 #200, 0, 1000, 200, 0, 1000, 200, 0, 1000)
                 self.addObject(self.h_TopSystemPt[proc][i])
                 self.h_bSystemCorr[proc][i] = ROOT.TH3F(
                     'h_bSystemCorr_{0:d}_{1:s}'.format(i + 1, proc),
                     'b Sys Correlations (R{0:d} t pt);|#eta_t - #eta_b|; Bottom_Pt (GeV); #Theta(t, b)'
                     .format(i + 1), 100, 0, 4, 1000, 0, 1000, 100, 0,
                     math.pi)
                 self.addObject(self.h_bSystemCorr[proc][i])
                 self.h_bSystemCorrMom[proc][i] = ROOT.TH3F(
                     'h_bSystemCorrMom_{0:d}_{1:s}'.format(i + 1, proc),
                     'b Sys Correlations (R{0:d} t pt);|#eta_b|; Bottom_Pt (GeV); Bottom_P()'
                     .format(i + 1), 100, 0, 4, 250, 0, 500, 250, 0, 500)
                 self.addObject(self.h_bSystemCorrMom[proc][i])
Ejemplo n.º 21
0
    def beginJob(self, histFile=None, histDirName=None):
        Module.beginJob(self, histFile, histDirName)

        self.h_dimuonmass = ROOT.TH1F("dimuon_mass", "dimuon_mass", 60, 60,
                                      120)
        self.h_zpt = ROOT.TH1F("z_pt", "z pt", 60, 0, 60)
        self.h_rawmet = ROOT.TH1F('rawmet', 'rawmet', 100, 0, 50)
        self.h_pfmet = ROOT.TH1F('pfmet', 'pfmet', 100, 0, 50)
        self.h_puppimet = ROOT.TH1F('puppimet', 'puppimet', 100, 0, 50)
        self.addObject(self.h_dimuonmass)
        self.addObject(self.h_zpt)
        self.addObject(self.h_rawmet)
        self.addObject(self.h_pfmet)
        self.addObject(self.h_puppimet)
Ejemplo n.º 22
0
 def beginJob(self, histFile=None, histDirName=None):
     if self.fillHists == False and self.writehistFile == False:
         Module.beginJob(self, None, None)
     else:
         if histFile == None or histDirName == None:
             raise RuntimeError(
                 "fillHists set to True, but no histFile or histDirName specified"
             )
         ###Inherited from Module
         prevdir = ROOT.gDirectory
         self.histFile = histFile
         self.histFile.cd()
         self.dir = self.histFile.mkdir(histDirName + "_JetMETLogic")
         prevdir.cd()
         self.objs = []
    def beginJob(self, histFile=None, histDirName=None):
        Module.beginJob(self, histFile, histDirName)
        self.h_cutflow_uw = ROOT.TH1F('h_cutflow_uw', 'h_cutflow_uw', 10, 0,
                                      10)
        self.h_cutflow_w = ROOT.TH1F('h_cutflow_w', 'h_cutflow_w', 10, 0, 10)
        self.h_cutflow_uw.GetXaxis().SetBinLabel(1, "Cut0:NoSelection")
        self.h_cutflow_uw.GetXaxis().SetBinLabel(2, "Cut1:>=1LooseLeptons")
        self.h_cutflow_uw.GetXaxis().SetBinLabel(3, "Cut2:>=1LooseFatJets")

        self.h_cutflow_w.GetXaxis().SetBinLabel(1, "Cut0:NoSelection")
        self.h_cutflow_w.GetXaxis().SetBinLabel(2, "Cut1:>=1LooseLeptons")
        self.h_cutflow_w.GetXaxis().SetBinLabel(3, "Cut2:>=1LooseFatJets")

        self.addObject(self.h_cutflow_uw)
        self.addObject(self.h_cutflow_w)
Ejemplo n.º 24
0
    def beginJob(self, histFile=None, histDirName=None):
        Module.beginJob(self,histFile,histDirName)
        
        self.hist_b = createEfficiencyMap('%s_%s_%s'%(self.tagger,'b',self.wp))
        self.hist_c = createEfficiencyMap('%s_%s_%s'%(self.tagger,'c',self.wp))
        self.hist_udsg = createEfficiencyMap('%s_%s_%s'%(self.tagger,'udsg',self.wp))
        self.hist_b_all = createEfficiencyMap('%s_%s_%s_all'%(self.tagger,'b',self.wp))
        self.hist_c_all = createEfficiencyMap('%s_%s_%s_all'%(self.tagger,'c',self.wp))
        self.hist_udsg_all = createEfficiencyMap('%s_%s_%s_all'%(self.tagger,'udsg',self.wp))

        self.addObject(self.hist_b)
        self.addObject(self.hist_c)
        self.addObject(self.hist_udsg)
        self.addObject(self.hist_b_all)
        self.addObject(self.hist_c_all)
        self.addObject(self.hist_udsg_all)
Ejemplo n.º 25
0
 def beginJob(self, histFile=None,histDirName=None):
     #if self.writeHistFile=False, called by the postprocessor as beginJob()
     #If self.writeHistFile=True, then called as beginJob(histFile=self.histFile,histDirName=self.histDirName)
     Module.beginJob(self,histFile,histDirName)
     # if self.makeHistos:
     #     self.h_cutHisto = ROOT.TH1F('h_cutHisto', ';Pruning Point in Event Selection; Events', 10, 0, 10)
     #     self.addObject(self.h_cutHisto)
     #     self.h_jSel_map = ROOT.TH2F('h_jSel_map', ';Jet Eta;Jet Phi', 40, -2.5, 2.5, 20, -3.14, 3.14)
     #     self.addObject(self.h_jSel_map)
     #     self.h_jSel_pt = ROOT.TH1F('h_jSel_pt', ';Jet Pt; Events', 20, 20, 420)
     #     self.addObject(self.h_jSel_pt)
     #     self.h_jBSel_map = ROOT.TH2F('h_jBSel_map', ';Jet Eta;Jet Phi', 40, -2.5, 2.5, 20, -3.14, 3.14)
     #     self.addObject(self.h_jBSel_map)
     #     self.h_jBSel_pt = ROOT.TH1F('h_jBSel_pt', ';Jet Pt; Events', 20, 20, 420)
     #     self.addObject(self.h_jBSel_pt)
         # self.h_medCSVV2 = ROOT.TH1D('h_medCSVV2', ';Medium CSVV2 btags; Events', 5, 0, 5)
         # self.addObject(self.h_medCSVV2)
     pass
Ejemplo n.º 26
0
 def beginJob(self, histFile=None, histDirName=None):
     Module.beginJob(self, histFile, histDirName + self.subname)
     self.h_PUDist = {}
     self.h_PUDist[self.subname] = ROOT.TH1F(
         'h_PUDist_' + self.subname,
         'Pileup Distribution ({0:s})'.format(self.subname), 200, 0, 200)
     self.h_PUDist[self.subname + '_v_True'] = ROOT.TH2F(
         'h_PUDist_' + self.subname + '_v_True',
         'Pileup Distribution versus True Pileup ({0:s}); nPV - 1; True Pileup'
         .format(self.subname), 200, 0, 200, 200, 0, 200)
     self.addObject(self.h_PUDist[self.subname])
     self.addObject(self.h_PUDist[self.subname + '_v_True'])
     self.h_GenWeight = {}
     self.h_GenWeight[self.subname] = ROOT.TH1F(
         'h_GenWeight_' + self.subname,
         'Generator Weight ({0:s})'.format(self.subname), 200000, -0.100,
         0.100)
     self.addObject(self.h_GenWeight[self.subname])
Ejemplo n.º 27
0
 def beginJob(self, histFile=None, histDirName=None):
     Module.beginJob(self, histFile, histDirName)
     if histFile and histDirName:
         self.writingHistFile = True
         self.ntup = ROOT.TNtuple(self.ntupName, self.ntupTitle,
                                  self.ntupVars)
         self.addObject(self.ntup)
         self.h_PUDist = {}
         for subname in self.subnames:
             self.h_PUDist[subname] = ROOT.TH1F(
                 'h_PUDist_' + subname,
                 'Pileup Distribution ({0:s})'.format(subname), 200, 0, 200)
             self.h_PUDist[subname + '_v_True'] = ROOT.TH2F(
                 'h_PUDist_' + subname + '_v_True',
                 'Pileup Distribution versus True Pileup ({0:s}); npvs; True Pileup'
                 .format(subname), 200, 0, 200, 200, 0, 200)
             self.addObject(self.h_PUDist[subname])
             self.addObject(self.h_PUDist[subname + '_v_True'])
Ejemplo n.º 28
0
    def beginJob(self, histFile=None, histDirName=None):
        Module.beginJob(self, histFile, histDirName)

        self.addObject(self.h_mass_res)
        self.addObject(self.h_rap_diff)
        self.addObject(self.h_pt_res)
        self.addObject(self.h_phi_diff)
        self.addObject(self.h_phi_res)
        self.addObject(self.h_dphi_diff)
        self.addObject(self.h_eta_res)
        self.addObject(self.h_eta_diff)
        self.addObject(self.h_ratio_diff)
        self.addObject(self.h_diphpt_diff)
        self.addObject(self.h_xi_res)
        self.addObject(self.h_logxi_diff)
        self.addObject(self.h_pro_xi_res)
        self.addObject(self.h_pro_xi_diff)
        self.addObject(self.h_pro_xi_gen)
        self.addObject(self.h_pro_xi_gen_twopro)
Ejemplo n.º 29
0
    def beginJob(self, histFile=None, histDirName=None):
        if self.fillHists == False and self.writehistFile == False:
            Module.beginJob(self, None, None)
        else:
            if histFile == None or histDirName == None:
                raise RuntimeError(
                    "fillHists set to True, but no histFile or histDirName specified"
                )
            ###Inherited from Module
            prevdir = ROOT.gDirectory
            self.histFile = histFile
            self.histFile.cd()
            self.dir = self.histFile.mkdir(histDirName + "_JetMETLogic")
            prevdir.cd()
            self.objs = []

            # self.JetMETLogic_Freq = {}
            # self.JetMETLogic_Correl = {}
            self.JetMETLogic_FailBits = {}
            self.JetMETLogic_FailFirst = {}
            for lvl in ["baseline", "selection"]:
                # self.JetMETLogic_Freq[lvl] = ROOT.TH1D("JetMETLogic_Freq_{}".format(lvl),
                #                                      "HLT Paths Fired and Vetoed at {} level  (weightMagnitude={}); Type; Events".format(lvl, self.weightMagnitude),
                #                                      1, 0, 0)
                # self.JetMETLogic_Correl[lvl] = ROOT.TH2D("JetMETLogic_Correl_{}".format(lvl),
                #                                          "Fired HLT Path Correlations at {} level (weightMagnitude={}); Path; Path ".format(lvl, self.weightMagnitude),
                #                                          self.PathsBins, self.PathsMin, self.PathsMax, self.PathsBins, self.PathsMin, self.PathsMax)
                self.JetMETLogic_FailBits[lvl] = ROOT.TH1D(
                    "JetMETLogic_FailBits_{}".format(lvl),
                    "Failed JetMETLogic selection (any bits) at {} level (weightMagnitude={}); Path; Least significant bit power"
                    .format(lvl, self.weightMagnitude), self.BitsBins,
                    self.BitsMin, self.BitsMax)
                self.JetMETLogic_FailFirst[lvl] = ROOT.TH1D(
                    "JetMETLogic_FailFirst_{}".format(lvl),
                    "Failed JetMETLogic selection (power of least significant bit) at {} level (weightMagnitude={}); Path; Least significant bit power"
                    .format(lvl, self.weightMagnitude), self.BitsBins,
                    self.BitsMin, self.BitsMax)
            for lvl in ["baseline", "selection"]:
                # self.addObject(self.JetMETLogic_Freq[lvl])
                # self.addObject(self.JetMETLogic_Correl[lvl])
                self.addObject(self.JetMETLogic_FailBits[lvl])
                self.addObject(self.JetMETLogic_FailFirst[lvl])
Ejemplo n.º 30
0
 def beginJob(self,histFile=None,histDirName=None):
     Module.beginJob(self,histFile,histDirName)
     if histFile and histDirName:
         self.h_bfcount=ROOT.TH1I('h_bfcount', 'Count of first b quarks in event; number of b quarks descended from top quarks; frequency', 10, 0, 10)
         self.addObject(self.h_bfcount)
         self.h_bfpcount=ROOT.TH1I('h_bfpcount', 'Count of first b quarks in event after pruning; number of b quarks descended from top quarks with sibling W; frequency', 10, 0, 10)
         self.addObject(self.h_bfpcount)
         self.h_Wfcount=ROOT.TH1I('h_Wfcount', 'Count of first W bosons in event; number of W bosons directly descended from top quarks; frequency', 10, 0, 10)
         self.addObject(self.h_Wfcount)
         self.h_TopSystemPt = {}
         self.h_bSystemCorr = {}
         for i in xrange(4):
             self.h_TopSystemPt[i]=ROOT.TH3F('h_TopSystemPt_{0:d}'.format(i+1),   
                                             'Top Sys Pt (R{0:d} t pt); Top_Pt (GeV); Bottom_Pt (GeV); W_Pt (GeV)'.format(i+1), 
                                             50, 0, 1000, 200, 0, 1000, 200, 0, 1000)
                                             #200, 0, 1000, 200, 0, 1000, 200, 0, 1000)
             self.addObject(self.h_TopSystemPt[i])       
             self.h_bSystemCorr[i]=ROOT.TH3F('h_bSystemCorr_{0:d}'.format(i+1),   
                                             'b Sys Correlations (R{0:d} t pt);DeltaEta(t, b); Bottom_Pt (GeV); b Status code, number'.format(i+1), 
                                             100, 0, 8, 1000, 0, 1000, 1, 0, 1)
             self.addObject(self.h_bSystemCorr[i])