diff --git a/.gitignore b/.gitignore index a9fe21a61..35f349ca2 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,7 @@ *.root *.tar.gz jobs_*/ +2016DataPlots_* +*_C.d +*_C_ACLiC_dict_rdict.pcm +*.pdf diff --git a/config/plotter_2016Analysis_triggerStudies.cfg b/config/plotter_2016Analysis_triggerStudies.cfg index f87fce8e8..85d4a9f36 100644 --- a/config/plotter_2016Analysis_triggerStudies.cfg +++ b/config/plotter_2016Analysis_triggerStudies.cfg @@ -1,23 +1,26 @@ [general] lumi = 35900 # pb^-1 -outputFolder = ./2016DataPlots +# outputFolder = ./2016DataPlots_4bSelection +# outputFolder = ./2016DataPlots_4bLooseSelection +outputFolder = ./2016DataPlots_MuonPt40_ForthJetPt30_BTag +# outputFolder = ./2016DataPlots_MuonPt40_ForthJetPt30_CMVAM # Comment out an entry if you don't want to run on it. # NOTE; data gets simply plotted (1 event -> 1 entry in the histograms) # while backgrounds and signals get scaled by weights, lumi, and normalisation from the histogram -# data = data_BTagCSV -# backgrounds = bkg_test -# signals = sig_Graviton_1000GeV , sig_Graviton_1200GeV, sig_Graviton_260GeV, sig_Graviton_270GeV, sig_Graviton_300GeV, sig_Graviton_350GeV, sig_Graviton_400GeV, sig_Graviton_450GeV, sig_Graviton_500GeV, sig_Graviton_550GeV, sig_Graviton_600GeV, sig_Graviton_650GeV, sig_Graviton_750GeV, sig_Graviton_800GeV, sig_Graviton_900GeV, sig_Radion_260GeV, sig_Radion_270GeV, sig_Radion_300GeV, sig_Radion_350GeV, sig_Radion_400GeV, sig_Radion_450GeV, sig_Radion_500GeV, sig_Radion_550GeV, sig_Radion_600GeV, sig_Radion_650GeV, sig_Radion_750GeV, sig_Radion_800GeV, sig_Radion_900GeV, sig_Radion_1000GeV, sig_Radion_1200GeV # signals = tmp_Graviton_750GeV -data = tmp_SingleMuon +data = SingleMuon +# data = SingleMuon_RunBF, SingleMuon_RunGH +signals = TTbar -variables = SelectedJetPtSum, FirstSelectedJetPt, SecondSelectedJetPt, ThirdSelectedJetPt, ForthSelectedJetPt, ThirdSelectedJetDeepCSV +variables = FourHighetJetPtSum, FirstJetPt, SecondJetPt, ThirdJetPt, ForthJetPt, ThirdJetDeepCSV, FirstPtOrderedJetDeepCSV +variables2D = OfflineJetPtForCaloResolution:ResolutionOnlineCaloJetPt, OfflineJetPtForPFResolution:ResolutionOnlinePFJetPt -selections = Normalization , L1triggerDouble90Double30AndPrevious , QuadCentralJet30AndPrevious , DoubleCentralJet90AndPrevious , BTagCaloCSVp087TripleDouble90Double30AndPrevious , QuadPFCentralJetLooseID30AndPrevious , DoublePFCentralJetLooseID90AndPrevious , L1triggerQuad45AndPrevious , QuadCentralJet45AndPrevious , BTagCaloCSVp087TripleQuad45AndPrevious , QuadPFCentralJetLooseID45AndPrevious -regions = Full +selections = Normalization , L1triggerDouble90Double30AndPrevious , QuadCentralJet30AndPrevious , DoubleCentralJet90AndPrevious , BTagCaloCSVp087TripleDouble90Double30AndPrevious , QuadPFCentralJetLooseID30AndPrevious , DoublePFCentralJetLooseID90AndPrevious , L1triggerQuad45AndPrevious , QuadCentralJet45AndPrevious , BTagCaloCSVp087TripleQuad45AndPrevious , QuadPFCentralJetLooseID45AndPrevious, HLT_Double90Double30AndPrevious, HLT_Quad45AndPrevious, NormalizationForBTagDouble90Double30, SelectionForBTagDouble90Double30, NormalizationForBTagQuad45, SelectionForBTagQuad45 +regions = HLT_IsoMu24, HLT_IsoMu20, HLT_IsoMu24_Matched, HLT_IsoMu20_Matched [configs] sampleCfg = config/sampleCfg_2016Analysis_triggerStudies.cfg diff --git a/config/sampleCfg_2016Analysis_triggerStudies.cfg b/config/sampleCfg_2016Analysis_triggerStudies.cfg index d42bca760..f55932bfe 100644 --- a/config/sampleCfg_2016Analysis_triggerStudies.cfg +++ b/config/sampleCfg_2016Analysis_triggerStudies.cfg @@ -3,44 +3,11 @@ [samples] -# dati_test = /uscms/home/fravera/nobackup/DiHiggs_v1/CMSSW_10_2_5/src/bbbbAnalysis/list_data.txt -# bkg_test = /uscms/home/fravera/nobackup/DiHiggs_v1/CMSSW_10_2_5/src/bbbbAnalysis/list_data.txt -# sig_test = /uscms/home/fravera/nobackup/DiHiggs_v1/CMSSW_10_2_5/src/bbbbAnalysis/list_signal.txt +SingleMuon = /uscms/home/fravera/nobackup/DiHiggs_v1/CMSSW_10_2_5/src/bbbbAnalysis/plotterListFiles/2016Analysis/Data_SingleMuon.txt -tmp_SingleMuon = /uscms/home/fravera/nobackup/DiHiggs_v1/CMSSW_10_2_5/src/bbbbAnalysis/plotterListFiles/2016Analysis/Data_SingleMuon_tmp.txt +# SingleMuon_RunBF = /uscms/home/fravera/nobackup/DiHiggs_v1/CMSSW_10_2_5/src/bbbbAnalysis/plotterListFiles/2016Analysis/Data_SingleMuon_RunBF.txt +# SingleMuon_RunGH = /uscms/home/fravera/nobackup/DiHiggs_v1/CMSSW_10_2_5/src/bbbbAnalysis/plotterListFiles/2016Analysis/Data_SingleMuon_RunGH.txt -tmp_Graviton_750GeV = /uscms/home/fravera/nobackup/DiHiggs_v1/CMSSW_10_2_5/src/bbbbAnalysis/plotterListFiles/2016Analysis/MCSignal_Graviton750_tmp.txt - -data_BTagCSV = /uscms/home/fravera/nobackup/DiHiggs_v1/CMSSW_10_2_5/src/bbbbAnalysis/plotterListFiles/2016Analysis/BTagCSV_Data_FileList_80x_reprocess.txt -sig_Graviton_1000GeV = /uscms/home/fravera/nobackup/DiHiggs_v1/CMSSW_10_2_5/src/bbbbAnalysis/plotterListFiles/2016Analysis/MCSignal_BulkGravTohhTohbbhbb_narrow_M-1000_13TeV-madgraph.txt -sig_Graviton_1200GeV = /uscms/home/fravera/nobackup/DiHiggs_v1/CMSSW_10_2_5/src/bbbbAnalysis/plotterListFiles/2016Analysis/MCSignal_BulkGravTohhTohbbhbb_narrow_M-1200_13TeV-madgraph.txt -sig_Graviton_260GeV = /uscms/home/fravera/nobackup/DiHiggs_v1/CMSSW_10_2_5/src/bbbbAnalysis/plotterListFiles/2016Analysis/MCSignal_GluGluToBulkGravitonToHHTo4B_M-260_narrow_13TeV-madgraph.txt -sig_Graviton_270GeV = /uscms/home/fravera/nobackup/DiHiggs_v1/CMSSW_10_2_5/src/bbbbAnalysis/plotterListFiles/2016Analysis/MCSignal_GluGluToBulkGravitonToHHTo4B_M-270_narrow_13TeV-madgraph.txt -sig_Graviton_300GeV = /uscms/home/fravera/nobackup/DiHiggs_v1/CMSSW_10_2_5/src/bbbbAnalysis/plotterListFiles/2016Analysis/MCSignal_GluGluToBulkGravitonToHHTo4B_M-300_narrow_13TeV-madgraph.txt -sig_Graviton_350GeV = /uscms/home/fravera/nobackup/DiHiggs_v1/CMSSW_10_2_5/src/bbbbAnalysis/plotterListFiles/2016Analysis/MCSignal_GluGluToBulkGravitonToHHTo4B_M-350_narrow_13TeV-madgraph.txt -sig_Graviton_400GeV = /uscms/home/fravera/nobackup/DiHiggs_v1/CMSSW_10_2_5/src/bbbbAnalysis/plotterListFiles/2016Analysis/MCSignal_GluGluToBulkGravitonToHHTo4B_M-400_narrow_13TeV-madgraph.txt -sig_Graviton_450GeV = /uscms/home/fravera/nobackup/DiHiggs_v1/CMSSW_10_2_5/src/bbbbAnalysis/plotterListFiles/2016Analysis/MCSignal_GluGluToBulkGravitonToHHTo4B_M-450_narrow_13TeV-madgraph.txt -sig_Graviton_500GeV = /uscms/home/fravera/nobackup/DiHiggs_v1/CMSSW_10_2_5/src/bbbbAnalysis/plotterListFiles/2016Analysis/MCSignal_GluGluToBulkGravitonToHHTo4B_M-500_narrow_13TeV-madgraph.txt -sig_Graviton_550GeV = /uscms/home/fravera/nobackup/DiHiggs_v1/CMSSW_10_2_5/src/bbbbAnalysis/plotterListFiles/2016Analysis/MCSignal_GluGluToBulkGravitonToHHTo4B_M-550_narrow_13TeV-madgraph.txt -sig_Graviton_600GeV = /uscms/home/fravera/nobackup/DiHiggs_v1/CMSSW_10_2_5/src/bbbbAnalysis/plotterListFiles/2016Analysis/MCSignal_GluGluToBulkGravitonToHHTo4B_M-600_narrow_13TeV-madgraph.txt -sig_Graviton_650GeV = /uscms/home/fravera/nobackup/DiHiggs_v1/CMSSW_10_2_5/src/bbbbAnalysis/plotterListFiles/2016Analysis/MCSignal_GluGluToBulkGravitonToHHTo4B_M-650_narrow_13TeV-madgraph.txt -sig_Graviton_750GeV = /uscms/home/fravera/nobackup/DiHiggs_v1/CMSSW_10_2_5/src/bbbbAnalysis/plotterListFiles/2016Analysis/MCSignal_GluGluToBulkGravitonToHHTo4B_M-750_narrow_13TeV-madgraph.txt -sig_Graviton_800GeV = /uscms/home/fravera/nobackup/DiHiggs_v1/CMSSW_10_2_5/src/bbbbAnalysis/plotterListFiles/2016Analysis/MCSignal_GluGluToBulkGravitonToHHTo4B_M-800_narrow_13TeV-madgraph.txt -sig_Graviton_900GeV = /uscms/home/fravera/nobackup/DiHiggs_v1/CMSSW_10_2_5/src/bbbbAnalysis/plotterListFiles/2016Analysis/MCSignal_GluGluToBulkGravitonToHHTo4B_M-900_narrow_13TeV-madgraph.txt -sig_Radion_260GeV = /uscms/home/fravera/nobackup/DiHiggs_v1/CMSSW_10_2_5/src/bbbbAnalysis/plotterListFiles/2016Analysis/MCSignal_GluGluToRadionToHHTo4B_M-260_narrow_13TeV-madgraph.txt -sig_Radion_270GeV = /uscms/home/fravera/nobackup/DiHiggs_v1/CMSSW_10_2_5/src/bbbbAnalysis/plotterListFiles/2016Analysis/MCSignal_GluGluToRadionToHHTo4B_M-270_narrow_13TeV-madgraph.txt -sig_Radion_300GeV = /uscms/home/fravera/nobackup/DiHiggs_v1/CMSSW_10_2_5/src/bbbbAnalysis/plotterListFiles/2016Analysis/MCSignal_GluGluToRadionToHHTo4B_M-300_narrow_13TeV-madgraph.txt -sig_Radion_350GeV = /uscms/home/fravera/nobackup/DiHiggs_v1/CMSSW_10_2_5/src/bbbbAnalysis/plotterListFiles/2016Analysis/MCSignal_GluGluToRadionToHHTo4B_M-350_narrow_13TeV-madgraph.txt -sig_Radion_400GeV = /uscms/home/fravera/nobackup/DiHiggs_v1/CMSSW_10_2_5/src/bbbbAnalysis/plotterListFiles/2016Analysis/MCSignal_GluGluToRadionToHHTo4B_M-400_narrow_13TeV-madgraph.txt -sig_Radion_450GeV = /uscms/home/fravera/nobackup/DiHiggs_v1/CMSSW_10_2_5/src/bbbbAnalysis/plotterListFiles/2016Analysis/MCSignal_GluGluToRadionToHHTo4B_M-450_narrow_13TeV-madgraph.txt -sig_Radion_500GeV = /uscms/home/fravera/nobackup/DiHiggs_v1/CMSSW_10_2_5/src/bbbbAnalysis/plotterListFiles/2016Analysis/MCSignal_GluGluToRadionToHHTo4B_M-500_narrow_13TeV-madgraph.txt -sig_Radion_550GeV = /uscms/home/fravera/nobackup/DiHiggs_v1/CMSSW_10_2_5/src/bbbbAnalysis/plotterListFiles/2016Analysis/MCSignal_GluGluToRadionToHHTo4B_M-550_narrow_13TeV-madgraph.txt -sig_Radion_600GeV = /uscms/home/fravera/nobackup/DiHiggs_v1/CMSSW_10_2_5/src/bbbbAnalysis/plotterListFiles/2016Analysis/MCSignal_GluGluToRadionToHHTo4B_M-600_narrow_13TeV-madgraph.txt -sig_Radion_650GeV = /uscms/home/fravera/nobackup/DiHiggs_v1/CMSSW_10_2_5/src/bbbbAnalysis/plotterListFiles/2016Analysis/MCSignal_GluGluToRadionToHHTo4B_M-650_narrow_13TeV-madgraph.txt -sig_Radion_750GeV = /uscms/home/fravera/nobackup/DiHiggs_v1/CMSSW_10_2_5/src/bbbbAnalysis/plotterListFiles/2016Analysis/MCSignal_GluGluToRadionToHHTo4B_M-750_narrow_13TeV-madgraph.txt -sig_Radion_800GeV = /uscms/home/fravera/nobackup/DiHiggs_v1/CMSSW_10_2_5/src/bbbbAnalysis/plotterListFiles/2016Analysis/MCSignal_GluGluToRadionToHHTo4B_M-800_narrow_13TeV-madgraph.txt -sig_Radion_900GeV = /uscms/home/fravera/nobackup/DiHiggs_v1/CMSSW_10_2_5/src/bbbbAnalysis/plotterListFiles/2016Analysis/MCSignal_GluGluToRadionToHHTo4B_M-900_narrow_13TeV-madgraph.txt -sig_Radion_1000GeV = /uscms/home/fravera/nobackup/DiHiggs_v1/CMSSW_10_2_5/src/bbbbAnalysis/plotterListFiles/2016Analysis/MCSignal_RadionTohhTohbbhbb_narrow_M-1000_13TeV-madgraph.txt -sig_Radion_1200GeV = /uscms/home/fravera/nobackup/DiHiggs_v1/CMSSW_10_2_5/src/bbbbAnalysis/plotterListFiles/2016Analysis/MCSignal_RadionTohhTohbbhbb_narrow_M-1200_13TeV-madgraph.txt +TTbar = /uscms/home/fravera/nobackup/DiHiggs_v1/CMSSW_10_2_5/src/bbbbAnalysis/plotterListFiles/2016Analysis/MC_TTbar.txt diff --git a/config/selectionCfg_2016Analysis_triggerStudies.cfg b/config/selectionCfg_2016Analysis_triggerStudies.cfg index b610b9862..42d8ba2c7 100644 --- a/config/selectionCfg_2016Analysis_triggerStudies.cfg +++ b/config/selectionCfg_2016Analysis_triggerStudies.cfg @@ -10,83 +10,86 @@ [selections] # common -basicSelection = ((H1_m > 120-40 && H1_m < 120+40) && (H2_m > 120-40 && H2_m < 120+40)) && HighestMuonPt>40 -BTagCaloCSVp087Triple = BTagCaloCSVp087Triple >= 3 +# basicSelectionPass = HighestIsoMuonPt>30 && ForthJetPt>30 && ForthJetCMVA>0.185 +basicSelectionPass = HighestIsoMuonPt>30 && ForthJetPt>30 +# basicSelectionPass = HighestIsoMuonPt>30 && ForthJetPt>30 && ((H1_m > 120-40 && H1_m < 120+40) && (H2_m > 120-40 && H2_m < 120+40)) && HH_2DdeltaM < 4.*20.*20. +# # # basicSelectionPass = ForthJetCMVA > 0.185 && ((H1_m > 120-40 && H1_m < 120+40) && (H2_m > 120-40 && H2_m < 120+40)) && HH_2DdeltaM < 25.*20*20 +# # # basicSelectionPass = ((H1_m > 120-40 && H1_m < 120+40) && (H2_m > 120-40 && H2_m < 120+40)) && HH_2DdeltaM < 25.*20*20 +BTagCaloCSVp087TriplePass = BTagCaloCSVp087Triple >= 3 +# SelectionForBTag = HighestIsoElectronPt > 20. && MuonElectronChargeMultiplication <= 0 && SecondPtOrderedJetDeepCSV >= 0.6 +SelectionForBTag = HighestIsoElectronPt > 20. && MuonElectronChargeMultiplication <= 0 +SingleBTag = FirstPtOrderedJetOnlineBtag >=1 # HLT_DoubleJet90_Double30_TripleBTagCSV_p087 -L1triggerDouble90Double30 = L1sTripleJetVBFIorHTTIorDoubleJetCIorSingleJet >= 1 -QuadCentralJet30 = QuadCentralJet30 >= 4 -DoubleCentralJet90 = DoubleCentralJet90 >= 2 -QuadPFCentralJetLooseID30 = QuadPFCentralJetLooseID30 >= 4 -DoublePFCentralJetLooseID90 = DoublePFCentralJetLooseID90 >= 2 +# L1triggerDouble90Double30Pass = L1sTripleJetVBFIorHTTIorDoubleJetCIorSingleJet >= 1 +L1triggerDouble90Double30Pass = QuadCentralJet30 >= 1 +QuadCentralJet30Pass = QuadCentralJet30 >= 4 +DoubleCentralJet90Pass = DoubleCentralJet90 >= 2 +QuadPFCentralJetLooseID30Pass = QuadPFCentralJetLooseID30 >= 4 +DoublePFCentralJetLooseID90Pass = DoublePFCentralJetLooseID90 >= 2 + +#not per-object efficiency HLT_DoubleJet90_Double30_TripleBTagCSV_p087 +HLT_Double90Double30Pass = HLT_DoubleJet90_Double30_TripleBTagCSV_p087_Fired && HLT_DoubleJet90_Double30_TripleBTagCSV_p087_ObjectMatched # HLT_QuadJet45_TripleBTagCSV_p087 -L1triggerQuad45 = L1sQuadJetC50IorQuadJetC60IorHTT280IorHTT300IorHTT320IorTripleJet846848VBFIorTripleJet887256VBFIorTripleJet927664VBF >= 1 -QuadCentralJet45 = QuadCentralJet45 >= 4 -QuadPFCentralJetLooseID45 = QuadPFCentralJetLooseID45 >= 4 +# L1triggerQuad45Pass = L1sQuadJetC50IorQuadJetC60IorHTT280IorHTT300IorHTT320IorTripleJet846848VBFIorTripleJet887256VBFIorTripleJet927664VBF >= 1 +L1triggerQuad45Pass = QuadCentralJet45 >= 1 +QuadCentralJet45Pass = QuadCentralJet45 >= 4 +QuadPFCentralJetLooseID45Pass = QuadPFCentralJetLooseID45 >= 4 + +#not per-object efficiency HLT_QuadJet45_TripleBTagCSV_p087 +HLT_Quad45Pass = HLT_QuadJet45_TripleBTagCSV_p087_Fired && HLT_QuadJet45_TripleBTagCSV_p087_ObjectMatched -#common -Normalization = basicSelection + +# common +Normalization = basicSelectionPass # HLT_DoubleJet90_Double30_TripleBTagCSV_p087 -L1triggerDouble90Double30AndPrevious = Normalization, L1triggerDouble90Double30 -QuadCentralJet30AndPrevious = L1triggerDouble90Double30AndPrevious, QuadCentralJet30 -DoubleCentralJet90AndPrevious = QuadCentralJet30AndPrevious, DoubleCentralJet90 -BTagCaloCSVp087TripleDouble90Double30AndPrevious = DoubleCentralJet90AndPrevious, BTagCaloCSVp087Triple -QuadPFCentralJetLooseID30AndPrevious = BTagCaloCSVp087TripleDouble90Double30AndPrevious, QuadPFCentralJetLooseID30 -DoublePFCentralJetLooseID90AndPrevious = QuadPFCentralJetLooseID30AndPrevious, DoublePFCentralJetLooseID90 +L1triggerDouble90Double30AndPrevious = Normalization, L1triggerDouble90Double30Pass +QuadCentralJet30AndPrevious = L1triggerDouble90Double30AndPrevious, QuadCentralJet30Pass +DoubleCentralJet90AndPrevious = QuadCentralJet30AndPrevious, DoubleCentralJet90Pass +BTagCaloCSVp087TripleDouble90Double30AndPrevious = DoubleCentralJet90AndPrevious, BTagCaloCSVp087TriplePass +QuadPFCentralJetLooseID30AndPrevious = BTagCaloCSVp087TripleDouble90Double30AndPrevious, QuadPFCentralJetLooseID30Pass +DoublePFCentralJetLooseID90AndPrevious = QuadPFCentralJetLooseID30AndPrevious, DoublePFCentralJetLooseID90Pass +NormalizationForBTagDouble90Double30 = DoubleCentralJet90AndPrevious, SelectionForBTag +SelectionForBTagDouble90Double30 = NormalizationForBTagDouble90Double30, FirstPtOrderedJetOnlineBtag + +# not per-object efficiency HLT_DoubleJet90_Double30_TripleBTagCSV_p087 +HLT_Double90Double30AndPrevious = Normalization, HLT_Double90Double30Pass # HLT_QuadJet45_TripleBTagCSV_p087 -L1triggerQuad45AndPrevious = Normalization, L1triggerQuad45 -QuadCentralJet45AndPrevious = L1triggerQuad45AndPrevious, QuadCentralJet45 -BTagCaloCSVp087TripleQuad45AndPrevious = QuadCentralJet45AndPrevious, BTagCaloCSVp087Triple -QuadPFCentralJetLooseID45AndPrevious = BTagCaloCSVp087TripleQuad45AndPrevious, QuadPFCentralJetLooseID45 +L1triggerQuad45AndPrevious = Normalization, L1triggerQuad45Pass +QuadCentralJet45AndPrevious = L1triggerQuad45AndPrevious, QuadCentralJet45Pass +BTagCaloCSVp087TripleQuad45AndPrevious = QuadCentralJet45AndPrevious, BTagCaloCSVp087TriplePass +QuadPFCentralJetLooseID45AndPrevious = BTagCaloCSVp087TripleQuad45AndPrevious, QuadPFCentralJetLooseID45Pass +NormalizationForBTagQuad45 = QuadCentralJet45AndPrevious, SelectionForBTag +SelectionForBTagQuad45 = NormalizationForBTagQuad45, FirstPtOrderedJetOnlineBtag + +# not per-object efficiency HLT_QuadJet45_TripleBTagCSV_p087 +HLT_Quad45AndPrevious = Normalization, HLT_Quad45Pass # Region -Full = 1 +HLT_IsoMu24 = HLT_IsoMu24_Fired +HLT_IsoMu20 = HLT_IsoMu20_Fired +HLT_IsoMu24_Matched = HLT_IsoMu24_Fired && HLT_IsoMu24_ObjectMatched +HLT_IsoMu20_Matched = HLT_IsoMu20_Fired && HLT_IsoMu20_ObjectMatched + +HLT_IsoMu24_PreselectedJetsLessThan6 = HLT_IsoMu24_Fired && NumberOfJetsPassingPreselection <6 +HLT_IsoMu24_PreselectedJetsBetween7And9 = HLT_IsoMu24_Fired && NumberOfJetsPassingPreselection >=7 && NumberOfJetsPassingPreselection <=9 +HLT_IsoMu24_PreselectedJetsMoreThan9 = HLT_IsoMu24_Fired && NumberOfJetsPassingPreselection > 9 ######################################################################### ######################################################################### [selectionWeights] -selectionJet = bTagScaleFactor_central ######################################################################### ######################################################################### [sampleWeights] -tmp_Graviton_750GeV = genWeight, PUWeight, LHEPdfWeight, LHEScaleWeight -sig_Graviton_1000GeV = genWeight, PUWeight, LHEPdfWeight, LHEScaleWeight -sig_Graviton_1200GeV = genWeight, PUWeight, LHEPdfWeight, LHEScaleWeight -sig_Graviton_260GeV = genWeight, PUWeight, LHEPdfWeight, LHEScaleWeight -sig_Graviton_270GeV = genWeight, PUWeight, LHEPdfWeight, LHEScaleWeight -sig_Graviton_300GeV = genWeight, PUWeight, LHEPdfWeight, LHEScaleWeight -sig_Graviton_350GeV = genWeight, PUWeight, LHEPdfWeight, LHEScaleWeight -sig_Graviton_400GeV = genWeight, PUWeight, LHEPdfWeight, LHEScaleWeight -sig_Graviton_450GeV = genWeight, PUWeight, LHEPdfWeight, LHEScaleWeight -sig_Graviton_500GeV = genWeight, PUWeight, LHEPdfWeight, LHEScaleWeight -sig_Graviton_550GeV = genWeight, PUWeight, LHEPdfWeight, LHEScaleWeight -sig_Graviton_600GeV = genWeight, PUWeight, LHEPdfWeight, LHEScaleWeight -sig_Graviton_650GeV = genWeight, PUWeight, LHEPdfWeight, LHEScaleWeight -sig_Graviton_750GeV = genWeight, PUWeight, LHEPdfWeight, LHEScaleWeight -sig_Graviton_800GeV = genWeight, PUWeight, LHEPdfWeight, LHEScaleWeight -sig_Graviton_900GeV = genWeight, PUWeight, LHEPdfWeight, LHEScaleWeight -sig_Radion_260GeV = genWeight, PUWeight, LHEPdfWeight, LHEScaleWeight -sig_Radion_270GeV = genWeight, PUWeight, LHEPdfWeight, LHEScaleWeight -sig_Radion_300GeV = genWeight, PUWeight, LHEPdfWeight, LHEScaleWeight -sig_Radion_350GeV = genWeight, PUWeight, LHEPdfWeight, LHEScaleWeight -sig_Radion_400GeV = genWeight, PUWeight, LHEPdfWeight, LHEScaleWeight -sig_Radion_450GeV = genWeight, PUWeight, LHEPdfWeight, LHEScaleWeight -sig_Radion_500GeV = genWeight, PUWeight, LHEPdfWeight, LHEScaleWeight -sig_Radion_550GeV = genWeight, PUWeight, LHEPdfWeight, LHEScaleWeight -sig_Radion_600GeV = genWeight, PUWeight, LHEPdfWeight, LHEScaleWeight -sig_Radion_650GeV = genWeight, PUWeight, LHEPdfWeight, LHEScaleWeight -sig_Radion_750GeV = genWeight, PUWeight, LHEPdfWeight, LHEScaleWeight -sig_Radion_800GeV = genWeight, PUWeight, LHEPdfWeight, LHEScaleWeight -sig_Radion_900GeV = genWeight, PUWeight, LHEPdfWeight, LHEScaleWeight -sig_Radion_1000GeV = genWeight, PUWeight, LHEPdfWeight, LHEScaleWeight -sig_Radion_1200GeV = genWeight, PUWeight, LHEPdfWeight, LHEScaleWeight +TTbar = genWeight, PUWeight, LHEPdfWeight, LHEScaleWeight + ######################################################################### ######################################################################### @@ -99,16 +102,31 @@ sig_Radion_1200GeV = genWeight, PUWeight, LHEPdfWeight, LHEScaleWeight # write binning as ROOT declaration: nXbins, xmin, xmax [histos] -SelectedJetPtSum = 150, 100., 600. -FirstSelectedJetPt = 150, 20., 160. -SecondSelectedJetPt = 150, 20., 200. -ThirdSelectedJetPt = 150, 20., 160. -ForthSelectedJetPt = 150, 20., 160. -ThirdSelectedJetDeepCSV = 150, 0., 1. +FourHighetJetPtSum = 50, 100., 600. +FirstJetPt = 50, 20., 160. +SecondJetPt = 50, 20., 200. +ThirdJetPt = 50, 20., 160. +ForthJetPt = 50, 20., 160. +ThirdJetDeepCSV = 50, 0., 1. +FirstPtOrderedJetDeepCSV = 50, 0., 1. # write binning as ROOT declaration: nXbins xmin, xmax, nYbins, ymin, ymax = [histos2D] +OfflineJetPtForCaloResolution:ResolutionOnlineCaloJetPt = 100, 30., 500., 100, -300., +300. +OfflineJetPtForPFResolution:ResolutionOnlinePFJetPt = 100, 30., 500., 100, -300., +300. + # user defined binning: if defined, overrides any definition in [histos] -[binning] \ No newline at end of file +[binning] +FourHighetJetPtSum = 100, 120, 140, 160, 170, 180, 190, 200, 210, 220, 230, 240, 250, 260, 270, 280, 290, 300, 310, 320, 330, 340, 350, 360, 370, 380, 390, 400, 410, 420, 430, 440, 450, 460, 470, 480, 490, 500, 520, 540, 560, 580, 600 +SecondJetPt = 20, 34.4, 48.8, 59.6, 66.8, 74, 81.2, 84.8, 88.4, 92, 95.6, 99.2, 102.8, 106.4, 110, 113.6, 117.2, 120.8, 124.4, 128, 131.6, 135.2, 138.8, 146, 153.2, 160.4, 167.6, 178.4, 189.2, 200 + + +ForthJetPt = 20, 25.6, 31.2, 36.8, 39.6, 42.4, 45.2, 48, 50.8, 53.6, 56.4, 59.2, 62, 64.8, 67.6, 70.4, 73.2, 76, 78.8, 84.4, 90, 95.6, 104, 112.4, 120.8, 129.2, 137.6, 148.8, 160 + +ThirdJetDeepCSV = 0, 0.02, 0.04, 0.06, 0.08, 0.1, 0.12, 0.14, 0.16, 0.18, 0.2, 0.22, 0.24, 0.26, 0.28, 0.3, 0.32, 0.36, 0.4, 0.44, 0.48, 0.52, 0.56, 0.6, 0.64, 0.7, 0.76, 0.82, 0.88, 0.94, 1 + +FirstPtOrderedJetDeepCSV = 0, 0.02, 0.04, 0.06, 0.08, 0.1, 0.12, 0.14, 0.16, 0.18, 0.2, 0.22, 0.24, 0.26, 0.28, 0.3, 0.32, 0.36, 0.4, 0.44, 0.48, 0.52, 0.56, 0.6, 0.64, 0.7, 0.76, 0.82, 0.88, 0.94, 1 + + diff --git a/config/skim_2016ResonantDiHiggs4B.cfg b/config/skim_2016ResonantDiHiggs4B.cfg index 21e2004eb..45771f380 100644 --- a/config/skim_2016ResonantDiHiggs4B.cfg +++ b/config/skim_2016ResonantDiHiggs4B.cfg @@ -77,7 +77,7 @@ JECListOfCorrections = AbsoluteStat, AbsoluteScale, AbsoluteMPFBias, Fragmen # TriggerObjects : save Trigger objects for trigger studies # triggers object are listed as branchName:objectType:filterBit -# ObjectsForCut = WandZleptonDecays +ObjectsForCut = WandZleptonDecays WElectronMaxPfIso = 0.12 ZElectronMaxPfIso = 0.15 WMuonMaxPfIso = 0.15 @@ -85,7 +85,7 @@ ZMuonMaxPfIso = 0.25 MuonMaxDxy = 0.05 MuonMaxDz = 0.20 -ObjectsForCut = TriggerObjects +# ObjectsForCut = TriggerObjects MaxDeltaR = 0.3 ListOfTriggerObjectsAndBit = 1:0:BTagCaloCSVp087Triple, 1:1:DoubleCentralJet90, 1:2:DoublePFCentralJetLooseID90, 1:3:L1sTripleJetVBFIorHTTIorDoubleJetCIorSingleJet, 1:4:QuadCentralJet30, 1:5:QuadPFCentralJetLooseID30, 1:6:L1sQuadJetC50IorQuadJetC60IorHTT280IorHTT300IorHTT320IorTripleJet846848VBFIorTripleJet887256VBFIorTripleJet927664VBF, 1:7:QuadCentralJet45, 1:8:QuadPFCentralJetLooseID45 @@ -122,6 +122,7 @@ makeORof = trigger1:HLT_DoubleJet90_Double30_TripleBTagCSV_p087, trigger2:HLT_Qu MaxDeltaR = 0.3 trigger1_ObjectRequirements = 1:0:3, 1:1:2, 1:2:2, 1:3:1, 1:4:4, 1:5:4 trigger2_ObjectRequirements = 1:0:3, 1:6:1, 1:7:4, 1:8:4 +MatchWithSelectedObjects = true # ############################################################################################################## # diff --git a/config/skim_2016ResonantDiHiggs4B_antiTag.cfg b/config/skim_2016ResonantDiHiggs4B_antiTag.cfg index d6388c627..38123d1e7 100644 --- a/config/skim_2016ResonantDiHiggs4B_antiTag.cfg +++ b/config/skim_2016ResonantDiHiggs4B_antiTag.cfg @@ -80,6 +80,7 @@ WeightMethod = StandardWeight [triggers] makeORof = HLT_DoubleJet90_Double30_TripleBTagCSV_p087, HLT_QuadJet45_TripleBTagCSV_p087 +TriggerStudies = false # ############################################################################################################## # diff --git a/config/skim_2016ResonantDiHiggs4B_triggerStudies.cfg b/config/skim_2016ResonantDiHiggs4B_triggerStudies.cfg index baf579006..ad306855b 100644 --- a/config/skim_2016ResonantDiHiggs4B_triggerStudies.cfg +++ b/config/skim_2016ResonantDiHiggs4B_triggerStudies.cfg @@ -38,9 +38,9 @@ UseAntiTagOnOneBjet = false # None (do nothing) PreselectionCut = bJetCut -MinDeepCSV = 0.1 -MinPt = 20 -MaxAbsEta = 2.6 +MinDeepCSV = 0. +MinPt = 20. +MaxAbsEta = 2.4 # PreselectionCut = None @@ -74,7 +74,7 @@ JECListOfCorrections = AbsoluteStat, AbsoluteScale, AbsoluteMPFBias, Fragmen # current options are: # None : no further object saved # WandZleptonDecays : save Isolated electrons and muons from W and Z decays -# TriggerObjects : save Trigger objects for trigger studies +# TriggerObjects : save Trigger objects # triggers object are listed as branchName:objectType:filterBit # ObjectsForCut = WandZleptonDecays @@ -87,7 +87,7 @@ MuonMaxDz = 0.20 ObjectsForCut = TriggerObjects MaxDeltaR = 0.3 -ListOfTriggerObjectsAndBit = 1:0:BTagCaloCSVp087Triple, 1:1:DoubleCentralJet90, 1:2:DoublePFCentralJetLooseID90, 1:3:L1sTripleJetVBFIorHTTIorDoubleJetCIorSingleJet, 1:4:QuadCentralJet30, 1:5:QuadPFCentralJetLooseID30, 1:6:L1sQuadJetC50IorQuadJetC60IorHTT280IorHTT300IorHTT320IorTripleJet846848VBFIorTripleJet887256VBFIorTripleJet927664VBF, 1:7:QuadCentralJet45, 1:8:QuadPFCentralJetLooseID45, 13:11:hltL1sSingleMu22, 13:12:hltL2fL1sMu22L1f0L2Filtered10Q, 13:13:hltL3crIsoL1sMu22L1f0L2f10QL3f24QL3trkIsoFiltered0p09, 13:14:hltL3fL1sMu22L1f0L2f10QL3Filtered24Q +ListOfTriggerObjectsAndBit = 1:0:BTagCaloCSVp087Triple, 1:1:DoubleCentralJet90, 1:2:DoublePFCentralJetLooseID90, 1:3:L1sTripleJetVBFIorHTTIorDoubleJetCIorSingleJet, 1:4:QuadCentralJet30, 1:5:QuadPFCentralJetLooseID30, 1:6:L1sQuadJetC50IorQuadJetC60IorHTT280IorHTT300IorHTT320IorTripleJet846848VBFIorTripleJet887256VBFIorTripleJet927664VBF, 1:7:QuadCentralJet45, 1:8:QuadPFCentralJetLooseID45 # -------------------------------------------------------------------------------------------------------------- # # use BTagScaleFactorMethod to select how to evaluate the b tag scale factors @@ -98,6 +98,8 @@ ListOfTriggerObjectsAndBit = 1:0:BTagCaloCSVp087Triple, 1:1:DoubleCentralJet90, BTagScaleFactorMethod = FourBtag_ScaleFactor BJetScaleFactorsFile = weights/DeepCSV_Moriond17_B_H.csv +# BTagScaleFactorMethod = None + # -------------------------------------------------------------------------------------------------------------- # # use WeightsMethod to select the method to calculate the weights # current options are: @@ -114,14 +116,16 @@ WeightMethod = StandardWeight # triggers object are listed as objectType:filterBit:MinimumRequired # leave makeORof empty to skip the trigger requirement -makeORof = triggerIsoMu24:HLT_IsoMu24 +makeORof = triggerIsoMu24:HLT_IsoMu24, triggerIsoMu20:HLT_IsoMu20, trigger1:HLT_DoubleJet90_Double30_TripleBTagCSV_p087, trigger2:HLT_QuadJet45_TripleBTagCSV_p087 # makeORof = trigger1:HLT_DoubleJet90_Double30_TripleBTagCSV_p087, trigger2:HLT_QuadJet45_TripleBTagCSV_p087 # makeORof = trigger1:HLT_DoubleJet90_Double30_TripleBTagCSV_p087 # makeORof = trigger2:HLT_QuadJet45_TripleBTagCSV_p087 MaxDeltaR = 0.3 trigger1_ObjectRequirements = 1:0:3, 1:1:2, 1:2:2, 1:3:1, 1:4:4, 1:5:4 trigger2_ObjectRequirements = 1:0:3, 1:6:1, 1:7:4, 1:8:4 -triggerIsoMu24_ObjectRequirements = 13:11:1, 13:12:1, 13:13:1, 13:14:1 +triggerIsoMu24_ObjectRequirements = 13:10:1, 13:11:1, 13:12:1, 13:13:1, 13:14:1 +triggerIsoMu20_ObjectRequirements = 13:15:1, 13:16:1, 13:17:1, 13:18:1, 13:19:1 +MatchWithSelectedObjects = false # ############################################################################################################## # diff --git a/interface/Candidate.h b/interface/Candidate.h index 9db61ef77..b7b935900 100644 --- a/interface/Candidate.h +++ b/interface/Candidate.h @@ -23,8 +23,27 @@ class Candidate public: Candidate(){nat_ = nullptr; idx_ = -1; isComposite_=false;} // creates an invalid Candidate Candidate(int idx, NanoAODTree* nat){idx_ = idx; nat_ = nat; isComposite_=false; parentIdxVector_.emplace_back(idx);} // standard ctor to be used for NanoAODTree inspection - ~Candidate(){}; - + virtual ~Candidate(){}; + // Candidate(const Candidate& rhs) + // { + // this -> idx_ = rhs.idx_; + // this -> parentIdxVector_ = rhs.parentIdxVector_; + // this -> p4_ = rhs.p4_; + // this -> nat_ = rhs.nat_; + // this -> isComposite_ = rhs.isComposite_; + // this -> typeId_ = rhs.typeId_; + // } + + // Candidate& operator = (const Candidate& rhs) + // { + // this -> p4_ = rhs.p4_; + // this -> isComposite_ = rhs.isComposite_; + // this -> parentIdxVector_ = rhs.parentIdxVector_; + // this -> cand1_ = rhs.cand1_->clone(); + // this -> cand2_ = rhs.cand2_->clone(); + // return (*this); + // } + TLorentzVector P4() const {return p4_;} void setP4( TLorentzVector p4) {p4_ = p4;} bool getIsComposite() const {return isComposite_;} diff --git a/interface/Electron.h b/interface/Electron.h index c1911f08d..a32f1f799 100644 --- a/interface/Electron.h +++ b/interface/Electron.h @@ -12,7 +12,7 @@ class Electron : public Candidate std::unique_ptr clone() const override{ Electron *clonedElectron = new Electron(this->getIdx(), this->getNanoAODTree()); clonedElectron->setP4(this->P4()); - return std::unique_ptr (clonedElectron); + return std::unique_ptr (clonedElectron); } private: diff --git a/interface/FatJet.h b/interface/FatJet.h index 86d8483af..1fffed4e1 100644 --- a/interface/FatJet.h +++ b/interface/FatJet.h @@ -12,7 +12,7 @@ class FatJet : public Candidate std::unique_ptr clone() const override{ FatJet *clonedFatJet = new FatJet(this->getIdx(), this->getNanoAODTree()); clonedFatJet->setP4(this->P4()); - return std::unique_ptr (clonedFatJet); + return std::unique_ptr (clonedFatJet); } private: diff --git a/interface/GenJet.h b/interface/GenJet.h index fa97da5a0..0e78a8ad2 100644 --- a/interface/GenJet.h +++ b/interface/GenJet.h @@ -12,7 +12,7 @@ class GenJet : public Candidate std::unique_ptr clone() const { GenJet *clonedGenJet = new GenJet(this->getIdx(), this->getNanoAODTree()); clonedGenJet->setP4(this->P4()); - return std::unique_ptr (clonedGenJet); + return std::unique_ptr (clonedGenJet); } private: void buildP4(); diff --git a/interface/OfflineProducerHelper.h b/interface/OfflineProducerHelper.h index 7aeb807cd..64cebf868 100644 --- a/interface/OfflineProducerHelper.h +++ b/interface/OfflineProducerHelper.h @@ -199,7 +199,7 @@ class OfflineProducerHelper{ // save trigger Objects for trigger studies void save_TriggerObjects (NanoAODTree& nat, OutputTree &ot, EventInfo& ei); // Calculate trigger map - void calculateTriggerMatching(const std::vector< std::unique_ptr > &candidateList, NanoAODTree& nat); + void calculateTriggerMatching(const std::vector< std::unique_ptr > &candidateList, NanoAODTree& nat, OutputTree& ot); //Initialize trigger Matching variables void initializeTriggerMatching(OutputTree &ot); diff --git a/interface/OutputTree.h b/interface/OutputTree.h index 5021a717b..e9dcf6b5e 100644 --- a/interface/OutputTree.h +++ b/interface/OutputTree.h @@ -41,7 +41,7 @@ class OutputTree { public: - OutputTree (bool savetlv = false, std::string name = "bbbbTree", std::string title = "bbbbTree"); + OutputTree (bool savetlv = false, std::string name = "bbbbTree", std::string title = "bbbbTree", bool initAllBranches = true); ~OutputTree(){}; void clear(); // to be called to reset the var values @@ -396,7 +396,7 @@ class OutputTree { float hhj2_deltaEta; float hhjj_deltaEta; private: - void init_branches(); + void init_branches(bool initAllBranches); std::unique_ptr tree_; const bool savetlv_; diff --git a/scripts/TriggerEfficiencyFitter.C b/scripts/TriggerEfficiencyFitter.C index 495f83162..d28c5889e 100644 --- a/scripts/TriggerEfficiencyFitter.C +++ b/scripts/TriggerEfficiencyFitter.C @@ -5,17 +5,17 @@ #include "TGraphAsymmErrors.h" -TGraphAsymmErrors* TriggerEfficiencyFitter(TFile *inputFile, std::string sampleName, std::string histogramName, +TGraphAsymmErrors* TriggerEfficiencyFitter(TFile *inputFile, std::string sampleName, std::string referenceTriggerName, std::string histogramName, std::string selectionName, std::string normalizationSelectionName, TF1 *fittingFunction, double *parameters, - std::string histogramTitle, std::string xAxisTitle) + std::string histogramTitle, std::string xAxisTitle, Color_t lineColor) { - std::string cutTmpName = Form("%s/%s/%s_%s_%s",sampleName.data(),selectionName.data(),sampleName.data(),selectionName.data(),histogramName.data()); + std::string cutTmpName = Form("%s/%s_%s/%s_%s_%s_%s",sampleName.data(),selectionName.data(),referenceTriggerName.data(),sampleName.data(),selectionName.data(),referenceTriggerName.data(),histogramName.data()); std::cout<Get(cutTmpName.data()); TH1D *cutHisto = (TH1D*)cutTmp->Clone(("cut "+selectionName).data()); cutHisto->SetDirectory(0); - std::string normalizationTmpName = Form("%s/%s/%s_%s_%s",sampleName.data(),normalizationSelectionName.data(),sampleName.data(),normalizationSelectionName.data(),histogramName.data()); + std::string normalizationTmpName = Form("%s/%s_%s/%s_%s_%s_%s",sampleName.data(),normalizationSelectionName.data(),referenceTriggerName.data(), sampleName.data(),normalizationSelectionName.data(),referenceTriggerName.data(), histogramName.data()); std::cout<Get(normalizationTmpName.data()); TH1D *normalizationHisto = (TH1D*)normalizationTmp->Clone(("Normalization "+selectionName).data()); @@ -26,14 +26,14 @@ TGraphAsymmErrors* TriggerEfficiencyFitter(TFile *inputFile, std::string sampleN g_efficiency->SetTitle(histogramTitle.data()); g_efficiency->GetXaxis()->SetTitle(xAxisTitle.data()); g_efficiency->GetYaxis()->SetTitle("efficiency"); - g_efficiency->SetNameTitle(("Efficiency_"+selectionName).data(), ("Efficiency "+selectionName).data()); + g_efficiency->SetNameTitle(("Efficiency_"+selectionName+"_"+histogramName).data(), ("Efficiency "+selectionName+"_"+histogramName).data()); g_efficiency->GetYaxis()->SetRangeUser(0., 1.2); - g_efficiency->SetLineColor(kBlue); + g_efficiency->SetLineColor(lineColor); return g_efficiency; } -void MeasureTriggerEfficiency(std::string inputFileName, std::string sampleName, std::string outputFileName) +void MeasureTriggerEfficiency(std::string inputFileName, std::string sampleName, std::string referenceTriggerName, std::string outputFileName, Color_t lineColor) { TF1 *dummyFormula = new TF1(); double dummyParameters[1] = {0.}; @@ -44,72 +44,265 @@ void MeasureTriggerEfficiency(std::string inputFileName, std::string sampleName, // HLT_DoubleJet90_Double30_TripleBTagCSV_p087 - efficiency = TriggerEfficiencyFitter(inputFile, sampleName, "SelectedJetPtSum", - "L1triggerDouble90Double30AndPrevious_Full", "Normalization_Full", dummyFormula, dummyParameters, - "L1 Trigger", "p_{1}^{T} + p_{2}^{T} + p_{3}^{T} + p_{4}^{T}"); - // efficiency->SetDirectory(0); + efficiency = TriggerEfficiencyFitter(inputFile, sampleName, referenceTriggerName, "FourHighetJetPtSum", + "L1triggerDouble90Double30AndPrevious", "Normalization", dummyFormula, dummyParameters, + "L1 Trigger", "p_{1}^{T} + p_{2}^{T} + p_{3}^{T} + p_{4}^{T}", lineColor); efficiency->Write(); - efficiency = TriggerEfficiencyFitter(inputFile, sampleName, "ForthSelectedJetPt", - "QuadCentralJet30AndPrevious_Full", "L1triggerDouble90Double30AndPrevious_Full", dummyFormula, dummyParameters, - "Quad Central Jet 30 GeV", "p_{4}^{T}"); - // efficiency->SetDirectory(0); + efficiency = TriggerEfficiencyFitter(inputFile, sampleName, referenceTriggerName, "FirstJetPt", + "QuadCentralJet30AndPrevious", "L1triggerDouble90Double30AndPrevious", dummyFormula, dummyParameters, + "Quad Central Jet 30 GeV", "p_{1}^{T}", lineColor); efficiency->Write(); - efficiency = TriggerEfficiencyFitter(inputFile, sampleName, "SecondSelectedJetPt", - "DoubleCentralJet90AndPrevious_Full", "QuadCentralJet30AndPrevious_Full", dummyFormula, dummyParameters, - "Double Central Jet 90 GeV", "p_{2}^{T}"); - // efficiency->SetDirectory(0); + efficiency = TriggerEfficiencyFitter(inputFile, sampleName, referenceTriggerName, "SecondJetPt", + "QuadCentralJet30AndPrevious", "L1triggerDouble90Double30AndPrevious", dummyFormula, dummyParameters, + "Quad Central Jet 30 GeV", "p_{2}^{T}", lineColor); efficiency->Write(); - efficiency = TriggerEfficiencyFitter(inputFile, sampleName, "ThirdSelectedJetDeepCSV", - "BTagCaloCSVp087TripleDouble90Double30AndPrevious_Full", "DoubleCentralJet90AndPrevious_Full", dummyFormula, dummyParameters, - "BTag CaloCSV p087 Triple", "DeepCSV_{3}"); - // efficiency->SetDirectory(0); + efficiency = TriggerEfficiencyFitter(inputFile, sampleName, referenceTriggerName, "ThirdJetPt", + "QuadCentralJet30AndPrevious", "L1triggerDouble90Double30AndPrevious", dummyFormula, dummyParameters, + "Quad Central Jet 30 GeV", "p_{3}^{T}", lineColor); efficiency->Write(); - efficiency = TriggerEfficiencyFitter(inputFile, sampleName, "ForthSelectedJetPt", - "QuadPFCentralJetLooseID30AndPrevious_Full", "BTagCaloCSVp087TripleDouble90Double30AndPrevious_Full", dummyFormula, dummyParameters, - "Quad PF Central Jet Loose ID 30 GeV", "p_{4}^{T}"); - // efficiency->SetDirectory(0); + efficiency = TriggerEfficiencyFitter(inputFile, sampleName, referenceTriggerName, "ForthJetPt", + "QuadCentralJet30AndPrevious", "L1triggerDouble90Double30AndPrevious", dummyFormula, dummyParameters, + "Quad Central Jet 30 GeV", "p_{4}^{T}", lineColor); efficiency->Write(); - efficiency = TriggerEfficiencyFitter(inputFile, sampleName, "SecondSelectedJetPt", - "DoublePFCentralJetLooseID90AndPrevious_Full", "QuadPFCentralJetLooseID30AndPrevious_Full", dummyFormula, dummyParameters, - "Double PF Central Jet Loose ID 90 GeV", "p_{2}^{T}"); - // efficiency->SetDirectory(0); + efficiency = TriggerEfficiencyFitter(inputFile, sampleName, referenceTriggerName, "FirstJetPt", + "DoubleCentralJet90AndPrevious", "QuadCentralJet30AndPrevious", dummyFormula, dummyParameters, + "Double Central Jet 90 GeV", "p_{1}^{T}", lineColor); + efficiency->Write(); + + efficiency = TriggerEfficiencyFitter(inputFile, sampleName, referenceTriggerName, "SecondJetPt", + "DoubleCentralJet90AndPrevious", "QuadCentralJet30AndPrevious", dummyFormula, dummyParameters, + "Double Central Jet 90 GeV", "p_{2}^{T}", lineColor); + efficiency->Write(); + + efficiency = TriggerEfficiencyFitter(inputFile, sampleName, referenceTriggerName, "ThirdJetDeepCSV", + "BTagCaloCSVp087TripleDouble90Double30AndPrevious", "DoubleCentralJet90AndPrevious", dummyFormula, dummyParameters, + "BTag CaloCSV p087 Triple", "DeepCSV_{3}", lineColor); + efficiency->Write(); + + // efficiency = TriggerEfficiencyFitter(inputFile, sampleName, referenceTriggerName, "FirstPtOrderedJetDeepCSV", + // "SelectionForBTagDouble90Double30", "NormalizationForBTagDouble90Double30", dummyFormula, dummyParameters, + // "BTag CaloCSV p087 Single", "DeepCSV", lineColor); + // efficiency->Write(); + + efficiency = TriggerEfficiencyFitter(inputFile, sampleName, referenceTriggerName, "FirstJetPt", + "QuadPFCentralJetLooseID30AndPrevious", "BTagCaloCSVp087TripleDouble90Double30AndPrevious", dummyFormula, dummyParameters, + "Quad PF Central Jet Loose ID 30 GeV", "p_{1}^{T}", lineColor); + efficiency->Write(); + + efficiency = TriggerEfficiencyFitter(inputFile, sampleName, referenceTriggerName, "SecondJetPt", + "QuadPFCentralJetLooseID30AndPrevious", "BTagCaloCSVp087TripleDouble90Double30AndPrevious", dummyFormula, dummyParameters, + "Quad PF Central Jet Loose ID 30 GeV", "p_{2}^{T}", lineColor); + efficiency->Write(); + + efficiency = TriggerEfficiencyFitter(inputFile, sampleName, referenceTriggerName, "ThirdJetPt", + "QuadPFCentralJetLooseID30AndPrevious", "BTagCaloCSVp087TripleDouble90Double30AndPrevious", dummyFormula, dummyParameters, + "Quad PF Central Jet Loose ID 30 GeV", "p_{3}^{T}", lineColor); + efficiency->Write(); + + efficiency = TriggerEfficiencyFitter(inputFile, sampleName, referenceTriggerName, "ForthJetPt", + "QuadPFCentralJetLooseID30AndPrevious", "BTagCaloCSVp087TripleDouble90Double30AndPrevious", dummyFormula, dummyParameters, + "Quad PF Central Jet Loose ID 30 GeV", "p_{4}^{T}", lineColor); + efficiency->Write(); + + efficiency = TriggerEfficiencyFitter(inputFile, sampleName, referenceTriggerName, "FirstJetPt", + "DoublePFCentralJetLooseID90AndPrevious", "QuadPFCentralJetLooseID30AndPrevious", dummyFormula, dummyParameters, + "Double PF Central Jet Loose ID 90 GeV", "p_{1}^{T}", lineColor); + efficiency->Write(); + + efficiency = TriggerEfficiencyFitter(inputFile, sampleName, referenceTriggerName, "SecondJetPt", + "DoublePFCentralJetLooseID90AndPrevious", "QuadPFCentralJetLooseID30AndPrevious", dummyFormula, dummyParameters, + "Double PF Central Jet Loose ID 90 GeV", "p_{2}^{T}", lineColor); efficiency->Write(); - // HLT_QuadJet45_TripleBTagCSV_p087 - efficiency = TriggerEfficiencyFitter(inputFile, sampleName, "SelectedJetPtSum", - "L1triggerQuad45AndPrevious_Full", "Normalization_Full", dummyFormula, dummyParameters, - "L1 Trigger", "p_{1}^{T} + p_{2}^{T} + p_{3}^{T} + p_{4}^{T}"); - // efficiency->SetDirectory(0); + + // _QuadJet45_TripleBTagCSV_p087 + efficiency = TriggerEfficiencyFitter(inputFile, sampleName, referenceTriggerName, "FourHighetJetPtSum", + "L1triggerQuad45AndPrevious", "Normalization", dummyFormula, dummyParameters, + "L1 Trigger", "p_{1}^{T} + p_{2}^{T} + p_{3}^{T} + p_{4}^{T}", lineColor); efficiency->Write(); - efficiency = TriggerEfficiencyFitter(inputFile, sampleName, "ForthSelectedJetPt", - "QuadCentralJet45AndPrevious_Full", "L1triggerQuad45AndPrevious_Full", dummyFormula, dummyParameters, - "Quad Central Jet 45 GeV", "p_{4}^{T}"); - // efficiency->SetDirectory(0); + efficiency = TriggerEfficiencyFitter(inputFile, sampleName, referenceTriggerName, "FirstJetPt", + "QuadCentralJet45AndPrevious", "L1triggerQuad45AndPrevious", dummyFormula, dummyParameters, + "Quad Central Jet 45 GeV", "p_{1}^{T}", lineColor); efficiency->Write(); - efficiency = TriggerEfficiencyFitter(inputFile, sampleName, "ThirdSelectedJetDeepCSV", - "BTagCaloCSVp087TripleQuad45AndPrevious_Full", "QuadCentralJet45AndPrevious_Full", dummyFormula, dummyParameters, - "BTag CaloCSV p087 Triple", "DeepCSV_{3}"); - // efficiency->SetDirectory(0); + efficiency = TriggerEfficiencyFitter(inputFile, sampleName, referenceTriggerName, "SecondJetPt", + "QuadCentralJet45AndPrevious", "L1triggerQuad45AndPrevious", dummyFormula, dummyParameters, + "Quad Central Jet 45 GeV", "p_{2}^{T}", lineColor); efficiency->Write(); - efficiency = TriggerEfficiencyFitter(inputFile, sampleName, "ForthSelectedJetPt", - "QuadPFCentralJetLooseID45AndPrevious_Full", "BTagCaloCSVp087TripleQuad45AndPrevious_Full", dummyFormula, dummyParameters, - "Quad PF Central Jet Loose ID 45 GeV", "p_{4}^{T}"); - // efficiency->SetDirectory(0); + efficiency = TriggerEfficiencyFitter(inputFile, sampleName, referenceTriggerName, "ThirdJetPt", + "QuadCentralJet45AndPrevious", "L1triggerQuad45AndPrevious", dummyFormula, dummyParameters, + "Quad Central Jet 45 GeV", "p_{3}^{T}", lineColor); + + efficiency->Write(); + efficiency = TriggerEfficiencyFitter(inputFile, sampleName, referenceTriggerName, "ForthJetPt", + "QuadCentralJet45AndPrevious", "L1triggerQuad45AndPrevious", dummyFormula, dummyParameters, + "Quad Central Jet 45 GeV", "p_{4}^{T}", lineColor); efficiency->Write(); - //outputFile->WriteObject(efficiency,"Efficiency"); + efficiency = TriggerEfficiencyFitter(inputFile, sampleName, referenceTriggerName, "ThirdJetDeepCSV", + "BTagCaloCSVp087TripleQuad45AndPrevious", "QuadCentralJet45AndPrevious", dummyFormula, dummyParameters, + "BTag CaloCSV p087 Triple", "DeepCSV_{3}", lineColor); + efficiency->Write(); - // inputFile->Close(); - // outputFile->Close(); + // efficiency = TriggerEfficiencyFitter(inputFile, sampleName, referenceTriggerName, "FirstPtOrderedJetDeepCSV", + // "SelectionForBTagQuad45", "NormalizationForBTagQuad45", dummyFormula, dummyParameters, + // "BTag CaloCSV p087 Single", "DeepCSV", lineColor); + // efficiency->Write(); + + efficiency = TriggerEfficiencyFitter(inputFile, sampleName, referenceTriggerName, "FirstJetPt", + "QuadPFCentralJetLooseID45AndPrevious", "BTagCaloCSVp087TripleQuad45AndPrevious", dummyFormula, dummyParameters, + "Quad PF Central Jet Loose ID 45 GeV", "p_{1}^{T}", lineColor); + efficiency->Write(); + + efficiency = TriggerEfficiencyFitter(inputFile, sampleName, referenceTriggerName, "SecondJetPt", + "QuadPFCentralJetLooseID45AndPrevious", "BTagCaloCSVp087TripleQuad45AndPrevious", dummyFormula, dummyParameters, + "Quad PF Central Jet Loose ID 45 GeV", "p_{2}^{T}", lineColor); + efficiency->Write(); + + efficiency = TriggerEfficiencyFitter(inputFile, sampleName, referenceTriggerName, "ThirdJetPt", + "QuadPFCentralJetLooseID45AndPrevious", "BTagCaloCSVp087TripleQuad45AndPrevious", dummyFormula, dummyParameters, + "Quad PF Central Jet Loose ID 45 GeV", "p_{3}^{T}", lineColor); + efficiency->Write(); + + efficiency = TriggerEfficiencyFitter(inputFile, sampleName, referenceTriggerName, "ForthJetPt", + "QuadPFCentralJetLooseID45AndPrevious", "BTagCaloCSVp087TripleQuad45AndPrevious", dummyFormula, dummyParameters, + "Quad PF Central Jet Loose ID 45 GeV", "p_{4}^{T}", lineColor); + efficiency->Write(); + + + inputFile->Close(); + outputFile->Close(); + + delete inputFile; + delete outputFile; return; -} \ No newline at end of file +} + +void ProduceAllTriggerEfficiencies() +{ + + // // SingleMuon_RunBF + // MeasureTriggerEfficiency("2016DataPlots_MuonPt40_ForthJetPt30_CMVAM/outPlotter.root","SingleMuon_RunBF","HLT_IsoMu24","TriggerEfficiency_SingleMuon_RunBF_MuonPt40_ForthJetPt30_CMVAM_IsoMu24.root",kBlue); + // MeasureTriggerEfficiency("2016DataPlots_MuonPt40_ForthJetPt30_CMVAM/outPlotter.root","SingleMuon_RunBF","HLT_IsoMu24_Matched","TriggerEfficiency_SingleMuon_RunBF_MuonPt40_ForthJetPt30_CMVAM_IsoMu24_Matched.root",kBlue); + // MeasureTriggerEfficiency("2016DataPlots_MuonPt40_ForthJetPt30_CMVAM/outPlotter.root","SingleMuon_RunBF","HLT_IsoMu20","TriggerEfficiency_SingleMuon_RunBF_MuonPt40_ForthJetPt30_CMVAM_IsoMu20.root",kBlue); + // MeasureTriggerEfficiency("2016DataPlots_MuonPt40_ForthJetPt30_CMVAM/outPlotter.root","SingleMuon_RunBF","HLT_IsoMu20_Matched","TriggerEfficiency_SingleMuon_RunBF_MuonPt40_ForthJetPt30_CMVAM_IsoMu20_Matched.root",kBlue); + + // MeasureTriggerEfficiency("2016DataPlots_MuonPt40_ForthJetPt30/outPlotter.root","SingleMuon_RunBF","HLT_IsoMu24","TriggerEfficiency_SingleMuon_RunBF_MuonPt40_ForthJetPt30_IsoMu24.root",kBlue); + // MeasureTriggerEfficiency("2016DataPlots_MuonPt40_ForthJetPt30/outPlotter.root","SingleMuon_RunBF","HLT_IsoMu24_Matched","TriggerEfficiency_SingleMuon_RunBF_MuonPt40_ForthJetPt30_IsoMu24_Matched.root",kBlue); + // MeasureTriggerEfficiency("2016DataPlots_MuonPt40_ForthJetPt30/outPlotter.root","SingleMuon_RunBF","HLT_IsoMu20","TriggerEfficiency_SingleMuon_RunBF_MuonPt40_ForthJetPt30_IsoMu20.root",kBlue); + // MeasureTriggerEfficiency("2016DataPlots_MuonPt40_ForthJetPt30/outPlotter.root","SingleMuon_RunBF","HLT_IsoMu20_Matched","TriggerEfficiency_SingleMuon_RunBF_MuonPt40_ForthJetPt30_IsoMu20_Matched.root",kBlue); + + // MeasureTriggerEfficiency("2016DataPlots_4bLooseSelection/outPlotter.root","SingleMuon_RunBF","HLT_IsoMu24","TriggerEfficiency_SingleMuon_RunBF_4bLooseSelection_IsoMu24.root",kBlue); + // MeasureTriggerEfficiency("2016DataPlots_4bLooseSelection/outPlotter.root","SingleMuon_RunBF","HLT_IsoMu24_Matched","TriggerEfficiency_SingleMuon_RunBF_4bLooseSelection_IsoMu24_Matched.root",kBlue); + // MeasureTriggerEfficiency("2016DataPlots_4bLooseSelection/outPlotter.root","SingleMuon_RunBF","HLT_IsoMu20","TriggerEfficiency_SingleMuon_RunBF_4bLooseSelection_IsoMu20.root",kBlue); + // MeasureTriggerEfficiency("2016DataPlots_4bLooseSelection/outPlotter.root","SingleMuon_RunBF","HLT_IsoMu20_Matched","TriggerEfficiency_SingleMuon_RunBF_4bLooseSelection_IsoMu20_Matched.root",kBlue); + + // MeasureTriggerEfficiency("2016DataPlots_4bSelection/outPlotter.root","SingleMuon_RunBF","HLT_IsoMu24","TriggerEfficiency_SingleMuon_RunBF_4bSelection_IsoMu24.root",kBlue); + // MeasureTriggerEfficiency("2016DataPlots_4bSelection/outPlotter.root","SingleMuon_RunBF","HLT_IsoMu24_Matched","TriggerEfficiency_SingleMuon_RunBF_4bSelection_IsoMu24_Matched.root",kBlue); + // MeasureTriggerEfficiency("2016DataPlots_4bSelection/outPlotter.root","SingleMuon_RunBF","HLT_IsoMu20","TriggerEfficiency_SingleMuon_RunBF_4bSelection_IsoMu20.root",kBlue); + // MeasureTriggerEfficiency("2016DataPlots_4bSelection/outPlotter.root","SingleMuon_RunBF","HLT_IsoMu20_Matched","TriggerEfficiency_SingleMuon_RunBF_4bSelection_IsoMu20_Matched.root",kBlue); + + // // SingleMuon_RunGH + // MeasureTriggerEfficiency("2016DataPlots_MuonPt40_ForthJetPt30_CMVAM/outPlotter.root","SingleMuon_RunGH","HLT_IsoMu24","TriggerEfficiency_SingleMuon_RunGH_MuonPt40_ForthJetPt30_CMVAM_IsoMu24.root",kBlue); + // MeasureTriggerEfficiency("2016DataPlots_MuonPt40_ForthJetPt30_CMVAM/outPlotter.root","SingleMuon_RunGH","HLT_IsoMu24_Matched","TriggerEfficiency_SingleMuon_RunGH_MuonPt40_ForthJetPt30_CMVAM_IsoMu24_Matched.root",kBlue); + // MeasureTriggerEfficiency("2016DataPlots_MuonPt40_ForthJetPt30_CMVAM/outPlotter.root","SingleMuon_RunGH","HLT_IsoMu20","TriggerEfficiency_SingleMuon_RunGH_MuonPt40_ForthJetPt30_CMVAM_IsoMu20.root",kBlue); + // MeasureTriggerEfficiency("2016DataPlots_MuonPt40_ForthJetPt30_CMVAM/outPlotter.root","SingleMuon_RunGH","HLT_IsoMu20_Matched","TriggerEfficiency_SingleMuon_RunGH_MuonPt40_ForthJetPt30_CMVAM_IsoMu20_Matched.root",kBlue); + + // MeasureTriggerEfficiency("2016DataPlots_MuonPt40_ForthJetPt30/outPlotter.root","SingleMuon_RunGH","HLT_IsoMu24","TriggerEfficiency_SingleMuon_RunGH_MuonPt40_ForthJetPt30_IsoMu24.root",kBlue); + // MeasureTriggerEfficiency("2016DataPlots_MuonPt40_ForthJetPt30/outPlotter.root","SingleMuon_RunGH","HLT_IsoMu24_Matched","TriggerEfficiency_SingleMuon_RunGH_MuonPt40_ForthJetPt30_IsoMu24_Matched.root",kBlue); + // MeasureTriggerEfficiency("2016DataPlots_MuonPt40_ForthJetPt30/outPlotter.root","SingleMuon_RunGH","HLT_IsoMu20","TriggerEfficiency_SingleMuon_RunGH_MuonPt40_ForthJetPt30_IsoMu20.root",kBlue); + // MeasureTriggerEfficiency("2016DataPlots_MuonPt40_ForthJetPt30/outPlotter.root","SingleMuon_RunGH","HLT_IsoMu20_Matched","TriggerEfficiency_SingleMuon_RunGH_MuonPt40_ForthJetPt30_IsoMu20_Matched.root",kBlue); + + // MeasureTriggerEfficiency("2016DataPlots_4bLooseSelection/outPlotter.root","SingleMuon_RunGH","HLT_IsoMu24","TriggerEfficiency_SingleMuon_RunGH_4bLooseSelection_IsoMu24.root",kBlue); + // MeasureTriggerEfficiency("2016DataPlots_4bLooseSelection/outPlotter.root","SingleMuon_RunGH","HLT_IsoMu24_Matched","TriggerEfficiency_SingleMuon_RunGH_4bLooseSelection_IsoMu24_Matched.root",kBlue); + // MeasureTriggerEfficiency("2016DataPlots_4bLooseSelection/outPlotter.root","SingleMuon_RunGH","HLT_IsoMu20","TriggerEfficiency_SingleMuon_RunGH_4bLooseSelection_IsoMu20.root",kBlue); + // MeasureTriggerEfficiency("2016DataPlots_4bLooseSelection/outPlotter.root","SingleMuon_RunGH","HLT_IsoMu20_Matched","TriggerEfficiency_SingleMuon_RunGH_4bLooseSelection_IsoMu20_Matched.root",kBlue); + + // MeasureTriggerEfficiency("2016DataPlots_4bSelection/outPlotter.root","SingleMuon_RunGH","HLT_IsoMu24","TriggerEfficiency_SingleMuon_RunGH_4bSelection_IsoMu24.root",kBlue); + // MeasureTriggerEfficiency("2016DataPlots_4bSelection/outPlotter.root","SingleMuon_RunGH","HLT_IsoMu24_Matched","TriggerEfficiency_SingleMuon_RunGH_4bSelection_IsoMu24_Matched.root",kBlue); + // MeasureTriggerEfficiency("2016DataPlots_4bSelection/outPlotter.root","SingleMuon_RunGH","HLT_IsoMu20","TriggerEfficiency_SingleMuon_RunGH_4bSelection_IsoMu20.root",kBlue); + // MeasureTriggerEfficiency("2016DataPlots_4bSelection/outPlotter.root","SingleMuon_RunGH","HLT_IsoMu20_Matched","TriggerEfficiency_SingleMuon_RunGH_4bSelection_IsoMu20_Matched.root",kBlue); + + // // TTbar + // MeasureTriggerEfficiency("2016DataPlots_MuonPt40_ForthJetPt30_CMVAM/outPlotter.root","TTbar","HLT_IsoMu24","TriggerEfficiency_TTbar_MuonPt40_ForthJetPt30_CMVAM_IsoMu24.root",kBlue); + // MeasureTriggerEfficiency("2016DataPlots_MuonPt40_ForthJetPt30_CMVAM/outPlotter.root","TTbar","HLT_IsoMu24_Matched","TriggerEfficiency_TTbar_MuonPt40_ForthJetPt30_CMVAM_IsoMu24_Matched.root",kBlue); + // MeasureTriggerEfficiency("2016DataPlots_MuonPt40_ForthJetPt30_CMVAM/outPlotter.root","TTbar","HLT_IsoMu20","TriggerEfficiency_TTbar_MuonPt40_ForthJetPt30_CMVAM_IsoMu20.root",kBlue); + // MeasureTriggerEfficiency("2016DataPlots_MuonPt40_ForthJetPt30_CMVAM/outPlotter.root","TTbar","HLT_IsoMu20_Matched","TriggerEfficiency_TTbar_MuonPt40_ForthJetPt30_CMVAM_IsoMu20_Matched.root",kBlue); + + // MeasureTriggerEfficiency("2016DataPlots_MuonPt40_ForthJetPt30/outPlotter.root","TTbar","HLT_IsoMu24","TriggerEfficiency_TTbar_MuonPt40_ForthJetPt30_IsoMu24.root",kBlue); + // MeasureTriggerEfficiency("2016DataPlots_MuonPt40_ForthJetPt30/outPlotter.root","TTbar","HLT_IsoMu24_Matched","TriggerEfficiency_TTbar_MuonPt40_ForthJetPt30_IsoMu24_Matched.root",kBlue); + // MeasureTriggerEfficiency("2016DataPlots_MuonPt40_ForthJetPt30/outPlotter.root","TTbar","HLT_IsoMu20","TriggerEfficiency_TTbar_MuonPt40_ForthJetPt30_IsoMu20.root",kBlue); + // MeasureTriggerEfficiency("2016DataPlots_MuonPt40_ForthJetPt30/outPlotter.root","TTbar","HLT_IsoMu20_Matched","TriggerEfficiency_TTbar_MuonPt40_ForthJetPt30_IsoMu20_Matched.root",kBlue); + + // MeasureTriggerEfficiency("2016DataPlots_4bLooseSelection/outPlotter.root","TTbar","HLT_IsoMu24","TriggerEfficiency_TTbar_4bLooseSelection_IsoMu24.root",kBlue); + // MeasureTriggerEfficiency("2016DataPlots_4bLooseSelection/outPlotter.root","TTbar","HLT_IsoMu24_Matched","TriggerEfficiency_TTbar_4bLooseSelection_IsoMu24_Matched.root",kBlue); + // MeasureTriggerEfficiency("2016DataPlots_4bLooseSelection/outPlotter.root","TTbar","HLT_IsoMu20","TriggerEfficiency_TTbar_4bLooseSelection_IsoMu20.root",kBlue); + // MeasureTriggerEfficiency("2016DataPlots_4bLooseSelection/outPlotter.root","TTbar","HLT_IsoMu20_Matched","TriggerEfficiency_TTbar_4bLooseSelection_IsoMu20_Matched.root",kBlue); + + // MeasureTriggerEfficiency("2016DataPlots_4bSelection/outPlotter.root","TTbar","HLT_IsoMu24","TriggerEfficiency_TTbar_4bSelection_IsoMu24.root",kBlue); + // MeasureTriggerEfficiency("2016DataPlots_4bSelection/outPlotter.root","TTbar","HLT_IsoMu24_Matched","TriggerEfficiency_TTbar_4bSelection_IsoMu24_Matched.root",kBlue); + // MeasureTriggerEfficiency("2016DataPlots_4bSelection/outPlotter.root","TTbar","HLT_IsoMu20","TriggerEfficiency_TTbar_4bSelection_IsoMu20.root",kBlue); + // MeasureTriggerEfficiency("2016DataPlots_4bSelection/outPlotter.root","TTbar","HLT_IsoMu20_Matched","TriggerEfficiency_TTbar_4bSelection_IsoMu20_Matched.root",kBlue); + + + SingleMuon + MeasureTriggerEfficiency("2016DataPlots_MuonPt40_ForthJetPt30_CMVAM/outPlotter.root","SingleMuon","HLT_IsoMu24","TriggerEfficiency_SingleMuon_MuonPt40_ForthJetPt30_CMVAM_IsoMu24.root",kBlue); + MeasureTriggerEfficiency("2016DataPlots_MuonPt40_ForthJetPt30_CMVAM/outPlotter.root","SingleMuon","HLT_IsoMu24_Matched","TriggerEfficiency_SingleMuon_MuonPt40_ForthJetPt30_CMVAM_IsoMu24_Matched.root",kBlue); + MeasureTriggerEfficiency("2016DataPlots_MuonPt40_ForthJetPt30_CMVAM/outPlotter.root","SingleMuon","HLT_IsoMu20","TriggerEfficiency_SingleMuon_MuonPt40_ForthJetPt30_CMVAM_IsoMu20.root",kBlue); + MeasureTriggerEfficiency("2016DataPlots_MuonPt40_ForthJetPt30_CMVAM/outPlotter.root","SingleMuon","HLT_IsoMu20_Matched","TriggerEfficiency_SingleMuon_MuonPt40_ForthJetPt30_CMVAM_IsoMu20_Matched.root",kBlue); + + MeasureTriggerEfficiency("2016DataPlots_MuonPt40_ForthJetPt30/outPlotter.root","SingleMuon","HLT_IsoMu24","TriggerEfficiency_SingleMuon_MuonPt40_ForthJetPt30_IsoMu24.root",kBlue); + MeasureTriggerEfficiency("2016DataPlots_MuonPt40_ForthJetPt30/outPlotter.root","SingleMuon","HLT_IsoMu24_Matched","TriggerEfficiency_SingleMuon_MuonPt40_ForthJetPt30_IsoMu24_Matched.root",kBlue); + MeasureTriggerEfficiency("2016DataPlots_MuonPt40_ForthJetPt30/outPlotter.root","SingleMuon","HLT_IsoMu20","TriggerEfficiency_SingleMuon_MuonPt40_ForthJetPt30_IsoMu20.root",kBlue); + MeasureTriggerEfficiency("2016DataPlots_MuonPt40_ForthJetPt30/outPlotter.root","SingleMuon","HLT_IsoMu20_Matched","TriggerEfficiency_SingleMuon_MuonPt40_ForthJetPt30_IsoMu20_Matched.root",kBlue); + + MeasureTriggerEfficiency("2016DataPlots_4bLooseSelection/outPlotter.root","SingleMuon","HLT_IsoMu24","TriggerEfficiency_SingleMuon_4bLooseSelection_IsoMu24.root",kBlue); + MeasureTriggerEfficiency("2016DataPlots_4bLooseSelection/outPlotter.root","SingleMuon","HLT_IsoMu24_Matched","TriggerEfficiency_SingleMuon_4bLooseSelection_IsoMu24_Matched.root",kBlue); + MeasureTriggerEfficiency("2016DataPlots_4bLooseSelection/outPlotter.root","SingleMuon","HLT_IsoMu20","TriggerEfficiency_SingleMuon_4bLooseSelection_IsoMu20.root",kBlue); + MeasureTriggerEfficiency("2016DataPlots_4bLooseSelection/outPlotter.root","SingleMuon","HLT_IsoMu20_Matched","TriggerEfficiency_SingleMuon_4bLooseSelection_IsoMu20_Matched.root",kBlue); + + MeasureTriggerEfficiency("2016DataPlots_4bSelection/outPlotter.root","SingleMuon","HLT_IsoMu24","TriggerEfficiency_SingleMuon_4bSelection_IsoMu24.root",kBlue); + MeasureTriggerEfficiency("2016DataPlots_4bSelection/outPlotter.root","SingleMuon","HLT_IsoMu24_Matched","TriggerEfficiency_SingleMuon_4bSelection_IsoMu24_Matched.root",kBlue); + MeasureTriggerEfficiency("2016DataPlots_4bSelection/outPlotter.root","SingleMuon","HLT_IsoMu20","TriggerEfficiency_SingleMuon_4bSelection_IsoMu20.root",kBlue); + MeasureTriggerEfficiency("2016DataPlots_4bSelection/outPlotter.root","SingleMuon","HLT_IsoMu20_Matched","TriggerEfficiency_SingleMuon_4bSelection_IsoMu20_Matched.root",kBlue); + + TTbar + MeasureTriggerEfficiency("2016DataPlots_MuonPt40_ForthJetPt30_CMVAM/outPlotter.root","TTbar","HLT_IsoMu24","TriggerEfficiency_TTbar_MuonPt40_ForthJetPt30_CMVAM_IsoMu24.root",kBlue); + MeasureTriggerEfficiency("2016DataPlots_MuonPt40_ForthJetPt30_CMVAM/outPlotter.root","TTbar","HLT_IsoMu24_Matched","TriggerEfficiency_TTbar_MuonPt40_ForthJetPt30_CMVAM_IsoMu24_Matched.root",kBlue); + MeasureTriggerEfficiency("2016DataPlots_MuonPt40_ForthJetPt30_CMVAM/outPlotter.root","TTbar","HLT_IsoMu20","TriggerEfficiency_TTbar_MuonPt40_ForthJetPt30_CMVAM_IsoMu20.root",kBlue); + MeasureTriggerEfficiency("2016DataPlots_MuonPt40_ForthJetPt30_CMVAM/outPlotter.root","TTbar","HLT_IsoMu20_Matched","TriggerEfficiency_TTbar_MuonPt40_ForthJetPt30_CMVAM_IsoMu20_Matched.root",kBlue); + + MeasureTriggerEfficiency("2016DataPlots_MuonPt40_ForthJetPt30/outPlotter.root","TTbar","HLT_IsoMu24","TriggerEfficiency_TTbar_MuonPt40_ForthJetPt30_IsoMu24.root",kBlue); + MeasureTriggerEfficiency("2016DataPlots_MuonPt40_ForthJetPt30/outPlotter.root","TTbar","HLT_IsoMu24_Matched","TriggerEfficiency_TTbar_MuonPt40_ForthJetPt30_IsoMu24_Matched.root",kBlue); + MeasureTriggerEfficiency("2016DataPlots_MuonPt40_ForthJetPt30/outPlotter.root","TTbar","HLT_IsoMu20","TriggerEfficiency_TTbar_MuonPt40_ForthJetPt30_IsoMu20.root",kBlue); + MeasureTriggerEfficiency("2016DataPlots_MuonPt40_ForthJetPt30/outPlotter.root","TTbar","HLT_IsoMu20_Matched","TriggerEfficiency_TTbar_MuonPt40_ForthJetPt30_IsoMu20_Matched.root",kBlue); + + MeasureTriggerEfficiency("2016DataPlots_4bLooseSelection/outPlotter.root","TTbar","HLT_IsoMu24","TriggerEfficiency_TTbar_4bLooseSelection_IsoMu24.root",kBlue); + MeasureTriggerEfficiency("2016DataPlots_4bLooseSelection/outPlotter.root","TTbar","HLT_IsoMu24_Matched","TriggerEfficiency_TTbar_4bLooseSelection_IsoMu24_Matched.root",kBlue); + MeasureTriggerEfficiency("2016DataPlots_4bLooseSelection/outPlotter.root","TTbar","HLT_IsoMu20","TriggerEfficiency_TTbar_4bLooseSelection_IsoMu20.root",kBlue); + MeasureTriggerEfficiency("2016DataPlots_4bLooseSelection/outPlotter.root","TTbar","HLT_IsoMu20_Matched","TriggerEfficiency_TTbar_4bLooseSelection_IsoMu20_Matched.root",kBlue); + + MeasureTriggerEfficiency("2016DataPlots_4bSelection/outPlotter.root","TTbar","HLT_IsoMu24","TriggerEfficiency_TTbar_4bSelection_IsoMu24.root",kBlue); + MeasureTriggerEfficiency("2016DataPlots_4bSelection/outPlotter.root","TTbar","HLT_IsoMu24_Matched","TriggerEfficiency_TTbar_4bSelection_IsoMu24_Matched.root",kBlue); + MeasureTriggerEfficiency("2016DataPlots_4bSelection/outPlotter.root","TTbar","HLT_IsoMu20","TriggerEfficiency_TTbar_4bSelection_IsoMu20.root",kBlue); + MeasureTriggerEfficiency("2016DataPlots_4bSelection/outPlotter.root","TTbar","HLT_IsoMu20_Matched","TriggerEfficiency_TTbar_4bSelection_IsoMu20_Matched.root",kBlue); + + +} + + + + + + + + diff --git a/scripts/computeAllPUWeights.sh b/scripts/computeAllPUWeights.sh index c70e386b7..e886cb319 100755 --- a/scripts/computeAllPUWeights.sh +++ b/scripts/computeAllPUWeights.sh @@ -27,6 +27,8 @@ #get_sample_PU_weights.exe --realPU weights/Collision16PileupHistogram.root --realPU_up weights/Collision16PileupHistogramUp.root --realPU_down weights/Collision16PileupHistogramDown.root --input inputFiles/2016ResonantDiHiggs4BDataSets/MCSignal_GluGluToRadionToHHTo4B_M-900_narrow_13TeV-madgraph.txt #get_sample_PU_weights.exe --realPU weights/Collision16PileupHistogram.root --realPU_up weights/Collision16PileupHistogramUp.root --realPU_down weights/Collision16PileupHistogramDown.root --input inputFiles/2016ResonantDiHiggs4BDataSets/MCSignal_RadionTohhTohbbhbb_narrow_M-1000_13TeV-madgraph.txt #get_sample_PU_weights.exe --realPU weights/Collision16PileupHistogram.root --realPU_up weights/Collision16PileupHistogramUp.root --realPU_down weights/Collision16PileupHistogramDown.root --input inputFiles/2016ResonantDiHiggs4BDataSets/MCSignal_RadionTohhTohbbhbb_narrow_M-1200_13TeV-madgraph.txt +#get_sample_PU_weights.exe --realPU weights/Collision16PileupHistogram.root --realPU_up weights/Collision16PileupHistogramUp.root --realPU_down weights/Collision16PileupHistogramDown.root --input inputFiles/2016ResonantDiHiggs4BDataSets/MC_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8.txt + #2016 NON RESONANT SAMPLES get_sample_PU_weights.exe --realPU weights/Collision16PileupHistogram.root --realPU_up weights/Collision16PileupHistogramUp.root --realPU_down weights/Collision16PileupHistogramDown.root -output weights/2016/GluGluToHHTo4B_node_SM_13TeV-madgraph_PUweights.txt --input inputFiles/2016NonResonantDiHiggs4BDataSets/GluGluToHHTo4B_node_SM_13TeV-madgraph.txt diff --git a/scripts/submitAllSkimsOnTier3.sh b/scripts/submitAllSkimsOnTier3.sh index b6e313bb6..02ebbdaca 100755 --- a/scripts/submitAllSkimsOnTier3.sh +++ b/scripts/submitAllSkimsOnTier3.sh @@ -1,5 +1,6 @@ # python scripts/submitSkimOnTier3.py --input=inputFiles/2016ResonantDiHiggs4BDataSets/BTagCSV_Data_FileList_80x_reprocess.txt --tag=$1 --cfg=config/skim_2016ResonantDiHiggs4B.cfg --is-data --njobs=200 -python scripts/submitSkimOnTier3.py --input=inputFiles/2016ResonantDiHiggs4BDataSets/SingleMuon_Data.txt --tag=$1 --cfg=config/skim_2016ResonantDiHiggs4B_triggerStudies.cfg --is-data --njobs=200 +# python scripts/submitSkimOnTier3.py --input=inputFiles/2016ResonantDiHiggs4BDataSets/SingleMuon_Data_RunBF.txt --tag=$1 --cfg=config/skim_2016ResonantDiHiggs4B_triggerStudies.cfg --is-data --njobs=300 +python scripts/submitSkimOnTier3.py --input=inputFiles/2016ResonantDiHiggs4BDataSets/MC_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8.txt --tag=$1 --cfg=config/skim_2016ResonantDiHiggs4B_triggerStudies.cfg --puWeight=weights/MCSignal_BulkGravTohhTohbbhbb_narrow_M-1000_13TeV-madgraph_PUweights.root --xs=1 --njobs=300 # python scripts/submitSkimOnTier3.py --input=inputFiles/2016ResonantDiHiggs4BDataSets/BTagCSV_Data_FileList_80x_reprocess.txt --tag=$1 --cfg=config/skim_2016ResonantDiHiggs4B_antiTag.cfg --is-data --njobs=300 # python scripts/submitSkimOnTier3.py --input=inputFiles/2016ResonantDiHiggs4BDataSets/MCSignal_BulkGravTohhTohbbhbb_narrow_M-1000_13TeV-madgraph.txt --tag=$1 --cfg=config/skim_2016ResonantDiHiggs4B.cfg --puWeight=weights/MCSignal_BulkGravTohhTohbbhbb_narrow_M-1000_13TeV-madgraph_PUweights.root --is-signal --xs=1 --no-tar --no-xrdcp-tar --njobs=3 # python scripts/submitSkimOnTier3.py --input=inputFiles/2016ResonantDiHiggs4BDataSets/MCSignal_BulkGravTohhTohbbhbb_narrow_M-1200_13TeV-madgraph.txt --tag=$1 --cfg=config/skim_2016ResonantDiHiggs4B.cfg --puWeight=weights/MCSignal_BulkGravTohhTohbbhbb_narrow_M-1200_13TeV-madgraph_PUweights.root --is-signal --xs=1 --no-tar --no-xrdcp-tar --njobs=3 diff --git a/scripts/submitSkimOnTier3.py b/scripts/submitSkimOnTier3.py index 7b58fc4dd..d124195ee 100644 --- a/scripts/submitSkimOnTier3.py +++ b/scripts/submitSkimOnTier3.py @@ -78,7 +78,9 @@ def writeln(f, line): #### root://cmseos.fnal.gov//store/user/lcadamur/bbbb_ntuples/' + TAG + '/' + ONAME ################## -executable = 'bin/skim_ntuple_nonresonant.exe' ##if non resonant 'bin/skim_ntuple_nonresonant.exe' ##If resonant analysis 'bin/skim_ntuple.exe' +executable = 'bin/skim_ntuple_nonresonant.exe' ##If resonant analysis 'bin/skim_ntuple.exe' +if "2016ResonantDiHiggs4BDataSets" in args.input : # dangerous for future + executable = 'bin/skim_ntuple.exe' ################## username = getpass.getuser() @@ -263,7 +265,7 @@ def writeln(f, line): writeln(outScript, '%s' % this_full_command) writeln(outScript, 'echo "... execution finished with status $?"') writeln(outScript, 'echo "... copying output file %s to EOS in %s"' % (outputFileName, outputEOSName)) - writeln(outScript, 'xrdcp -s %s %s' % (outputFileName, outputEOSName)) ## no not force overwrite output in destination + writeln(outScript, 'xrdcp -s -f %s %s' % (outputFileName, outputEOSName)) ## no force overwrite output in destination writeln(outScript, 'echo "... copy done with status $?"') # writeln(outScript, 'remove the input and output files if you dont want it automatically transferred when the job ends') # writeln(outScript, 'rm nameOfOutputFile.root') diff --git a/src/CompositeCandidate.cc b/src/CompositeCandidate.cc index 1bfee58ca..ef41b61c2 100644 --- a/src/CompositeCandidate.cc +++ b/src/CompositeCandidate.cc @@ -45,11 +45,8 @@ bool CompositeCandidate::sharesComponentWith(const CompositeCandidate& cc) const CompositeCandidate::CompositeCandidate(const CompositeCandidate& rhs) +: Candidate(rhs) { - - this -> p4_ = rhs.p4_; - this -> isComposite_ = rhs.isComposite_; - this -> parentIdxVector_ = rhs.parentIdxVector_; this -> cand1_ = rhs.cand1_->clone(); this -> cand2_ = rhs.cand2_->clone(); } diff --git a/src/OfflineProducerHelper.cc b/src/OfflineProducerHelper.cc index 5e3932405..008ce6d82 100644 --- a/src/OfflineProducerHelper.cc +++ b/src/OfflineProducerHelper.cc @@ -25,7 +25,8 @@ using namespace std; // ----------------- Objects for cut - BEGIN ----------------- // -void OfflineProducerHelper::initializeObjectsForCuts(OutputTree &ot){ +void OfflineProducerHelper::initializeObjectsForCuts(OutputTree &ot) +{ string objectsForCut = any_cast(parameterList_->at("ObjectsForCut")); @@ -53,14 +54,26 @@ void OfflineProducerHelper::initializeObjectsForCuts(OutputTree &ot){ mapTriggerObjectIdAndFilter_[triggerObject.first.first].emplace_back(triggerObject.first.second); ot.declareUserIntBranch(triggerObject.second, 0); } - ot.declareUserFloatBranch("FirstSelectedJetPt", -1.); - ot.declareUserFloatBranch("SecondSelectedJetPt", -1.); - ot.declareUserFloatBranch("ThirdSelectedJetPt", -1.); - ot.declareUserFloatBranch("ForthSelectedJetPt", -1.); - ot.declareUserFloatBranch("SelectedJetPtSum", -1.); - ot.declareUserFloatBranch("ThirdSelectedJetDeepCSV", -1.); - ot.declareUserFloatBranch("HighestMuonPt", -1.); - ot.declareUserFloatBranch("SmallestMuonJetDeltaR", -1.); + + ot.declareUserFloatBranch("FirstJetPt", -1.); + ot.declareUserFloatBranch("SecondJetPt", -1.); + ot.declareUserFloatBranch("ThirdJetPt", -1.); + ot.declareUserFloatBranch("ForthJetPt", -1.); + ot.declareUserFloatBranch("FourHighetJetPtSum", -1.); + ot.declareUserFloatBranch("ThirdJetDeepCSV", -1.); + ot.declareUserFloatBranch("ForthJetCMVA", -1.); + ot.declareUserFloatBranch("HighestIsoMuonPt", -1.); + ot.declareUserFloatBranch("HighestIsoElectronPt", -1.); + ot.declareUserIntBranch ("MuonElectronChargeMultiplication", 0); + ot.declareUserFloatBranch("FirstPtOrderedJetDeepCSV", -1.); + ot.declareUserFloatBranch("SecondPtOrderedJetDeepCSV", -1.); + ot.declareUserIntBranch ("FirstPtOrderedJetOnlineBtag", 0); + + ot.declareUserFloatBranch("ResolutionOnlineCaloJetPt", -999.); + ot.declareUserFloatBranch("OfflineJetPtForCaloResolution", -999.); + ot.declareUserFloatBranch("ResolutionOnlinePFJetPt", -999.); + ot.declareUserFloatBranch("OfflineJetPtForPFResolution", -999.); + ot.declareUserIntBranch ("NumberOfJetsPassingPreselection", -1); } @@ -69,7 +82,8 @@ void OfflineProducerHelper::initializeObjectsForCuts(OutputTree &ot){ } // reject events with leptons that may come from W and Z decays -void OfflineProducerHelper::save_WAndZLeptonDecays (NanoAODTree& nat, OutputTree &ot, EventInfo& ei){ +void OfflineProducerHelper::save_WAndZLeptonDecays (NanoAODTree& nat, OutputTree &ot, EventInfo& ei) +{ std::vector electronFromW; electronFromW.reserve(*(nat.nElectron)); @@ -152,50 +166,12 @@ void OfflineProducerHelper::save_WAndZLeptonDecays (NanoAODTree& nat, OutputTree void OfflineProducerHelper::save_TriggerObjects (NanoAODTree& nat, OutputTree &ot, EventInfo& ei) { - for( const auto & triggerAndBranch : any_cast, std::string > >(parameterList_->at("TriggerObjectsForStudies")) ) { ot.userInt(triggerAndBranch.second) = mapTriggerMatching_[triggerAndBranch.first]; } - std::vector candidatePt = - { - ei.H1_b1->P4().Pt(), - ei.H1_b2->P4().Pt(), - ei.H2_b1->P4().Pt(), - ei.H2_b2->P4().Pt() - }; - stable_sort(candidatePt.begin(), candidatePt.end(), greater()); - - std::vector candidateDeepCSV = - { - get_property(ei.H1_b1.get(),Jet_btagDeepB), - get_property(ei.H1_b2.get(),Jet_btagDeepB), - get_property(ei.H2_b1.get(),Jet_btagDeepB), - get_property(ei.H2_b2.get(),Jet_btagDeepB) - }; - stable_sort(candidateDeepCSV.begin(), candidateDeepCSV.end(), greater()); - - - ot.userFloat("FirstSelectedJetPt") = candidatePt[0]; - ot.userFloat("SecondSelectedJetPt") = candidatePt[1]; - ot.userFloat("ThirdSelectedJetPt") = candidatePt[2]; - ot.userFloat("ForthSelectedJetPt") = candidatePt[3]; - ot.userFloat("SelectedJetPtSum") = candidatePt[0] + candidatePt[1] + candidatePt[2] + candidatePt[3]; - ot.userFloat("ThirdSelectedJetDeepCSV") = candidateDeepCSV[2]; - if(*(nat.nMuon)>0){ - ot.userFloat("HighestMuonPt") = nat.Muon_pt.At(0); - std::vector muonJetDeltaR; - muonJetDeltaR.emplace_back(sqrt(pow(ei.H1_b1->P4().Eta() - nat.Muon_eta.At(0),2) + pow(deltaPhi(ei.H1_b1->P4().Phi(), nat.Muon_phi.At(0)),2) ) ); - muonJetDeltaR.emplace_back(sqrt(pow(ei.H1_b2->P4().Eta() - nat.Muon_eta.At(0),2) + pow(deltaPhi(ei.H1_b2->P4().Phi(), nat.Muon_phi.At(0)),2) ) ); - muonJetDeltaR.emplace_back(sqrt(pow(ei.H2_b1->P4().Eta() - nat.Muon_eta.At(0),2) + pow(deltaPhi(ei.H2_b1->P4().Phi(), nat.Muon_phi.At(0)),2) ) ); - muonJetDeltaR.emplace_back(sqrt(pow(ei.H2_b2->P4().Eta() - nat.Muon_eta.At(0),2) + pow(deltaPhi(ei.H2_b2->P4().Phi(), nat.Muon_phi.At(0)),2) ) ); - stable_sort(muonJetDeltaR.begin(), muonJetDeltaR.end()); - ot.userFloat("SmallestMuonJetDeltaR") = muonJetDeltaR.at(0); - } - - return; } @@ -204,7 +180,8 @@ void OfflineProducerHelper::save_TriggerObjects (NanoAODTree& nat, OutputTree &o // ----------------- Compute scaleFactors - BEGIN ----------------- // -void OfflineProducerHelper::initializeObjectsBJetForScaleFactors(OutputTree &ot){ +void OfflineProducerHelper::initializeObjectsBJetForScaleFactors(OutputTree &ot) +{ string scaleFactorsMethod = any_cast(parameterList_->at("BTagScaleFactorMethod")); @@ -463,7 +440,7 @@ float OfflineProducerHelper::calculateEventWeight_AllWeights(NanoAODTree& nat, E eventWeight *= tmpWeight; // LHEScaleWeight weight variations for(unsigned int var = 0; var<*(nat.nLHEScaleWeight); ++var) - { + { tmpWeight = nat.LHEScaleWeight.At(var); tmpWeight = tmpWeight==0 ? 1 : tmpWeight; //set to 1 if weight is 0 std::string variationBranch = branchName + "_var" + std::to_string(var); @@ -748,7 +725,6 @@ void OfflineProducerHelper::fillJetEnergyVariationBranch(OutputTree &ot, std::st bool OfflineProducerHelper::select_bbbb_jets(NanoAODTree& nat, EventInfo& ei, OutputTree &ot, std::vector listOfPassedTriggers) { - if (*(nat.nJet) < 4) return false; std::vector unsmearedJets; @@ -757,8 +733,7 @@ bool OfflineProducerHelper::select_bbbb_jets(NanoAODTree& nat, EventInfo& ei, Ou for (uint ij = 0; ij < *(nat.nJet); ++ij){ unsmearedJets.emplace_back(Jet(ij, &nat)); } -// std::cout<<"culo1\n"; - + //if some montecarlo weight are applied via a reshaping of the jets variables, they must be applied here //Apply preselection cuts @@ -767,11 +742,11 @@ bool OfflineProducerHelper::select_bbbb_jets(NanoAODTree& nat, EventInfo& ei, Ou if(preselectionCutStrategy=="bJetCut"){ bJets_PreselectionCut(unsmearedJets); } - else if(preselectionCutStrategy=="None"){ + else if(preselectionCutStrategy=="None") + { //do nothing } else throw std::runtime_error("cannot recognize cut strategy --" + preselectionCutStrategy + "--"); -// std::cout<<"culo2\n"; //at least 4 jets required if(unsmearedJets.size()<4) return false; @@ -805,7 +780,6 @@ bool OfflineProducerHelper::select_bbbb_jets(NanoAODTree& nat, EventInfo& ei, Ou } -// std::cout<<"culo3\n"; int H1b1_idx(-1), H1b2_idx(-1), H2b1_idx(-1), H2b2_idx(-1); //Jet indexes for variations for(auto & jets : jetEnergyVariationsMap) @@ -814,15 +788,16 @@ bool OfflineProducerHelper::select_bbbb_jets(NanoAODTree& nat, EventInfo& ei, Ou if(jets.first == originalSampleName) //Original sample without variations { // calculate scaleFactors after preselection cuts - if(parameterList_->find("BTagScaleFactorMethod") != parameterList_->end()){ //is it a MC event + if(parameterList_->find("BTagScaleFactorMethod") != parameterList_->end()) //is it a MC event + { const string BJetcaleFactorsMethod = any_cast(parameterList_->at("BTagScaleFactorMethod")); - if(BJetcaleFactorsMethod == "FourBtag_ScaleFactor"){ + if(BJetcaleFactorsMethod == "FourBtag_ScaleFactor") + { compute_scaleFactors_fourBtag_eventScaleFactor(jets.second,nat,ot); } } -// std::cout<<"culo4\n"; // now need to pair the jets std::vector presel_jets = {{ (jets.second[0]), @@ -841,12 +816,14 @@ bool OfflineProducerHelper::select_bbbb_jets(NanoAODTree& nat, EventInfo& ei, Ou ordered_jets = bbbb_jets_idxs_BothClosestToMh(&presel_jets); else if(strategy == "MostBackToBack") ordered_jets = bbbb_jets_idxs_MostBackToBack(&presel_jets); - else if(strategy == "HighestCSVandClosestToMh"){ + else if(strategy == "HighestCSVandClosestToMh") + { ordered_jets = bbbb_jets_idxs_HighestCSVandClosestToMh(&jets.second); } + else throw std::runtime_error("cannot recognize bbbb choice strategy " + strategy); -// std::cout<<"culo5\n"; + // std::cout << __PRETTY_FUNCTION__ << ordered_jets.size() << std::endl; if(ordered_jets.size()!=4) { if(!any_cast(parameterList_->at("UseAntiTagOnOneBjet")) && strategy == "HighestCSVandClosestToMh") @@ -858,67 +835,159 @@ bool OfflineProducerHelper::select_bbbb_jets(NanoAODTree& nat, EventInfo& ei, Ou if(debug) std::cout<< "Event " << *(nat.run) << " - " << *(nat.luminosityBlock) << " - " << *(nat.event) << std::endl; -// std::cout<<"culo6\n"; - if(jets.first == originalSampleName) + std::vector< std::unique_ptr > candidatesForTriggerMatching; + + for(auto jet : ordered_jets) + { + candidatesForTriggerMatching.emplace_back(std::make_unique(jet)); + } + + + + if(any_cast(parameterList_->at("ObjectsForCut")) == "TriggerObjects") { - std::vector< std::unique_ptr > selectedCandidates; -// std::cout<<"culo6.1\n"; - for(auto jet : ordered_jets) + + stable_sort(candidatesForTriggerMatching.begin(), candidatesForTriggerMatching.end(), [](const std::unique_ptr & a, const std::unique_ptr & b) + { + return ( a->P4().Pt() > b->P4().Pt() ); + }); + + std::vector jetsForTriggerStudies; + if(any_cast(parameterList_->at("MatchWithSelectedObjects"))) + { + jetsForTriggerStudies = ordered_jets; + } + else { - selectedCandidates.emplace_back(std::make_unique(jet)); - //std::cout<P4().Eta()<<" "<P4().Eta()<0) + for (uint muonIt = 0; muonIt < *(nat.nMuon); ++muonIt) { - //Candidate *theHighestPtMuon = new Muon(0, &nat); - selectedCandidates.emplace_back(std::make_unique(Muon(0, &nat))); + if(nat.Muon_pfRelIso04_all[muonIt]<0.1 && nat.Muon_mediumId[muonIt]) + { + int muonJetId = nat.Muon_jetIdx[muonIt]; + bool matchingJetFound = false; + if(muonJetId >= 0) + { + for(auto jet : jetsForTriggerStudies) + { + if(jet.getIdx() == muonJetId) + { + matchingJetFound = true; + break; + } + } + } + if(!matchingJetFound) + { + ot.userFloat("HighestIsoMuonPt") = nat.Muon_pt.At(muonIt); + ot.userInt ("MuonElectronChargeMultiplication") = nat.Muon_charge.At(muonIt); + candidatesForTriggerMatching.emplace_back(std::make_unique(Muon(muonIt, &nat))); + break; + } + } } - calculateTriggerMatching(selectedCandidates,nat); + for (uint electronIt = 0; electronIt < *(nat.nElectron); ++electronIt) + { + if(nat.Electron_pfRelIso03_all[electronIt]<0.1 && abs(nat.Electron_eta[electronIt])<2.4 && nat.Electron_cutBased[electronIt] == 3) + { + + int electronJetId = nat.Electron_jetIdx[electronIt]; + bool matchingJetFound = false; + if(electronJetId >= 0) + { + for(auto jet : jetsForTriggerStudies) + { + if(jet.getIdx() == electronJetId) + { + matchingJetFound = true; + break; + } + } + } + if(!matchingJetFound) + { + ot.userFloat("HighestIsoElectronPt") = nat.Electron_pt.At(electronIt); + ot.userInt ("MuonElectronChargeMultiplication") *= nat.Electron_charge.At(electronIt); + break; + } + } + } + + // sort by deepCSV + stable_sort(jetsForTriggerStudies.begin(), jetsForTriggerStudies.end(), [](const Jet & a, const Jet & b) -> bool + { + return ( get_property(a, Jet_btagDeepB) > get_property(b, Jet_btagDeepB) ); + }); + + ot.userFloat("ThirdJetDeepCSV") = get_property(jetsForTriggerStudies[2],Jet_btagDeepB); + // std::cout << __PRETTY_FUNCTION__ << get_property(jetsForTriggerStudies[0],Jet_btagDeepB) << " " << get_property(jetsForTriggerStudies[1],Jet_btagDeepB) << " " << get_property(jetsForTriggerStudies[2],Jet_btagDeepB) << " " << get_property(jetsForTriggerStudies[3],Jet_btagDeepB) << " " << std::endl; + + // order by CMVA + stable_sort(jetsForTriggerStudies.begin(), jetsForTriggerStudies.end(), [](const Jet & a, const Jet & b) -> bool + { + return ( get_property(a, Jet_btagCMVA) > get_property(b, Jet_btagCMVA) ); + }); + ot.userFloat("ForthJetCMVA") = get_property(jetsForTriggerStudies[3],Jet_btagCMVA); + // std::cout << __PRETTY_FUNCTION__ << get_property(jetsForTriggerStudies[0],Jet_btagCMVA) << " " << get_property(jetsForTriggerStudies[1],Jet_btagCMVA) << " " << get_property(jetsForTriggerStudies[2],Jet_btagCMVA) << " " << get_property(jetsForTriggerStudies[3],Jet_btagCMVA) << " " << std::endl; + + //order by unregressed pt + stable_sort(jetsForTriggerStudies.begin(), jetsForTriggerStudies.end(), [](const Jet & a, const Jet & b) -> bool + { + return ( a.P4().Pt() > b.P4().Pt() ); + }); + + // std::cout << __PRETTY_FUNCTION__ << jetsForTriggerStudies[0].P4().Pt() << " " << jetsForTriggerStudies[1].P4().Pt() << " " << jetsForTriggerStudies[2].P4().Pt() << " " << jetsForTriggerStudies[3].P4().Pt() << " " << std::endl; + ot.userFloat("FirstJetPt") = jetsForTriggerStudies[0].P4().Pt(); + ot.userFloat("SecondJetPt") = jetsForTriggerStudies[1].P4().Pt(); + ot.userFloat("ThirdJetPt") = jetsForTriggerStudies[2].P4().Pt(); + ot.userFloat("ForthJetPt") = jetsForTriggerStudies[3].P4().Pt(); + ot.userFloat("FourHighetJetPtSum") = jetsForTriggerStudies[0].P4().Pt() + jetsForTriggerStudies[1].P4().Pt() + jetsForTriggerStudies[2].P4().Pt() + jetsForTriggerStudies[3].P4().Pt(); + + ot.userFloat("FirstPtOrderedJetDeepCSV") = get_property(jetsForTriggerStudies[0],Jet_btagDeepB); + ot.userFloat("SecondPtOrderedJetDeepCSV") = get_property(jetsForTriggerStudies[1],Jet_btagDeepB); + + ot.userInt("NumberOfJetsPassingPreselection") = jets.second.size(); -// std::cout<<"culo6.2\n"; } - if(jets.first == originalSampleName) + calculateTriggerMatching(candidatesForTriggerMatching,nat,ot); + + + for(auto & triggerFired : listOfPassedTriggers) { -// std::cout<<"culo6.3\n"; - for(auto & triggerFired : listOfPassedTriggers) - { - ot.userInt(triggerFired+"_Fired") = 1; - } + ot.userInt(triggerFired+"_Fired") = 1; + } - if(!checkTriggerObjectMatching(listOfPassedTriggers,ot)) + if(!checkTriggerObjectMatching(listOfPassedTriggers,ot)) + { + if(debug) { - if(debug) std::cout<<"TriggerObjects not matched, Printing jets:\n"; - if(debug) std::cout<<"Id\t\tPt\t\tEta\t\tPhi\t\tCSV\t\tSelected\n"; - for(const auto & jet : jetsOriginal) + std::cout<<"TriggerObjects not matched, Printing jets:\n"; + std::cout<<"Id\t\tPt\t\tEta\t\tPhi\t\tPId\t\tCSV\t\tSelected\n"; + for(const auto & candidate : candidatesForTriggerMatching) { - if(debug) std::cout<< std::fixed << std::setprecision(3) <getIdx()<<"\t\t"<P4().Pt()<<"\t\t"<P4().Eta()<<"\t\t"<P4().Phi()<<"\t\t"<getCandidateTypeId()<<"\t\t"; + if(candidate->getCandidateTypeId() == 1) std::cout<< std::fixed << std::setprecision(3)<(candidate.get())),Jet_btagDeepB)<<"\t\t"; + else std::cout << "\t\t\t"; bool selected=false; for(const auto & selectedJet : ordered_jets) { - if(selectedJet.getIdx() == jet.getIdx()) + if(candidate->getCandidateTypeId() != 1) continue; + if(selectedJet.getIdx() == candidate->getIdx()) { selected=true; break; } } - if(selected) if(debug) std::cout<<"*"; - if(debug) std::cout<getIdx()<<"\t\t"<P4().Pt()<<"\t\t"<P4().Eta()<<"\t\t"<P4().Phi()<<"\n"; - } - } -// std::cout<<"culo6.4\n"; } -// std::cout<<"culo7\n"; - // order H1, H2 by pT: pT(H1) > pT (H2) CompositeCandidate H1 = CompositeCandidate(ordered_jets.at(0), ordered_jets.at(1)); H1.rebuildP4UsingRegressedPt(true,true); @@ -971,7 +1040,7 @@ bool OfflineProducerHelper::select_bbbb_jets(NanoAODTree& nat, EventInfo& ei, Ou { targetHiggsMass = any_cast(parameterList_->at("HiggsMass")); } - + ei.HH_2DdeltaM = pow(ei.H1->P4().M() - targetHiggsMass,2) + pow(ei.H2->P4().M() - targetHiggsMass,2); bool applyKineamticFit=true; @@ -991,12 +1060,10 @@ bool OfflineProducerHelper::select_bbbb_jets(NanoAODTree& nat, EventInfo& ei, Ou ei.LumiSec = *(nat.luminosityBlock); ei.Event = *(nat.event); -// std::cout<<"culo9\n"; } else //Variations { -// std::cout<<"culo10\n"; int H1b1(-1), H1b2(-1), H2b1(-1), H2b2(-1); for(size_t iJet=0; iJet &jets) { float minimumDeepCSVaccepted = any_cast(parameterList_->at("MinDeepCSV" )); float maximumPtAccepted = any_cast(parameterList_->at("MinPt" )); float maximumAbsEtaCSVaccepted = any_cast(parameterList_->at("MaxAbsEta" )); - if(any_cast(parameterList_->at("UseAntiTagOnOneBjet"))) + + if(parameterList_->find("bbbbChoice") != parameterList_->end()) { - minimumDeepCSVaccepted = -1; + if(any_cast(parameterList_->at("bbbbChoice")) == "HighestCSVandClosestToMh") + { + if(any_cast(parameterList_->at("UseAntiTagOnOneBjet"))) + { + minimumDeepCSVaccepted = -1; + } + } } if(minimumDeepCSVaccepted<=0. && maximumPtAccepted<=0. && maximumAbsEtaCSVaccepted<=0.) return; @@ -1118,12 +1192,14 @@ std::vector OfflineProducerHelper::bbbb_jets_idxs_OneClosestToMh(const std: std::vector>> mHs_and_jetIdx; // each entry is the mH and the two idxs of the pair for (uint i = 0; i < presel_jets->size(); ++i) + { for (uint j = i+1; j < presel_jets->size(); ++j) { TLorentzVector p4sum = (presel_jets->at(i).P4Regressed() + presel_jets->at(j).P4Regressed()); float dmh = fabs(p4sum.Mag() - targetHiggsMass); mHs_and_jetIdx.emplace_back(make_pair(dmh, make_pair(i,j))); } + } // sort to get the pair closest to mH stable_sort (mHs_and_jetIdx.begin(), mHs_and_jetIdx.end()); @@ -1135,7 +1211,7 @@ std::vector OfflineProducerHelper::bbbb_jets_idxs_OneClosestToMh(const std: // get the other two jets. The following creates a vector with idxs 0/1/2/3, and then removes ij1 and ij2 std::vector vres; for (uint i = 0; i < presel_jets->size(); ++i) vres.emplace_back(i); - vres.erase(std::remove(vres.begin(), vres.end(), ij0), vres.end()); + vres.erase(std::remove(vres.begin(), vres.end(), ij0), vres.end()); vres.erase(std::remove(vres.begin(), vres.end(), ij1), vres.end()); int ij2 = vres.at(0); @@ -1157,11 +1233,13 @@ std::vector OfflineProducerHelper::bbbb_jets_idxs_BothClosestToMh(const std std::vector mHs; for (uint i = 0; i < presel_jets->size(); ++i) + { for (uint j = i+1; j < presel_jets->size(); ++j) { TLorentzVector p4sum = (presel_jets->at(i).P4() + presel_jets->at(j).P4()); mHs.emplace_back(p4sum.Mag()); } + } std::pair m_12_34 = make_pair (mHs.at(0), mHs.at(5)); std::pair m_13_24 = make_pair (mHs.at(1), mHs.at(4)); @@ -1602,26 +1680,26 @@ bool OfflineProducerHelper::select_bbbbjj_jets(NanoAODTree& nat, EventInfo& ei, float OfflineProducerHelper::MindRToAJet(const GenPart quark,const std::vector jets) { -float dR=999999,dRmin=0; -for (uint x=0; x < jets.size(); x++ ) -{ + float dR=999999,dRmin=0; + for (uint x=0; x < jets.size(); x++ ) + { dRmin = jets.at(x).P4().DeltaR(quark.P4()); if(dRmin < dR){dR=dRmin;} } -return dR; + return dR; } float OfflineProducerHelper::MindRToAGenJet(const GenPart quark,const std::vector jets) { -float dR=999999,dRmin=0; -for (uint x=0; x < jets.size(); x++ ) -{ + float dR=999999,dRmin=0; + for (uint x=0; x < jets.size(); x++ ) + { dRmin = jets.at(x).P4().DeltaR(quark.P4()); if(dRmin < dR){dR=dRmin;} } -return dR; + return dR; } float OfflineProducerHelper::GenJetToPartonPt(const GenPart quark,const std::vector jets) @@ -1633,7 +1711,7 @@ for (uint x=0; x < jets.size(); x++ ) if(dRmin < dR){dR=dRmin; ptratio = jets.at(x).P4().Pt() / quark.P4().Pt();} } -return ptratio; + return ptratio; } @@ -2578,12 +2656,13 @@ std::vector OfflineProducerHelper::bjJets_2016_PreselectionCut(NanoAODTree& return outputJets; } -std::vector OfflineProducerHelper::ExternalEtaJetPair(std::vector jets, std::vector bjets){ -//Check Max abs(Eta) among the b-jets -std::vector outputJets; -float maxbEta=-1; -for (uint i=0;i OfflineProducerHelper::ExternalEtaJetPair(std::vector jets, std::vector bjets) { + //Check Max abs(Eta) among the b-jets + std::vector outputJets; + float maxbEta=-1; + for (uint i=0;imaxbEta){maxbEta=Eta;} } @@ -2595,12 +2674,12 @@ while (jt != jets.end()){ continue; } ++jt; -} -//Ordered the VBF candidates by pt. Ff there are not two VBF-candidates, then return empty -if(jets.size()<2) return outputJets; -stable_sort(jets.begin(), jets.end(), [](const Jet & a, const Jet & b) -> bool -{ return ( get_property(a, Jet_pt ) > get_property(b, Jet_pt) );}); -outputJets = {{*(jets.begin()+0),*(jets.begin()+1)}}; return outputJets; + } + //Ordered the VBF candidates by pt. Ff there are not two VBF-candidates, then return empty + if(jets.size()<2) return outputJets; + stable_sort(jets.begin(), jets.end(), [](const Jet & a, const Jet & b) -> bool + { return ( get_property(a, Jet_pt ) > get_property(b, Jet_pt) );}); + outputJets = {{*(jets.begin()+0),*(jets.begin()+1)}}; return outputJets; } std::vector OfflineProducerHelper::AddGenMatchingInfo(NanoAODTree& nat, EventInfo& ei, std::vector jets) @@ -2697,13 +2776,14 @@ if(!foundpair) return outputJets; outputJets = {{*(jets.begin()+0),*(jets.begin()+id)}}; return outputJets; } -std::vector OfflineProducerHelper::HighestPtJetPair(std::vector jets){ -std::vector outputJets; -//Order the jets py pt -stable_sort(jets.begin(), jets.end(), [](const Jet & a, const Jet & b) -> bool -{ return ( get_property(a, Jet_pt ) > get_property(b, Jet_pt) );}); -//Find the j1 (highest pt jet) and j2 (the jet with highest pt and opposite eta sign) -outputJets = {{*(jets.begin()+0),*(jets.begin()+1)}}; return outputJets; +std::vector OfflineProducerHelper::HighestPtJetPair(std::vector jets) +{ + std::vector outputJets; + //Order the jets py pt + stable_sort(jets.begin(), jets.end(), [](const Jet & a, const Jet & b) -> bool + { return ( get_property(a, Jet_pt ) > get_property(b, Jet_pt) );}); + //Find the j1 (highest pt jet) and j2 (the jet with highest pt and opposite eta sign) + outputJets = {{*(jets.begin()+0),*(jets.begin()+1)}}; return outputJets; } ////////////-----FUNCTIONS FOR PRESELECTION OF EVENTS FOR NON-RESONANT ANALYSIS - END @@ -2724,7 +2804,9 @@ void OfflineProducerHelper::initializeTriggerMatching(OutputTree &ot) } //Adding only the ones not already in there if(std::find(mapTriggerObjectIdAndFilter_[triggerObject.first.first].begin(),mapTriggerObjectIdAndFilter_[triggerObject.first.first].end(),triggerObject.first.second) == mapTriggerObjectIdAndFilter_[triggerObject.first.first].end()) + { mapTriggerObjectIdAndFilter_[triggerObject.first.first].emplace_back(triggerObject.first.second); + } } } } @@ -2749,7 +2831,7 @@ bool OfflineProducerHelper::checkTriggerObjectMatching(std::vector for ( const auto & requiredNumberOfObjects : triggerRequirements.second) // triggers fired { if(mapTriggerMatching_.find(requiredNumberOfObjects.first)==mapTriggerMatching_.end()) triggerResult[triggerRequirements.first] = false; // Object not found - if(mapTriggerMatching_[requiredNumberOfObjects.first] < requiredNumberOfObjects.second) triggerResult[triggerRequirements.first] = false; // Number of object not enought + else if(mapTriggerMatching_.at(requiredNumberOfObjects.first) < requiredNumberOfObjects.second) triggerResult[triggerRequirements.first] = false; // Number of object not enought } for(const auto & triggerChecked : triggerResult) //If at least one of the trigger was found return true @@ -2764,23 +2846,20 @@ bool OfflineProducerHelper::checkTriggerObjectMatching(std::vector return triggerMatched; // no matching trigger found among the fired ones } -void OfflineProducerHelper::calculateTriggerMatching(const std::vector< std::unique_ptr > &candidateList, NanoAODTree& nat) +void OfflineProducerHelper::calculateTriggerMatching(const std::vector< std::unique_ptr > &candidateList, NanoAODTree& nat, OutputTree &ot) { if(debug) std::cout<<"Matching triggers, Objects found:\n"; - if(debug) std::cout<<"\t\tPt\t\tEta\t\tPhi\t\tBit\t\tMatchedJetId\n"; + if(debug) std::cout<<"\t\tPt\t\tEta\t\tPhi\t\tObjId\t\tBit\t\tMatchedJetId\n"; mapTriggerMatching_.clear(); -//std::cout<<"culo6.1.1\n"; for (uint trigObjIt = 0; trigObjIt < *(nat.nTrigObj); ++trigObjIt) //for over all trigger objects { int triggerObjectId = nat.TrigObj_id.At(trigObjIt); -//std::cout<<"culo6.1.2\n"; -//std::cout<> filterBit) & 0x1 ) //check object passes the filter { if(!isNeeded) isNeeded=true; if(newCandidate) { - if(debug) std::cout<< std::fixed << std::setprecision(3) <<"\t\t"<getCandidateTypeId() != triggerObjectId) continue; // Skip different particles - //std::cout<<"!!!~~~~ - "<P4().Eta (); float candidatePhi = candidate->P4().Phi (); float tmpdeltaR = (candidateEta - triggerObjectEta)*(candidateEta - triggerObjectEta) + deltaPhi(candidatePhi,triggerObjectPhi)*deltaPhi(candidatePhi,triggerObjectPhi); - //std::cout<getIdx()<< "!!!~~~~candidateEta - "<getIdx(); + deltaPt = candidate->P4().Pt() - triggerObjectPt; + offlinePt = candidate->P4().Pt(); } - //std::cout<<"!!!~~~~DeltaR - "<(parameterList_->at("MatchWithSelectedObjects"))) + { + deltaR = 0; } - if(sqrt(deltaR) < any_cast(parameterList_->at("MaxDeltaR"))) // check if a matching was found { std::pair particleAndFilter(triggerObjectId,filterBit); @@ -2837,7 +2926,34 @@ void OfflineProducerHelper::calculateTriggerMatching(const std::vector< std::uni } ++mapTriggerMatching_[particleAndFilter]; candidateIdx=tmpCandidateIdx; - //std::cout<(parameterList_->at("ObjectsForCut")) == "TriggerObjects") + { + if(triggerObjectId == 1 && firstCandidadeMatched && firstCandidadeMatchedDeltaR < any_cast(parameterList_->at("MaxDeltaR")) && filterBit == 0) //BTagged + { + ot.userInt("FirstPtOrderedJetOnlineBtag")++; + } + if(triggerObjectId == 1 && any_cast(parameterList_->at("MatchWithSelectedObjects"))) + { + if(ot.userFloat("ResolutionOnlineCaloJetPt") == -999.) + { + if(filterBit == 1 || filterBit == 4 || filterBit == 7) + { + ot.userFloat("ResolutionOnlineCaloJetPt") = deltaPt; + ot.userFloat("OfflineJetPtForCaloResolution") = offlinePt; + } + } + if(ot.userFloat("ResolutionOnlinePFJetPt") == -999.) + { + if(filterBit == 2 || filterBit == 5 || filterBit == 8) + { + ot.userFloat("ResolutionOnlinePFJetPt") = deltaPt; + ot.userFloat("OfflineJetPtForPFResolution") = offlinePt; + } + } + } + } } } } @@ -3097,22 +3213,22 @@ bool OfflineProducerHelper::select_gen_VBF_partons (NanoAODTree& nat, EventInfo& // quality checks if (!ei.gen_q1_in || !ei.gen_q2_in){ - cout << "** [WARNING] : select_gen_VBF_partons : didn't find two incoming partons : " - << std::boolalpha - << " q1_in :" << ei.gen_q1_in.is_initialized() - << " q2_in :" << ei.gen_q2_in.is_initialized() - << std::noboolalpha - << endl; + cout << "** [WARNING] : select_gen_VBF_partons : didn't find two incoming partons : " + << std::boolalpha + << " q1_in :" << ei.gen_q1_in.is_initialized() + << " q2_in :" << ei.gen_q2_in.is_initialized() + << std::noboolalpha + << endl; all_ok = false; } if (!ei.gen_q1_out || !ei.gen_q2_out){ - cout << "** [WARNING] : select_gen_VBF_partons : didn't find two outgoing partons : " - << std::boolalpha - << " q1_out :" << ei.gen_q1_out.is_initialized() - << " q2_out :" << ei.gen_q2_out.is_initialized() - << std::noboolalpha - << endl; + cout << "** [WARNING] : select_gen_VBF_partons : didn't find two outgoing partons : " + << std::boolalpha + << " q1_out :" << ei.gen_q1_out.is_initialized() + << " q2_out :" << ei.gen_q2_out.is_initialized() + << std::noboolalpha + << endl; all_ok = false; } @@ -3178,32 +3294,32 @@ void OfflineProducerHelper::dump_gen_part (NanoAODTree& nat, bool printFlags) GenPart gp (igp, &nat); // if (abs(get_property(gp, GenPart_pdgId)) >= 6) continue; // only light quarks + b cout << igp << " -- " - << " pdgId: " << setw(4) << get_property(gp, GenPart_pdgId) - << " pt: " << setw(10) << get_property(gp, GenPart_pt) - << " eta: " << setw(10) << get_property(gp, GenPart_eta) - << " phi: " << setw(10) << get_property(gp, GenPart_phi) - << " status: " << setw(4) << get_property(gp, GenPart_status) - << " moth_idx: " << setw(4) << get_property(gp, GenPart_genPartIdxMother) - << endl; + << " pdgId: " << setw(4) << get_property(gp, GenPart_pdgId) + << " pt: " << setw(10) << get_property(gp, GenPart_pt) + << " eta: " << setw(10) << get_property(gp, GenPart_eta) + << " phi: " << setw(10) << get_property(gp, GenPart_phi) + << " status: " << setw(4) << get_property(gp, GenPart_status) + << " moth_idx: " << setw(4) << get_property(gp, GenPart_genPartIdxMother) + << endl; if (printFlags) { cout << " . Flags :" << endl - << " isPrompt : " << gp.isPrompt() << endl - << " isDecayedLeptonHadron : " << gp.isDecayedLeptonHadron() << endl - << " isTauDecayProduct : " << gp.isTauDecayProduct() << endl - << " isPromptTauDecayProduct : " << gp.isPromptTauDecayProduct() << endl - << " isDirectTauDecayProduct : " << gp.isDirectTauDecayProduct() << endl - << " isDirectPromptTauDecayProduct : " << gp.isDirectPromptTauDecayProduct() << endl - << " isDirectHadronDecayProduct : " << gp.isDirectHadronDecayProduct() << endl - << " isHardProcess : " << gp.isHardProcess() << endl - << " fromHardProcess : " << gp.fromHardProcess() << endl - << " isHardProcessTauDecayProduct : " << gp.isHardProcessTauDecayProduct() << endl - << " isDirectHardProcessTauDecayProduct : " << gp.isDirectHardProcessTauDecayProduct() << endl - << " fromHardProcessBeforeFSR : " << gp.fromHardProcessBeforeFSR() << endl - << " isFirstCopy : " << gp.isFirstCopy() << endl - << " isLastCopy : " << gp.isLastCopy() << endl - << " isLastCopyBeforeFSR : " << gp.isLastCopyBeforeFSR() << endl - << endl; + << " isPrompt : " << gp.isPrompt() << endl + << " isDecayedLeptonHadron : " << gp.isDecayedLeptonHadron() << endl + << " isTauDecayProduct : " << gp.isTauDecayProduct() << endl + << " isPromptTauDecayProduct : " << gp.isPromptTauDecayProduct() << endl + << " isDirectTauDecayProduct : " << gp.isDirectTauDecayProduct() << endl + << " isDirectPromptTauDecayProduct : " << gp.isDirectPromptTauDecayProduct() << endl + << " isDirectHadronDecayProduct : " << gp.isDirectHadronDecayProduct() << endl + << " isHardProcess : " << gp.isHardProcess() << endl + << " fromHardProcess : " << gp.fromHardProcess() << endl + << " isHardProcessTauDecayProduct : " << gp.isHardProcessTauDecayProduct() << endl + << " isDirectHardProcessTauDecayProduct : " << gp.isDirectHardProcessTauDecayProduct() << endl + << " fromHardProcessBeforeFSR : " << gp.fromHardProcessBeforeFSR() << endl + << " isFirstCopy : " << gp.isFirstCopy() << endl + << " isLastCopy : " << gp.isLastCopy() << endl + << " isLastCopyBeforeFSR : " << gp.isLastCopyBeforeFSR() << endl + << endl; } } cout << noboolalpha; diff --git a/src/OutputTree.cc b/src/OutputTree.cc index 29bcbb455..c36823e12 100644 --- a/src/OutputTree.cc +++ b/src/OutputTree.cc @@ -35,22 +35,23 @@ using namespace std; OBJ ## _phi = -999.; \ OBJ ## _p4 . SetPxPyPzE(0,0,0,0); -OutputTree::OutputTree (bool savetlv, string name, string title) : +OutputTree::OutputTree (bool savetlv, string name, string title, bool initAllBranches) : savetlv_ (savetlv) { tree_ = std::unique_ptr (new TTree(name.c_str(), title.c_str())); - init_branches(); + init_branches(initAllBranches); clear(); } -void OutputTree::init_branches() +void OutputTree::init_branches(bool initAllBranches) { //event information tree_->Branch("Run", &Run); tree_->Branch("LumiSec", &LumiSec); tree_->Branch("Event", &Event); + if(!initAllBranches) return; // reco b jets BRANCH_m_pt_ptRegressed_eta_phi_p4(H1_b1) tree_->Branch("H1_b1_deepCSV", &H1_b1_deepCSV); diff --git a/test/fill_histograms.cpp b/test/fill_histograms.cpp index c51d14dbd..fa2800a2e 100644 --- a/test/fill_histograms.cpp +++ b/test/fill_histograms.cpp @@ -45,5 +45,5 @@ int main(int argc, char** argv) ah.mergeSamples(); // do it just at the end ah.saveOutputsToFile(); cout << "... exiting" << endl; - exit(1); + exit(EXIT_SUCCESS); } \ No newline at end of file diff --git a/test/skim_ntuple.cpp b/test/skim_ntuple.cpp index eafd8d707..bcac7239b 100644 --- a/test/skim_ntuple.cpp +++ b/test/skim_ntuple.cpp @@ -355,7 +355,9 @@ int main(int argc, char** argv) } - parameterList.emplace("MaxDeltaR",config.readFloatOpt("triggers::MaxDeltaR")); + parameterList.emplace("MaxDeltaR", config.readFloatOpt("triggers::MaxDeltaR") ); + parameterList.emplace("MatchWithSelectedObjects", config.readBoolOpt("triggers::MatchWithSelectedObjects") ); + // parameterList.emplace("TriggerStudies",config.readBoolOpt ("triggers::TriggerStudies")); parameterList.emplace("TriggerObjectAndMinNumberMap", triggerObjectAndMinNumberMap); nat.triggerReader().setTriggers(triggerVector); @@ -415,16 +417,12 @@ int main(int argc, char** argv) if(!is_data) weight = oph.calculateEventWeight(nat, ei, ot, ec); // std::cout<<"pirla1\n"; ec.updateProcessed(weight); -// std::cout<<"pirla2\n"; std::vector listOfPassedTriggers = nat.getTrgPassed(); -// std::cout<<"pirla3\n"; if( listOfPassedTriggers.size() == 0 && triggerVector.size()>0 ) continue; -// std::cout<<"pirla4\n"; ec.updateTriggered(weight); -// std::cout<<"pirla5\n"; if (!oph.select_bbbb_jets(nat, ei, ot, listOfPassedTriggers)) continue; // std::cout<<"pirla6\n"; @@ -446,11 +444,8 @@ int main(int argc, char** argv) oph.save_objects_for_cut(nat, ot, ei); -// std::cout<<"pirla7\n"; ec.updateSelected(weight); -// std::cout<<"pirla8\n"; su::fill_output_tree(ot, nat, ei); -// std::cout<<"pirla9\n"; }