예제 #1
0
import ROOT
import os
import math
import numpy as np
import copy
from array import array
from Workflow_Handler import Workflow_Handler

#Supress the opening of many Canvas's
ROOT.gROOT.SetBatch(True)   

isBDT_with_Wmass = False # If true, pT(pi) and ET(gamma) in the BDT are normalized to Wmass 
myWF = Workflow_Handler("Signal","Data",isBDT_with_Wmass)

ttbar_sig_calib_file = ROOT.TFile.Open("ttbar_signal_ratio.root")
ttbar_sig_calib = ttbar_sig_calib_file.Get("ttbar_signal_ratio")

##Bools for rundom SF variation
random_mu_SF  = False #------if True, muon scale factors are sampled from a Gaussian
random_ele_SF = False #------if True, electron scale factors are sampled from a Gaussian
random_ph_SF  = False #------if True, photon scale factors are sampled from a Gaussian


############################################################################
#                                                                          #
#-------------------------- Integrated luminosity -------------------------#
#                                                                          #
############################################################################

#Normalize to this luminsity, in fb-1
#luminosity_norm = 36.46
예제 #2
0
import ROOT
import math
import numpy as np

##normalize to the 2016 lumi
luminosity_norm = 5.

from Workflow_Handler import Workflow_Handler
myWF = Workflow_Handler("Signal_H800_A300")

def is_Event_selected(jet_btag,jet_pt):
    """Save events according to some basic selection criteria"""
    btag_cut = jet_btag[0] > 0.97 and jet_btag[1] > 0.97 and jet_btag[2] > 0.97 and jet_btag[3] > 0.97
    #btag_cut = jet_btag[0] > 0.89 and jet_btag[1] > 0.89 and jet_btag[2] > 0.97 and jet_btag[3] > 0.97
    #pt_cut = jet_pt[0] > 165. and jet_pt[1] > 130. and jet_pt[2] > 130. and jet_pt[3] > 110.
    #pt_cut = jet_pt[3] > 50.

    return btag_cut #and pt_cut

##Here starts the program
Norm_Map = myWF.get_normalizations_map()

steps_cut1 = 20
cut1_init = 70.
cut1_stepsize = 10.

steps_cut2 = 20
cut2_init = 70.
cut2_stepsize = 10.

steps_cut3 = 20
예제 #3
0
import ROOT
import os

from Workflow_Handler import Workflow_Handler
myWF = Workflow_Handler("Signal_H800_A300")

if not os.path.exists("plots"):
    os.makedirs("plots")

##Do all the scaling to this luminosity, in fb-1
luminosity_norm = 36.
signal_magnify = 100.

##These are the histograms to be merged
list_histos = [
    "h_jet1pt", "h_jet2pt", "h_jet3pt", "h_jet4pt", "h_jet1Btag", "h_jet2Btag",
    "h_jet3Btag", "h_jet4Btag", "h_delta_Phi_pair", "h_delta_Eta_pair",
    "h_Events", "h_jet1eta", "h_jet2eta"
]

##Here starts the program
Norm_Map = myWF.get_normalizations_map()

##Get the handlers for all the histos
h_QCD = dict()
h_QCD[list_histos[0]] = ROOT.TH1F(list_histos[0], "p_{t} of 1st jet", 200, 0.,
                                  500.)
h_QCD[list_histos[1]] = ROOT.TH1F(list_histos[1], "p_{t} of 2nd jet", 200, 0.,
                                  500.)
h_QCD[list_histos[2]] = ROOT.TH1F(list_histos[2], "p_{t} of 3rd jet", 200, 0.,
                                  500.)
예제 #4
0
import ROOT
import math
import numpy as np

##normalize to the 2016 lumi
luminosity_norm = 5.

from Workflow_Handler import Workflow_Handler

myWF = Workflow_Handler("Signal_H800_A300")


def is_Event_selected(jet_btag, jet_pt):
    """Save events according to some basic selection criteria"""
    btag_cut = jet_btag[0] > 0.97 and jet_btag[1] > 0.97 and jet_btag[
        2] > 0.97 and jet_btag[3] > 0.97
    #btag_cut = jet_btag[0] > 0.89 and jet_btag[1] > 0.89 and jet_btag[2] > 0.97 and jet_btag[3] > 0.97
    #pt_cut = jet_pt[0] > 165. and jet_pt[1] > 130. and jet_pt[2] > 130. and jet_pt[3] > 110.
    #pt_cut = jet_pt[3] > 50.

    return btag_cut  #and pt_cut


##Here starts the program
Norm_Map = myWF.get_normalizations_map()

steps_cut1 = 20
cut1_init = 70.
cut1_stepsize = 10.

