forked from UniMiBAnalyses/PlotsConfigurations
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
156fea8
commit 5319467
Showing
22 changed files
with
3,957 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,296 @@ | ||
import inspect | ||
import os | ||
import math as mt | ||
import numpy as np | ||
|
||
configurations = os.path.realpath(inspect.getfile(inspect.currentframe())) # this file | ||
configurations = os.path.dirname(configurations) # Full2017 | ||
configurations = os.path.dirname(configurations) # ggH | ||
configurations = os.path.dirname(configurations) # Configurations | ||
|
||
#aliases = {} | ||
bAlgo = 'DeepB' | ||
bWP = '0.4184' | ||
|
||
mc = [skey for skey in samples if skey not in ('Fake','DATA')] | ||
|
||
aliases['wzinc'] = { | ||
'linesToAdd': ['.L %s/macros/wzinc.cc+' % configurations], | ||
'class': 'Wzinc', | ||
} | ||
|
||
aliases['wz_var'] = { | ||
'linesToAdd': [ | ||
'gSystem->Load("libLatinoAnalysisMultiDraw.so")', | ||
'.L %s/macros/wz_var.cc+' % configurations | ||
], | ||
'class': 'WZvar', | ||
'args': (), | ||
} | ||
|
||
aliases['2e_mu'] = { | ||
'expr': '(abs(Alt$(Lepton_pdgId[0],9999))==11 && abs(Alt$(Lepton_pdgId[1],9999))==11 && abs(Alt$(Lepton_pdgId[2],9999))==13) || \ | ||
(abs(Alt$(Lepton_pdgId[0],9999))==13 && abs(Alt$(Lepton_pdgId[1],9999))==11 && abs(Alt$(Lepton_pdgId[2],9999))==11) || \ | ||
(abs(Alt$(Lepton_pdgId[0],9999))==11 && abs(Alt$(Lepton_pdgId[1],9999))==13 && abs(Alt$(Lepton_pdgId[2],9999))==11)' | ||
} | ||
|
||
aliases['2mu_e'] = { | ||
'expr': '(abs(Alt$(Lepton_pdgId[0],9999))==13 && abs(Alt$(Lepton_pdgId[1],9999))==13 && abs(Alt$(Lepton_pdgId[2],9999))==11) || \ | ||
(abs(Alt$(Lepton_pdgId[0],9999))==11 && abs(Alt$(Lepton_pdgId[1],9999))==13 && abs(Alt$(Lepton_pdgId[2],9999))==13) || \ | ||
(abs(Alt$(Lepton_pdgId[0],9999))==13 && abs(Alt$(Lepton_pdgId[1],9999))==11 && abs(Alt$(Lepton_pdgId[2],9999))==13)' | ||
} | ||
|
||
aliases['3e'] = { | ||
'expr': '(abs(Alt$(Lepton_pdgId[0],9999))==11 && abs(Alt$(Lepton_pdgId[1],9999))==11 && abs(Alt$(Lepton_pdgId[2],9999))==11)' | ||
} | ||
|
||
aliases['3mu'] = { | ||
'expr': '(abs(Alt$(Lepton_pdgId[0],9999))==13 && abs(Alt$(Lepton_pdgId[1],9999))==13 && abs(Alt$(Lepton_pdgId[2],9999))==13)' | ||
} | ||
|
||
# tau veto | ||
aliases['tauVeto_wz'] = { | ||
'expr': '(Sum$(Tau_pt > 18 && abs(Tau_eta)<2.3 && (Tau_idMVAoldDM2017v2>> 1 & 1) && Tau_idDecayMode &&sqrt( pow(Tau_eta - Lepton_eta[0], 2) + pow(abs(abs(Tau_phi - Lepton_phi[0])-pi)-pi, 2) ) >= 0.4 && sqrt( pow(Tau_eta - Lepton_eta[1], 2) + pow(abs(abs(Tau_phi - Lepton_phi[1])-pi)-pi, 2) ) >= 0.4 && sqrt( pow(Tau_eta - Lepton_eta[2], 2) + pow(abs(abs(Tau_phi - Lepton_phi[2])-pi)-pi, 2) ) >= 0.4) == 0)' | ||
} | ||
aliases['softmuon_veto']={ | ||
'expr':'(Sum$(abs(Muon_dxy)<0.02 && abs(Muon_dz)<0.1 && Muon_softId && Muon_pt>5 && abs(Muon_eta)<2.4 && sqrt( pow(Muon_eta - Lepton_eta[0], 2) + pow(abs(abs(Muon_phi - Lepton_phi[0])-pi)-pi, 2) ) >= 0.4 && sqrt( pow(Muon_eta - Lepton_eta[1], 2) + pow(abs(abs(Muon_phi - Lepton_phi[1])-pi)-pi, 2) ) >= 0.4)==0)' | ||
} | ||
|
||
eleWP = 'mvaFall17V1Iso_WP90_SS' | ||
|
||
muWP = 'cut_Tight_HWWW' | ||
|
||
aliases['LepWPCut'] = { | ||
'expr': 'LepCut3l__ele_'+eleWP+'__mu_'+muWP, | ||
'samples': mc + ['DATA'] | ||
} | ||
aliases['gstarLow'] = { | ||
'expr': 'Gen_ZGstar_mass >0 && Gen_ZGstar_mass < 4', | ||
'samples': ['VgS','VgS1','VgS2'] | ||
} | ||
|
||
aliases['gstarHigh'] = { | ||
'expr': 'Gen_ZGstar_mass <0 || Gen_ZGstar_mass > 4', | ||
'samples': ['VgS','VgS1','VgS2'] | ||
} | ||
# Fake leptons transfer factor | ||
aliases['fakeW'] = { | ||
#'expr': 'fakeW2l_ele_'+eleWP+'_mu_'+muWP, | ||
'expr': 'fakeW_ele_'+eleWP+'_mu_'+muWP+'_3l', | ||
'samples': ['Fake'] | ||
} | ||
# And variations - already divided by central values in formulas ! | ||
aliases['fakeW'] = { | ||
#'expr': 'fakeW2l_ele_'+eleWP+'_mu_'+muWP, | ||
'expr': 'fakeW_ele_'+eleWP+'_mu_'+muWP+'_3l', | ||
'samples': ['Fake'] | ||
} | ||
# And variations - already divided by central values in formulas ! | ||
aliases['fakeWEleUp'] = { | ||
#'expr': 'fakeW2l_ele_'+eleWP+'_mu_'+muWP+'_EleUp', | ||
'expr': 'fakeW_ele_'+eleWP+'_mu_'+muWP+'_3lElUp', | ||
'samples': ['Fake'] | ||
} | ||
aliases['fakeWEleDown'] = { | ||
#'expr': 'fakeW2l_ele_'+eleWP+'_mu_'+muWP+'_EleDown', | ||
'expr': 'fakeW_ele_'+eleWP+'_mu_'+muWP+'_3lElDown', | ||
'samples': ['Fake'] | ||
} | ||
aliases['fakeWMuUp'] = { | ||
#'expr': 'fakeW2l_ele_'+eleWP+'_mu_'+muWP+'_MuUp', | ||
'expr': 'fakeW_ele_'+eleWP+'_mu_'+muWP+'_3lMuUp', | ||
'samples': ['Fake'] | ||
} | ||
aliases['fakeWMuDown'] = { | ||
#'expr': 'fakeW2l_ele_'+eleWP+'_mu_'+muWP+'_MuDown', | ||
'expr': 'fakeW_ele_'+eleWP+'_mu_'+muWP+'_3lMuDown', | ||
'samples': ['Fake'] | ||
} | ||
aliases['fakeWStatEleUp'] = { | ||
#'expr': 'fakeW2l_ele_'+eleWP+'_mu_'+muWP+'_statEleUp', | ||
'expr': 'fakeW_ele_'+eleWP+'_mu_'+muWP+'_3lstatElUp', | ||
'samples': ['Fake'] | ||
} | ||
aliases['fakeWStatEleDown'] = { | ||
#'expr': 'fakeW2l_ele_'+eleWP+'_mu_'+muWP+'_statEleDown', | ||
'expr': 'fakeW_ele_'+eleWP+'_mu_'+muWP+'_3lstatElDown', | ||
'samples': ['Fake'] | ||
} | ||
aliases['fakeWStatMuUp'] = { | ||
#'expr': 'fakeW2l_ele_'+eleWP+'_mu_'+muWP+'_statMuUp', | ||
'expr': 'fakeW_ele_'+eleWP+'_mu_'+muWP+'_3lstatMuUp', | ||
'samples': ['Fake'] | ||
} | ||
aliases['fakeWStatMuDown'] = { | ||
#'expr': 'fakeW2l_ele_'+eleWP+'_mu_'+muWP+'_statMuDown', | ||
'expr': 'fakeW_ele_'+eleWP+'_mu_'+muWP+'_3lstatMuDown', | ||
'samples': ['Fake'] | ||
} | ||
# gen-matching to prompt only (GenLepMatch2l matches to *any* gen lepton) | ||
aliases['PromptGenLepMatch2l'] = { | ||
'expr': 'Alt$(Lepton_promptgenmatched[0]*Lepton_promptgenmatched[1], 0)', | ||
'samples': mc | ||
} | ||
aliases['PromptGenLepMatch3l'] = { | ||
'expr': 'Alt$(Lepton_promptgenmatched[0]*Lepton_promptgenmatched[1]*Lepton_promptgenmatched[2], 0)', | ||
'samples': mc | ||
} | ||
# PostProcessing did not create (anti)topGenPt for ST samples with _ext1 | ||
lastcopy = (1 << 13) | ||
|
||
aliases['isTTbar'] = { | ||
'expr': 'Sum$(TMath::Abs(GenPart_pdgId) == 6 && TMath::Odd(GenPart_statusFlags / %d)) == 2' % lastcopy, | ||
'samples': ['top'] | ||
} | ||
|
||
aliases['isSingleTop'] = { | ||
'expr': 'Sum$(TMath::Abs(GenPart_pdgId) == 6 && TMath::Odd(GenPart_statusFlags / %d)) == 1' % lastcopy, | ||
'samples': ['top'] | ||
} | ||
|
||
aliases['Top_pTrw'] = { | ||
'expr': 'isTTbar * (TMath::Sqrt(TMath::Exp(0.0615 - 0.0005 * topGenPtOTF) * TMath::Exp(0.0615 - 0.0005 * antitopGenPtOTF))) + isSingleTop', | ||
'samples': ['top'] | ||
} | ||
|
||
#bjet | ||
# No jet with pt > 30 GeV | ||
aliases['zeroJet'] = { | ||
'expr': 'Alt$(CleanJet_pt[0], 0) < 30.' | ||
} | ||
|
||
# ==1 jet with pt > 30 GeV | ||
aliases['oneJet'] = { | ||
'expr': 'Alt$(CleanJet_pt[0], 0) >= 30. && Alt$(CleanJet_pt[1], 0) < 30.' | ||
} | ||
|
||
# ==2 jets with pt > 30 GeV | ||
aliases['twoJet'] = { | ||
'expr': 'Alt$(CleanJet_pt[0], 0) >= 30. && Alt$(CleanJet_pt[1], 0) >= 30. && Alt$(CleanJet_pt[2], 0) < 30.' | ||
} | ||
|
||
# >=2 jets with pt > 30 GeV | ||
aliases['twoJetOrMore'] = { | ||
'expr': 'Alt$(CleanJet_pt[0], 0) >= 30. && Alt$(CleanJet_pt[1], 0) >= 30.' | ||
} | ||
|
||
aliases['bVeto'] = { | ||
'expr': 'Sum$(CleanJet_pt > 20. && abs(CleanJet_eta) < 2.5 && Jet_btagDeepB[CleanJet_jetIdx] > 0.4184) == 0' | ||
} | ||
|
||
aliases['bReq'] = { | ||
'expr': 'Sum$(CleanJet_pt > 30. && abs(CleanJet_eta) < 2.5 && Jet_btagDeepB[CleanJet_jetIdx] > 0.4184) >= 1' | ||
} | ||
|
||
aliases['btag0'] = { | ||
'expr': 'zeroJet && !bVeto' | ||
} | ||
|
||
aliases['btag1'] = { | ||
'expr': 'oneJet && bReq' | ||
} | ||
|
||
aliases['btag2'] = { | ||
'expr': 'twoJet && bReq' | ||
} | ||
|
||
# lepton eta range | ||
aliases['lep0eta']={ | ||
'expr': '((abs(Alt$(Lepton_pdgId[0],-9999))==11 && abs(Alt$(Lepton_eta[0],-9999.)) <2.5) || (abs(Alt$(Lepton_pdgId[0],-9999))==13 && abs(Alt$(Lepton_eta[0],-9999.)) <2.4))' | ||
} | ||
aliases['lep1eta']={ | ||
'expr': '((abs(Alt$(Lepton_pdgId[1],-9999))==11 && abs(Alt$(Lepton_eta[1],-9999.)) <2.5) || (abs(Alt$(Lepton_pdgId[1],-9999))==13 && abs(Alt$(Lepton_eta[1],-9999.)) <2.4))' | ||
} | ||
aliases['jetpt30']={ | ||
'expr': 'Alt$(CleanJet_pt[0],-9999.) >30 && Alt$(CleanJet_pt[1],-9999.) >30 && abs(Alt$(CleanJet_eta[0],-9999.)) < 4.7&& abs(Alt$(CleanJet_eta[1],-9999.)) < 4.7' | ||
} | ||
aliases['jetpt50']={ | ||
'expr': 'Alt$(CleanJet_pt[0],-9999.) >50 && Alt$(CleanJet_pt[1],-9999.) >50 && abs(Alt$(CleanJet_eta[0],-9999.)) < 4.7&& abs(Alt$(CleanJet_eta[1],-9999.)) < 4.7' | ||
} | ||
aliases['jetpt_opt']={ | ||
'expr': 'Alt$(CleanJet_pt[0],-9999.) >50 && Alt$(CleanJet_pt[1],-9999.) >35 && abs(Alt$(CleanJet_eta[0],-9999.)) < 4.7&& abs(Alt$(CleanJet_eta[1],-9999.)) < 4.7' | ||
} | ||
|
||
aliases['leppt0']={ | ||
'expr': 'Alt$(Lepton_pt[0],-9999.) >25 && Alt$(Lepton_pt[1],-9999.) >20' | ||
} | ||
aliases['leppt1']={ | ||
'expr': 'Alt$(Lepton_pt[0],-9999.) >30 && Alt$(Lepton_pt[1],-9999.) >30' | ||
} | ||
# -3.2<eta<-1.3 and -1.57<phi< -0.87 | ||
aliases['HEM']={ | ||
'expr': '(Alt$(CleanJet_eta[0],-9999.)>-3.2 && Alt$(CleanJet_eta[0],-9999.)<-1.3 && Alt$(CleanJet_phi[0],-9999.)>-1.57 && Alt$(CleanJet_phi[0],-9999.)<-0.87) || \ | ||
(Alt$(CleanJet_eta[1],-9999.)>-3.2 && Alt$(CleanJet_eta[1],-9999.)<-1.3 && Alt$(CleanJet_phi[1],-9999.)>-1.57 && Alt$(CleanJet_phi[1],-9999.)<-0.87)' | ||
} | ||
# ssww region | ||
aliases['zlep_wz']={ | ||
'expr': 'abs((Alt$(Lepton_eta[0],-9999.) - (Alt$(CleanJet_eta[0],-9999.)+Alt$(CleanJet_eta[1],-9999.))/2)/detajj) < 1 && abs((Alt$(Lepton_eta[1],-9999.) - (Alt$(CleanJet_eta[0],-9999.)+Alt$(CleanJet_eta[1],-9999.))/2)/detajj) < 1 && abs((Alt$(Lepton_eta[2],-9999.) - (Alt$(CleanJet_eta[0],-9999.)+Alt$(CleanJet_eta[1],-9999.))/2)/detajj) <1' | ||
} | ||
|
||
aliases['zveto_ww']={ | ||
'expr': '(abs(Alt$(Lepton_pdgId[0],-9999)) * abs(Alt$(Lepton_pdgId[1],-9999)) != 11*11 || abs(mll - 91.1876) > 15)' | ||
} | ||
|
||
aliases['bVetoSF'] = { | ||
'expr': 'TMath::Exp(Sum$(TMath::Log((CleanJet_pt>20 && abs(CleanJet_eta)<2.5)*Jet_btagSF_deepcsv_shape[CleanJet_jetIdx]+1*(CleanJet_pt<20 || abs(CleanJet_eta)>2.5))))', | ||
'samples': mc | ||
} | ||
|
||
aliases['btag0SF'] = { | ||
'expr': 'TMath::Exp(Sum$(TMath::Log((CleanJet_pt>20 && CleanJet_pt<30 && abs(CleanJet_eta)<2.5)*Jet_btagSF_deepcsv_shape[CleanJet_jetIdx]+1*(CleanJet_pt<20 || CleanJet_pt>30 || abs(CleanJet_eta)>2.5))))', | ||
'samples': mc | ||
} | ||
|
||
aliases['btagnSF'] = { | ||
'expr': 'TMath::Exp(Sum$(TMath::Log((CleanJet_pt>30 && abs(CleanJet_eta)<2.5)*Jet_btagSF_deepcsv_shape[CleanJet_jetIdx] + (CleanJet_pt<30 || abs(CleanJet_eta)>2.5))))', | ||
'samples': mc | ||
} | ||
|
||
aliases['btagSF'] = { | ||
'expr': 'bVetoSF*bVeto + btag0SF*btag0 + btagnSF*(btag1 + btag2) + (!bVeto && !btag0 && !btag1 && !btag2)', | ||
'samples': mc | ||
} | ||
|
||
for shift in ['jes','lf','hf','lfstats1','lfstats2','hfstats1','hfstats2','cferr1','cferr2']: | ||
for targ in ['bVeto', 'btag0', 'btagn']: | ||
alias = aliases['%sSF%sup' % (targ, shift)] = copy.deepcopy(aliases['%sSF' % targ]) | ||
alias['expr'] = alias['expr'].replace('btagSF_shape', 'btagSF_shape_up_%s' % shift) | ||
|
||
alias = aliases['%sSF%sdown' % (targ, shift)] = copy.deepcopy(aliases['%sSF' % targ]) | ||
alias['expr'] = alias['expr'].replace('btagSF_shape', 'btagSF_shape_down_%s' % shift) | ||
|
||
aliases['btagSF%sup' % shift] = { | ||
'expr': 'bVetoSF{shift}up*bVeto + btag0SF{shift}up*btag0 + btagnSF{shift}up*(btag1 + btag2) + (!bVeto && !btag0 && !btag1 && !btag2)'.format(shift = shift), | ||
'samples': mc | ||
} | ||
|
||
aliases['btagSF%sdown' % shift] = { | ||
'expr': 'bVetoSF{shift}down*bVeto + btag0SF{shift}down*btag0 + btagnSF{shift}down*(btag1 + btag2) + (!bVeto && !btag0 && !btag1 && !btag2)'.format(shift = shift), | ||
'samples': mc | ||
} | ||
|
||
# data/MC scale factors | ||
aliases['SFweight'] = { | ||
'expr': ' * '.join(['SFweight3l','LepSF3l__ele_' + eleWP + '__mu_' + muWP, 'LepWPCut','XSWeight','METFilter_MC','btagSF']), #bveto_sf*lep_sf*trig_sf*mu_roc_sf | ||
#'expr': 'LepWPCut', | ||
'samples': mc | ||
} | ||
# variations | ||
aliases['SFweightEleUp'] = { | ||
'expr': 'LepSF3l__ele_'+eleWP+'__Up', | ||
'samples': mc | ||
} | ||
aliases['SFweightEleDown'] = { | ||
'expr': 'LepSF3l__ele_'+eleWP+'__Do', | ||
'samples': mc | ||
} | ||
aliases['SFweightMuUp'] = { | ||
'expr': 'LepSF3l__mu_'+muWP+'__Up', | ||
'samples': mc | ||
} | ||
aliases['SFweightMuDown'] = { | ||
'expr': 'LepSF3l__mu_'+muWP+'__Do', | ||
'samples': mc | ||
} | ||
aliases['zlep1'] = {'expr' : '(Alt$(Lepton_eta[0],-9999.) - (Alt$(CleanJet_eta[0],-9999.)+Alt$(CleanJet_eta[1],-9999.))/2)/detajj'} | ||
aliases['zlep2'] = {'expr' : '(Alt$(Lepton_eta[1],-9999.) - (Alt$(CleanJet_eta[0],-9999.)+Alt$(CleanJet_eta[1],-9999.))/2)/detajj'} |
46 changes: 46 additions & 0 deletions
46
Configurations/VBSlllnu/WZ/conf_WZ_BSM_2D/configuration.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#example of configuration file | ||
treeName= 'Events' | ||
|
||
#date='_Nov252018_ptll' | ||
date='_WZ_BSM_2D_l3_2018' | ||
|
||
tag = 'VBS'+date | ||
|
||
|
||
# used by mkShape to define output directory for root files | ||
outputDir = 'rootFile'+date | ||
|
||
# file with TTree aliases | ||
aliasesFile = 'aliases.py' | ||
|
||
# file with list of variables | ||
variablesFile = 'variables.py' | ||
|
||
# file with list of cuts | ||
cutsFile = 'cuts.py' | ||
#cutsFile = 'cuts_forPlots.py' | ||
|
||
# file with list of samples | ||
samplesFile = 'samples.py' | ||
|
||
# file with list of samples | ||
plotFile = 'plot.py' | ||
|
||
# luminosity to normalize to (in 1/fb) | ||
lumi =59.74 | ||
|
||
# used by mkPlot to define output directory for plots | ||
# different from "outputDir" to do things more tidy | ||
outputDirPlots = 'plotVBS'+date | ||
|
||
|
||
# used by mkDatacards to define output directory for datacards | ||
outputDirDatacard = 'datacards'+date | ||
|
||
|
||
# structure file for datacard | ||
structureFile = 'structure.py' | ||
|
||
|
||
# nuisances file for mkDatacards and for mkShape | ||
nuisancesFile = 'total_nuisances.py' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# cuts | ||
# cuts = {} | ||
#Different supercut used | ||
|
||
#supercut for test on succesive selections | ||
|
||
## Signal regions | ||
|
||
supercut='nLepton>2' | ||
|
||
cuts['SR_3l'] = 'wzinc && bVeto && MET_pt>20 && tauVeto_wz && jetpt_opt && abs(detajj)>1.5 && mjj>400 && zlep_wz' | ||
cuts['SR_2e_mu'] = 'wzinc && bVeto && MET_pt>20 && tauVeto_wz && jetpt_opt && abs(detajj)>1.5 && mjj>400 && zlep_wz && 2e_mu' | ||
cuts['SR_2mu_e'] = 'wzinc && bVeto && MET_pt>20 && tauVeto_wz && jetpt_opt && abs(detajj)>1.5 && mjj>400 && zlep_wz && 2mu_e' | ||
cuts['SR_3e'] = 'wzinc && bVeto && MET_pt>20 && tauVeto_wz && jetpt_opt && abs(detajj)>1.5 && mjj>400 && zlep_wz && 3e' | ||
cuts['SR_3mu'] = 'wzinc && bVeto && MET_pt>20 && tauVeto_wz && jetpt_opt && abs(detajj)>1.5 && mjj>400 && zlep_wz && 3mu' | ||
cuts['CR'] = 'wzinc && bVeto && MET_pt>20 && tauVeto_wz && jetpt_opt && abs(detajj)>1.5 && mjj>100 && mjj<400 && zlep_wz' |
Oops, something went wrong.