steps_cut2 = 20
예제 #5
0
import ROOT
import math
import numpy as np
import sys
#sys.path.insert(0, '/afs/cern.ch/user/r/rselvati/wpigamma/CMSSW_8_0_28/src/StandardModel/WPiGamma/test/scripts')
from scripts.create_normalization_table import get_xsec_fromsample

##normalize to the 2016 lumi
luminosity_norm = 36.46

from Workflow_Handler import Workflow_Handler

myWF = Workflow_Handler("Signal", "Data", isMedium=True)

#-----Some selection bools------#
is_pi_gamma = False
is_ele_gamma = True
is_mu_pT = False
is_ele_pT = False
is_deltaphi_mu_pi = False
is_deltaphi_ele_pi = False
is_piIso_03 = False
is_piIso_05 = False


def is_Event_selected(Wmass, nBjets, lepton_iso,
                      ele_gamma_InvMass):  #,lep_pT):#,pi_pT,gamma_eT):
    """Save events according to some basic selection criteria"""
    bjet_cut = nBjets >= 2.

    mass_cut_down = Wmass >= 50.
예제 #6
0
import ROOT

from Workflow_Handler import Workflow_Handler
myWF = Workflow_Handler("Signal_H500_A200")

##Do all the scaling to this luminosity, in fb-1
luminosity_norm = 10.
signal_magnify = 100.

##These are the histograms to be merged
list_histos = ["h_jet1pt", "h_jet2pt", "h_jet3pt", "h_jet4pt", "h_jet1Btag", "h_jet2Btag", "h_jet3Btag", "h_jet4Btag", "h_delta_Phi_pair", "h_delta_Eta_pair", "h_Events", "h_jet1eta", "h_jet2eta"]

##Here starts the program
Norm_Map = myWF.get_normalizations_map()

##Get the handlers for all the histos
h_QCD = dict()
h_QCD[list_histos[0]]  = ROOT.TH1F(list_histos[0], "p_{t} of 1st jet", 200, 0., 500.)
h_QCD[list_histos[1]]  = ROOT.TH1F(list_histos[1], "p_{t} of 2nd jet", 200, 0., 500.)
h_QCD[list_histos[2]]  = ROOT.TH1F(list_histos[2], "p_{t} of 3rd jet", 200, 0., 500.)
h_QCD[list_histos[3]]  = ROOT.TH1F(list_histos[3], "p_{t} of 4th jet", 200, 0., 500.)
h_QCD[list_histos[4]]  = ROOT.TH1F(list_histos[4], "Btag value of 1st jet", 50, 0.89, 1.)
h_QCD[list_histos[5]]  = ROOT.TH1F(list_histos[5], "Btag value of 2nd jet", 50, 0.89, 1.)
h_QCD[list_histos[6]]  = ROOT.TH1F(list_histos[6], "Btag value of 3rd jet", 50, 0.89, 1.)
h_QCD[list_histos[7]]  = ROOT.TH1F(list_histos[7], "Btag value of 4th jet", 50, 0.89, 1.)
h_QCD[list_histos[8]]  = ROOT.TH1F(list_histos[8], "#Delta_{#phi} between the two jet pairs", 50, 0., 6.28)
h_QCD[list_histos[9]]  = ROOT.TH1F(list_histos[9], "#Delta_{#eta} between the two jet pairs", 50, -10., 10.)
h_QCD[list_histos[10]] = ROOT.TH1F(list_histos[10], "Events after pre-selection steps", 6, 0., 6.)
h_QCD[list_histos[11]] = ROOT.TH1F(list_histos[11], "#eta of 1st jet", 50, -10., 10.)
h_QCD[list_histos[12]] = ROOT.TH1F(list_histos[12], "#eta of 2nd jet", 50, -10., 10.)
예제 #7
0
    'runningEra_option',
    help=
    'Type <<0>> for 2016, <<1>> for 2017, <<2>> for 2018, <<3>> for combination 2016+2017'
)
args = p.parse_args()

# Switch from muon to electron channel, and from 2016 to 2017
if args.isBDT_option == "preselection":
    isBDT = False
if args.isBDT_option == "BDT":
    isBDT = True
runningEra = int(args.runningEra_option)
#---------------------------------#

isBDT_with_Wmass = False  # If true, pT(pi) and ET(gamma) in the BDT are normalized to Wmass
myWF = Workflow_Handler("Signal", "Data", isBDT_with_Wmass, runningEra)

#Bools for rundom SF variation
random_mu_SF = False  #------if True, muon scale factors are sampled from a Gaussian
random_ele_SF = False  #------if True, electron scale factors are sampled from a Gaussian
random_ph_SF = False  #------if True, photon scale factors are sampled from a Gaussian

############################################################################
#                                                                          #
#-------------------------- Integrated luminosity -------------------------#
#                                                                          #
############################################################################

#Normalize to this luminsity, in fb-1

luminosity_norm_2016 = 35.86