diff --git a/Analysis/HiggsTauTauRun2/input/pileup/2022/pu_2022_postEE.root b/Analysis/HiggsTauTauRun2/input/pileup/2022/pu_data_2022_postEE.root similarity index 100% rename from Analysis/HiggsTauTauRun2/input/pileup/2022/pu_2022_postEE.root rename to Analysis/HiggsTauTauRun2/input/pileup/2022/pu_data_2022_postEE.root diff --git a/Analysis/HiggsTauTauRun2/input/pileup/2022/pu_2022_preEE.root b/Analysis/HiggsTauTauRun2/input/pileup/2022/pu_data_2022_preEE.root similarity index 100% rename from Analysis/HiggsTauTauRun2/input/pileup/2022/pu_2022_preEE.root rename to Analysis/HiggsTauTauRun2/input/pileup/2022/pu_data_2022_preEE.root diff --git a/Analysis/HiggsTauTauRun2/input/pileup/2022/pu_mc_2022.root b/Analysis/HiggsTauTauRun2/input/pileup/2022/pu_mc_2022.root new file mode 100644 index 000000000..77eda4b18 Binary files /dev/null and b/Analysis/HiggsTauTauRun2/input/pileup/2022/pu_mc_2022.root differ diff --git a/Analysis/HiggsTauTauRun2/input/scale_factors/htt_scalefactors_2022_postEE.root b/Analysis/HiggsTauTauRun2/input/scale_factors/htt_scalefactors_2022_postEE.root new file mode 100644 index 000000000..b12448559 Binary files /dev/null and b/Analysis/HiggsTauTauRun2/input/scale_factors/htt_scalefactors_2022_postEE.root differ diff --git a/Analysis/HiggsTauTauRun2/input/scale_factors/htt_scalefactors_2022_preEE.root b/Analysis/HiggsTauTauRun2/input/scale_factors/htt_scalefactors_2022_preEE.root new file mode 100644 index 000000000..6def7df1e Binary files /dev/null and b/Analysis/HiggsTauTauRun2/input/scale_factors/htt_scalefactors_2022_preEE.root differ diff --git a/Analysis/HiggsTauTauRun2/input/scale_factors/htt_scalefactors_2022postEE.root b/Analysis/HiggsTauTauRun2/input/scale_factors/htt_scalefactors_2022postEE.root deleted file mode 100644 index 854d2dca4..000000000 Binary files a/Analysis/HiggsTauTauRun2/input/scale_factors/htt_scalefactors_2022postEE.root and /dev/null differ diff --git a/Analysis/HiggsTauTauRun2/input/scale_factors/htt_scalefactors_2022preEE.root b/Analysis/HiggsTauTauRun2/input/scale_factors/htt_scalefactors_2022preEE.root deleted file mode 100644 index d38aceb87..000000000 Binary files a/Analysis/HiggsTauTauRun2/input/scale_factors/htt_scalefactors_2022preEE.root and /dev/null differ diff --git a/Analysis/HiggsTauTauRun2/scripts/HiggsTauTauPlot.py b/Analysis/HiggsTauTauRun2/scripts/HiggsTauTauPlot.py index a4ef6baae..8cd627e41 100644 --- a/Analysis/HiggsTauTauRun2/scripts/HiggsTauTauPlot.py +++ b/Analysis/HiggsTauTauRun2/scripts/HiggsTauTauPlot.py @@ -501,7 +501,7 @@ cats['baseline'] = '(iso_1<0.15 && deepTauVsJets_medium_2>0.5 && deepTauVsEle_vvloose_2>0.5 && deepTauVsMu_tight_2>0.5 && !leptonveto && ((trg_mutaucross&&pt_2>25&&pt_1<23)||(trg_singlemuon&&pt_1>23)))' if options.era in ['tauid2017']: cats['baseline'] = '(iso_1<0.15 && antiele_2 && antimu_2 && !leptonveto && pt_1>25 && trg_singlemuon &&pt_2>20)' - if options.era in ['cpsummer17','UL_17','cp18','UL_18','22']: + if options.era in ['cpsummer17','UL_17','cp18','UL_18','22_preEE','22_postEE']: cats['baseline'] = '(iso_1<0.15 && deepTauVsJets_medium_2>0.5 && deepTauVsEle_vvloose_2>0.5 && deepTauVsMu_tight_2>0.5 && !leptonveto && ((trg_mutaucross&&pt_2>32&&pt_1<25)||(trg_singlemuon&&pt_1>25)) && wt<2)' if options.era in ['tauid2016']: cats['baseline'] = '(iso_1<0.15 && antiele_2 && antimu_2 && !leptonveto && trg_singlemuon && pt_1>23)' @@ -548,7 +548,7 @@ t_highpt=180 t_lowpt_mt=32 t_lowpt_et=35 - if options.era in ['22']: + if options.era in ['22_preEE','22_postEE']: m_lowpt=25 e_lowpt=33 t_highpt=180 @@ -596,7 +596,7 @@ cats['baseline'] = '(deepTauVsJets_medium_1>0.5 && deepTauVsJets_medium_2>0.5 && leptonveto==0 && trg_doubletau && deepTauVsEle_vvloose_1 && deepTauVsEle_vvloose_2 && deepTauVsMu_vloose_1 && deepTauVsMu_vloose_2)' if options.era in ['cpsummer17','UL_17','cp18','UL_18']: cats['baseline'] = '(deepTauVsJets_medium_1>0.5 && deepTauVsJets_medium_2>0.5 && leptonveto==0 && (trg_doubletau && pt_2>40) && deepTauVsEle_vvloose_1 && deepTauVsEle_vvloose_2 && deepTauVsMu_vloose_1 && deepTauVsMu_vloose_2)' - if options.era == '22': + if options.era in ['22_preEE','22_postEE']: cats['baseline'] = '(deepTauVsJets_medium_1>0.5 && deepTauVsJets_medium_2>0.5 && leptonveto==0 && (trg_doubletau && pt_2>40) && deepTauVsEle_vvloose_1 && deepTauVsEle_vvloose_2 && deepTauVsMu_vloose_1 && deepTauVsMu_vloose_2)' if options.analysis in ['mssmrun2','vlq']: @@ -624,7 +624,7 @@ elif options.channel == 'zmm': cats['baseline'] = '(iso_1<0.15 && iso_2<0.15)' if options.era in ['smsummer16','cpsummer16','cpdecay16',"legacy16",'UL_16_preVFP','UL_16_postVFP','mvadm2016']: cats['baseline'] = '(iso_1<0.15 && iso_2<0.15 && trg_singlemuon)' - if options.era in ['cpsummer17','UL_17','cp18','UL_18','22']: cats['baseline'] = '(pt_1>25 && iso_1<0.15 && iso_2<0.15 && trg_singlemuon)' + if options.era in ['cpsummer17','UL_17','cp18','UL_18','22_preEE','22_postEE']: cats['baseline'] = '(pt_1>25 && iso_1<0.15 && iso_2<0.15 && trg_singlemuon)' elif options.channel == 'zee': cats['baseline'] = '(iso_1<0.1 && iso_2<0.1)' if options.era in ['smsummer16','cpsummer16','cpdecay16',"legacy16",'UL_16_preVFP','UL_16_postVFP','mvadm2016']: cats['baseline'] = '(iso_1<0.1 && iso_2<0.1 && trg_singleelectron && fabs(wt)<2)' @@ -805,7 +805,7 @@ cats['boosted'] = '(!(%s) && !(%s))' % (cats['0jet'], cats['vbf']) if options.channel == 'em': cats['boosted'] = '(!(%s) && !(%s) && n_bjets==0)' % (cats['0jet'], cats['vbf']) -if options.era in ['cpsummer16','cpdecay16',"legacy16",'UL_16_preVFP','UL_16_postVFP','cpsummer17','UL_17','cp18','UL_18','mvadm2016','22'] or options.analysis in ['cpprod']: +if options.era in ['cpsummer16','cpdecay16',"legacy16",'UL_16_preVFP','UL_16_postVFP','cpsummer17','UL_17','cp18','UL_18','mvadm2016','22_preEE','22_postEE'] or options.analysis in ['cpprod']: cats['ttbar'] = 'n_jets>0' if options.channel in ['mt','et']: cats['0jet'] = '(n_jets==0 && n_bjets==0 &&n_loose_bjets<2)' @@ -1235,7 +1235,7 @@ top_sels['ttt_sel'] = '(gen_match_1==5 && gen_match_2==5)' top_sels['ttj_sel'] = '(!(gen_match_1==5 && gen_match_2==5))' -if options.era in ['cpsummer16','cpdecay16',"legacy16",'UL_16_preVFP','UL_16_postVFP','tauid2016','cpsummer17','UL_17','tauid2017','cp18','UL_18','mvadm2016','22']: +if options.era in ['cpsummer16','cpdecay16',"legacy16",'UL_16_preVFP','UL_16_postVFP','tauid2016','cpsummer17','UL_17','tauid2017','cp18','UL_18','mvadm2016','22_preEE','22_postEE']: # define these selections to make them more compatible with the fake-factor method and embedded samples if options.channel =='em': z_sels['zll_sel'] = '(!(gen_match_2==4 && gen_match_1==3))' @@ -1571,35 +1571,57 @@ if options.channel == 'tt': data_samples = ['TauA','TauB','TauC','TauD'] -if options.era in ['22']: - - ztt_samples = ['DYJetsToLL-LO_preEE','DYJetsToLL-LO_postEE'] - top_samples = ['TTTo2L2Nu_preEE','TTto4Q_preEE','TTtoLNu2Q_preEE','TTTo2L2Nu_postEE','TTto4Q_postEE','TTtoLNu2Q_postEE'] - vv_samples = ['WW_preEE','WZ_preEE','ZZ_preEE','TWminusto2L2Nu_preEE', - 'TWminustoLNu2Q_preEE','TbarWplusto2L2Nu_preEE', - 'TbarWplustoLNu2Q_preEE','TbarBQ_t-channel_4FS_preEE','TBbarQ_t-channel_4FS_preEE','WW_postEE','WZ_postEE','ZZ_postEE','TWminusto2L2Nu_postEE', - 'TWminustoLNu2Q_postEE','TbarWplusto2L2Nu_postEE', - 'TbarWplustoLNu2Q_postEE','TbarBQ_t-channel_4FS_postEE','TBbarQ_t-channel_4FS_postEE'] - wjets_samples = ['W3JetsToLNu-LO_preEE', - 'WJetsToLNu-LO_preEE','W1JetsToLNu-LO_postEE','W2JetsToLNu-LO_postEE', - 'WJetsToLNu-LO_postEE'] +if options.era in ['22_preEE']: + + ztt_samples = ['DYto2L-4Jets_MLL-50','DYto2L-4Jets_MLL-50_2J','DYto2L-4Jets_MLL-50_3J','DYto2L-4Jets_MLL-50_4J'] + top_samples = ['TTTo2L2Nu','TTto4Q','TTtoLNu2Q'] + vv_samples = ['WW','WZ','ZZ', + 'TBbarQ_t-channel_4FS','TbarBQ_t-channel_4FS', + 'TWminusto2L2Nu','WminustoLNu2Q', + 'TbarWplusto2L2Nu','TbarWplustoLNu2Q'] + + wjets_samples = ['WJetsToLNu-LO','W3JetsToLNu-LO','WJetsToLNu-4Jets_4J'] wgam_samples = [] ewkz_samples = [] gghww_samples = [] - qqhww_samples = [] + qqhww_samples = [] if options.channel in ['mt','zmm','mj']: - data_samples = ['SingleMuonB_rereco_preEE','SingleMuonC_rereco_preEE','MuonC_rereco_preEE','MuonD_rereco_preEE'] # check this as SingleMuonC_rereco was missing from Endre's list - # data_samples = ['SingleMuonB_rereco_preEE','MuonC_rereco_preEE','MuonD_rereco_preEE','MuonE_rereco_postEE','MuonF_postEE','MuonG_postEE'] - # if options.analysis in ['mssmrun2','vlq'] and options.channel == 'mt': data_samples += ['TauB_rereco_preEE','TauC_rereco_preEE','TauD_rereco_preEE'] + data_samples = ['SingleMuonC_rereco','MuonC_rereco','MuonD_rereco'] + #if options.analysis in ['mssmrun2','vlq'] and options.channel == 'mt': data_samples += ['TauC_rereco','TauD_rereco'] if options.channel == 'em': - data_samples = ['MuonEGA','MuonEGB','MuonEGC','MuonEGD'] + data_samples = ['MuonEGC_rereco','MuonEGD_rereco'] if options.channel == 'et' or options.channel == 'zee': - data_samples = ['EGammaA','EGammaB','EGammaC','EGammaD'] - if options.analysis in ['mssmrun2','vlq'] and options.channel == 'et': data_samples += ['TauA','TauB','TauC','TauD'] + data_samples = ['EGammaC_rereco','EGammaD_rereco'] + #if options.analysis in ['mssmrun2','vlq'] and options.channel == 'et': data_samples += ['TauC_rereco','TauD_rereco'] + if options.channel == 'tt': + data_samples = ['TauC_rereco','TauD_rereco'] + +if options.era in ['22_postEE']: + + ztt_samples = ['DYto2L-4Jets_MLL-50','DYto2L-4Jets_MLL-50_1J','DYto2L-4Jets_MLL-50_2J','DYto2L-4Jets_MLL-50_3J','DYto2L-4Jets_MLL-50_4J'] + top_samples = ['TTTo2L2Nu','TTto4Q','TTtoLNu2Q'] + vv_samples = ['WW','WZ','ZZ', + 'TBbarQ_t-channel_4FS','TbarBQ_t-channel_4FS', + 'TWminusto2L2Nu','WminustoLNu2Q', + 'TbarWplusto2L2Nu','TbarWplustoLNu2Q'] + + wjets_samples = ['WJetsToLNu-LO','W1JetsToLNu-LO','W2JetsToLNu-LO','WtoLNu-4Jets_4J'] + wgam_samples = [] + ewkz_samples = [] + gghww_samples = [] + qqhww_samples = [] + + if options.channel in ['mt','zmm','mj']: + data_samples = ['MuonE_rereco','MuonF','MuonG'] + #if options.analysis in ['mssmrun2','vlq'] and options.channel == 'mt': data_samples += ['TauE_rereco','TauF','TauG'] + if options.channel == 'em': + data_samples = ['MuonEGE_rereco','MuonEGF','MuonEGG'] + if options.channel == 'et' or options.channel == 'zee': + data_samples = ['EGammaE_rereco','EGammaF','EGammaG'] + #if options.analysis in ['mssmrun2','vlq'] and options.channel == 'et': data_samples += ['TauE_rereco','TauF','TauG'] if options.channel == 'tt': - data_samples = ['TauA_preEE','TauB_rereco_preEE', - 'TauC_rereco_preEE','TauD_rereco_preEE','TauE_rereco_postEE','TauF_postEE','TauG_postEE'] + data_samples = ['TauE_rereco','TauF','TauG'] if options.method==0: ztt_samples+=ewkz_samples @@ -1716,7 +1738,7 @@ 'ZH_sm_htt*' : 'ZHiggs0PMToTauTau', } - if options.era == '22': + if options.era in ['22_preEE','22_postEE']: sm_samples = { #'vbf_new' : 'VBFHToTauTau_M125_withDipoleRecoil', 'ggh*_powheg' : 'GluGluHToTauTau_M-125', @@ -1820,7 +1842,7 @@ "ggH_flat_htt*": "GluGluHToTauTauUncorrelatedDecay_Filtered", "qqH_flat_htt*": "VBFHToTauTauUncorrelatedDecay_Filtered", } - if options.era == '22': + if options.era in ['22_preEE','22_postEE']: sm_samples = { # test CP in decay samples 'ggH_ph_htt*' : 'GluGluHToTauTau_M-125', @@ -1845,7 +1867,7 @@ if options.analysis in ['mssmrun2','vlq']: - if options.era == '22': + if options.era in ['22_preEE','22_postEE']: sm_samples = { 'ggH125_SM' : 'GluGluHToTauTau_M-125', 'qqH125' : ['VBFHToTauTau_M-125-ext1','ZHToTauTau_M-125','WplusHToTauTau_M-125','WminusHToTauTau_M-125'], } @@ -2100,7 +2122,7 @@ if options.era in ["legacy16",'UL_16_preVFP','UL_16_postVFP']: replaceYear = "2016" elif (options.era == "cpsummer17" or options.era == 'UL_17'): replaceYear = "2017" elif (options.era == "cp18" or options.era == 'UL_18'): replaceYear = "2018" - elif options.era == "22": replaceYear = "2022" + elif options.era in ['22_preEE','22_postEE']: replaceYear = "2022" else: assert ValueError("Regrouped JES only works for full RunII analyses") @@ -2854,10 +2876,10 @@ qcd_os_ss_ratio = 1.0 qcd_os_ss_ratio = 1.13 if options.cat == '0jet': - if options.era in ['cpsummer16','cpdecay16',"legacy16",'UL_16_preVFP','UL_16_postVFP','cpsummer17','UL_17','cp18','UL_18','mvadm2016','22']: qcd_os_ss_ratio = 0.97 + if options.era in ['cpsummer16','cpdecay16',"legacy16",'UL_16_preVFP','UL_16_postVFP','cpsummer17','UL_17','cp18','UL_18','mvadm2016','22_preEE','22_postEE']: qcd_os_ss_ratio = 0.97 else: qcd_os_ss_ratio = 1.0 elif options.cat == 'boosted': - if options.era in ['cpsummer16','cpdecay16',"legacy16",'UL_16_preVFP','UL_16_postVFP','cpsummer17','UL_17','cp18','UL_18','mvadm2016','22']: qcd_os_ss_ratio = 1.61 + if options.era in ['cpsummer16','cpdecay16',"legacy16",'UL_16_preVFP','UL_16_postVFP','cpsummer17','UL_17','cp18','UL_18','mvadm2016','22_preEE','22_postEE']: qcd_os_ss_ratio = 1.61 else: qcd_os_ss_ratio = 1.28 elif options.cat in ['vbf']: qcd_os_ss_ratio = 1.0 elif options.cat in ['dijet','dijet_lowboost','dijet_boosted', @@ -2870,10 +2892,10 @@ #qcd_os_ss_ratio = 1.07 qcd_os_ss_ratio = 1.12 if options.cat == '0jet': - if options.era in ['cpsummer16','cpdecay16',"legacy16",'UL_16_preVFP','UL_16_postVFP','cpsummer17','UL_17','cp18','UL_18','mvadm2016','22']: qcd_os_ss_ratio = 1.15 + if options.era in ['cpsummer16','cpdecay16',"legacy16",'UL_16_preVFP','UL_16_postVFP','cpsummer17','UL_17','cp18','UL_18','mvadm2016','22_preEE','22_postEE']: qcd_os_ss_ratio = 1.15 else: qcd_os_ss_ratio = 1.07 elif options.cat == 'boosted': - if options.era in ['cpsummer16','cpdecay16',"legacy16",'UL_16_preVFP','UL_16_postVFP','cpsummer17','UL_17','cp18','UL_18','mvadm2016','22']: qcd_os_ss_ratio = 1.18 + if options.era in ['cpsummer16','cpdecay16',"legacy16",'UL_16_preVFP','UL_16_postVFP','cpsummer17','UL_17','cp18','UL_18','mvadm2016','22_preEE','22_postEE']: qcd_os_ss_ratio = 1.18 else: qcd_os_ss_ratio = 1.06 elif options.cat in ['vbf']: qcd_os_ss_ratio = 1.0 elif options.cat in ['dijet','dijet_lowboost','dijet_boosted', @@ -2966,7 +2988,7 @@ def GetEmbeddedNode(ana, add_name='', samples=[], plot='', wt='', sel='', cat='' if options.era in ['cpsummer16','cpdecay16',"legacy16",'UL_16_preVFP','UL_16_postVFP','mvadm2016']: wt_+='*1.106' if options.era in ['cpsummer17','UL_17']: wt_+='*1.080' if options.era in ['cp18','UL_18']: wt_+='*1.101' - if options.era in ['22']: wt_+='*1.101' + if options.era in ['22_preEE','22_postEE']: wt_+='*1.101' full_selection = BuildCutString(wt_+'*(wt<2)', sel, cat, OSSS, z_sels['ztt_sel']) return ana.SummedFactory('EmbedZTT'+add_name, samples, plot, full_selection) @@ -3355,7 +3377,7 @@ def GenerateW(ana, add_name='', samples=[], data=[], wg_samples=[], plot='', plo def GetSubtractNode(ana,add_name,plot,plot_unmodified,wt,sel,cat,cat_data,method,qcd_os_ss_ratio,OSSS,includeW=False,w_shift=None): subtract_node = SummedNode('total_bkg'+add_name) - if includeW and options.era!='22': + if includeW and not options.era in ['22_preEE','22_postEE']: if w_shift is not None: w_wt = '%s*%f' %(wt,w_shift) else: w_wt = wt w_node = GetWNode(ana, 'W', wjets_samples, data_samples, plot, plot_unmodified, w_wt, sel, cat, cat_data,method, qcd_os_ss_ratio, OSSS) @@ -3527,18 +3549,18 @@ def GenerateFakeTaus(ana, add_name='', data=[], plot='',plot_unmodified='', wt=' # Select data from anti-isolated region if options.channel != "tt": if options.channel == 'mt': - if options.era in ['smsummer16','cpsummer16','cpdecay16',"legacy16",'UL_16_preVFP','UL_16_postVFP','cpsummer17','UL_17','mvadm2016','cp18','UL_18','22']: + if options.era in ['smsummer16','cpsummer16','cpdecay16',"legacy16",'UL_16_preVFP','UL_16_postVFP','cpsummer17','UL_17','mvadm2016','cp18','UL_18','22_preEE','22_postEE']: anti_isolated_sel = cats['baseline'].replace('deepTauVsJets_%(wp)s_2>0.5' % vars(),'deepTauVsJets_%(wp)s_2<0.5 && deepTauVsJets_vvvloose_2>0.5' % vars()) else: anti_isolated_sel = '(iso_1<0.15 && mva_olddm_tight_2<0.5 && mva_olddm_vloose_2>0.5 && antiele_2 && antimu_2 && !leptonveto && trg_singlemuon)' elif options.channel == 'et': - if options.era in ["smsummer16","cpsummer16","cpdecay16","legacy16",'UL_16_preVFP','UL_16_postVFP',"cpsummer17",'UL_17',"mvadm2016","cp18",'UL_18','22']: + if options.era in ["smsummer16","cpsummer16","cpdecay16","legacy16",'UL_16_preVFP','UL_16_postVFP',"cpsummer17",'UL_17',"mvadm2016","cp18",'UL_18','22_preEE','22_postEE']: anti_isolated_sel = cats['baseline'].replace('deepTauVsJets_%(wp)s_2>0.5' % vars(),'deepTauVsJets_%(wp)s_2<0.5 && deepTauVsJets_vvvloose_2>0.5' % vars()) else: anti_isolated_sel = '(iso_1<0.1 && mva_olddm_tight_2<0.5 && mva_olddm_vloose_2>0.5 && antiele_2 && antimu_2 && !leptonveto && trg_singleelectron)' ff_cat = cats[cat_name] +" && "+ anti_isolated_sel ff_cat_data = cats_unmodified[cat_name] +" && "+ anti_isolated_sel - if options.era in ['smsummer16','cpsummer16','cpdecay16',"legacy16",'UL_16_preVFP','UL_16_postVFP','cpsummer17','UL_17','mvadm2016','cp18','UL_18','22']: + if options.era in ['smsummer16','cpsummer16','cpdecay16',"legacy16",'UL_16_preVFP','UL_16_postVFP','cpsummer17','UL_17','mvadm2016','cp18','UL_18','22_preEE','22_postEE']: if ff_syst_weight is not None and 'sub_syst' not in add_name: fake_factor_wt_string = '('+ff_syst_weight+'_1)' else: if options.analysis in ['cpprod']: @@ -3598,7 +3620,7 @@ def GenerateFakeTaus(ana, add_name='', data=[], plot='',plot_unmodified='', wt=' if options.era in ["smsummer16","cpsummer16","cpdecay16","legacy16",'UL_16_preVFP','UL_16_postVFP',"mvadm2016"]: anti_isolated_sel_1 = cats['baseline'].replace('mva_olddm_tight_1>0.5','mva_olddm_tight_1<0.5 && mva_olddm_vloose_1>0.5') anti_isolated_sel_2 = cats['baseline'].replace('mva_olddm_tight_2>0.5','mva_olddm_tight_2<0.5 && mva_olddm_vloose_2>0.5') - if options.era in ["cpsummer17",'UL_17',"cp18",'UL_18','cpdecay16','legacy16','UL_16_preVFP','UL_16_postVFP','22']: # need to do also for MVA cats for 2016! + if options.era in ["cpsummer17",'UL_17',"cp18",'UL_18','cpdecay16','legacy16','UL_16_preVFP','UL_16_postVFP','22_preEE','22_postEE']: # need to do also for MVA cats for 2016! anti_isolated_sel_2 = cats['baseline'].replace('deepTauVsJets_%(wp)s_2>0.5' % vars(),'deepTauVsJets_%(wp)s_2<0.5 && deepTauVsJets_vvvloose_2>0.5' % vars()) anti_isolated_sel_1 = cats['baseline'].replace('deepTauVsJets_%(wp)s_1>0.5' % vars(),'deepTauVsJets_%(wp)s_1<0.5 && deepTauVsJets_vvvloose_1>0.5' % vars()) ff_cat_1 = cats[cat_name] +" && "+ anti_isolated_sel_1 @@ -3615,7 +3637,7 @@ def GenerateFakeTaus(ana, add_name='', data=[], plot='',plot_unmodified='', wt=' flat = 1.04 if (options.era=='cpsummer17' or options.era == 'UL_17'): flat=1.07 if (options.era=='cp18'or options.era == 'UL_18'): flat=1.06 - if (options.era=='22'): flat=1.06 + if (options.era in ['22_preEE','22_postEE']): flat=1.06 if 'njets0' in add_name: @@ -3636,7 +3658,7 @@ def GenerateFakeTaus(ana, add_name='', data=[], plot='',plot_unmodified='', wt=' if options.analysis in ['cpdecay'] and 'ff_tt_qcd_syst' in add_name: - if(options.era=='22'): + if(options.era in ['22_preEE','22_postEE']): if 'njets0' in add_name: if 'Up' in add_name: ff_syst_weight = '((n_jets==0)*(1.24845-0.0578994*dR)/1.06 + (n_jets>0))*wt_ff_1' @@ -3711,7 +3733,7 @@ def GenerateFakeTaus(ana, add_name='', data=[], plot='',plot_unmodified='', wt=' if options.analysis in ['cpprod','cpdecay','mssmrun2','vlq']: fake_factor_wt_string_2='0' else: - if options.era in ["smsummer16","cpsummer16","cpdecay16","legacy16",'UL_16_preVFP','UL_16_postVFP',"cpsummer17",'UL_17',"mvadm2016","cp18",'UL_18','22']: + if options.era in ["smsummer16","cpsummer16","cpdecay16","legacy16",'UL_16_preVFP','UL_16_postVFP',"cpsummer17",'UL_17',"mvadm2016","cp18",'UL_18','22_preEE','22_postEE']: # deep tau tight 2018 anti isolating the subleading tau if options.analysis == 'cpprod': fake_factor_wt_string_2='0' @@ -5021,7 +5043,7 @@ def RawFFFromString(string): if options.channel == 'em': ana.remaps['MuonEG'] = 'data_obs' elif options.channel in ['mt','mj','zmm']: - if options.era == '22': + if options.era in ['22_preEE','22_postEE']: ana.remaps['Muon'] = 'data_obs' else: ana.remaps['SingleMuon'] = 'data_obs' @@ -5763,7 +5785,7 @@ def MergeXBins(hist): NormSignals(outfile,add_name) # for smsummer16 need to ad WplusH and WminusH templates into one -if options.era in ["smsummer16",'cpsummer16','cpdecay16',"legacy16",'UL_16_preVFP','UL_16_postVFP','cpsummer17','UL_17','cp18','UL_18','mvadm2016','22'] and options.channel != 'zmm' and options.analysis != "mssmrun2": +if options.era in ["smsummer16",'cpsummer16','cpdecay16',"legacy16",'UL_16_preVFP','UL_16_postVFP','cpsummer17','UL_17','cp18','UL_18','mvadm2016','22_preEE','22_postEE'] and options.channel != 'zmm' and options.analysis != "mssmrun2": outfile.cd(nodename) directory = outfile.Get(nodename) hists_to_add = [] diff --git a/Analysis/HiggsTauTauRun2/scripts/TnP.py b/Analysis/HiggsTauTauRun2/scripts/TnP.py index 170b051e7..0a2ea353b 100644 --- a/Analysis/HiggsTauTauRun2/scripts/TnP.py +++ b/Analysis/HiggsTauTauRun2/scripts/TnP.py @@ -1009,7 +1009,7 @@ def FitWorkspace(name,infile,outfile,sig_model='DoubleVCorr',bkg_model='Exponent elif options.era == 'UL_16postVFP': ztt_samples = ['DYJetsToLL-LO'] elif options.era == 'UL_17': ztt_samples = ['DYJetsToLL-LO','DYJetsToLL-LO-ext1'] elif options.era == 'UL_18': ztt_samples = ['DYJetsToLL-LO','DYJetsToLL-LO-ext1'] -elif options.era == '22_preEE': ztt_samples = ['DYJetsToLL-LO','DYto2L-4Jets_MLL-50'] +elif options.era == '22_preEE': ztt_samples = ['DYJetsToLL_M-50','DYto2L-4Jets_MLL-50'] elif options.era == '22_postEE': ztt_samples = ['DYJetsToLL-LO','DYto2L-4Jets_MLL-50'] #Formula: abs(eta_2),pt_2,m_vis[0,0.1,0.3,0.8,1.0,1.2,1.6,1.8,2.1,2.4],[10,15,17,19,21,23,24,25,26,27,28,31,34,37,40,45,50,60,70,100,1000],(40,70,110) (wt)*((m_vis>50&&m_vis<150&&pt_1>28&&abs(eta_1)<2.1&&iso_1<0.15&&id_tag_1&&trg_tag_1&&os)*(1&&id_probe_1))*(os)*(1)*(!(trg_probe_2)) diff --git a/Analysis/HiggsTauTauRun2/scripts/TnP_SF.py b/Analysis/HiggsTauTauRun2/scripts/TnP_SF.py index 5a539f60d..a5e60d627 100644 --- a/Analysis/HiggsTauTauRun2/scripts/TnP_SF.py +++ b/Analysis/HiggsTauTauRun2/scripts/TnP_SF.py @@ -130,7 +130,7 @@ if options.embed and EMB_y_val != 0: stat_error_embed_sf = ((stat_error_data/data_y_val)**2+(stat_error_EMB/EMB_y_val)**2)**.5*data_y_val/EMB_y_val - if name == 'trg' and data_y_val<0.1: + if name == 'trg' and data_y_val<0.01: # for the trigger SF we have to remove the low pT SFs where the SFs don;t make sense as the efficiencies are very small. # at the moment to avoid having to use seperate pT cuts depending on the era/channel/trigger we just zero all SF where the efficiencies are < 10% # need to be careful with this bit method incase efficiencies are low for another reason! diff --git a/Analysis/HiggsTauTauRun2/scripts/config_2022_postEE.json b/Analysis/HiggsTauTauRun2/scripts/config_2022_postEE.json index 2b99269f1..7b90009fc 100644 --- a/Analysis/HiggsTauTauRun2/scripts/config_2022_postEE.json +++ b/Analysis/HiggsTauTauRun2/scripts/config_2022_postEE.json @@ -4,10 +4,7 @@ "file_prefix" : "root://gfe02.grid.hep.ph.ic.ac.uk:1097/store/user/irandreo/July0623_Data_124X_2022-postEE/", "max_events": -1, "timings": true, - //"channels": ["mt","et","tt","zmm","zee","em"], - // "channels": ["mt","zmm","tt","et"], - "channels": ["tpzee","tpzmm"], -// "channels": ["tt","mt","et","em","zmm","zee"], + "channels": ["mt","zmm","et","zee"], "sequences": { "all": ["default"] //,"scale_met_high,""scale_met_lo","res_met_high","res_met_lo"] @@ -66,7 +63,7 @@ "do_ff_systematics": false, "do_pdf_wts": false, "do_qcd_scale_wts": false, - "output_folder" : "/vols/cms/dw515/outputs/MSSM/2022-postEE_061023_v1/", + "output_folder" : "output/", "svfit_from_grid" : true, "read_all_svfit_files" : true, "svfit_folder" : "/vols/cms/dw515/outputs/MSSM/mssm_2018_tres1_v2_svfit/", @@ -85,8 +82,8 @@ "hadronic_tau_selector" : 0, "run_gen_info" : false, "do_pu_wt" : true, - "data_pu_file" : "input/pileup/2022/pu_2022_postEE.root", - "mc_pu_file" : "input/pileup/2022/pileup_2022_DYJetsToLL-LO_postEE_postEE.root", + "data_pu_file" : "input/pileup/2022/pu_data_2022_postEE.root", + "mc_pu_file" : "input/pileup/2022/pu_mc_2022.root", "run_trg_filter": false, "baseline": { "tau_scale_mode" : true, diff --git a/Analysis/HiggsTauTauRun2/scripts/config_2022_preEE.json b/Analysis/HiggsTauTauRun2/scripts/config_2022_preEE.json index c4b954e8f..5c429e763 100644 --- a/Analysis/HiggsTauTauRun2/scripts/config_2022_preEE.json +++ b/Analysis/HiggsTauTauRun2/scripts/config_2022_preEE.json @@ -4,10 +4,7 @@ "file_prefix" : "root://gfe02.grid.hep.ph.ic.ac.uk:1097/store/user/irandreo/July0623_Data_124X_2022-preEE/", "max_events": -1, "timings": true, - //"channels": ["mt","et","tt","zmm","zee","em"], - // "channels": ["mt","zmm","tt","et"], - "channels": ["tpzee","tpzmm"], -// "channels": ["tt","mt","et","em","zmm","zee"], + "channels": ["mt","zmm","et","zee"], "sequences": { "all": ["default"] //,"scale_met_high,""scale_met_lo","res_met_high","res_met_lo"] @@ -66,7 +63,7 @@ "do_ff_systematics": false, "do_pdf_wts": false, "do_qcd_scale_wts": false, - "output_folder" : "/vols/cms/dw515/outputs/MSSM/2022-preEE_061023_v1/", + "output_folder" : "output/", "svfit_from_grid" : true, "read_all_svfit_files" : true, "svfit_folder" : "/vols/cms/dw515/outputs/MSSM/mssm_2018_tres1_v2_svfit/", @@ -85,8 +82,8 @@ "hadronic_tau_selector" : 0, "run_gen_info" : false, "do_pu_wt" : true, - "data_pu_file" : "input/pileup/2022/pu_2022_preEE.root", - "mc_pu_file" : "input/pileup/2022/pileup_2022_DYJetsToLL-LO_summer_preEE.root", + "data_pu_file" : "input/pileup/2022/pu_data_2022_preEE.root", + "mc_pu_file" : "input/pileup/2022/pu_mc_2022.root", "run_trg_filter": false, "baseline": { "tau_scale_mode" : true, diff --git a/Analysis/HiggsTauTauRun2/scripts/getEffectiveEvents.py b/Analysis/HiggsTauTauRun2/scripts/getEffectiveEvents.py index 67cb7cd8a..a4f43540a 100644 --- a/Analysis/HiggsTauTauRun2/scripts/getEffectiveEvents.py +++ b/Analysis/HiggsTauTauRun2/scripts/getEffectiveEvents.py @@ -4,7 +4,7 @@ file_names = {} channels = ['mt'] -years = ['2016','2017','2018'] +years = ['2016','2017','2018','2022_preEE','2022_postEE'] for file_name in os.listdir(sys.argv[1]): if '.root' not in file_name: continue @@ -15,7 +15,7 @@ file_names[key] = file_name for f in file_names: - if "SingleMuon" in f or "SingleElectron" in f or "EGamma" in f or f in "MuonEG" or\ + if "Muon" in f or "SingleElectron" in f or "EGamma" in f or f in "MuonEG" or\ "\bTau" in f: continue input_file = ROOT.TFile(sys.argv[1]+'/'+file_names[f]) diff --git a/Analysis/HiggsTauTauRun2/scripts/resubmit_jobs.sh b/Analysis/HiggsTauTauRun2/scripts/resubmit_jobs.sh index dac95a6ab..1b54d93b7 100755 --- a/Analysis/HiggsTauTauRun2/scripts/resubmit_jobs.sh +++ b/Analysis/HiggsTauTauRun2/scripts/resubmit_jobs.sh @@ -17,9 +17,9 @@ source /vols/grid/cms/setup.sh' $job echo $job (( COUNT++ )) if [[ $1 != "" ]]; then - #qsub -e /dev/null -o /dev/null -V -q hep.q -l h_rt=0:$1:0 -l h_vmem=24G -cwd $job + qsub -e /dev/null -o /dev/null -V -q hep.q -l h_rt=0:$1:0 -l h_vmem=24G -cwd $job #qsub -e /dev/null -o /dev/null -V -q hep.q -l h_rt=0:$1:0 -l h_vmem=12G -cwd $job - qsub -e /dev/null -o /dev/null -V -q hep.q -l h_rt=$1:0:0 -l h_vmem=24G -pe hep.pe 2 -cwd $job + #qsub -e /dev/null -o /dev/null -V -q hep.q -l h_rt=$1:0:0 -l h_vmem=24G -pe hep.pe 2 -cwd $job #qsub -e /dev/null -o /dev/null -V -q hep.q -l h_rt=0:$1:0 -cwd $job fi fi; diff --git a/Analysis/HiggsTauTauRun2/scripts/run_TAP_22.sh b/Analysis/HiggsTauTauRun2/scripts/run_TAP_22.sh index df90b3156..2f3c3821c 100755 --- a/Analysis/HiggsTauTauRun2/scripts/run_TAP_22.sh +++ b/Analysis/HiggsTauTauRun2/scripts/run_TAP_22.sh @@ -2,10 +2,10 @@ year=$1 extra=$2 if [[ "$year" == "2022_preEE" ]]; then - dir="/vols/cms/dw515/outputs/MSSM/2022-preEE_031023_v2/" + dir="/vols/cms/dw515/outputs/MSSM/2022-preEE_061023_v1/" era="22_preEE" elif [[ "$year" == "2022_postEE" ]]; then - dir="/vols/cms/dw515/outputs/MSSM/2022-postEE_031023_v2/" + dir="/vols/cms/dw515/outputs/MSSM/2022-postEE_061023_v1/" era="22_postEE" fi @@ -15,6 +15,8 @@ mkdir -p TAP_Run3_v2/${year}/SingleMu # single electron triggers python scripts/TnP.py --channel tpzee --outputfolder=TAP_Run3_v2/${year}/SingleE --folder=${dir} --era=${era} --tree_name=tagandprobe ${extra} python scripts/TnP.py --channel tpzee --outputfolder=TAP_Run3_v2/${year}/SingleE --folder=${dir} --era=${era} --tree_name=tagandprobe ${extra} --tight_tag +python scripts/TnP_SF.py --channel tpzee --input_folder TAP_Run3_v2/${year}/SingleE/ + ## single muon triggers: #python scripts/TnP.py --outputfolder=TAP_Run3_v2/${year}/SingleMu --folder=${dir} --era=${era} --tree_name=tagandprobe ${extra} diff --git a/Analysis/HiggsTauTauRun2/src/HTTSequence.cc b/Analysis/HiggsTauTauRun2/src/HTTSequence.cc index 8b138a7d0..5ecbe1f27 100644 --- a/Analysis/HiggsTauTauRun2/src/HTTSequence.cc +++ b/Analysis/HiggsTauTauRun2/src/HTTSequence.cc @@ -383,7 +383,8 @@ void HTTSequence::BuildSequence(){ if ((era_type == era::data_2018 || era_type == era::data_2018UL)) data_json = "input/json/Cert_314472-325175_13TeV_Legacy2018_Collisions18_JSON.txt"; if ((era_type == era::data_2022_preEE || era_type == era::data_2022_postEE)) - data_json = "input/json/Cert_Collisions2022_355100_362760_Golden_lumicorr.json"; //359571 and 359661 removed https://twiki.cern.ch/twiki/bin/view/CMS/LumiRecommendationsRun3 + //data_json = "input/json/Cert_Collisions2022_355100_362760_Golden_lumicorr.json"; //359571 and 359661 removed https://twiki.cern.ch/twiki/bin/view/CMS/LumiRecommendationsRun3 + data_json = "input/json/Cert_Collisions2022_355100_362760_Golden.json"; if(js["get_effective"].asBool() && js["make_sync_ntuple"].asBool()){ std::cerr<< "Error: cannot run effective number of event module in make_syncntuple mode"<( - w_->function("e_trk_ratio")->functor(w_->argSet("e_pt,e_eta"))); - fns_["e_trk_embed_ratio"] = std::shared_ptr( - w_->function("e_trk_embed_ratio")->functor(w_->argSet("e_pt,e_eta"))); - fns_["m_trk_ratio"] = std::shared_ptr( - w_->function("m_trk_ratio")->functor(w_->argSet("m_eta"))); - - // triggers for muon legs in mt and zmm channels - - fns_["m_trg_binned_mc"] = std::shared_ptr( w_->function("m_trg_binned_ic_mc")->functor(w_->argSet("m_pt,m_eta,m_iso"))); - fns_["m_trg_binned_data"] = std::shared_ptr( - w_->function("m_trg_binned_ic_data")->functor(w_->argSet("m_pt,m_eta,m_iso"))); - fns_["m_trg_binned_embed"] = std::shared_ptr( - w_->function("m_trg_binned_ic_embed")->functor(w_->argSet("m_pt,m_eta,m_iso"))); - if(mc_ == mc::mcleg2016) { - fns_["m_crosstrg_data"] = std::shared_ptr( - w_->function("m_trg_19_binned_ic_data")->functor(w_->argSet("m_pt,m_eta,m_iso"))); - fns_["m_crosstrg_mc"] = std::shared_ptr( - w_->function("m_trg_19_binned_ic_mc")->functor(w_->argSet("m_pt,m_eta,m_iso"))); - fns_["m_crosstrg_embed"] = std::shared_ptr( - w_->function("m_trg_19_binned_ic_embed")->functor(w_->argSet("m_pt,m_eta,m_iso"))); - } - if(mc_ == mc::mc2017 || mc_ == mc::mc2018) { - fns_["m_crosstrg_data"] = std::shared_ptr( - w_->function("m_trg_20_binned_ic_data")->functor(w_->argSet("m_pt,m_eta,m_iso"))); - fns_["m_crosstrg_mc"] = std::shared_ptr( - w_->function("m_trg_20_binned_ic_mc")->functor(w_->argSet("m_pt,m_eta,m_iso"))); - fns_["m_crosstrg_embed"] = std::shared_ptr( - w_->function("m_trg_20_binned_ic_embed")->functor(w_->argSet("m_pt,m_eta,m_iso"))); - } - - fns_["e_trg_binned_mc"] = std::shared_ptr( - w_->function("e_trg_binned_ic_mc")->functor(w_->argSet("e_pt,e_eta,e_iso"))); - fns_["e_trg_binned_data"] = std::shared_ptr( - w_->function("e_trg_binned_ic_data")->functor(w_->argSet("e_pt,e_eta,e_iso"))); - fns_["e_trg_binned_embed"] = std::shared_ptr( - w_->function("e_trg_binned_ic_embed")->functor(w_->argSet("e_pt,e_eta,e_iso"))); - if(mc_ == mc::mc2017 || mc_ == mc::mc2018) { - fns_["e_crosstrg_mc"] = std::shared_ptr( - w_->function("e_trg_24_binned_ic_mc")->functor(w_->argSet("e_pt,e_eta,e_iso"))); - fns_["e_crosstrg_data"] = std::shared_ptr( - w_->function("e_trg_24_binned_ic_data")->functor(w_->argSet("e_pt,e_eta,e_iso"))); - fns_["e_crosstrg_embed"] = std::shared_ptr( - w_->function("e_trg_24_binned_ic_embed")->functor(w_->argSet("e_pt,e_eta,e_iso"))); - } - - // triggers for electron and muon legs in em channel - fns_["e_trg_binned_12_mc"] = std::shared_ptr( - w_->function("e_trg_12_binned_ic_mc")->functor(w_->argSet("e_pt,e_eta,e_iso"))); - fns_["e_trg_binned_12_data"] = std::shared_ptr( - w_->function("e_trg_12_binned_ic_data")->functor(w_->argSet("e_pt,e_eta,e_iso"))); - fns_["e_trg_binned_12_embed"] = std::shared_ptr( - w_->function("e_trg_12_binned_ic_embed")->functor(w_->argSet("e_pt,e_eta,e_iso"))); - fns_["e_trg_binned_23_mc"] = std::shared_ptr( - w_->function("e_trg_23_binned_ic_mc")->functor(w_->argSet("e_pt,e_eta,e_iso"))); - fns_["e_trg_binned_23_data"] = std::shared_ptr( - w_->function("e_trg_23_binned_ic_data")->functor(w_->argSet("e_pt,e_eta,e_iso"))); - fns_["e_trg_binned_23_embed"] = std::shared_ptr( - w_->function("e_trg_23_binned_ic_embed")->functor(w_->argSet("e_pt,e_eta,e_iso"))); - fns_["m_trg_binned_8_mc"] = std::shared_ptr( - w_->function("m_trg_8_binned_ic_mc")->functor(w_->argSet("m_pt,m_eta,m_iso"))); - fns_["m_trg_binned_8_data"] = std::shared_ptr( - w_->function("m_trg_8_binned_ic_data")->functor(w_->argSet("m_pt,m_eta,m_iso"))); - fns_["m_trg_binned_8_embed"] = std::shared_ptr( - w_->function("m_trg_8_binned_ic_embed")->functor(w_->argSet("m_pt,m_eta,m_iso"))); - fns_["m_trg_binned_23_mc"] = std::shared_ptr( - w_->function("m_trg_23_binned_ic_mc")->functor(w_->argSet("m_pt,m_eta,m_iso"))); - fns_["m_trg_binned_23_data"] = std::shared_ptr( - w_->function("m_trg_23_binned_ic_data")->functor(w_->argSet("m_pt,m_eta,m_iso"))); - fns_["m_trg_binned_23_embed"] = std::shared_ptr( - w_->function("m_trg_23_binned_ic_embed")->functor(w_->argSet("m_pt,m_eta,m_iso"))); - - fns_["t_trg_30_embed_data"] = std::shared_ptr( - w_->function("t_trg_mediumDeepTau_etau_data")->functor(w_->argSet("t_pt,t_eta,t_phi,t_dm"))); - fns_["t_trg_30_embed"] = std::shared_ptr( - w_->function("t_trg_mediumDeepTau_etau_embed")->functor(w_->argSet("t_pt,t_eta,t_phi,t_dm"))); - fns_["t_trg_30_embed_ratio"] = std::shared_ptr( - w_->function("t_trg_mediumDeepTau_etau_embed_ratio")->functor(w_->argSet("t_pt,t_eta,t_phi,t_dm"))); - - // triggers for tau legs in et, mt and tt channels - if(era_ != era::data_2018 || era_ != era::data_2018UL) { - fns_["t_trg_30_data"] = std::shared_ptr( - w_->function("t_trg_pog_deeptau_medium_etau_data")->functor(w_->argSet("t_pt,t_dm"))); - fns_["t_trg_30_mc"] = std::shared_ptr( - w_->function("t_trg_pog_deeptau_medium_etau_mc")->functor(w_->argSet("t_pt,t_dm"))); - fns_["t_trg_30_ratio"] = std::shared_ptr( - w_->function("t_trg_pog_deeptau_medium_etau_ratio")->functor(w_->argSet("t_pt,t_dm"))); - } else { - fns_["t_trg_30_data"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_etau_data")->functor(w_->argSet("t_pt,t_dm"))); - fns_["t_trg_30_mc"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_etau_mc")->functor(w_->argSet("t_pt,t_dm"))); - fns_["t_trg_30_ratio"] = std::shared_ptr( - w_->function("t_trg_pog_deeptau_medium_etau_ratio")->functor(w_->argSet("t_pt,t_dm"))); - } - - - fns_["t_trg_27_embed_data"] = std::shared_ptr( - w_->function("t_trg_mediumDeepTau_mutau_data")->functor(w_->argSet("t_pt,t_eta,t_phi,t_dm"))); - fns_["t_trg_27_data"] = std::shared_ptr( - w_->function("t_trg_pog_deeptau_medium_mutau_data")->functor(w_->argSet("t_pt,t_dm"))); - fns_["t_trg_27_mc"] = std::shared_ptr( - w_->function("t_trg_pog_deeptau_medium_mutau_mc")->functor(w_->argSet("t_pt,t_dm"))); - fns_["t_trg_27_embed"] = std::shared_ptr( - w_->function("t_trg_mediumDeepTau_mutau_embed")->functor(w_->argSet("t_pt,t_eta,t_phi,t_dm"))); - fns_["t_trg_27_ratio"] = std::shared_ptr( - w_->function("t_trg_pog_deeptau_medium_mutau_ratio")->functor(w_->argSet("t_pt,t_dm"))); - fns_["t_trg_27_embed_ratio"] = std::shared_ptr( - w_->function("t_trg_mediumDeepTau_mutau_embed_ratio")->functor(w_->argSet("t_pt,t_eta,t_phi,t_dm"))); - - - fns_["t_trg_35_ratio"] = std::shared_ptr( - w_->function("t_trg_pog_deeptau_medium_ditau_ratio")->functor(w_->argSet("t_pt,t_dm"))); - fns_["t_trg_35_embed_ratio"] = std::shared_ptr( - w_->function("t_trg_mediumDeepTau_ditau_embed_ratio")->functor(w_->argSet("t_pt,t_eta,t_phi,t_dm"))); - fns_["t_trg_35_embed"] = std::shared_ptr( - w_->function("t_trg_mediumDeepTau_ditau_embed")->functor(w_->argSet("t_pt,t_eta,t_phi,t_dm"))); - - fns_["t_trg_27_ratio_dm0_up"] = std::shared_ptr( - w_->function("t_trg_pog_deeptau_medium_mutau_ratio_dm0_up")->functor(w_->argSet("t_pt,t_dm"))); - fns_["t_trg_27_ratio_dm1_up"] = std::shared_ptr( - w_->function("t_trg_pog_deeptau_medium_mutau_ratio_dm1_up")->functor(w_->argSet("t_pt,t_dm"))); - fns_["t_trg_27_ratio_dm10_up"] = std::shared_ptr( - w_->function("t_trg_pog_deeptau_medium_mutau_ratio_dm10_up")->functor(w_->argSet("t_pt,t_dm"))); - fns_["t_trg_27_ratio_dm11_up"] = std::shared_ptr( - w_->function("t_trg_pog_deeptau_medium_mutau_ratio_dm11_up")->functor(w_->argSet("t_pt,t_dm"))); - fns_["t_trg_27_ratio_dm0_down"] = std::shared_ptr( - w_->function("t_trg_pog_deeptau_medium_mutau_ratio_dm0_down")->functor(w_->argSet("t_pt,t_dm"))); - fns_["t_trg_27_ratio_dm1_down"] = std::shared_ptr( - w_->function("t_trg_pog_deeptau_medium_mutau_ratio_dm1_down")->functor(w_->argSet("t_pt,t_dm"))); - fns_["t_trg_27_ratio_dm10_down"] = std::shared_ptr( - w_->function("t_trg_pog_deeptau_medium_mutau_ratio_dm10_down")->functor(w_->argSet("t_pt,t_dm"))); - fns_["t_trg_27_ratio_dm11_down"] = std::shared_ptr( - w_->function("t_trg_pog_deeptau_medium_mutau_ratio_dm11_down")->functor(w_->argSet("t_pt,t_dm"))); - - fns_["t_trg_27_embed_ratio_dm0_up"] = std::shared_ptr( - w_->function("t_trg_mediumDeepTau_mutau_embed_ratio_dm0_up")->functor(w_->argSet("t_pt,t_eta,t_phi,t_dm"))); - fns_["t_trg_27_embed_ratio_dm1_up"] = std::shared_ptr( - w_->function("t_trg_mediumDeepTau_mutau_embed_ratio_dm1_up")->functor(w_->argSet("t_pt,t_eta,t_phi,t_dm"))); - fns_["t_trg_27_embed_ratio_dm10_up"] = std::shared_ptr( - w_->function("t_trg_mediumDeepTau_mutau_embed_ratio_dm10_up")->functor(w_->argSet("t_pt,t_eta,t_phi,t_dm"))); - fns_["t_trg_27_embed_ratio_dm11_up"] = std::shared_ptr( - w_->function("t_trg_mediumDeepTau_mutau_embed_ratio_dm11_up")->functor(w_->argSet("t_pt,t_eta,t_phi,t_dm"))); - fns_["t_trg_27_embed_ratio_dm0_down"] = std::shared_ptr( - w_->function("t_trg_mediumDeepTau_mutau_embed_ratio_dm0_down")->functor(w_->argSet("t_pt,t_eta,t_phi,t_dm"))); - fns_["t_trg_27_embed_ratio_dm1_down"] = std::shared_ptr( - w_->function("t_trg_mediumDeepTau_mutau_embed_ratio_dm1_down")->functor(w_->argSet("t_pt,t_eta,t_phi,t_dm"))); - fns_["t_trg_27_embed_ratio_dm10_down"] = std::shared_ptr( - w_->function("t_trg_mediumDeepTau_mutau_embed_ratio_dm10_down")->functor(w_->argSet("t_pt,t_eta,t_phi,t_dm"))); - fns_["t_trg_27_embed_ratio_dm11_down"] = std::shared_ptr( - w_->function("t_trg_mediumDeepTau_mutau_embed_ratio_dm11_down")->functor(w_->argSet("t_pt,t_eta,t_phi,t_dm"))); - - fns_["t_trg_30_embed_ratio_dm0_up"] = std::shared_ptr( - w_->function("t_trg_mediumDeepTau_etau_embed_ratio_dm0_up")->functor(w_->argSet("t_pt,t_eta,t_phi,t_dm"))); - fns_["t_trg_30_embed_ratio_dm1_up"] = std::shared_ptr( - w_->function("t_trg_mediumDeepTau_etau_embed_ratio_dm1_up")->functor(w_->argSet("t_pt,t_eta,t_phi,t_dm"))); - fns_["t_trg_30_embed_ratio_dm10_up"] = std::shared_ptr( - w_->function("t_trg_mediumDeepTau_etau_embed_ratio_dm10_up")->functor(w_->argSet("t_pt,t_eta,t_phi,t_dm"))); - fns_["t_trg_30_embed_ratio_dm11_up"] = std::shared_ptr( - w_->function("t_trg_mediumDeepTau_etau_embed_ratio_dm11_up")->functor(w_->argSet("t_pt,t_eta,t_phi,t_dm"))); - fns_["t_trg_30_embed_ratio_dm0_down"] = std::shared_ptr( - w_->function("t_trg_mediumDeepTau_etau_embed_ratio_dm0_down")->functor(w_->argSet("t_pt,t_eta,t_phi,t_dm"))); - fns_["t_trg_30_embed_ratio_dm1_down"] = std::shared_ptr( - w_->function("t_trg_mediumDeepTau_etau_embed_ratio_dm1_down")->functor(w_->argSet("t_pt,t_eta,t_phi,t_dm"))); - fns_["t_trg_30_embed_ratio_dm10_down"] = std::shared_ptr( - w_->function("t_trg_mediumDeepTau_etau_embed_ratio_dm10_down")->functor(w_->argSet("t_pt,t_eta,t_phi,t_dm"))); - fns_["t_trg_30_embed_ratio_dm11_down"] = std::shared_ptr( - w_->function("t_trg_mediumDeepTau_etau_embed_ratio_dm11_down")->functor(w_->argSet("t_pt,t_eta,t_phi,t_dm"))); - - if(era_ != era::data_2018 || era_ != era::data_2018UL) { - - fns_["t_trg_30_ratio_dm0_up"] = std::shared_ptr( - w_->function("t_trg_pog_deeptau_medium_etau_ratio_dm0_up")->functor(w_->argSet("t_pt,t_dm"))); - fns_["t_trg_30_ratio_dm1_up"] = std::shared_ptr( - w_->function("t_trg_pog_deeptau_medium_etau_ratio_dm1_up")->functor(w_->argSet("t_pt,t_dm"))); - fns_["t_trg_30_ratio_dm10_up"] = std::shared_ptr( - w_->function("t_trg_pog_deeptau_medium_etau_ratio_dm10_up")->functor(w_->argSet("t_pt,t_dm"))); - fns_["t_trg_30_ratio_dm11_up"] = std::shared_ptr( - w_->function("t_trg_pog_deeptau_medium_etau_ratio_dm11_up")->functor(w_->argSet("t_pt,t_dm"))); - fns_["t_trg_30_ratio_dm0_down"] = std::shared_ptr( - w_->function("t_trg_pog_deeptau_medium_etau_ratio_dm0_down")->functor(w_->argSet("t_pt,t_dm"))); - fns_["t_trg_30_ratio_dm1_down"] = std::shared_ptr( - w_->function("t_trg_pog_deeptau_medium_etau_ratio_dm1_down")->functor(w_->argSet("t_pt,t_dm"))); - fns_["t_trg_30_ratio_dm10_down"] = std::shared_ptr( - w_->function("t_trg_pog_deeptau_medium_etau_ratio_dm10_down")->functor(w_->argSet("t_pt,t_dm"))); - fns_["t_trg_30_ratio_dm11_down"] = std::shared_ptr( - w_->function("t_trg_pog_deeptau_medium_etau_ratio_dm11_down")->functor(w_->argSet("t_pt,t_dm"))); - - } else { - - fns_["t_trg_30_ratio_dm0_up"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_etau_ratio_dm0_up")->functor(w_->argSet("t_pt,t_dm"))); - fns_["t_trg_30_ratio_dm1_up"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_etau_ratio_dm1_up")->functor(w_->argSet("t_pt,t_dm"))); - fns_["t_trg_30_ratio_dm10_up"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_etau_ratio_dm10_up")->functor(w_->argSet("t_pt,t_dm"))); - fns_["t_trg_30_ratio_dm11_up"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_etau_ratio_dm11_up")->functor(w_->argSet("t_pt,t_dm"))); - fns_["t_trg_30_ratio_dm0_down"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_etau_ratio_dm0_down")->functor(w_->argSet("t_pt,t_dm"))); - fns_["t_trg_30_ratio_dm1_down"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_etau_ratio_dm1_down")->functor(w_->argSet("t_pt,t_dm"))); - fns_["t_trg_30_ratio_dm10_down"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_etau_ratio_dm10_down")->functor(w_->argSet("t_pt,t_dm"))); - fns_["t_trg_30_ratio_dm11_down"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_etau_ratio_dm11_down")->functor(w_->argSet("t_pt,t_dm"))); - } - - fns_["t_trg_35_ratio_dm0_up"] = std::shared_ptr( - w_->function("t_trg_pog_deeptau_medium_ditau_ratio_dm0_up")->functor(w_->argSet("t_pt,t_dm"))); - fns_["t_trg_35_ratio_dm1_up"] = std::shared_ptr( - w_->function("t_trg_pog_deeptau_medium_ditau_ratio_dm1_up")->functor(w_->argSet("t_pt,t_dm"))); - fns_["t_trg_35_ratio_dm10_up"] = std::shared_ptr( - w_->function("t_trg_pog_deeptau_medium_ditau_ratio_dm10_up")->functor(w_->argSet("t_pt,t_dm"))); - fns_["t_trg_35_ratio_dm11_up"] = std::shared_ptr( - w_->function("t_trg_pog_deeptau_medium_ditau_ratio_dm11_up")->functor(w_->argSet("t_pt,t_dm"))); - fns_["t_trg_35_ratio_dm0_down"] = std::shared_ptr( - w_->function("t_trg_pog_deeptau_medium_ditau_ratio_dm0_down")->functor(w_->argSet("t_pt,t_dm"))); - fns_["t_trg_35_ratio_dm1_down"] = std::shared_ptr( - w_->function("t_trg_pog_deeptau_medium_ditau_ratio_dm1_down")->functor(w_->argSet("t_pt,t_dm"))); - fns_["t_trg_35_ratio_dm10_down"] = std::shared_ptr( - w_->function("t_trg_pog_deeptau_medium_ditau_ratio_dm10_down")->functor(w_->argSet("t_pt,t_dm"))); - fns_["t_trg_35_ratio_dm11_down"] = std::shared_ptr( - w_->function("t_trg_pog_deeptau_medium_ditau_ratio_dm11_down")->functor(w_->argSet("t_pt,t_dm"))); - - fns_["t_trg_35_embed_ratio_dm0_up"] = std::shared_ptr( - w_->function("t_trg_mediumDeepTau_ditau_embed_ratio_dm0_up")->functor(w_->argSet("t_pt,t_eta,t_phi,t_dm"))); - fns_["t_trg_35_embed_ratio_dm1_up"] = std::shared_ptr( - w_->function("t_trg_mediumDeepTau_ditau_embed_ratio_dm1_up")->functor(w_->argSet("t_pt,t_eta,t_phi,t_dm"))); - fns_["t_trg_35_embed_ratio_dm10_up"] = std::shared_ptr( - w_->function("t_trg_mediumDeepTau_ditau_embed_ratio_dm10_up")->functor(w_->argSet("t_pt,t_eta,t_phi,t_dm"))); - fns_["t_trg_35_embed_ratio_dm11_up"] = std::shared_ptr( - w_->function("t_trg_mediumDeepTau_ditau_embed_ratio_dm11_up")->functor(w_->argSet("t_pt,t_eta,t_phi,t_dm"))); - fns_["t_trg_35_embed_ratio_dm0_down"] = std::shared_ptr( - w_->function("t_trg_mediumDeepTau_ditau_embed_ratio_dm0_down")->functor(w_->argSet("t_pt,t_eta,t_phi,t_dm"))); - fns_["t_trg_35_embed_ratio_dm1_down"] = std::shared_ptr( - w_->function("t_trg_mediumDeepTau_ditau_embed_ratio_dm1_down")->functor(w_->argSet("t_pt,t_eta,t_phi,t_dm"))); - fns_["t_trg_35_embed_ratio_dm10_down"] = std::shared_ptr( - w_->function("t_trg_mediumDeepTau_ditau_embed_ratio_dm10_down")->functor(w_->argSet("t_pt,t_eta,t_phi,t_dm"))); - fns_["t_trg_35_embed_ratio_dm11_down"] = std::shared_ptr( - w_->function("t_trg_mediumDeepTau_ditau_embed_ratio_dm11_down")->functor(w_->argSet("t_pt,t_eta,t_phi,t_dm"))); - - // trigger SF for MSSM - - // OR trigger functions for lt channels - std::vector systs = {"","_crosslep_up","_crosslep_down","_singlelep_up","_singlelep_down","_singletau_up","_singletau_down", - "_dm0_up","_dm0_down","_dm1_up","_dm1_down","_dm10_up","_dm10_down","_dm11_up","_dm11_down" - }; - - for (auto s: systs) { - fns_["mt_trg_ratio"+s] = std::shared_ptr(w_->function(("mt_trg_ratio"+s).c_str())->functor(w_->argSet("m_pt,m_eta,m_iso,t_pt,t_dm,t_eta"))); - fns_["mt_trg_embed_ratio"+s] = std::shared_ptr(w_->function(("mt_trg_embed_ratio"+s).c_str())->functor(w_->argSet("m_pt,m_eta,m_iso,t_pt,t_dm,t_eta,t_phi"))); + + // tracking corrections for electrons and muons + fns_["e_trk_ratio"] = std::shared_ptr( + w_->function("e_trk_ratio")->functor(w_->argSet("e_pt,e_eta"))); + fns_["e_trk_embed_ratio"] = std::shared_ptr( + w_->function("e_trk_embed_ratio")->functor(w_->argSet("e_pt,e_eta"))); + fns_["m_trk_ratio"] = std::shared_ptr( + w_->function("m_trk_ratio")->functor(w_->argSet("m_eta"))); + + // triggers for muon legs in mt and zmm channels - fns_["et_trg_ratio"+s] = std::shared_ptr(w_->function(("et_trg_ratio"+s).c_str())->functor(w_->argSet("e_pt,e_eta,e_iso,t_pt,t_dm,t_eta"))); - fns_["et_trg_embed_ratio"+s] = std::shared_ptr(w_->function(("et_trg_embed_ratio"+s).c_str())->functor(w_->argSet("e_pt,e_eta,e_iso,t_pt,t_dm,t_eta,t_phi"))); + fns_["m_trg_binned_mc"] = std::shared_ptr( w_->function("m_trg_binned_ic_mc")->functor(w_->argSet("m_pt,m_eta,m_iso"))); + fns_["m_trg_binned_data"] = std::shared_ptr( + w_->function("m_trg_binned_ic_data")->functor(w_->argSet("m_pt,m_eta,m_iso"))); + fns_["m_trg_binned_embed"] = std::shared_ptr( + w_->function("m_trg_binned_ic_embed")->functor(w_->argSet("m_pt,m_eta,m_iso"))); + if(mc_ == mc::mcleg2016) { + fns_["m_crosstrg_data"] = std::shared_ptr( + w_->function("m_trg_19_binned_ic_data")->functor(w_->argSet("m_pt,m_eta,m_iso"))); + fns_["m_crosstrg_mc"] = std::shared_ptr( + w_->function("m_trg_19_binned_ic_mc")->functor(w_->argSet("m_pt,m_eta,m_iso"))); + fns_["m_crosstrg_embed"] = std::shared_ptr( + w_->function("m_trg_19_binned_ic_embed")->functor(w_->argSet("m_pt,m_eta,m_iso"))); + } + if(mc_ == mc::mc2017 || mc_ == mc::mc2018) { + fns_["m_crosstrg_data"] = std::shared_ptr( + w_->function("m_trg_20_binned_ic_data")->functor(w_->argSet("m_pt,m_eta,m_iso"))); + fns_["m_crosstrg_mc"] = std::shared_ptr( + w_->function("m_trg_20_binned_ic_mc")->functor(w_->argSet("m_pt,m_eta,m_iso"))); + fns_["m_crosstrg_embed"] = std::shared_ptr( + w_->function("m_trg_20_binned_ic_embed")->functor(w_->argSet("m_pt,m_eta,m_iso"))); + } + + fns_["e_trg_binned_mc"] = std::shared_ptr( + w_->function("e_trg_binned_ic_mc")->functor(w_->argSet("e_pt,e_eta,e_iso"))); + fns_["e_trg_binned_data"] = std::shared_ptr( + w_->function("e_trg_binned_ic_data")->functor(w_->argSet("e_pt,e_eta,e_iso"))); + fns_["e_trg_binned_embed"] = std::shared_ptr( + w_->function("e_trg_binned_ic_embed")->functor(w_->argSet("e_pt,e_eta,e_iso"))); + if(mc_ == mc::mc2017 || mc_ == mc::mc2018) { + fns_["e_crosstrg_mc"] = std::shared_ptr( + w_->function("e_trg_24_binned_ic_mc")->functor(w_->argSet("e_pt,e_eta,e_iso"))); + fns_["e_crosstrg_data"] = std::shared_ptr( + w_->function("e_trg_24_binned_ic_data")->functor(w_->argSet("e_pt,e_eta,e_iso"))); + fns_["e_crosstrg_embed"] = std::shared_ptr( + w_->function("e_trg_24_binned_ic_embed")->functor(w_->argSet("e_pt,e_eta,e_iso"))); + } + + // triggers for electron and muon legs in em channel + fns_["e_trg_binned_12_mc"] = std::shared_ptr( + w_->function("e_trg_12_binned_ic_mc")->functor(w_->argSet("e_pt,e_eta,e_iso"))); + fns_["e_trg_binned_12_data"] = std::shared_ptr( + w_->function("e_trg_12_binned_ic_data")->functor(w_->argSet("e_pt,e_eta,e_iso"))); + fns_["e_trg_binned_12_embed"] = std::shared_ptr( + w_->function("e_trg_12_binned_ic_embed")->functor(w_->argSet("e_pt,e_eta,e_iso"))); + fns_["e_trg_binned_23_mc"] = std::shared_ptr( + w_->function("e_trg_23_binned_ic_mc")->functor(w_->argSet("e_pt,e_eta,e_iso"))); + fns_["e_trg_binned_23_data"] = std::shared_ptr( + w_->function("e_trg_23_binned_ic_data")->functor(w_->argSet("e_pt,e_eta,e_iso"))); + fns_["e_trg_binned_23_embed"] = std::shared_ptr( + w_->function("e_trg_23_binned_ic_embed")->functor(w_->argSet("e_pt,e_eta,e_iso"))); + fns_["m_trg_binned_8_mc"] = std::shared_ptr( + w_->function("m_trg_8_binned_ic_mc")->functor(w_->argSet("m_pt,m_eta,m_iso"))); + fns_["m_trg_binned_8_data"] = std::shared_ptr( + w_->function("m_trg_8_binned_ic_data")->functor(w_->argSet("m_pt,m_eta,m_iso"))); + fns_["m_trg_binned_8_embed"] = std::shared_ptr( + w_->function("m_trg_8_binned_ic_embed")->functor(w_->argSet("m_pt,m_eta,m_iso"))); + fns_["m_trg_binned_23_mc"] = std::shared_ptr( + w_->function("m_trg_23_binned_ic_mc")->functor(w_->argSet("m_pt,m_eta,m_iso"))); + fns_["m_trg_binned_23_data"] = std::shared_ptr( + w_->function("m_trg_23_binned_ic_data")->functor(w_->argSet("m_pt,m_eta,m_iso"))); + fns_["m_trg_binned_23_embed"] = std::shared_ptr( + w_->function("m_trg_23_binned_ic_embed")->functor(w_->argSet("m_pt,m_eta,m_iso"))); + + fns_["t_trg_30_embed_data"] = std::shared_ptr( + w_->function("t_trg_mediumDeepTau_etau_data")->functor(w_->argSet("t_pt,t_eta,t_phi,t_dm"))); + fns_["t_trg_30_embed"] = std::shared_ptr( + w_->function("t_trg_mediumDeepTau_etau_embed")->functor(w_->argSet("t_pt,t_eta,t_phi,t_dm"))); + fns_["t_trg_30_embed_ratio"] = std::shared_ptr( + w_->function("t_trg_mediumDeepTau_etau_embed_ratio")->functor(w_->argSet("t_pt,t_eta,t_phi,t_dm"))); + + // triggers for tau legs in et, mt and tt channels + if(era_ != era::data_2018 || era_ != era::data_2018UL) { + fns_["t_trg_30_data"] = std::shared_ptr( + w_->function("t_trg_pog_deeptau_medium_etau_data")->functor(w_->argSet("t_pt,t_dm"))); + fns_["t_trg_30_mc"] = std::shared_ptr( + w_->function("t_trg_pog_deeptau_medium_etau_mc")->functor(w_->argSet("t_pt,t_dm"))); + fns_["t_trg_30_ratio"] = std::shared_ptr( + w_->function("t_trg_pog_deeptau_medium_etau_ratio")->functor(w_->argSet("t_pt,t_dm"))); + } else { + fns_["t_trg_30_data"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_etau_data")->functor(w_->argSet("t_pt,t_dm"))); + fns_["t_trg_30_mc"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_etau_mc")->functor(w_->argSet("t_pt,t_dm"))); + fns_["t_trg_30_ratio"] = std::shared_ptr( + w_->function("t_trg_pog_deeptau_medium_etau_ratio")->functor(w_->argSet("t_pt,t_dm"))); + } + + + fns_["t_trg_27_embed_data"] = std::shared_ptr( + w_->function("t_trg_mediumDeepTau_mutau_data")->functor(w_->argSet("t_pt,t_eta,t_phi,t_dm"))); + fns_["t_trg_27_data"] = std::shared_ptr( + w_->function("t_trg_pog_deeptau_medium_mutau_data")->functor(w_->argSet("t_pt,t_dm"))); + fns_["t_trg_27_mc"] = std::shared_ptr( + w_->function("t_trg_pog_deeptau_medium_mutau_mc")->functor(w_->argSet("t_pt,t_dm"))); + fns_["t_trg_27_embed"] = std::shared_ptr( + w_->function("t_trg_mediumDeepTau_mutau_embed")->functor(w_->argSet("t_pt,t_eta,t_phi,t_dm"))); + fns_["t_trg_27_ratio"] = std::shared_ptr( + w_->function("t_trg_pog_deeptau_medium_mutau_ratio")->functor(w_->argSet("t_pt,t_dm"))); + fns_["t_trg_27_embed_ratio"] = std::shared_ptr( + w_->function("t_trg_mediumDeepTau_mutau_embed_ratio")->functor(w_->argSet("t_pt,t_eta,t_phi,t_dm"))); + + + fns_["t_trg_35_ratio"] = std::shared_ptr( + w_->function("t_trg_pog_deeptau_medium_ditau_ratio")->functor(w_->argSet("t_pt,t_dm"))); + fns_["t_trg_35_embed_ratio"] = std::shared_ptr( + w_->function("t_trg_mediumDeepTau_ditau_embed_ratio")->functor(w_->argSet("t_pt,t_eta,t_phi,t_dm"))); + fns_["t_trg_35_embed"] = std::shared_ptr( + w_->function("t_trg_mediumDeepTau_ditau_embed")->functor(w_->argSet("t_pt,t_eta,t_phi,t_dm"))); + + fns_["t_trg_27_ratio_dm0_up"] = std::shared_ptr( + w_->function("t_trg_pog_deeptau_medium_mutau_ratio_dm0_up")->functor(w_->argSet("t_pt,t_dm"))); + fns_["t_trg_27_ratio_dm1_up"] = std::shared_ptr( + w_->function("t_trg_pog_deeptau_medium_mutau_ratio_dm1_up")->functor(w_->argSet("t_pt,t_dm"))); + fns_["t_trg_27_ratio_dm10_up"] = std::shared_ptr( + w_->function("t_trg_pog_deeptau_medium_mutau_ratio_dm10_up")->functor(w_->argSet("t_pt,t_dm"))); + fns_["t_trg_27_ratio_dm11_up"] = std::shared_ptr( + w_->function("t_trg_pog_deeptau_medium_mutau_ratio_dm11_up")->functor(w_->argSet("t_pt,t_dm"))); + fns_["t_trg_27_ratio_dm0_down"] = std::shared_ptr( + w_->function("t_trg_pog_deeptau_medium_mutau_ratio_dm0_down")->functor(w_->argSet("t_pt,t_dm"))); + fns_["t_trg_27_ratio_dm1_down"] = std::shared_ptr( + w_->function("t_trg_pog_deeptau_medium_mutau_ratio_dm1_down")->functor(w_->argSet("t_pt,t_dm"))); + fns_["t_trg_27_ratio_dm10_down"] = std::shared_ptr( + w_->function("t_trg_pog_deeptau_medium_mutau_ratio_dm10_down")->functor(w_->argSet("t_pt,t_dm"))); + fns_["t_trg_27_ratio_dm11_down"] = std::shared_ptr( + w_->function("t_trg_pog_deeptau_medium_mutau_ratio_dm11_down")->functor(w_->argSet("t_pt,t_dm"))); + + fns_["t_trg_27_embed_ratio_dm0_up"] = std::shared_ptr( + w_->function("t_trg_mediumDeepTau_mutau_embed_ratio_dm0_up")->functor(w_->argSet("t_pt,t_eta,t_phi,t_dm"))); + fns_["t_trg_27_embed_ratio_dm1_up"] = std::shared_ptr( + w_->function("t_trg_mediumDeepTau_mutau_embed_ratio_dm1_up")->functor(w_->argSet("t_pt,t_eta,t_phi,t_dm"))); + fns_["t_trg_27_embed_ratio_dm10_up"] = std::shared_ptr( + w_->function("t_trg_mediumDeepTau_mutau_embed_ratio_dm10_up")->functor(w_->argSet("t_pt,t_eta,t_phi,t_dm"))); + fns_["t_trg_27_embed_ratio_dm11_up"] = std::shared_ptr( + w_->function("t_trg_mediumDeepTau_mutau_embed_ratio_dm11_up")->functor(w_->argSet("t_pt,t_eta,t_phi,t_dm"))); + fns_["t_trg_27_embed_ratio_dm0_down"] = std::shared_ptr( + w_->function("t_trg_mediumDeepTau_mutau_embed_ratio_dm0_down")->functor(w_->argSet("t_pt,t_eta,t_phi,t_dm"))); + fns_["t_trg_27_embed_ratio_dm1_down"] = std::shared_ptr( + w_->function("t_trg_mediumDeepTau_mutau_embed_ratio_dm1_down")->functor(w_->argSet("t_pt,t_eta,t_phi,t_dm"))); + fns_["t_trg_27_embed_ratio_dm10_down"] = std::shared_ptr( + w_->function("t_trg_mediumDeepTau_mutau_embed_ratio_dm10_down")->functor(w_->argSet("t_pt,t_eta,t_phi,t_dm"))); + fns_["t_trg_27_embed_ratio_dm11_down"] = std::shared_ptr( + w_->function("t_trg_mediumDeepTau_mutau_embed_ratio_dm11_down")->functor(w_->argSet("t_pt,t_eta,t_phi,t_dm"))); + + fns_["t_trg_30_embed_ratio_dm0_up"] = std::shared_ptr( + w_->function("t_trg_mediumDeepTau_etau_embed_ratio_dm0_up")->functor(w_->argSet("t_pt,t_eta,t_phi,t_dm"))); + fns_["t_trg_30_embed_ratio_dm1_up"] = std::shared_ptr( + w_->function("t_trg_mediumDeepTau_etau_embed_ratio_dm1_up")->functor(w_->argSet("t_pt,t_eta,t_phi,t_dm"))); + fns_["t_trg_30_embed_ratio_dm10_up"] = std::shared_ptr( + w_->function("t_trg_mediumDeepTau_etau_embed_ratio_dm10_up")->functor(w_->argSet("t_pt,t_eta,t_phi,t_dm"))); + fns_["t_trg_30_embed_ratio_dm11_up"] = std::shared_ptr( + w_->function("t_trg_mediumDeepTau_etau_embed_ratio_dm11_up")->functor(w_->argSet("t_pt,t_eta,t_phi,t_dm"))); + fns_["t_trg_30_embed_ratio_dm0_down"] = std::shared_ptr( + w_->function("t_trg_mediumDeepTau_etau_embed_ratio_dm0_down")->functor(w_->argSet("t_pt,t_eta,t_phi,t_dm"))); + fns_["t_trg_30_embed_ratio_dm1_down"] = std::shared_ptr( + w_->function("t_trg_mediumDeepTau_etau_embed_ratio_dm1_down")->functor(w_->argSet("t_pt,t_eta,t_phi,t_dm"))); + fns_["t_trg_30_embed_ratio_dm10_down"] = std::shared_ptr( + w_->function("t_trg_mediumDeepTau_etau_embed_ratio_dm10_down")->functor(w_->argSet("t_pt,t_eta,t_phi,t_dm"))); + fns_["t_trg_30_embed_ratio_dm11_down"] = std::shared_ptr( + w_->function("t_trg_mediumDeepTau_etau_embed_ratio_dm11_down")->functor(w_->argSet("t_pt,t_eta,t_phi,t_dm"))); + + if(era_ != era::data_2018 || era_ != era::data_2018UL) { + + fns_["t_trg_30_ratio_dm0_up"] = std::shared_ptr( + w_->function("t_trg_pog_deeptau_medium_etau_ratio_dm0_up")->functor(w_->argSet("t_pt,t_dm"))); + fns_["t_trg_30_ratio_dm1_up"] = std::shared_ptr( + w_->function("t_trg_pog_deeptau_medium_etau_ratio_dm1_up")->functor(w_->argSet("t_pt,t_dm"))); + fns_["t_trg_30_ratio_dm10_up"] = std::shared_ptr( + w_->function("t_trg_pog_deeptau_medium_etau_ratio_dm10_up")->functor(w_->argSet("t_pt,t_dm"))); + fns_["t_trg_30_ratio_dm11_up"] = std::shared_ptr( + w_->function("t_trg_pog_deeptau_medium_etau_ratio_dm11_up")->functor(w_->argSet("t_pt,t_dm"))); + fns_["t_trg_30_ratio_dm0_down"] = std::shared_ptr( + w_->function("t_trg_pog_deeptau_medium_etau_ratio_dm0_down")->functor(w_->argSet("t_pt,t_dm"))); + fns_["t_trg_30_ratio_dm1_down"] = std::shared_ptr( + w_->function("t_trg_pog_deeptau_medium_etau_ratio_dm1_down")->functor(w_->argSet("t_pt,t_dm"))); + fns_["t_trg_30_ratio_dm10_down"] = std::shared_ptr( + w_->function("t_trg_pog_deeptau_medium_etau_ratio_dm10_down")->functor(w_->argSet("t_pt,t_dm"))); + fns_["t_trg_30_ratio_dm11_down"] = std::shared_ptr( + w_->function("t_trg_pog_deeptau_medium_etau_ratio_dm11_down")->functor(w_->argSet("t_pt,t_dm"))); + + } else { + + fns_["t_trg_30_ratio_dm0_up"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_etau_ratio_dm0_up")->functor(w_->argSet("t_pt,t_dm"))); + fns_["t_trg_30_ratio_dm1_up"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_etau_ratio_dm1_up")->functor(w_->argSet("t_pt,t_dm"))); + fns_["t_trg_30_ratio_dm10_up"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_etau_ratio_dm10_up")->functor(w_->argSet("t_pt,t_dm"))); + fns_["t_trg_30_ratio_dm11_up"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_etau_ratio_dm11_up")->functor(w_->argSet("t_pt,t_dm"))); + fns_["t_trg_30_ratio_dm0_down"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_etau_ratio_dm0_down")->functor(w_->argSet("t_pt,t_dm"))); + fns_["t_trg_30_ratio_dm1_down"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_etau_ratio_dm1_down")->functor(w_->argSet("t_pt,t_dm"))); + fns_["t_trg_30_ratio_dm10_down"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_etau_ratio_dm10_down")->functor(w_->argSet("t_pt,t_dm"))); + fns_["t_trg_30_ratio_dm11_down"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_etau_ratio_dm11_down")->functor(w_->argSet("t_pt,t_dm"))); + } + + fns_["t_trg_35_ratio_dm0_up"] = std::shared_ptr( + w_->function("t_trg_pog_deeptau_medium_ditau_ratio_dm0_up")->functor(w_->argSet("t_pt,t_dm"))); + fns_["t_trg_35_ratio_dm1_up"] = std::shared_ptr( + w_->function("t_trg_pog_deeptau_medium_ditau_ratio_dm1_up")->functor(w_->argSet("t_pt,t_dm"))); + fns_["t_trg_35_ratio_dm10_up"] = std::shared_ptr( + w_->function("t_trg_pog_deeptau_medium_ditau_ratio_dm10_up")->functor(w_->argSet("t_pt,t_dm"))); + fns_["t_trg_35_ratio_dm11_up"] = std::shared_ptr( + w_->function("t_trg_pog_deeptau_medium_ditau_ratio_dm11_up")->functor(w_->argSet("t_pt,t_dm"))); + fns_["t_trg_35_ratio_dm0_down"] = std::shared_ptr( + w_->function("t_trg_pog_deeptau_medium_ditau_ratio_dm0_down")->functor(w_->argSet("t_pt,t_dm"))); + fns_["t_trg_35_ratio_dm1_down"] = std::shared_ptr( + w_->function("t_trg_pog_deeptau_medium_ditau_ratio_dm1_down")->functor(w_->argSet("t_pt,t_dm"))); + fns_["t_trg_35_ratio_dm10_down"] = std::shared_ptr( + w_->function("t_trg_pog_deeptau_medium_ditau_ratio_dm10_down")->functor(w_->argSet("t_pt,t_dm"))); + fns_["t_trg_35_ratio_dm11_down"] = std::shared_ptr( + w_->function("t_trg_pog_deeptau_medium_ditau_ratio_dm11_down")->functor(w_->argSet("t_pt,t_dm"))); + + fns_["t_trg_35_embed_ratio_dm0_up"] = std::shared_ptr( + w_->function("t_trg_mediumDeepTau_ditau_embed_ratio_dm0_up")->functor(w_->argSet("t_pt,t_eta,t_phi,t_dm"))); + fns_["t_trg_35_embed_ratio_dm1_up"] = std::shared_ptr( + w_->function("t_trg_mediumDeepTau_ditau_embed_ratio_dm1_up")->functor(w_->argSet("t_pt,t_eta,t_phi,t_dm"))); + fns_["t_trg_35_embed_ratio_dm10_up"] = std::shared_ptr( + w_->function("t_trg_mediumDeepTau_ditau_embed_ratio_dm10_up")->functor(w_->argSet("t_pt,t_eta,t_phi,t_dm"))); + fns_["t_trg_35_embed_ratio_dm11_up"] = std::shared_ptr( + w_->function("t_trg_mediumDeepTau_ditau_embed_ratio_dm11_up")->functor(w_->argSet("t_pt,t_eta,t_phi,t_dm"))); + fns_["t_trg_35_embed_ratio_dm0_down"] = std::shared_ptr( + w_->function("t_trg_mediumDeepTau_ditau_embed_ratio_dm0_down")->functor(w_->argSet("t_pt,t_eta,t_phi,t_dm"))); + fns_["t_trg_35_embed_ratio_dm1_down"] = std::shared_ptr( + w_->function("t_trg_mediumDeepTau_ditau_embed_ratio_dm1_down")->functor(w_->argSet("t_pt,t_eta,t_phi,t_dm"))); + fns_["t_trg_35_embed_ratio_dm10_down"] = std::shared_ptr( + w_->function("t_trg_mediumDeepTau_ditau_embed_ratio_dm10_down")->functor(w_->argSet("t_pt,t_eta,t_phi,t_dm"))); + fns_["t_trg_35_embed_ratio_dm11_down"] = std::shared_ptr( + w_->function("t_trg_mediumDeepTau_ditau_embed_ratio_dm11_down")->functor(w_->argSet("t_pt,t_eta,t_phi,t_dm"))); + + // trigger SF for MSSM + + // OR trigger functions for lt channels + std::vector systs = {"","_crosslep_up","_crosslep_down","_singlelep_up","_singlelep_down","_singletau_up","_singletau_down", + "_dm0_up","_dm0_down","_dm1_up","_dm1_down","_dm10_up","_dm10_down","_dm11_up","_dm11_down" + }; + + for (auto s: systs) { + fns_["mt_trg_ratio"+s] = std::shared_ptr(w_->function(("mt_trg_ratio"+s).c_str())->functor(w_->argSet("m_pt,m_eta,m_iso,t_pt,t_dm,t_eta"))); + fns_["mt_trg_embed_ratio"+s] = std::shared_ptr(w_->function(("mt_trg_embed_ratio"+s).c_str())->functor(w_->argSet("m_pt,m_eta,m_iso,t_pt,t_dm,t_eta,t_phi"))); + + fns_["et_trg_ratio"+s] = std::shared_ptr(w_->function(("et_trg_ratio"+s).c_str())->functor(w_->argSet("e_pt,e_eta,e_iso,t_pt,t_dm,t_eta"))); + fns_["et_trg_embed_ratio"+s] = std::shared_ptr(w_->function(("et_trg_embed_ratio"+s).c_str())->functor(w_->argSet("e_pt,e_eta,e_iso,t_pt,t_dm,t_eta,t_phi"))); + } + + systs = {"","_singletau_up","_singletau_down","_lowpt_dm0_up","_lowpt_dm0_down","_lowpt_dm1_up","_lowpt_dm1_down","_lowpt_dm10_up","_lowpt_dm10_down","_lowpt_dm11_up","_lowpt_dm11_down", + "_highpt_dm0_up", "_highpt_dm0_down","_highpt_dm1_up","_highpt_dm1_down","_highpt_dm10_up","_highpt_dm10_down","_highpt_dm11_up","_highpt_dm11_down" + }; + for (auto s : systs){ + fns_["t_trg_2d_ratio"+s] = std::shared_ptr( + w_->function(("t_trg_2d_ratio"+s).c_str())->functor(w_->argSet("t_pt,t_dm,t_pt_2,t_dm_2"))); + fns_["t_trg_2d_embed_ratio"+s] = std::shared_ptr( + w_->function(("t_trg_2d_embed_ratio"+s).c_str())->functor(w_->argSet("t_pt,t_dm,t_pt_2,t_dm_2"))); + } + + fns_["t_trg_2d_doubleonly_ratio"] = std::shared_ptr( + w_->function("t_trg_2d_doubleonly_ratio")->functor(w_->argSet("t_pt,t_dm,t_pt_2,t_dm_2"))); + fns_["t_trg_2d_doubleonly_embed_ratio"] = std::shared_ptr( + w_->function("t_trg_2d_doubleonly_embed_ratio")->functor(w_->argSet("t_pt,t_dm,t_pt_2,t_dm_2"))); + + fns_["t_trg_single_data"] = std::shared_ptr( + w_->function("t_trg_single_data")->functor(w_->argSet("t_pt"))); + fns_["t_trg_single_data_up"] = std::shared_ptr( + w_->function("t_trg_single_data_up")->functor(w_->argSet("t_pt"))); + fns_["t_trg_single_data_down"] = std::shared_ptr( + w_->function("t_trg_single_data_down")->functor(w_->argSet("t_pt"))); + fns_["t_trg_single_mc"] = std::shared_ptr( + w_->function("t_trg_single_mc")->functor(w_->argSet("t_pt"))); + fns_["t_trg_single_embed"] = std::shared_ptr( + w_->function("t_trg_single_embed")->functor(w_->argSet("t_pt"))); + //////// + + // Mohammads trigger SFs + //t_trg_ic_deeptau_medium_mvadm_ditau_ratio_mvadm1_down + + fns_["t_trg_27_ic_ratio"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mutau_ratio")->functor(w_->argSet("t_pt,t_dm"))); + fns_["t_trg_27_ic_embed_ratio"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mutau_embed_ratio")->functor(w_->argSet("t_pt,t_dm"))); + + fns_["t_trg_27_ic_mvadm_ratio"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_mutau_ratio")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_trg_27_ic_mvadm_embed_ratio"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_mutau_embed_ratio")->functor(w_->argSet("t_pt,t_mvadm"))); + + fns_["t_trg_27_ic_mvadm_ratio_mvadm0_up"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_mutau_ratio_mvadm0_up")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_trg_27_ic_mvadm_ratio_mvadm0_down"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_mutau_ratio_mvadm0_down")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_trg_27_ic_mvadm_ratio_mvadm1_up"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_mutau_ratio_mvadm1_up")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_trg_27_ic_mvadm_ratio_mvadm1_down"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_mutau_ratio_mvadm1_down")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_trg_27_ic_mvadm_ratio_mvadm2_up"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_mutau_ratio_mvadm2_up")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_trg_27_ic_mvadm_ratio_mvadm2_down"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_mutau_ratio_mvadm2_down")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_trg_27_ic_mvadm_ratio_mvadm10_up"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_mutau_ratio_mvadm10_up")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_trg_27_ic_mvadm_ratio_mvadm10_down"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_mutau_ratio_mvadm10_down")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_trg_27_ic_mvadm_ratio_mvadm11_up"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_mutau_ratio_mvadm11_up")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_trg_27_ic_mvadm_ratio_mvadm11_down"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_mutau_ratio_mvadm11_down")->functor(w_->argSet("t_pt,t_mvadm"))); + + fns_["t_trg_27_ic_mvadm_embed_ratio_mvadm0_up"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_mutau_embed_ratio_mvadm0_up")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_trg_27_ic_mvadm_embed_ratio_mvadm0_down"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_mutau_embed_ratio_mvadm0_down")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_trg_27_ic_mvadm_embed_ratio_mvadm1_up"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_mutau_embed_ratio_mvadm1_up")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_trg_27_ic_mvadm_embed_ratio_mvadm1_down"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_mutau_embed_ratio_mvadm1_down")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_trg_27_ic_mvadm_embed_ratio_mvadm2_up"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_mutau_embed_ratio_mvadm2_up")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_trg_27_ic_mvadm_embed_ratio_mvadm2_down"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_mutau_embed_ratio_mvadm2_down")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_trg_27_ic_mvadm_embed_ratio_mvadm10_up"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_mutau_embed_ratio_mvadm10_up")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_trg_27_ic_mvadm_embed_ratio_mvadm10_down"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_mutau_embed_ratio_mvadm10_down")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_trg_27_ic_mvadm_embed_ratio_mvadm11_up"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_mutau_embed_ratio_mvadm11_up")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_trg_27_ic_mvadm_embed_ratio_mvadm11_down"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_mutau_embed_ratio_mvadm11_down")->functor(w_->argSet("t_pt,t_mvadm"))); + + if(mc_ != mc::mcleg2016) { + fns_["t_trg_30_ic_ratio"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_etau_ratio")->functor(w_->argSet("t_pt,t_dm"))); + fns_["t_trg_30_ic_embed_ratio"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_etau_embed_ratio")->functor(w_->argSet("t_pt,t_dm"))); + + fns_["t_trg_30_ic_embed_data"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_etau_embed_data")->functor(w_->argSet("t_pt,t_dm"))); + fns_["t_trg_30_ic_mvadm_ratio"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_etau_ratio")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_trg_30_ic_mvadm_embed_ratio"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_etau_embed_ratio")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_trg_30_ic_mvadm_embed_data"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_etau_embed_data")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_trg_30_ic_mvadm_embed"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_etau_embed")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_trg_30_ic_mvadm_mc"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_etau_mc")->functor(w_->argSet("t_pt,t_mvadm"))); + + fns_["t_trg_30_ic_mvadm_ratio_mvadm0_up"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_etau_ratio_mvadm0_up")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_trg_30_ic_mvadm_ratio_mvadm0_down"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_etau_ratio_mvadm0_down")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_trg_30_ic_mvadm_ratio_mvadm1_up"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_etau_ratio_mvadm1_up")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_trg_30_ic_mvadm_ratio_mvadm1_down"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_etau_ratio_mvadm1_down")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_trg_30_ic_mvadm_ratio_mvadm2_up"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_etau_ratio_mvadm2_up")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_trg_30_ic_mvadm_ratio_mvadm2_down"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_etau_ratio_mvadm2_down")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_trg_30_ic_mvadm_ratio_mvadm10_up"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_etau_ratio_mvadm10_up")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_trg_30_ic_mvadm_ratio_mvadm10_down"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_etau_ratio_mvadm10_down")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_trg_30_ic_mvadm_ratio_mvadm11_up"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_etau_ratio_mvadm11_up")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_trg_30_ic_mvadm_ratio_mvadm11_down"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_etau_ratio_mvadm11_down")->functor(w_->argSet("t_pt,t_mvadm"))); + + fns_["t_trg_30_ic_mvadm_embed_ratio_mvadm0_up"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_etau_embed_ratio_mvadm0_up")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_trg_30_ic_mvadm_embed_ratio_mvadm0_down"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_etau_embed_ratio_mvadm0_down")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_trg_30_ic_mvadm_embed_ratio_mvadm1_up"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_etau_embed_ratio_mvadm1_up")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_trg_30_ic_mvadm_embed_ratio_mvadm1_down"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_etau_embed_ratio_mvadm1_down")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_trg_30_ic_mvadm_embed_ratio_mvadm2_up"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_etau_embed_ratio_mvadm2_up")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_trg_30_ic_mvadm_embed_ratio_mvadm2_down"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_etau_embed_ratio_mvadm2_down")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_trg_30_ic_mvadm_embed_ratio_mvadm10_up"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_etau_embed_ratio_mvadm10_up")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_trg_30_ic_mvadm_embed_ratio_mvadm10_down"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_etau_embed_ratio_mvadm10_down")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_trg_30_ic_mvadm_embed_ratio_mvadm11_up"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_etau_embed_ratio_mvadm11_up")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_trg_30_ic_mvadm_embed_ratio_mvadm11_down"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_etau_embed_ratio_mvadm11_down")->functor(w_->argSet("t_pt,t_mvadm"))); + } + + fns_["t_trg_35_ic_ratio"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_ditau_ratio")->functor(w_->argSet("t_pt,t_dm"))); + fns_["t_trg_35_ic_embed_ratio"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_ditau_embed_ratio")->functor(w_->argSet("t_pt,t_dm"))); + + fns_["t_trg_35_ic_mvadm_ratio"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_ditau_ratio")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_trg_35_ic_mvadm_embed_ratio"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_ditau_embed_ratio")->functor(w_->argSet("t_pt,t_mvadm"))); + + fns_["t_trg_35_ic_mvadm_ratio_mvadm0_up"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_ditau_ratio_mvadm0_up")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_trg_35_ic_mvadm_ratio_mvadm0_down"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_ditau_ratio_mvadm0_down")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_trg_35_ic_mvadm_embed_ratio_mvadm0_up"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_ditau_embed_ratio_mvadm0_up")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_trg_35_ic_mvadm_embed_ratio_mvadm0_down"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_ditau_embed_ratio_mvadm0_down")->functor(w_->argSet("t_pt,t_mvadm"))); + + fns_["t_trg_35_ic_mvadm_ratio_mvadm1_up"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_ditau_ratio_mvadm1_up")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_trg_35_ic_mvadm_ratio_mvadm1_down"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_ditau_ratio_mvadm1_down")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_trg_35_ic_mvadm_embed_ratio_mvadm1_up"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_ditau_embed_ratio_mvadm1_up")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_trg_35_ic_mvadm_embed_ratio_mvadm1_down"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_ditau_embed_ratio_mvadm1_down")->functor(w_->argSet("t_pt,t_mvadm"))); + + fns_["t_trg_35_ic_mvadm_ratio_mvadm2_up"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_ditau_ratio_mvadm2_up")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_trg_35_ic_mvadm_ratio_mvadm2_down"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_ditau_ratio_mvadm2_down")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_trg_35_ic_mvadm_embed_ratio_mvadm2_up"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_ditau_embed_ratio_mvadm2_up")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_trg_35_ic_mvadm_embed_ratio_mvadm2_down"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_ditau_embed_ratio_mvadm2_down")->functor(w_->argSet("t_pt,t_mvadm"))); + + fns_["t_trg_35_ic_mvadm_ratio_mvadm10_up"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_ditau_ratio_mvadm10_up")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_trg_35_ic_mvadm_ratio_mvadm10_down"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_ditau_ratio_mvadm10_down")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_trg_35_ic_mvadm_embed_ratio_mvadm10_up"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_ditau_embed_ratio_mvadm10_up")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_trg_35_ic_mvadm_embed_ratio_mvadm10_down"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_ditau_embed_ratio_mvadm10_down")->functor(w_->argSet("t_pt,t_mvadm"))); + + fns_["t_trg_35_ic_mvadm_ratio_mvadm11_up"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_ditau_ratio_mvadm11_up")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_trg_35_ic_mvadm_ratio_mvadm11_down"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_ditau_ratio_mvadm11_down")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_trg_35_ic_mvadm_embed_ratio_mvadm11_up"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_ditau_embed_ratio_mvadm11_up")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_trg_35_ic_mvadm_embed_ratio_mvadm11_down"] = std::shared_ptr( + w_->function("t_trg_ic_deeptau_medium_mvadm_ditau_embed_ratio_mvadm11_down")->functor(w_->argSet("t_pt,t_mvadm"))); + + // electron id/iso + fns_["e_idiso_embed_ratio"] = std::shared_ptr( + w_->function("e_idiso_binned_ic_embed_ratio")->functor(w_->argSet("e_pt,e_eta,e_iso"))); + fns_["e_idiso_ratio"] = std::shared_ptr( + w_->function("e_idiso_binned_ic_ratio")->functor(w_->argSet("e_pt,e_eta,e_iso"))); + + // muon id/iso + fns_["m_idiso_embed_ratio"] = std::shared_ptr( + w_->function("m_idiso_binned_ic_embed_ratio")->functor(w_->argSet("m_pt,m_eta,m_iso"))); + fns_["m_idiso_ratio"] = std::shared_ptr( + w_->function("m_idiso_binned_ic_ratio")->functor(w_->argSet("m_pt,m_eta,m_iso"))); + fns_["m_id_ratio"] = std::shared_ptr( + w_->function("m_id_ic_ratio")->functor(w_->argSet("m_pt,m_eta"))); + fns_["m_id_embed_ratio"] = std::shared_ptr( + w_->function("m_id_ic_embed_ratio")->functor(w_->argSet("m_pt,m_eta"))); + fns_["m_looseiso_ratio"] = std::shared_ptr( + w_->function("m_looseiso_binned_ic_ratio")->functor(w_->argSet("m_pt,m_eta,m_iso"))); + fns_["m_looseiso_embed_ratio"] = std::shared_ptr( + w_->function("m_looseiso_binned_ic_embed_ratio")->functor(w_->argSet("m_pt,m_eta,m_iso"))); + fns_["m_sel_idEmb_ratio"] = std::shared_ptr( + w_->function("m_sel_id_ic_ratio")->functor(w_->argSet("gt_eta,gt_pt"))); + fns_["m_sel_trg_ratio"] = std::shared_ptr( + w_->function("m_sel_trg_ic_ratio")->functor(w_->argSet("gt1_pt,gt1_eta,gt2_pt,gt2_eta"))); + fns_["m_sel_idEmb_kit_ratio"] = std::shared_ptr( + w_->function("m_sel_idEmb_ratio")->functor(w_->argSet("gt_eta,gt_pt"))); + fns_["m_sel_trg_kit_ratio"] = std::shared_ptr( + w_->function("m_sel_trg_ratio")->functor(w_->argSet("gt1_pt,gt1_eta,gt2_pt,gt2_eta"))); + + // tau id + fns_["t_id_pt_tight"] = std::shared_ptr( + w_->function("t_id_pt_tight")->functor(w_->argSet("t_pt"))); + fns_["t_id_dm_tight"] = std::shared_ptr( + w_->function("t_id_dm_tight")->functor(w_->argSet("t_dm"))); + fns_["t_id_dm_vloose"] = std::shared_ptr( + w_->function("t_id_dm_vloose")->functor(w_->argSet("t_dm"))); + fns_["t_deeptauid_pt_medium"] = std::shared_ptr( + w_->function("t_deeptauid_pt_medium")->functor(w_->argSet("t_pt"))); + + // high pT tau ID efficiency for MSSM analysis + fns_["t_deeptauid_highpt"] = std::shared_ptr( + w_->function("t_deeptauid_highpt")->functor(w_->argSet("t_pt"))); + fns_["t_deeptauid_highpt_bin5_up"] = std::shared_ptr( + w_->function("t_deeptauid_highpt_bin5_up")->functor(w_->argSet("t_pt"))); + fns_["t_deeptauid_highpt_bin5_down"] = std::shared_ptr( + w_->function("t_deeptauid_highpt_bin5_down")->functor(w_->argSet("t_pt"))); + fns_["t_deeptauid_highpt_bin6_up"] = std::shared_ptr( + w_->function("t_deeptauid_highpt_bin6_up")->functor(w_->argSet("t_pt"))); + fns_["t_deeptauid_highpt_bin6_down"] = std::shared_ptr( + w_->function("t_deeptauid_highpt_bin6_down")->functor(w_->argSet("t_pt"))); + + fns_["t_deeptauid_highpt_embed"] = std::shared_ptr( + w_->function("t_deeptauid_highpt_embed")->functor(w_->argSet("t_pt"))); + fns_["t_deeptauid_highpt_embed_bin5_up"] = std::shared_ptr( + w_->function("t_deeptauid_highpt_embed_bin5_up")->functor(w_->argSet("t_pt"))); + fns_["t_deeptauid_highpt_embed_bin5_down"] = std::shared_ptr( + w_->function("t_deeptauid_highpt_embed_bin5_down")->functor(w_->argSet("t_pt"))); + fns_["t_deeptauid_highpt_embed_bin6_up"] = std::shared_ptr( + w_->function("t_deeptauid_highpt_embed_bin6_up")->functor(w_->argSet("t_pt"))); + fns_["t_deeptauid_highpt_embed_bin6_down"] = std::shared_ptr( + w_->function("t_deeptauid_highpt_embed_bin6_down")->functor(w_->argSet("t_pt"))); + fns_["t_deeptauid_highpt_tightvse_embed"] = std::shared_ptr( + w_->function("t_deeptauid_highpt_tightvse_embed")->functor(w_->argSet("t_pt"))); + fns_["t_deeptauid_highpt_tightvse_embed_bin5_up"] = std::shared_ptr( + w_->function("t_deeptauid_highpt_tightvse_embed_bin5_up")->functor(w_->argSet("t_pt"))); + fns_["t_deeptauid_highpt_tightvse_embed_bin5_down"] = std::shared_ptr( + w_->function("t_deeptauid_highpt_tightvse_embed_bin5_down")->functor(w_->argSet("t_pt"))); + fns_["t_deeptauid_highpt_tightvse_embed_bin6_up"] = std::shared_ptr( + w_->function("t_deeptauid_highpt_tightvse_embed_bin6_up")->functor(w_->argSet("t_pt"))); + fns_["t_deeptauid_highpt_tightvse_embed_bin6_down"] = std::shared_ptr( + w_->function("t_deeptauid_highpt_tightvse_embed_bin6_down")->functor(w_->argSet("t_pt"))); + + fns_["t_deeptauid_pt_vvvloose"] = std::shared_ptr( + w_->function("t_deeptauid_pt_vvvloose")->functor(w_->argSet("t_pt"))); + fns_["t_deeptauid_dm_medium"] = std::shared_ptr( + w_->function("t_deeptauid_dm_medium")->functor(w_->argSet("t_dm"))); + fns_["t_deeptauid_dm_vvvloose"] = std::shared_ptr( + w_->function("t_deeptauid_dm_vvvloose")->functor(w_->argSet("t_dm"))); + + fns_["t_deeptauid_pt_medium_bin1_up"] = std::shared_ptr( + w_->function("t_deeptauid_pt_medium_bin1_up")->functor(w_->argSet("t_pt"))); + fns_["t_deeptauid_pt_medium_bin2_up"] = std::shared_ptr( + w_->function("t_deeptauid_pt_medium_bin2_up")->functor(w_->argSet("t_pt"))); + fns_["t_deeptauid_pt_medium_bin3_up"] = std::shared_ptr( + w_->function("t_deeptauid_pt_medium_bin3_up")->functor(w_->argSet("t_pt"))); + fns_["t_deeptauid_pt_medium_bin4_up"] = std::shared_ptr( + w_->function("t_deeptauid_pt_medium_bin4_up")->functor(w_->argSet("t_pt"))); + fns_["t_deeptauid_pt_medium_bin5_up"] = std::shared_ptr( + w_->function("t_deeptauid_pt_medium_bin5_up")->functor(w_->argSet("t_pt"))); + + fns_["t_deeptauid_pt_medium_bin1_down"] = std::shared_ptr( + w_->function("t_deeptauid_pt_medium_bin1_down")->functor(w_->argSet("t_pt"))); + fns_["t_deeptauid_pt_medium_bin2_down"] = std::shared_ptr( + w_->function("t_deeptauid_pt_medium_bin2_down")->functor(w_->argSet("t_pt"))); + fns_["t_deeptauid_pt_medium_bin3_down"] = std::shared_ptr( + w_->function("t_deeptauid_pt_medium_bin3_down")->functor(w_->argSet("t_pt"))); + fns_["t_deeptauid_pt_medium_bin4_down"] = std::shared_ptr( + w_->function("t_deeptauid_pt_medium_bin4_down")->functor(w_->argSet("t_pt"))); + fns_["t_deeptauid_pt_medium_bin5_down"] = std::shared_ptr( + w_->function("t_deeptauid_pt_medium_bin5_down")->functor(w_->argSet("t_pt"))); + + fns_["t_deeptauid_dm_medium_dm0_up"] = std::shared_ptr( + w_->function("t_deeptauid_dm_medium_dm0_up")->functor(w_->argSet("t_dm"))); + fns_["t_deeptauid_dm_medium_dm1_up"] = std::shared_ptr( + w_->function("t_deeptauid_dm_medium_dm1_up")->functor(w_->argSet("t_dm"))); + fns_["t_deeptauid_dm_medium_dm10_up"] = std::shared_ptr( + w_->function("t_deeptauid_dm_medium_dm10_up")->functor(w_->argSet("t_dm"))); + fns_["t_deeptauid_dm_medium_dm11_up"] = std::shared_ptr( + w_->function("t_deeptauid_dm_medium_dm11_up")->functor(w_->argSet("t_dm"))); + + fns_["t_deeptauid_dm_medium_dm0_down"] = std::shared_ptr( + w_->function("t_deeptauid_dm_medium_dm0_down")->functor(w_->argSet("t_dm"))); + fns_["t_deeptauid_dm_medium_dm1_down"] = std::shared_ptr( + w_->function("t_deeptauid_dm_medium_dm1_down")->functor(w_->argSet("t_dm"))); + fns_["t_deeptauid_dm_medium_dm10_down"] = std::shared_ptr( + w_->function("t_deeptauid_dm_medium_dm10_down")->functor(w_->argSet("t_dm"))); + fns_["t_deeptauid_dm_medium_dm11_down"] = std::shared_ptr( + w_->function("t_deeptauid_dm_medium_dm11_down")->functor(w_->argSet("t_dm"))); + + fns_["t_deeptauid_pt_embed_medium"] = std::shared_ptr( + w_->function("t_deeptauid_pt_embed_medium")->functor(w_->argSet("t_pt"))); + fns_["t_deeptauid_pt_tightvse_embed_medium"] = std::shared_ptr( + w_->function("t_deeptauid_pt_tightvse_embed_medium")->functor(w_->argSet("t_pt"))); + fns_["t_deeptauid_pt_embed_vvvloose"] = std::shared_ptr( + w_->function("t_deeptauid_pt_embed_vvvloose")->functor(w_->argSet("t_pt"))); + fns_["t_deeptauid_dm_embed_medium"] = std::shared_ptr( + w_->function("t_deeptauid_dm_embed_medium")->functor(w_->argSet("t_dm"))); + fns_["t_deeptauid_dm_embed_vvvloose"] = std::shared_ptr( + w_->function("t_deeptauid_dm_embed_vvvloose")->functor(w_->argSet("t_dm"))); + + fns_["t_deeptauid_pt_tightvse_embed_medium_bin1_up"] = std::shared_ptr( + w_->function("t_deeptauid_pt_tightvse_embed_medium_bin1_up")->functor(w_->argSet("t_pt"))); + fns_["t_deeptauid_pt_tightvse_embed_medium_bin2_up"] = std::shared_ptr( + w_->function("t_deeptauid_pt_tightvse_embed_medium_bin2_up")->functor(w_->argSet("t_pt"))); + fns_["t_deeptauid_pt_tightvse_embed_medium_bin3_up"] = std::shared_ptr( + w_->function("t_deeptauid_pt_tightvse_embed_medium_bin3_up")->functor(w_->argSet("t_pt"))); + fns_["t_deeptauid_pt_tightvse_embed_medium_bin4_up"] = std::shared_ptr( + w_->function("t_deeptauid_pt_tightvse_embed_medium_bin4_up")->functor(w_->argSet("t_pt"))); + fns_["t_deeptauid_pt_tightvse_embed_medium_bin5_up"] = std::shared_ptr( + w_->function("t_deeptauid_pt_tightvse_embed_medium_bin5_up")->functor(w_->argSet("t_pt"))); + + fns_["t_deeptauid_pt_tightvse_embed_medium_bin1_down"] = std::shared_ptr( + w_->function("t_deeptauid_pt_tightvse_embed_medium_bin1_down")->functor(w_->argSet("t_pt"))); + fns_["t_deeptauid_pt_tightvse_embed_medium_bin2_down"] = std::shared_ptr( + w_->function("t_deeptauid_pt_tightvse_embed_medium_bin2_down")->functor(w_->argSet("t_pt"))); + fns_["t_deeptauid_pt_tightvse_embed_medium_bin3_down"] = std::shared_ptr( + w_->function("t_deeptauid_pt_tightvse_embed_medium_bin3_down")->functor(w_->argSet("t_pt"))); + fns_["t_deeptauid_pt_tightvse_embed_medium_bin4_down"] = std::shared_ptr( + w_->function("t_deeptauid_pt_tightvse_embed_medium_bin4_down")->functor(w_->argSet("t_pt"))); + fns_["t_deeptauid_pt_tightvse_embed_medium_bin5_down"] = std::shared_ptr( + w_->function("t_deeptauid_pt_tightvse_embed_medium_bin5_down")->functor(w_->argSet("t_pt"))); + + + fns_["t_deeptauid_pt_embed_medium_bin1_up"] = std::shared_ptr( + w_->function("t_deeptauid_pt_embed_medium_bin1_up")->functor(w_->argSet("t_pt"))); + fns_["t_deeptauid_pt_embed_medium_bin2_up"] = std::shared_ptr( + w_->function("t_deeptauid_pt_embed_medium_bin2_up")->functor(w_->argSet("t_pt"))); + fns_["t_deeptauid_pt_embed_medium_bin3_up"] = std::shared_ptr( + w_->function("t_deeptauid_pt_embed_medium_bin3_up")->functor(w_->argSet("t_pt"))); + fns_["t_deeptauid_pt_embed_medium_bin4_up"] = std::shared_ptr( + w_->function("t_deeptauid_pt_embed_medium_bin4_up")->functor(w_->argSet("t_pt"))); + fns_["t_deeptauid_pt_embed_medium_bin5_up"] = std::shared_ptr( + w_->function("t_deeptauid_pt_embed_medium_bin5_up")->functor(w_->argSet("t_pt"))); + + fns_["t_deeptauid_pt_embed_medium_bin1_down"] = std::shared_ptr( + w_->function("t_deeptauid_pt_embed_medium_bin1_down")->functor(w_->argSet("t_pt"))); + fns_["t_deeptauid_pt_embed_medium_bin2_down"] = std::shared_ptr( + w_->function("t_deeptauid_pt_embed_medium_bin2_down")->functor(w_->argSet("t_pt"))); + fns_["t_deeptauid_pt_embed_medium_bin3_down"] = std::shared_ptr( + w_->function("t_deeptauid_pt_embed_medium_bin3_down")->functor(w_->argSet("t_pt"))); + fns_["t_deeptauid_pt_embed_medium_bin4_down"] = std::shared_ptr( + w_->function("t_deeptauid_pt_embed_medium_bin4_down")->functor(w_->argSet("t_pt"))); + fns_["t_deeptauid_pt_embed_medium_bin5_down"] = std::shared_ptr( + w_->function("t_deeptauid_pt_embed_medium_bin5_down")->functor(w_->argSet("t_pt"))); + + fns_["t_deeptauid_dm_embed_medium_dm0_up"] = std::shared_ptr( + w_->function("t_deeptauid_dm_embed_medium_dm0_up")->functor(w_->argSet("t_dm"))); + fns_["t_deeptauid_dm_embed_medium_dm1_up"] = std::shared_ptr( + w_->function("t_deeptauid_dm_embed_medium_dm1_up")->functor(w_->argSet("t_dm"))); + fns_["t_deeptauid_dm_embed_medium_dm10_up"] = std::shared_ptr( + w_->function("t_deeptauid_dm_embed_medium_dm10_up")->functor(w_->argSet("t_dm"))); + fns_["t_deeptauid_dm_embed_medium_dm11_up"] = std::shared_ptr( + w_->function("t_deeptauid_dm_embed_medium_dm11_up")->functor(w_->argSet("t_dm"))); + + fns_["t_deeptauid_dm_embed_medium_dm0_down"] = std::shared_ptr( + w_->function("t_deeptauid_dm_embed_medium_dm0_down")->functor(w_->argSet("t_dm"))); + fns_["t_deeptauid_dm_embed_medium_dm1_down"] = std::shared_ptr( + w_->function("t_deeptauid_dm_embed_medium_dm1_down")->functor(w_->argSet("t_dm"))); + fns_["t_deeptauid_dm_embed_medium_dm10_down"] = std::shared_ptr( + w_->function("t_deeptauid_dm_embed_medium_dm10_down")->functor(w_->argSet("t_dm"))); + fns_["t_deeptauid_dm_embed_medium_dm11_down"] = std::shared_ptr( + w_->function("t_deeptauid_dm_embed_medium_dm11_down")->functor(w_->argSet("t_dm"))); + + // tau id in mva-dm bins + fns_["t_deeptauid_mvadm_medium"] = std::shared_ptr( + w_->function("t_deeptauid_mvadm_medium")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_deeptauid_mvadm_embed_medium"] = std::shared_ptr( + w_->function("t_deeptauid_mvadm_embed_medium")->functor(w_->argSet("t_pt,t_mvadm"))); + + fns_["t_deeptauid_mvadm_medium_tightvsele"] = std::shared_ptr( + w_->function("t_deeptauid_mvadm_medium_tightvsele")->functor(w_->argSet("t_pt,t_mvadm"))); + + fns_["t_deeptauid_mvadm_embed_medium_tightvsele"] = std::shared_ptr( + w_->function("t_deeptauid_mvadm_embed_medium_tightvsele")->functor(w_->argSet("t_pt,t_mvadm"))); + + fns_["t_deeptauid_mvadm_medium_lowpt_mvadm0_up"] = std::shared_ptr( + w_->function("t_deeptauid_mvadm_medium_lowpt_mvadm0_up")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_deeptauid_mvadm_medium_lowpt_mvadm1_up"] = std::shared_ptr( + w_->function("t_deeptauid_mvadm_medium_lowpt_mvadm1_up")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_deeptauid_mvadm_medium_lowpt_mvadm2_up"] = std::shared_ptr( + w_->function("t_deeptauid_mvadm_medium_lowpt_mvadm2_up")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_deeptauid_mvadm_medium_lowpt_mvadm10_up"] = std::shared_ptr( + w_->function("t_deeptauid_mvadm_medium_lowpt_mvadm10_up")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_deeptauid_mvadm_medium_lowpt_mvadm11_up"] = std::shared_ptr( + w_->function("t_deeptauid_mvadm_medium_lowpt_mvadm11_up")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_deeptauid_mvadm_medium_highpt_mvadm0_up"] = std::shared_ptr( + w_->function("t_deeptauid_mvadm_medium_highpt_mvadm0_up")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_deeptauid_mvadm_medium_highpt_mvadm1_up"] = std::shared_ptr( + w_->function("t_deeptauid_mvadm_medium_highpt_mvadm1_up")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_deeptauid_mvadm_medium_highpt_mvadm2_up"] = std::shared_ptr( + w_->function("t_deeptauid_mvadm_medium_highpt_mvadm2_up")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_deeptauid_mvadm_medium_highpt_mvadm10_up"] = std::shared_ptr( + w_->function("t_deeptauid_mvadm_medium_highpt_mvadm10_up")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_deeptauid_mvadm_medium_highpt_mvadm11_up"] = std::shared_ptr( + w_->function("t_deeptauid_mvadm_medium_highpt_mvadm11_up")->functor(w_->argSet("t_pt,t_mvadm"))); + + fns_["t_deeptauid_mvadm_medium_lowpt_mvadm0_down"] = std::shared_ptr( + w_->function("t_deeptauid_mvadm_medium_lowpt_mvadm0_down")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_deeptauid_mvadm_medium_lowpt_mvadm1_down"] = std::shared_ptr( + w_->function("t_deeptauid_mvadm_medium_lowpt_mvadm1_down")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_deeptauid_mvadm_medium_lowpt_mvadm2_down"] = std::shared_ptr( + w_->function("t_deeptauid_mvadm_medium_lowpt_mvadm2_down")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_deeptauid_mvadm_medium_lowpt_mvadm10_down"] = std::shared_ptr( + w_->function("t_deeptauid_mvadm_medium_lowpt_mvadm10_down")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_deeptauid_mvadm_medium_lowpt_mvadm11_down"] = std::shared_ptr( + w_->function("t_deeptauid_mvadm_medium_lowpt_mvadm11_down")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_deeptauid_mvadm_medium_highpt_mvadm0_down"] = std::shared_ptr( + w_->function("t_deeptauid_mvadm_medium_highpt_mvadm0_down")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_deeptauid_mvadm_medium_highpt_mvadm1_down"] = std::shared_ptr( + w_->function("t_deeptauid_mvadm_medium_highpt_mvadm1_down")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_deeptauid_mvadm_medium_highpt_mvadm2_down"] = std::shared_ptr( + w_->function("t_deeptauid_mvadm_medium_highpt_mvadm2_down")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_deeptauid_mvadm_medium_highpt_mvadm10_down"] = std::shared_ptr( + w_->function("t_deeptauid_mvadm_medium_highpt_mvadm10_down")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_deeptauid_mvadm_medium_highpt_mvadm11_down"] = std::shared_ptr( + w_->function("t_deeptauid_mvadm_medium_highpt_mvadm11_down")->functor(w_->argSet("t_pt,t_mvadm"))); + + fns_["t_deeptauid_mvadm_embed_medium_lowpt_mvadm0_up"] = std::shared_ptr( + w_->function("t_deeptauid_mvadm_embed_medium_lowpt_mvadm0_up")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_deeptauid_mvadm_embed_medium_lowpt_mvadm1_up"] = std::shared_ptr( + w_->function("t_deeptauid_mvadm_embed_medium_lowpt_mvadm1_up")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_deeptauid_mvadm_embed_medium_lowpt_mvadm2_up"] = std::shared_ptr( + w_->function("t_deeptauid_mvadm_embed_medium_lowpt_mvadm2_up")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_deeptauid_mvadm_embed_medium_lowpt_mvadm10_up"] = std::shared_ptr( + w_->function("t_deeptauid_mvadm_embed_medium_lowpt_mvadm10_up")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_deeptauid_mvadm_embed_medium_lowpt_mvadm11_up"] = std::shared_ptr( + w_->function("t_deeptauid_mvadm_embed_medium_lowpt_mvadm11_up")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_deeptauid_mvadm_embed_medium_highpt_mvadm0_up"] = std::shared_ptr( + w_->function("t_deeptauid_mvadm_embed_medium_highpt_mvadm0_up")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_deeptauid_mvadm_embed_medium_highpt_mvadm1_up"] = std::shared_ptr( + w_->function("t_deeptauid_mvadm_embed_medium_highpt_mvadm1_up")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_deeptauid_mvadm_embed_medium_highpt_mvadm2_up"] = std::shared_ptr( + w_->function("t_deeptauid_mvadm_embed_medium_highpt_mvadm2_up")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_deeptauid_mvadm_embed_medium_highpt_mvadm10_up"] = std::shared_ptr( + w_->function("t_deeptauid_mvadm_embed_medium_highpt_mvadm10_up")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_deeptauid_mvadm_embed_medium_highpt_mvadm11_up"] = std::shared_ptr( + w_->function("t_deeptauid_mvadm_embed_medium_highpt_mvadm11_up")->functor(w_->argSet("t_pt,t_mvadm"))); + + fns_["t_deeptauid_mvadm_embed_medium_lowpt_mvadm0_down"] = std::shared_ptr( + w_->function("t_deeptauid_mvadm_embed_medium_lowpt_mvadm0_down")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_deeptauid_mvadm_embed_medium_lowpt_mvadm1_down"] = std::shared_ptr( + w_->function("t_deeptauid_mvadm_embed_medium_lowpt_mvadm1_down")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_deeptauid_mvadm_embed_medium_lowpt_mvadm2_down"] = std::shared_ptr( + w_->function("t_deeptauid_mvadm_embed_medium_lowpt_mvadm2_down")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_deeptauid_mvadm_embed_medium_lowpt_mvadm10_down"] = std::shared_ptr( + w_->function("t_deeptauid_mvadm_embed_medium_lowpt_mvadm10_down")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_deeptauid_mvadm_embed_medium_lowpt_mvadm11_down"] = std::shared_ptr( + w_->function("t_deeptauid_mvadm_embed_medium_lowpt_mvadm11_down")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_deeptauid_mvadm_embed_medium_highpt_mvadm0_down"] = std::shared_ptr( + w_->function("t_deeptauid_mvadm_embed_medium_highpt_mvadm0_down")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_deeptauid_mvadm_embed_medium_highpt_mvadm1_down"] = std::shared_ptr( + w_->function("t_deeptauid_mvadm_embed_medium_highpt_mvadm1_down")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_deeptauid_mvadm_embed_medium_highpt_mvadm2_down"] = std::shared_ptr( + w_->function("t_deeptauid_mvadm_embed_medium_highpt_mvadm2_down")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_deeptauid_mvadm_embed_medium_highpt_mvadm10_down"] = std::shared_ptr( + w_->function("t_deeptauid_mvadm_embed_medium_highpt_mvadm10_down")->functor(w_->argSet("t_pt,t_mvadm"))); + fns_["t_deeptauid_mvadm_embed_medium_highpt_mvadm11_down"] = std::shared_ptr( + w_->function("t_deeptauid_mvadm_embed_medium_highpt_mvadm11_down")->functor(w_->argSet("t_pt,t_mvadm"))); + + fns_["t_id_vs_e_eta_vvloose"] = std::shared_ptr( + w_->function("t_id_vs_e_eta_vvloose")->functor(w_->argSet("t_eta"))); + fns_["t_id_vs_e_eta_vvloose_up"] = std::shared_ptr( + w_->function("t_id_vs_e_eta_vvloose_up")->functor(w_->argSet("t_eta"))); + fns_["t_id_vs_e_eta_vvloose_down"] = std::shared_ptr( + w_->function("t_id_vs_e_eta_vvloose_down")->functor(w_->argSet("t_eta"))); + fns_["t_id_vs_e_eta_tight"] = std::shared_ptr( + w_->function("t_id_vs_e_eta_tight")->functor(w_->argSet("t_eta"))); + fns_["t_id_vs_e_eta_tight_up"] = std::shared_ptr( + w_->function("t_id_vs_e_eta_tight_up")->functor(w_->argSet("t_eta"))); + fns_["t_id_vs_e_eta_tight_down"] = std::shared_ptr( + w_->function("t_id_vs_e_eta_tight_down")->functor(w_->argSet("t_eta"))); + + fns_["t_id_vs_mu_eta_vloose"] = std::shared_ptr( + w_->function("t_id_vs_mu_eta_vloose")->functor(w_->argSet("t_eta"))); + fns_["t_id_vs_mu_eta_vloose_up"] = std::shared_ptr( + w_->function("t_id_vs_mu_eta_vloose_up")->functor(w_->argSet("t_eta"))); + fns_["t_id_vs_mu_eta_vloose_down"] = std::shared_ptr( + w_->function("t_id_vs_mu_eta_vloose_down")->functor(w_->argSet("t_eta"))); + fns_["t_id_vs_mu_eta_tight"] = std::shared_ptr( + w_->function("t_id_vs_mu_eta_tight")->functor(w_->argSet("t_eta"))); + fns_["t_id_vs_mu_eta_tight_up"] = std::shared_ptr( + w_->function("t_id_vs_mu_eta_tight_up")->functor(w_->argSet("t_eta"))); + fns_["t_id_vs_mu_eta_tight_down"] = std::shared_ptr( + w_->function("t_id_vs_mu_eta_tight_down")->functor(w_->argSet("t_eta"))); + + // zpt reweighting + fns_["zpt_weight_nom"] = std::shared_ptr( + w_->function("zptmass_weight_nom")->functor(w_->argSet("z_gen_pt,z_gen_mass"))); + + // em osss same names for all years + fns_["em_qcd_osss"] = std::shared_ptr( + w_->function("em_qcd_osss")->functor(w_->argSet("dR,njets,e_pt,m_pt"))); + fns_["em_qcd_osss_extrap_up"] = std::shared_ptr( + w_->function("em_qcd_osss_extrap_up")->functor(w_->argSet("dR,njets,e_pt,m_pt"))); + fns_["em_qcd_osss_extrap_down"] = std::shared_ptr( + w_->function("em_qcd_osss_extrap_down")->functor(w_->argSet("dR,njets,e_pt,m_pt"))); + + fns_["em_qcd_osss_stat_0jet_unc1_up"] = std::shared_ptr( + w_->function("em_qcd_osss_stat_0jet_unc1_up")->functor(w_->argSet("dR,njets,e_pt,m_pt"))); + fns_["em_qcd_osss_stat_0jet_unc1_down"] = std::shared_ptr( + w_->function("em_qcd_osss_stat_0jet_unc1_down")->functor(w_->argSet("dR,njets,e_pt,m_pt"))); + fns_["em_qcd_osss_stat_0jet_unc2_up"] = std::shared_ptr( + w_->function("em_qcd_osss_stat_0jet_unc2_up")->functor(w_->argSet("dR,njets,e_pt,m_pt"))); + fns_["em_qcd_osss_stat_0jet_unc2_down"] = std::shared_ptr( + w_->function("em_qcd_osss_stat_0jet_unc2_down")->functor(w_->argSet("dR,njets,e_pt,m_pt"))); + + fns_["em_qcd_osss_stat_1jet_unc1_up"] = std::shared_ptr( + w_->function("em_qcd_osss_stat_1jet_unc1_up")->functor(w_->argSet("dR,njets,e_pt,m_pt"))); + fns_["em_qcd_osss_stat_1jet_unc1_down"] = std::shared_ptr( + w_->function("em_qcd_osss_stat_1jet_unc1_down")->functor(w_->argSet("dR,njets,e_pt,m_pt"))); + fns_["em_qcd_osss_stat_1jet_unc2_up"] = std::shared_ptr( + w_->function("em_qcd_osss_stat_1jet_unc2_up")->functor(w_->argSet("dR,njets,e_pt,m_pt"))); + fns_["em_qcd_osss_stat_1jet_unc2_down"] = std::shared_ptr( + w_->function("em_qcd_osss_stat_1jet_unc2_down")->functor(w_->argSet("dR,njets,e_pt,m_pt"))); + + fns_["em_qcd_osss_stat_2jet_unc1_up"] = std::shared_ptr( + w_->function("em_qcd_osss_stat_2jet_unc1_up")->functor(w_->argSet("dR,njets,e_pt,m_pt"))); + fns_["em_qcd_osss_stat_2jet_unc1_down"] = std::shared_ptr( + w_->function("em_qcd_osss_stat_2jet_unc1_down")->functor(w_->argSet("dR,njets,e_pt,m_pt"))); + fns_["em_qcd_osss_stat_2jet_unc2_up"] = std::shared_ptr( + w_->function("em_qcd_osss_stat_2jet_unc2_up")->functor(w_->argSet("dR,njets,e_pt,m_pt"))); + fns_["em_qcd_osss_stat_2jet_unc2_down"] = std::shared_ptr( + w_->function("em_qcd_osss_stat_2jet_unc2_down")->functor(w_->argSet("dR,njets,e_pt,m_pt"))); + + // MG ggH specific weights + if(do_quarkmass_higgspt_){ + fns_["ggH_quarkmass_corr"] = std::shared_ptr( + w_ggh_->function("ggH_quarkmass_corr")->functor(w_ggh_->argSet("HpT"))); + fns_["ggH_quarkmass_corr_up"] = std::shared_ptr( + w_ggh_->function("ggH_quarkmass_corr_up")->functor(w_ggh_->argSet("HpT"))); + fns_["ggH_quarkmass_corr_down"] = std::shared_ptr( + w_ggh_->function("ggH_quarkmass_corr_down")->functor(w_ggh_->argSet("HpT"))); + fns_["ggH_fullquarkmass_corr"] = std::shared_ptr( + w_ggh_->function("ggH_fullquarkmass_corr")->functor(w_ggh_->argSet("HpT"))); + } + if(do_ps_weights_){ + fns_["ggH_mg_ue_up"] = std::shared_ptr( + w_ggh_->function("ggH_mg_ue_up")->functor(w_ggh_->argSet("ngenjets"))); + fns_["ggH_mg_ue_down"] = std::shared_ptr( + w_ggh_->function("ggH_mg_ue_down")->functor(w_ggh_->argSet("ngenjets"))); + } + } - systs = {"","_singletau_up","_singletau_down","_lowpt_dm0_up","_lowpt_dm0_down","_lowpt_dm1_up","_lowpt_dm1_down","_lowpt_dm10_up","_lowpt_dm10_down","_lowpt_dm11_up","_lowpt_dm11_down", - "_highpt_dm0_up", "_highpt_dm0_down","_highpt_dm1_up","_highpt_dm1_down","_highpt_dm10_up","_highpt_dm10_down","_highpt_dm11_up","_highpt_dm11_down" - }; - for (auto s : systs){ - fns_["t_trg_2d_ratio"+s] = std::shared_ptr( - w_->function(("t_trg_2d_ratio"+s).c_str())->functor(w_->argSet("t_pt,t_dm,t_pt_2,t_dm_2"))); - fns_["t_trg_2d_embed_ratio"+s] = std::shared_ptr( - w_->function(("t_trg_2d_embed_ratio"+s).c_str())->functor(w_->argSet("t_pt,t_dm,t_pt_2,t_dm_2"))); - } + if(era_ == era::data_2022_preEE || era_ == era::data_2022_postEE){ + // specify all Run-3 SF here + fns_["m_trg_ratio"] = std::shared_ptr( + w_->function("m_trg_ic_ratio")->functor(w_->argSet("m_pt,m_eta"))); + fns_["m_iso_ratio"] = std::shared_ptr( + w_->function("m_iso_ic_ratio")->functor(w_->argSet("m_pt,m_eta"))); + fns_["m_id_ratio"] = std::shared_ptr( + w_->function("m_id_ic_ratio")->functor(w_->argSet("m_pt,m_eta"))); - fns_["t_trg_2d_doubleonly_ratio"] = std::shared_ptr( - w_->function("t_trg_2d_doubleonly_ratio")->functor(w_->argSet("t_pt,t_dm,t_pt_2,t_dm_2"))); - fns_["t_trg_2d_doubleonly_embed_ratio"] = std::shared_ptr( - w_->function("t_trg_2d_doubleonly_embed_ratio")->functor(w_->argSet("t_pt,t_dm,t_pt_2,t_dm_2"))); - - fns_["t_trg_single_data"] = std::shared_ptr( - w_->function("t_trg_single_data")->functor(w_->argSet("t_pt"))); - fns_["t_trg_single_data_up"] = std::shared_ptr( - w_->function("t_trg_single_data_up")->functor(w_->argSet("t_pt"))); - fns_["t_trg_single_data_down"] = std::shared_ptr( - w_->function("t_trg_single_data_down")->functor(w_->argSet("t_pt"))); - fns_["t_trg_single_mc"] = std::shared_ptr( - w_->function("t_trg_single_mc")->functor(w_->argSet("t_pt"))); - fns_["t_trg_single_embed"] = std::shared_ptr( - w_->function("t_trg_single_embed")->functor(w_->argSet("t_pt"))); - //////// - - // Mohammads trigger SFs - //t_trg_ic_deeptau_medium_mvadm_ditau_ratio_mvadm1_down - - fns_["t_trg_27_ic_ratio"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mutau_ratio")->functor(w_->argSet("t_pt,t_dm"))); - fns_["t_trg_27_ic_embed_ratio"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mutau_embed_ratio")->functor(w_->argSet("t_pt,t_dm"))); - - fns_["t_trg_27_ic_mvadm_ratio"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_mutau_ratio")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_trg_27_ic_mvadm_embed_ratio"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_mutau_embed_ratio")->functor(w_->argSet("t_pt,t_mvadm"))); - - fns_["t_trg_27_ic_mvadm_ratio_mvadm0_up"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_mutau_ratio_mvadm0_up")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_trg_27_ic_mvadm_ratio_mvadm0_down"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_mutau_ratio_mvadm0_down")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_trg_27_ic_mvadm_ratio_mvadm1_up"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_mutau_ratio_mvadm1_up")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_trg_27_ic_mvadm_ratio_mvadm1_down"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_mutau_ratio_mvadm1_down")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_trg_27_ic_mvadm_ratio_mvadm2_up"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_mutau_ratio_mvadm2_up")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_trg_27_ic_mvadm_ratio_mvadm2_down"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_mutau_ratio_mvadm2_down")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_trg_27_ic_mvadm_ratio_mvadm10_up"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_mutau_ratio_mvadm10_up")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_trg_27_ic_mvadm_ratio_mvadm10_down"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_mutau_ratio_mvadm10_down")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_trg_27_ic_mvadm_ratio_mvadm11_up"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_mutau_ratio_mvadm11_up")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_trg_27_ic_mvadm_ratio_mvadm11_down"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_mutau_ratio_mvadm11_down")->functor(w_->argSet("t_pt,t_mvadm"))); - - fns_["t_trg_27_ic_mvadm_embed_ratio_mvadm0_up"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_mutau_embed_ratio_mvadm0_up")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_trg_27_ic_mvadm_embed_ratio_mvadm0_down"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_mutau_embed_ratio_mvadm0_down")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_trg_27_ic_mvadm_embed_ratio_mvadm1_up"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_mutau_embed_ratio_mvadm1_up")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_trg_27_ic_mvadm_embed_ratio_mvadm1_down"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_mutau_embed_ratio_mvadm1_down")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_trg_27_ic_mvadm_embed_ratio_mvadm2_up"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_mutau_embed_ratio_mvadm2_up")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_trg_27_ic_mvadm_embed_ratio_mvadm2_down"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_mutau_embed_ratio_mvadm2_down")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_trg_27_ic_mvadm_embed_ratio_mvadm10_up"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_mutau_embed_ratio_mvadm10_up")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_trg_27_ic_mvadm_embed_ratio_mvadm10_down"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_mutau_embed_ratio_mvadm10_down")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_trg_27_ic_mvadm_embed_ratio_mvadm11_up"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_mutau_embed_ratio_mvadm11_up")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_trg_27_ic_mvadm_embed_ratio_mvadm11_down"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_mutau_embed_ratio_mvadm11_down")->functor(w_->argSet("t_pt,t_mvadm"))); - - if(mc_ != mc::mcleg2016) { - fns_["t_trg_30_ic_ratio"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_etau_ratio")->functor(w_->argSet("t_pt,t_dm"))); - fns_["t_trg_30_ic_embed_ratio"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_etau_embed_ratio")->functor(w_->argSet("t_pt,t_dm"))); - - fns_["t_trg_30_ic_embed_data"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_etau_embed_data")->functor(w_->argSet("t_pt,t_dm"))); - fns_["t_trg_30_ic_mvadm_ratio"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_etau_ratio")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_trg_30_ic_mvadm_embed_ratio"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_etau_embed_ratio")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_trg_30_ic_mvadm_embed_data"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_etau_embed_data")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_trg_30_ic_mvadm_embed"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_etau_embed")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_trg_30_ic_mvadm_mc"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_etau_mc")->functor(w_->argSet("t_pt,t_mvadm"))); - - fns_["t_trg_30_ic_mvadm_ratio_mvadm0_up"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_etau_ratio_mvadm0_up")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_trg_30_ic_mvadm_ratio_mvadm0_down"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_etau_ratio_mvadm0_down")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_trg_30_ic_mvadm_ratio_mvadm1_up"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_etau_ratio_mvadm1_up")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_trg_30_ic_mvadm_ratio_mvadm1_down"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_etau_ratio_mvadm1_down")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_trg_30_ic_mvadm_ratio_mvadm2_up"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_etau_ratio_mvadm2_up")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_trg_30_ic_mvadm_ratio_mvadm2_down"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_etau_ratio_mvadm2_down")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_trg_30_ic_mvadm_ratio_mvadm10_up"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_etau_ratio_mvadm10_up")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_trg_30_ic_mvadm_ratio_mvadm10_down"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_etau_ratio_mvadm10_down")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_trg_30_ic_mvadm_ratio_mvadm11_up"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_etau_ratio_mvadm11_up")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_trg_30_ic_mvadm_ratio_mvadm11_down"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_etau_ratio_mvadm11_down")->functor(w_->argSet("t_pt,t_mvadm"))); - - fns_["t_trg_30_ic_mvadm_embed_ratio_mvadm0_up"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_etau_embed_ratio_mvadm0_up")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_trg_30_ic_mvadm_embed_ratio_mvadm0_down"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_etau_embed_ratio_mvadm0_down")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_trg_30_ic_mvadm_embed_ratio_mvadm1_up"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_etau_embed_ratio_mvadm1_up")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_trg_30_ic_mvadm_embed_ratio_mvadm1_down"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_etau_embed_ratio_mvadm1_down")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_trg_30_ic_mvadm_embed_ratio_mvadm2_up"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_etau_embed_ratio_mvadm2_up")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_trg_30_ic_mvadm_embed_ratio_mvadm2_down"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_etau_embed_ratio_mvadm2_down")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_trg_30_ic_mvadm_embed_ratio_mvadm10_up"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_etau_embed_ratio_mvadm10_up")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_trg_30_ic_mvadm_embed_ratio_mvadm10_down"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_etau_embed_ratio_mvadm10_down")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_trg_30_ic_mvadm_embed_ratio_mvadm11_up"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_etau_embed_ratio_mvadm11_up")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_trg_30_ic_mvadm_embed_ratio_mvadm11_down"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_etau_embed_ratio_mvadm11_down")->functor(w_->argSet("t_pt,t_mvadm"))); - } + fns_["e_trg_ratio"] = std::shared_ptr( + w_->function("e_trg_ic_ratio")->functor(w_->argSet("e_pt,e_eta"))); + fns_["e_iso_ratio"] = std::shared_ptr( + w_->function("e_iso_ic_ratio")->functor(w_->argSet("e_pt,e_eta"))); + fns_["e_id_ratio"] = std::shared_ptr( + w_->function("e_id_ic_ratio")->functor(w_->argSet("e_pt,e_eta"))); - fns_["t_trg_35_ic_ratio"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_ditau_ratio")->functor(w_->argSet("t_pt,t_dm"))); - fns_["t_trg_35_ic_embed_ratio"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_ditau_embed_ratio")->functor(w_->argSet("t_pt,t_dm"))); - - fns_["t_trg_35_ic_mvadm_ratio"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_ditau_ratio")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_trg_35_ic_mvadm_embed_ratio"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_ditau_embed_ratio")->functor(w_->argSet("t_pt,t_mvadm"))); - - fns_["t_trg_35_ic_mvadm_ratio_mvadm0_up"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_ditau_ratio_mvadm0_up")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_trg_35_ic_mvadm_ratio_mvadm0_down"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_ditau_ratio_mvadm0_down")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_trg_35_ic_mvadm_embed_ratio_mvadm0_up"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_ditau_embed_ratio_mvadm0_up")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_trg_35_ic_mvadm_embed_ratio_mvadm0_down"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_ditau_embed_ratio_mvadm0_down")->functor(w_->argSet("t_pt,t_mvadm"))); - - fns_["t_trg_35_ic_mvadm_ratio_mvadm1_up"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_ditau_ratio_mvadm1_up")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_trg_35_ic_mvadm_ratio_mvadm1_down"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_ditau_ratio_mvadm1_down")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_trg_35_ic_mvadm_embed_ratio_mvadm1_up"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_ditau_embed_ratio_mvadm1_up")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_trg_35_ic_mvadm_embed_ratio_mvadm1_down"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_ditau_embed_ratio_mvadm1_down")->functor(w_->argSet("t_pt,t_mvadm"))); - - fns_["t_trg_35_ic_mvadm_ratio_mvadm2_up"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_ditau_ratio_mvadm2_up")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_trg_35_ic_mvadm_ratio_mvadm2_down"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_ditau_ratio_mvadm2_down")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_trg_35_ic_mvadm_embed_ratio_mvadm2_up"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_ditau_embed_ratio_mvadm2_up")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_trg_35_ic_mvadm_embed_ratio_mvadm2_down"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_ditau_embed_ratio_mvadm2_down")->functor(w_->argSet("t_pt,t_mvadm"))); - - fns_["t_trg_35_ic_mvadm_ratio_mvadm10_up"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_ditau_ratio_mvadm10_up")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_trg_35_ic_mvadm_ratio_mvadm10_down"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_ditau_ratio_mvadm10_down")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_trg_35_ic_mvadm_embed_ratio_mvadm10_up"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_ditau_embed_ratio_mvadm10_up")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_trg_35_ic_mvadm_embed_ratio_mvadm10_down"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_ditau_embed_ratio_mvadm10_down")->functor(w_->argSet("t_pt,t_mvadm"))); - - fns_["t_trg_35_ic_mvadm_ratio_mvadm11_up"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_ditau_ratio_mvadm11_up")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_trg_35_ic_mvadm_ratio_mvadm11_down"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_ditau_ratio_mvadm11_down")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_trg_35_ic_mvadm_embed_ratio_mvadm11_up"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_ditau_embed_ratio_mvadm11_up")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_trg_35_ic_mvadm_embed_ratio_mvadm11_down"] = std::shared_ptr( - w_->function("t_trg_ic_deeptau_medium_mvadm_ditau_embed_ratio_mvadm11_down")->functor(w_->argSet("t_pt,t_mvadm"))); - - // electron id/iso - fns_["e_idiso_embed_ratio"] = std::shared_ptr( - w_->function("e_idiso_binned_ic_embed_ratio")->functor(w_->argSet("e_pt,e_eta,e_iso"))); - fns_["e_idiso_ratio"] = std::shared_ptr( - w_->function("e_idiso_binned_ic_ratio")->functor(w_->argSet("e_pt,e_eta,e_iso"))); - - // muon id/iso - fns_["m_idiso_embed_ratio"] = std::shared_ptr( - w_->function("m_idiso_binned_ic_embed_ratio")->functor(w_->argSet("m_pt,m_eta,m_iso"))); - fns_["m_idiso_ratio"] = std::shared_ptr( - w_->function("m_idiso_binned_ic_ratio")->functor(w_->argSet("m_pt,m_eta,m_iso"))); - fns_["m_id_ratio"] = std::shared_ptr( - w_->function("m_id_ic_ratio")->functor(w_->argSet("m_pt,m_eta"))); - fns_["m_id_embed_ratio"] = std::shared_ptr( - w_->function("m_id_ic_embed_ratio")->functor(w_->argSet("m_pt,m_eta"))); - fns_["m_looseiso_ratio"] = std::shared_ptr( - w_->function("m_looseiso_binned_ic_ratio")->functor(w_->argSet("m_pt,m_eta,m_iso"))); - fns_["m_looseiso_embed_ratio"] = std::shared_ptr( - w_->function("m_looseiso_binned_ic_embed_ratio")->functor(w_->argSet("m_pt,m_eta,m_iso"))); - fns_["m_sel_idEmb_ratio"] = std::shared_ptr( - w_->function("m_sel_id_ic_ratio")->functor(w_->argSet("gt_eta,gt_pt"))); - fns_["m_sel_trg_ratio"] = std::shared_ptr( - w_->function("m_sel_trg_ic_ratio")->functor(w_->argSet("gt1_pt,gt1_eta,gt2_pt,gt2_eta"))); - fns_["m_sel_idEmb_kit_ratio"] = std::shared_ptr( - w_->function("m_sel_idEmb_ratio")->functor(w_->argSet("gt_eta,gt_pt"))); - fns_["m_sel_trg_kit_ratio"] = std::shared_ptr( - w_->function("m_sel_trg_ratio")->functor(w_->argSet("gt1_pt,gt1_eta,gt2_pt,gt2_eta"))); - - // tau id - fns_["t_id_pt_tight"] = std::shared_ptr( - w_->function("t_id_pt_tight")->functor(w_->argSet("t_pt"))); - fns_["t_id_dm_tight"] = std::shared_ptr( - w_->function("t_id_dm_tight")->functor(w_->argSet("t_dm"))); - fns_["t_id_dm_vloose"] = std::shared_ptr( - w_->function("t_id_dm_vloose")->functor(w_->argSet("t_dm"))); - fns_["t_deeptauid_pt_medium"] = std::shared_ptr( - w_->function("t_deeptauid_pt_medium")->functor(w_->argSet("t_pt"))); - - // high pT tau ID efficiency for MSSM analysis - fns_["t_deeptauid_highpt"] = std::shared_ptr( - w_->function("t_deeptauid_highpt")->functor(w_->argSet("t_pt"))); - fns_["t_deeptauid_highpt_bin5_up"] = std::shared_ptr( - w_->function("t_deeptauid_highpt_bin5_up")->functor(w_->argSet("t_pt"))); - fns_["t_deeptauid_highpt_bin5_down"] = std::shared_ptr( - w_->function("t_deeptauid_highpt_bin5_down")->functor(w_->argSet("t_pt"))); - fns_["t_deeptauid_highpt_bin6_up"] = std::shared_ptr( - w_->function("t_deeptauid_highpt_bin6_up")->functor(w_->argSet("t_pt"))); - fns_["t_deeptauid_highpt_bin6_down"] = std::shared_ptr( - w_->function("t_deeptauid_highpt_bin6_down")->functor(w_->argSet("t_pt"))); - - fns_["t_deeptauid_highpt_embed"] = std::shared_ptr( - w_->function("t_deeptauid_highpt_embed")->functor(w_->argSet("t_pt"))); - fns_["t_deeptauid_highpt_embed_bin5_up"] = std::shared_ptr( - w_->function("t_deeptauid_highpt_embed_bin5_up")->functor(w_->argSet("t_pt"))); - fns_["t_deeptauid_highpt_embed_bin5_down"] = std::shared_ptr( - w_->function("t_deeptauid_highpt_embed_bin5_down")->functor(w_->argSet("t_pt"))); - fns_["t_deeptauid_highpt_embed_bin6_up"] = std::shared_ptr( - w_->function("t_deeptauid_highpt_embed_bin6_up")->functor(w_->argSet("t_pt"))); - fns_["t_deeptauid_highpt_embed_bin6_down"] = std::shared_ptr( - w_->function("t_deeptauid_highpt_embed_bin6_down")->functor(w_->argSet("t_pt"))); - fns_["t_deeptauid_highpt_tightvse_embed"] = std::shared_ptr( - w_->function("t_deeptauid_highpt_tightvse_embed")->functor(w_->argSet("t_pt"))); - fns_["t_deeptauid_highpt_tightvse_embed_bin5_up"] = std::shared_ptr( - w_->function("t_deeptauid_highpt_tightvse_embed_bin5_up")->functor(w_->argSet("t_pt"))); - fns_["t_deeptauid_highpt_tightvse_embed_bin5_down"] = std::shared_ptr( - w_->function("t_deeptauid_highpt_tightvse_embed_bin5_down")->functor(w_->argSet("t_pt"))); - fns_["t_deeptauid_highpt_tightvse_embed_bin6_up"] = std::shared_ptr( - w_->function("t_deeptauid_highpt_tightvse_embed_bin6_up")->functor(w_->argSet("t_pt"))); - fns_["t_deeptauid_highpt_tightvse_embed_bin6_down"] = std::shared_ptr( - w_->function("t_deeptauid_highpt_tightvse_embed_bin6_down")->functor(w_->argSet("t_pt"))); - - fns_["t_deeptauid_pt_vvvloose"] = std::shared_ptr( - w_->function("t_deeptauid_pt_vvvloose")->functor(w_->argSet("t_pt"))); - fns_["t_deeptauid_dm_medium"] = std::shared_ptr( - w_->function("t_deeptauid_dm_medium")->functor(w_->argSet("t_dm"))); - fns_["t_deeptauid_dm_vvvloose"] = std::shared_ptr( - w_->function("t_deeptauid_dm_vvvloose")->functor(w_->argSet("t_dm"))); - - fns_["t_deeptauid_pt_medium_bin1_up"] = std::shared_ptr( - w_->function("t_deeptauid_pt_medium_bin1_up")->functor(w_->argSet("t_pt"))); - fns_["t_deeptauid_pt_medium_bin2_up"] = std::shared_ptr( - w_->function("t_deeptauid_pt_medium_bin2_up")->functor(w_->argSet("t_pt"))); - fns_["t_deeptauid_pt_medium_bin3_up"] = std::shared_ptr( - w_->function("t_deeptauid_pt_medium_bin3_up")->functor(w_->argSet("t_pt"))); - fns_["t_deeptauid_pt_medium_bin4_up"] = std::shared_ptr( - w_->function("t_deeptauid_pt_medium_bin4_up")->functor(w_->argSet("t_pt"))); - fns_["t_deeptauid_pt_medium_bin5_up"] = std::shared_ptr( - w_->function("t_deeptauid_pt_medium_bin5_up")->functor(w_->argSet("t_pt"))); - - fns_["t_deeptauid_pt_medium_bin1_down"] = std::shared_ptr( - w_->function("t_deeptauid_pt_medium_bin1_down")->functor(w_->argSet("t_pt"))); - fns_["t_deeptauid_pt_medium_bin2_down"] = std::shared_ptr( - w_->function("t_deeptauid_pt_medium_bin2_down")->functor(w_->argSet("t_pt"))); - fns_["t_deeptauid_pt_medium_bin3_down"] = std::shared_ptr( - w_->function("t_deeptauid_pt_medium_bin3_down")->functor(w_->argSet("t_pt"))); - fns_["t_deeptauid_pt_medium_bin4_down"] = std::shared_ptr( - w_->function("t_deeptauid_pt_medium_bin4_down")->functor(w_->argSet("t_pt"))); - fns_["t_deeptauid_pt_medium_bin5_down"] = std::shared_ptr( - w_->function("t_deeptauid_pt_medium_bin5_down")->functor(w_->argSet("t_pt"))); - - fns_["t_deeptauid_dm_medium_dm0_up"] = std::shared_ptr( - w_->function("t_deeptauid_dm_medium_dm0_up")->functor(w_->argSet("t_dm"))); - fns_["t_deeptauid_dm_medium_dm1_up"] = std::shared_ptr( - w_->function("t_deeptauid_dm_medium_dm1_up")->functor(w_->argSet("t_dm"))); - fns_["t_deeptauid_dm_medium_dm10_up"] = std::shared_ptr( - w_->function("t_deeptauid_dm_medium_dm10_up")->functor(w_->argSet("t_dm"))); - fns_["t_deeptauid_dm_medium_dm11_up"] = std::shared_ptr( - w_->function("t_deeptauid_dm_medium_dm11_up")->functor(w_->argSet("t_dm"))); - - fns_["t_deeptauid_dm_medium_dm0_down"] = std::shared_ptr( - w_->function("t_deeptauid_dm_medium_dm0_down")->functor(w_->argSet("t_dm"))); - fns_["t_deeptauid_dm_medium_dm1_down"] = std::shared_ptr( - w_->function("t_deeptauid_dm_medium_dm1_down")->functor(w_->argSet("t_dm"))); - fns_["t_deeptauid_dm_medium_dm10_down"] = std::shared_ptr( - w_->function("t_deeptauid_dm_medium_dm10_down")->functor(w_->argSet("t_dm"))); - fns_["t_deeptauid_dm_medium_dm11_down"] = std::shared_ptr( - w_->function("t_deeptauid_dm_medium_dm11_down")->functor(w_->argSet("t_dm"))); - - fns_["t_deeptauid_pt_embed_medium"] = std::shared_ptr( - w_->function("t_deeptauid_pt_embed_medium")->functor(w_->argSet("t_pt"))); - fns_["t_deeptauid_pt_tightvse_embed_medium"] = std::shared_ptr( - w_->function("t_deeptauid_pt_tightvse_embed_medium")->functor(w_->argSet("t_pt"))); - fns_["t_deeptauid_pt_embed_vvvloose"] = std::shared_ptr( - w_->function("t_deeptauid_pt_embed_vvvloose")->functor(w_->argSet("t_pt"))); - fns_["t_deeptauid_dm_embed_medium"] = std::shared_ptr( - w_->function("t_deeptauid_dm_embed_medium")->functor(w_->argSet("t_dm"))); - fns_["t_deeptauid_dm_embed_vvvloose"] = std::shared_ptr( - w_->function("t_deeptauid_dm_embed_vvvloose")->functor(w_->argSet("t_dm"))); - - fns_["t_deeptauid_pt_tightvse_embed_medium_bin1_up"] = std::shared_ptr( - w_->function("t_deeptauid_pt_tightvse_embed_medium_bin1_up")->functor(w_->argSet("t_pt"))); - fns_["t_deeptauid_pt_tightvse_embed_medium_bin2_up"] = std::shared_ptr( - w_->function("t_deeptauid_pt_tightvse_embed_medium_bin2_up")->functor(w_->argSet("t_pt"))); - fns_["t_deeptauid_pt_tightvse_embed_medium_bin3_up"] = std::shared_ptr( - w_->function("t_deeptauid_pt_tightvse_embed_medium_bin3_up")->functor(w_->argSet("t_pt"))); - fns_["t_deeptauid_pt_tightvse_embed_medium_bin4_up"] = std::shared_ptr( - w_->function("t_deeptauid_pt_tightvse_embed_medium_bin4_up")->functor(w_->argSet("t_pt"))); - fns_["t_deeptauid_pt_tightvse_embed_medium_bin5_up"] = std::shared_ptr( - w_->function("t_deeptauid_pt_tightvse_embed_medium_bin5_up")->functor(w_->argSet("t_pt"))); - - fns_["t_deeptauid_pt_tightvse_embed_medium_bin1_down"] = std::shared_ptr( - w_->function("t_deeptauid_pt_tightvse_embed_medium_bin1_down")->functor(w_->argSet("t_pt"))); - fns_["t_deeptauid_pt_tightvse_embed_medium_bin2_down"] = std::shared_ptr( - w_->function("t_deeptauid_pt_tightvse_embed_medium_bin2_down")->functor(w_->argSet("t_pt"))); - fns_["t_deeptauid_pt_tightvse_embed_medium_bin3_down"] = std::shared_ptr( - w_->function("t_deeptauid_pt_tightvse_embed_medium_bin3_down")->functor(w_->argSet("t_pt"))); - fns_["t_deeptauid_pt_tightvse_embed_medium_bin4_down"] = std::shared_ptr( - w_->function("t_deeptauid_pt_tightvse_embed_medium_bin4_down")->functor(w_->argSet("t_pt"))); - fns_["t_deeptauid_pt_tightvse_embed_medium_bin5_down"] = std::shared_ptr( - w_->function("t_deeptauid_pt_tightvse_embed_medium_bin5_down")->functor(w_->argSet("t_pt"))); - - - fns_["t_deeptauid_pt_embed_medium_bin1_up"] = std::shared_ptr( - w_->function("t_deeptauid_pt_embed_medium_bin1_up")->functor(w_->argSet("t_pt"))); - fns_["t_deeptauid_pt_embed_medium_bin2_up"] = std::shared_ptr( - w_->function("t_deeptauid_pt_embed_medium_bin2_up")->functor(w_->argSet("t_pt"))); - fns_["t_deeptauid_pt_embed_medium_bin3_up"] = std::shared_ptr( - w_->function("t_deeptauid_pt_embed_medium_bin3_up")->functor(w_->argSet("t_pt"))); - fns_["t_deeptauid_pt_embed_medium_bin4_up"] = std::shared_ptr( - w_->function("t_deeptauid_pt_embed_medium_bin4_up")->functor(w_->argSet("t_pt"))); - fns_["t_deeptauid_pt_embed_medium_bin5_up"] = std::shared_ptr( - w_->function("t_deeptauid_pt_embed_medium_bin5_up")->functor(w_->argSet("t_pt"))); - - fns_["t_deeptauid_pt_embed_medium_bin1_down"] = std::shared_ptr( - w_->function("t_deeptauid_pt_embed_medium_bin1_down")->functor(w_->argSet("t_pt"))); - fns_["t_deeptauid_pt_embed_medium_bin2_down"] = std::shared_ptr( - w_->function("t_deeptauid_pt_embed_medium_bin2_down")->functor(w_->argSet("t_pt"))); - fns_["t_deeptauid_pt_embed_medium_bin3_down"] = std::shared_ptr( - w_->function("t_deeptauid_pt_embed_medium_bin3_down")->functor(w_->argSet("t_pt"))); - fns_["t_deeptauid_pt_embed_medium_bin4_down"] = std::shared_ptr( - w_->function("t_deeptauid_pt_embed_medium_bin4_down")->functor(w_->argSet("t_pt"))); - fns_["t_deeptauid_pt_embed_medium_bin5_down"] = std::shared_ptr( - w_->function("t_deeptauid_pt_embed_medium_bin5_down")->functor(w_->argSet("t_pt"))); - - fns_["t_deeptauid_dm_embed_medium_dm0_up"] = std::shared_ptr( - w_->function("t_deeptauid_dm_embed_medium_dm0_up")->functor(w_->argSet("t_dm"))); - fns_["t_deeptauid_dm_embed_medium_dm1_up"] = std::shared_ptr( - w_->function("t_deeptauid_dm_embed_medium_dm1_up")->functor(w_->argSet("t_dm"))); - fns_["t_deeptauid_dm_embed_medium_dm10_up"] = std::shared_ptr( - w_->function("t_deeptauid_dm_embed_medium_dm10_up")->functor(w_->argSet("t_dm"))); - fns_["t_deeptauid_dm_embed_medium_dm11_up"] = std::shared_ptr( - w_->function("t_deeptauid_dm_embed_medium_dm11_up")->functor(w_->argSet("t_dm"))); - - fns_["t_deeptauid_dm_embed_medium_dm0_down"] = std::shared_ptr( - w_->function("t_deeptauid_dm_embed_medium_dm0_down")->functor(w_->argSet("t_dm"))); - fns_["t_deeptauid_dm_embed_medium_dm1_down"] = std::shared_ptr( - w_->function("t_deeptauid_dm_embed_medium_dm1_down")->functor(w_->argSet("t_dm"))); - fns_["t_deeptauid_dm_embed_medium_dm10_down"] = std::shared_ptr( - w_->function("t_deeptauid_dm_embed_medium_dm10_down")->functor(w_->argSet("t_dm"))); - fns_["t_deeptauid_dm_embed_medium_dm11_down"] = std::shared_ptr( - w_->function("t_deeptauid_dm_embed_medium_dm11_down")->functor(w_->argSet("t_dm"))); - - // tau id in mva-dm bins - fns_["t_deeptauid_mvadm_medium"] = std::shared_ptr( - w_->function("t_deeptauid_mvadm_medium")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_deeptauid_mvadm_embed_medium"] = std::shared_ptr( - w_->function("t_deeptauid_mvadm_embed_medium")->functor(w_->argSet("t_pt,t_mvadm"))); - - fns_["t_deeptauid_mvadm_medium_tightvsele"] = std::shared_ptr( - w_->function("t_deeptauid_mvadm_medium_tightvsele")->functor(w_->argSet("t_pt,t_mvadm"))); - - fns_["t_deeptauid_mvadm_embed_medium_tightvsele"] = std::shared_ptr( - w_->function("t_deeptauid_mvadm_embed_medium_tightvsele")->functor(w_->argSet("t_pt,t_mvadm"))); - - fns_["t_deeptauid_mvadm_medium_lowpt_mvadm0_up"] = std::shared_ptr( - w_->function("t_deeptauid_mvadm_medium_lowpt_mvadm0_up")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_deeptauid_mvadm_medium_lowpt_mvadm1_up"] = std::shared_ptr( - w_->function("t_deeptauid_mvadm_medium_lowpt_mvadm1_up")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_deeptauid_mvadm_medium_lowpt_mvadm2_up"] = std::shared_ptr( - w_->function("t_deeptauid_mvadm_medium_lowpt_mvadm2_up")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_deeptauid_mvadm_medium_lowpt_mvadm10_up"] = std::shared_ptr( - w_->function("t_deeptauid_mvadm_medium_lowpt_mvadm10_up")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_deeptauid_mvadm_medium_lowpt_mvadm11_up"] = std::shared_ptr( - w_->function("t_deeptauid_mvadm_medium_lowpt_mvadm11_up")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_deeptauid_mvadm_medium_highpt_mvadm0_up"] = std::shared_ptr( - w_->function("t_deeptauid_mvadm_medium_highpt_mvadm0_up")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_deeptauid_mvadm_medium_highpt_mvadm1_up"] = std::shared_ptr( - w_->function("t_deeptauid_mvadm_medium_highpt_mvadm1_up")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_deeptauid_mvadm_medium_highpt_mvadm2_up"] = std::shared_ptr( - w_->function("t_deeptauid_mvadm_medium_highpt_mvadm2_up")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_deeptauid_mvadm_medium_highpt_mvadm10_up"] = std::shared_ptr( - w_->function("t_deeptauid_mvadm_medium_highpt_mvadm10_up")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_deeptauid_mvadm_medium_highpt_mvadm11_up"] = std::shared_ptr( - w_->function("t_deeptauid_mvadm_medium_highpt_mvadm11_up")->functor(w_->argSet("t_pt,t_mvadm"))); - - fns_["t_deeptauid_mvadm_medium_lowpt_mvadm0_down"] = std::shared_ptr( - w_->function("t_deeptauid_mvadm_medium_lowpt_mvadm0_down")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_deeptauid_mvadm_medium_lowpt_mvadm1_down"] = std::shared_ptr( - w_->function("t_deeptauid_mvadm_medium_lowpt_mvadm1_down")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_deeptauid_mvadm_medium_lowpt_mvadm2_down"] = std::shared_ptr( - w_->function("t_deeptauid_mvadm_medium_lowpt_mvadm2_down")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_deeptauid_mvadm_medium_lowpt_mvadm10_down"] = std::shared_ptr( - w_->function("t_deeptauid_mvadm_medium_lowpt_mvadm10_down")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_deeptauid_mvadm_medium_lowpt_mvadm11_down"] = std::shared_ptr( - w_->function("t_deeptauid_mvadm_medium_lowpt_mvadm11_down")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_deeptauid_mvadm_medium_highpt_mvadm0_down"] = std::shared_ptr( - w_->function("t_deeptauid_mvadm_medium_highpt_mvadm0_down")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_deeptauid_mvadm_medium_highpt_mvadm1_down"] = std::shared_ptr( - w_->function("t_deeptauid_mvadm_medium_highpt_mvadm1_down")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_deeptauid_mvadm_medium_highpt_mvadm2_down"] = std::shared_ptr( - w_->function("t_deeptauid_mvadm_medium_highpt_mvadm2_down")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_deeptauid_mvadm_medium_highpt_mvadm10_down"] = std::shared_ptr( - w_->function("t_deeptauid_mvadm_medium_highpt_mvadm10_down")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_deeptauid_mvadm_medium_highpt_mvadm11_down"] = std::shared_ptr( - w_->function("t_deeptauid_mvadm_medium_highpt_mvadm11_down")->functor(w_->argSet("t_pt,t_mvadm"))); - - fns_["t_deeptauid_mvadm_embed_medium_lowpt_mvadm0_up"] = std::shared_ptr( - w_->function("t_deeptauid_mvadm_embed_medium_lowpt_mvadm0_up")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_deeptauid_mvadm_embed_medium_lowpt_mvadm1_up"] = std::shared_ptr( - w_->function("t_deeptauid_mvadm_embed_medium_lowpt_mvadm1_up")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_deeptauid_mvadm_embed_medium_lowpt_mvadm2_up"] = std::shared_ptr( - w_->function("t_deeptauid_mvadm_embed_medium_lowpt_mvadm2_up")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_deeptauid_mvadm_embed_medium_lowpt_mvadm10_up"] = std::shared_ptr( - w_->function("t_deeptauid_mvadm_embed_medium_lowpt_mvadm10_up")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_deeptauid_mvadm_embed_medium_lowpt_mvadm11_up"] = std::shared_ptr( - w_->function("t_deeptauid_mvadm_embed_medium_lowpt_mvadm11_up")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_deeptauid_mvadm_embed_medium_highpt_mvadm0_up"] = std::shared_ptr( - w_->function("t_deeptauid_mvadm_embed_medium_highpt_mvadm0_up")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_deeptauid_mvadm_embed_medium_highpt_mvadm1_up"] = std::shared_ptr( - w_->function("t_deeptauid_mvadm_embed_medium_highpt_mvadm1_up")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_deeptauid_mvadm_embed_medium_highpt_mvadm2_up"] = std::shared_ptr( - w_->function("t_deeptauid_mvadm_embed_medium_highpt_mvadm2_up")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_deeptauid_mvadm_embed_medium_highpt_mvadm10_up"] = std::shared_ptr( - w_->function("t_deeptauid_mvadm_embed_medium_highpt_mvadm10_up")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_deeptauid_mvadm_embed_medium_highpt_mvadm11_up"] = std::shared_ptr( - w_->function("t_deeptauid_mvadm_embed_medium_highpt_mvadm11_up")->functor(w_->argSet("t_pt,t_mvadm"))); - - fns_["t_deeptauid_mvadm_embed_medium_lowpt_mvadm0_down"] = std::shared_ptr( - w_->function("t_deeptauid_mvadm_embed_medium_lowpt_mvadm0_down")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_deeptauid_mvadm_embed_medium_lowpt_mvadm1_down"] = std::shared_ptr( - w_->function("t_deeptauid_mvadm_embed_medium_lowpt_mvadm1_down")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_deeptauid_mvadm_embed_medium_lowpt_mvadm2_down"] = std::shared_ptr( - w_->function("t_deeptauid_mvadm_embed_medium_lowpt_mvadm2_down")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_deeptauid_mvadm_embed_medium_lowpt_mvadm10_down"] = std::shared_ptr( - w_->function("t_deeptauid_mvadm_embed_medium_lowpt_mvadm10_down")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_deeptauid_mvadm_embed_medium_lowpt_mvadm11_down"] = std::shared_ptr( - w_->function("t_deeptauid_mvadm_embed_medium_lowpt_mvadm11_down")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_deeptauid_mvadm_embed_medium_highpt_mvadm0_down"] = std::shared_ptr( - w_->function("t_deeptauid_mvadm_embed_medium_highpt_mvadm0_down")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_deeptauid_mvadm_embed_medium_highpt_mvadm1_down"] = std::shared_ptr( - w_->function("t_deeptauid_mvadm_embed_medium_highpt_mvadm1_down")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_deeptauid_mvadm_embed_medium_highpt_mvadm2_down"] = std::shared_ptr( - w_->function("t_deeptauid_mvadm_embed_medium_highpt_mvadm2_down")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_deeptauid_mvadm_embed_medium_highpt_mvadm10_down"] = std::shared_ptr( - w_->function("t_deeptauid_mvadm_embed_medium_highpt_mvadm10_down")->functor(w_->argSet("t_pt,t_mvadm"))); - fns_["t_deeptauid_mvadm_embed_medium_highpt_mvadm11_down"] = std::shared_ptr( - w_->function("t_deeptauid_mvadm_embed_medium_highpt_mvadm11_down")->functor(w_->argSet("t_pt,t_mvadm"))); - - fns_["t_id_vs_e_eta_vvloose"] = std::shared_ptr( - w_->function("t_id_vs_e_eta_vvloose")->functor(w_->argSet("t_eta"))); - fns_["t_id_vs_e_eta_vvloose_up"] = std::shared_ptr( - w_->function("t_id_vs_e_eta_vvloose_up")->functor(w_->argSet("t_eta"))); - fns_["t_id_vs_e_eta_vvloose_down"] = std::shared_ptr( - w_->function("t_id_vs_e_eta_vvloose_down")->functor(w_->argSet("t_eta"))); - fns_["t_id_vs_e_eta_tight"] = std::shared_ptr( - w_->function("t_id_vs_e_eta_tight")->functor(w_->argSet("t_eta"))); - fns_["t_id_vs_e_eta_tight_up"] = std::shared_ptr( - w_->function("t_id_vs_e_eta_tight_up")->functor(w_->argSet("t_eta"))); - fns_["t_id_vs_e_eta_tight_down"] = std::shared_ptr( - w_->function("t_id_vs_e_eta_tight_down")->functor(w_->argSet("t_eta"))); - - fns_["t_id_vs_mu_eta_vloose"] = std::shared_ptr( - w_->function("t_id_vs_mu_eta_vloose")->functor(w_->argSet("t_eta"))); - fns_["t_id_vs_mu_eta_vloose_up"] = std::shared_ptr( - w_->function("t_id_vs_mu_eta_vloose_up")->functor(w_->argSet("t_eta"))); - fns_["t_id_vs_mu_eta_vloose_down"] = std::shared_ptr( - w_->function("t_id_vs_mu_eta_vloose_down")->functor(w_->argSet("t_eta"))); - fns_["t_id_vs_mu_eta_tight"] = std::shared_ptr( - w_->function("t_id_vs_mu_eta_tight")->functor(w_->argSet("t_eta"))); - fns_["t_id_vs_mu_eta_tight_up"] = std::shared_ptr( - w_->function("t_id_vs_mu_eta_tight_up")->functor(w_->argSet("t_eta"))); - fns_["t_id_vs_mu_eta_tight_down"] = std::shared_ptr( - w_->function("t_id_vs_mu_eta_tight_down")->functor(w_->argSet("t_eta"))); - - // zpt reweighting - fns_["zpt_weight_nom"] = std::shared_ptr( + fns_["zpt_weight_nom"] = std::shared_ptr( w_->function("zptmass_weight_nom")->functor(w_->argSet("z_gen_pt,z_gen_mass"))); - // em osss same names for all years - fns_["em_qcd_osss"] = std::shared_ptr( - w_->function("em_qcd_osss")->functor(w_->argSet("dR,njets,e_pt,m_pt"))); - fns_["em_qcd_osss_extrap_up"] = std::shared_ptr( - w_->function("em_qcd_osss_extrap_up")->functor(w_->argSet("dR,njets,e_pt,m_pt"))); - fns_["em_qcd_osss_extrap_down"] = std::shared_ptr( - w_->function("em_qcd_osss_extrap_down")->functor(w_->argSet("dR,njets,e_pt,m_pt"))); - - fns_["em_qcd_osss_stat_0jet_unc1_up"] = std::shared_ptr( - w_->function("em_qcd_osss_stat_0jet_unc1_up")->functor(w_->argSet("dR,njets,e_pt,m_pt"))); - fns_["em_qcd_osss_stat_0jet_unc1_down"] = std::shared_ptr( - w_->function("em_qcd_osss_stat_0jet_unc1_down")->functor(w_->argSet("dR,njets,e_pt,m_pt"))); - fns_["em_qcd_osss_stat_0jet_unc2_up"] = std::shared_ptr( - w_->function("em_qcd_osss_stat_0jet_unc2_up")->functor(w_->argSet("dR,njets,e_pt,m_pt"))); - fns_["em_qcd_osss_stat_0jet_unc2_down"] = std::shared_ptr( - w_->function("em_qcd_osss_stat_0jet_unc2_down")->functor(w_->argSet("dR,njets,e_pt,m_pt"))); - - fns_["em_qcd_osss_stat_1jet_unc1_up"] = std::shared_ptr( - w_->function("em_qcd_osss_stat_1jet_unc1_up")->functor(w_->argSet("dR,njets,e_pt,m_pt"))); - fns_["em_qcd_osss_stat_1jet_unc1_down"] = std::shared_ptr( - w_->function("em_qcd_osss_stat_1jet_unc1_down")->functor(w_->argSet("dR,njets,e_pt,m_pt"))); - fns_["em_qcd_osss_stat_1jet_unc2_up"] = std::shared_ptr( - w_->function("em_qcd_osss_stat_1jet_unc2_up")->functor(w_->argSet("dR,njets,e_pt,m_pt"))); - fns_["em_qcd_osss_stat_1jet_unc2_down"] = std::shared_ptr( - w_->function("em_qcd_osss_stat_1jet_unc2_down")->functor(w_->argSet("dR,njets,e_pt,m_pt"))); - - fns_["em_qcd_osss_stat_2jet_unc1_up"] = std::shared_ptr( - w_->function("em_qcd_osss_stat_2jet_unc1_up")->functor(w_->argSet("dR,njets,e_pt,m_pt"))); - fns_["em_qcd_osss_stat_2jet_unc1_down"] = std::shared_ptr( - w_->function("em_qcd_osss_stat_2jet_unc1_down")->functor(w_->argSet("dR,njets,e_pt,m_pt"))); - fns_["em_qcd_osss_stat_2jet_unc2_up"] = std::shared_ptr( - w_->function("em_qcd_osss_stat_2jet_unc2_up")->functor(w_->argSet("dR,njets,e_pt,m_pt"))); - fns_["em_qcd_osss_stat_2jet_unc2_down"] = std::shared_ptr( - w_->function("em_qcd_osss_stat_2jet_unc2_down")->functor(w_->argSet("dR,njets,e_pt,m_pt"))); - - // MG ggH specific weights - if(do_quarkmass_higgspt_){ - fns_["ggH_quarkmass_corr"] = std::shared_ptr( - w_ggh_->function("ggH_quarkmass_corr")->functor(w_ggh_->argSet("HpT"))); - fns_["ggH_quarkmass_corr_up"] = std::shared_ptr( - w_ggh_->function("ggH_quarkmass_corr_up")->functor(w_ggh_->argSet("HpT"))); - fns_["ggH_quarkmass_corr_down"] = std::shared_ptr( - w_ggh_->function("ggH_quarkmass_corr_down")->functor(w_ggh_->argSet("HpT"))); - fns_["ggH_fullquarkmass_corr"] = std::shared_ptr( - w_ggh_->function("ggH_fullquarkmass_corr")->functor(w_ggh_->argSet("HpT"))); - } - if(do_ps_weights_){ - fns_["ggH_mg_ue_up"] = std::shared_ptr( - w_ggh_->function("ggH_mg_ue_up")->functor(w_ggh_->argSet("ngenjets"))); - fns_["ggH_mg_ue_down"] = std::shared_ptr( - w_ggh_->function("ggH_mg_ue_down")->functor(w_ggh_->argSet("ngenjets"))); - } } -// These are the factors that are also available in Run 3, 2022 as of August 2023 - fns_["m_trg_binned_mc"] = std::shared_ptr( w_->function("m_trg_binned_ic_mc")->functor(w_->argSet("m_pt,m_eta,m_iso"))); - fns_["m_trg_binned_data"] = std::shared_ptr( - w_->function("m_trg_binned_ic_data")->functor(w_->argSet("m_pt,m_eta,m_iso"))); - fns_["m_idiso_ratio"] = std::shared_ptr( - w_->function("m_idiso_binned_ic_ratio")->functor(w_->argSet("m_pt,m_eta,m_iso"))); - fns_["m_id_ratio"] = std::shared_ptr( - w_->function("m_id_ic_ratio")->functor(w_->argSet("m_pt,m_eta"))); - fns_["zpt_weight_nom"] = std::shared_ptr( - w_->function("zptmass_weight_nom")->functor(w_->argSet("z_gen_pt,z_gen_mass"))); - - // UL Scale Factors if(scalefactor_file_UL_!="" && (era_ == era::data_2016UL_preVFP || era_ == era::data_2016UL_postVFP || era_ == era::data_2017UL || era_ == era::data_2018UL)){ @@ -2305,232 +2315,479 @@ int HTTWeights::Execute(TreeEvent *event) { if (do_trg_weights_) { if (channel_ == channel::et) { Electron const* elec = dynamic_cast(dilepton[0]->GetCandidate("lepton1")); - Tau const* tau = dynamic_cast(dilepton[0]->GetCandidate("lepton2")); double e_pt = elec->pt(); - double e_iso = PF03IsolationVal(elec,0.5,0); double e_eta = fabs(elec->eta()); - double t_pt = tau->pt(); - double t_signed_eta = tau->eta(); - double t_phi = tau->phi(); - double ele_trg = 1.0; - double tau_trg = 1.0; - double tau_trg_mc=1.; - double ele_trg_mc = 1.0; - // add here for e tau cross trg - e_iso = PF03EAIsolationVal(elec, eventInfo->jet_rho()); - auto args_1 = std::vector{e_pt,e_eta,e_iso}; - auto args_1_noiso = std::vector{e_pt,e_eta}; - ele_trg = fns_["e_trg_binned_data"]->eval(args_1_noiso.data()); - if(!is_embedded_) ele_trg_mc = fns_["e_trg_binned_mc"]->eval(args_1_noiso.data()); - else ele_trg_mc = fns_["e_trg_binned_embed"]->eval(args_1.data()); - - double single_e_sf = ele_trg_mc>0 ? ele_trg / ele_trg_mc : 0.; - double t_dm = tau->decay_mode(); - auto args_2 = std::vector{e_pt,e_eta}; - auto args_3 = std::vector{t_pt,t_signed_eta,t_phi,t_dm}; - auto args_4 = std::vector{t_pt,t_dm}; - - double t_mvadm = tau->GetTauID(MVADM2017); - auto args_mvadm = std::vector{t_pt,t_mvadm}; - - double ele_xtrg = 1.; - double ele_xtrg_mc=1.; - double tau_trg_ic=1., tau_trg_mvadm=1., tau_trg_ic_data=1., tau_trg_mvadm_data=1., tau_trg_data=1., tau_trg_mvadm_mc=1.; - - double xtrg_et_sf_mvadm=1.; - - if(era_ == era::data_2017 || era_ == era::data_2017UL || era_ == era::data_2018 || era_ == era::data_2018UL || era_ == era::data_2022_preEE || era_ == era::data_2022_postEE) { - - ele_xtrg = fns_["e_crosstrg_data"]->eval(args_1.data()); - if(is_embedded_) ele_xtrg_mc = fns_["e_crosstrg_embed"]->eval(args_1.data()); - else ele_xtrg_mc = fns_["e_crosstrg_mc"]->eval(args_1.data()); - - if(is_embedded_) { - tau_trg_mc = 1.; - tau_trg = fns_["t_trg_30_embed_ratio"]->eval(args_3.data()); - tau_trg_data = fns_["t_trg_30_embed_data"]->eval(args_3.data()); - tau_trg_ic = fns_["t_trg_30_ic_embed_ratio"]->eval(args_4.data()); - tau_trg_mvadm = fns_["t_trg_30_ic_mvadm_embed_ratio"]->eval(args_mvadm.data()); - tau_trg_ic_data = fns_["t_trg_30_ic_embed_data"]->eval(args_4.data()); - tau_trg_mvadm_data = fns_["t_trg_30_ic_mvadm_embed_data"]->eval(args_mvadm.data()); - tau_trg_mvadm_mc = fns_["t_trg_30_ic_mvadm_embed"]->eval(args_mvadm.data()); - } - else { - tau_trg_mc = 1.; - tau_trg = fns_["t_trg_30_ratio"]->eval(args_4.data()); - tau_trg_ic = fns_["t_trg_30_ic_ratio"]->eval(args_4.data()); - tau_trg_mvadm = fns_["t_trg_30_ic_mvadm_ratio"]->eval(args_mvadm.data()); - tau_trg_mvadm_mc = fns_["t_trg_30_ic_mvadm_mc"]->eval(args_mvadm.data()); + if(era_ == era::data_2022_preEE || era_ == era::data_2022_postEE){ + // specify all Run-3 SF here + auto args_1 = std::vector{e_pt,e_eta}; + double ele_trg_sf = fns_["e_trg_ratio"]->eval(args_1.data()); + eventInfo->set_weight("trigger", ele_trg_sf); + event->Add("trigweight_1", ele_trg_sf); + event->Add("trigweight_2", double(1.0)); + } else { - } - xtrg_et_sf_mvadm = tau_trg_mvadm; + Tau const* tau = dynamic_cast(dilepton[0]->GetCandidate("lepton2")); + double e_iso = PF03IsolationVal(elec,0.5,0); + double t_pt = tau->pt(); + double t_signed_eta = tau->eta(); + double t_phi = tau->phi(); + double ele_trg = 1.0; + double tau_trg = 1.0; + double tau_trg_mc=1.; + double ele_trg_mc = 1.0; + // add here for e tau cross trg + e_iso = PF03EAIsolationVal(elec, eventInfo->jet_rho()); + auto args_1 = std::vector{e_pt,e_eta,e_iso}; + auto args_1_noiso = std::vector{e_pt,e_eta}; + ele_trg = fns_["e_trg_binned_data"]->eval(args_1_noiso.data()); + if(!is_embedded_) ele_trg_mc = fns_["e_trg_binned_mc"]->eval(args_1_noiso.data()); + else ele_trg_mc = fns_["e_trg_binned_embed"]->eval(args_1.data()); + + double single_e_sf = ele_trg_mc>0 ? ele_trg / ele_trg_mc : 0.; + double t_dm = tau->decay_mode(); + auto args_2 = std::vector{e_pt,e_eta}; + auto args_3 = std::vector{t_pt,t_signed_eta,t_phi,t_dm}; + auto args_4 = std::vector{t_pt,t_dm}; + + double t_mvadm = tau->GetTauID(MVADM2017); + auto args_mvadm = std::vector{t_pt,t_mvadm}; + + double ele_xtrg = 1.; + double ele_xtrg_mc=1.; + double tau_trg_ic=1., tau_trg_mvadm=1., tau_trg_ic_data=1., tau_trg_mvadm_data=1., tau_trg_data=1., tau_trg_mvadm_mc=1.; + + double xtrg_et_sf_mvadm=1.; + + if(era_ == era::data_2017 || era_ == era::data_2017UL || era_ == era::data_2018 || era_ == era::data_2018UL) { + + ele_xtrg = fns_["e_crosstrg_data"]->eval(args_1.data()); + if(is_embedded_) ele_xtrg_mc = fns_["e_crosstrg_embed"]->eval(args_1.data()); + else ele_xtrg_mc = fns_["e_crosstrg_mc"]->eval(args_1.data()); + + if(is_embedded_) { + tau_trg_mc = 1.; + tau_trg = fns_["t_trg_30_embed_ratio"]->eval(args_3.data()); + tau_trg_data = fns_["t_trg_30_embed_data"]->eval(args_3.data()); + tau_trg_ic = fns_["t_trg_30_ic_embed_ratio"]->eval(args_4.data()); + tau_trg_mvadm = fns_["t_trg_30_ic_mvadm_embed_ratio"]->eval(args_mvadm.data()); + tau_trg_ic_data = fns_["t_trg_30_ic_embed_data"]->eval(args_4.data()); + tau_trg_mvadm_data = fns_["t_trg_30_ic_mvadm_embed_data"]->eval(args_mvadm.data()); + tau_trg_mvadm_mc = fns_["t_trg_30_ic_mvadm_embed"]->eval(args_mvadm.data()); + } + else { + tau_trg_mc = 1.; + tau_trg = fns_["t_trg_30_ratio"]->eval(args_4.data()); + tau_trg_ic = fns_["t_trg_30_ic_ratio"]->eval(args_4.data()); + tau_trg_mvadm = fns_["t_trg_30_ic_mvadm_ratio"]->eval(args_mvadm.data()); + tau_trg_mvadm_mc = fns_["t_trg_30_ic_mvadm_mc"]->eval(args_mvadm.data()); - } + } + xtrg_et_sf_mvadm = tau_trg_mvadm; - double et_trg_or=1.; - //double cpdecay_sf = 1.; - if(era_ != era::data_2016 || era_ != era::data_2016UL_preVFP || era_ != era::data_2016UL_postVFP){ - et_trg_or = (ele_trg + (ele_xtrg - ele_trg)*tau_trg_mvadm_data)/(ele_trg_mc + (ele_xtrg_mc - ele_trg_mc)*tau_trg_mvadm_mc); - //eff(single-e) + (eff(e-leg, e-tau)-eff(single-e))*eff(tau-leg, e-tau) - } + } - double e_high_pt_cut=28.; - if(era_ == era::data_2018 || era_ == era::data_2018UL) e_high_pt_cut=33; + double et_trg_or=1.; + //double cpdecay_sf = 1.; + if(era_ != era::data_2016 || era_ != era::data_2016UL_preVFP || era_ != era::data_2016UL_postVFP){ + et_trg_or = (ele_trg + (ele_xtrg - ele_trg)*tau_trg_mvadm_data)/(ele_trg_mc + (ele_xtrg_mc - ele_trg_mc)*tau_trg_mvadm_mc); + //eff(single-e) + (eff(e-leg, e-tau)-eff(single-e))*eff(tau-leg, e-tau) + } - double xtrg_et_sf = (ele_xtrg_mc*tau_trg_mc) > 0 ? (ele_xtrg*tau_trg)/(ele_xtrg_mc*tau_trg_mc) : 0.0; + double e_high_pt_cut=28.; + if(era_ == era::data_2018 || era_ == era::data_2018UL) e_high_pt_cut=33; - double xtrg_OR_sf = (e_pt >= e_high_pt_cut) ? single_e_sf : xtrg_et_sf; + double xtrg_et_sf = (ele_xtrg_mc*tau_trg_mc) > 0 ? (ele_xtrg*tau_trg)/(ele_xtrg_mc*tau_trg_mc) : 0.0; - // if trigger is not applied in the MC then set the SF to the efficiency - if(!trg_applied_in_mc_) { - xtrg_et_sf = ele_xtrg*tau_trg; - xtrg_OR_sf = ele_trg*(1-tau_trg) + ele_xtrg*tau_trg; - single_e_sf = ele_trg; - } + double xtrg_OR_sf = (e_pt >= e_high_pt_cut) ? single_e_sf : xtrg_et_sf; - xtrg_et_sf_mvadm = ele_xtrg / ele_xtrg_mc *tau_trg_mvadm; - - if((era_ == era::data_2017 || era_ == era::data_2017UL) && is_embedded_ && e_pt<40 && fabs(e_eta)>1.479){ - // electron triggers in this eta/pT region don't work properly for the embedding in 2017 so set the SF to the data efficiency and have all events pass the trigger in HTTTriggerFilter - this works for the 2018 but needs to be checked for the 2016 legacy! - single_e_sf = ele_trg; - xtrg_et_sf = ele_xtrg*tau_trg_data; - xtrg_OR_sf = (e_pt >= e_high_pt_cut) ? single_e_sf : xtrg_et_sf; - tau_trg_ic = tau_trg_ic_data; - tau_trg_mvadm = tau_trg_mvadm_data; - xtrg_et_sf_mvadm = tau_trg_mvadm_data*ele_xtrg; - et_trg_or = ele_trg + (ele_xtrg - ele_trg)*tau_trg_mvadm_data; - } + // if trigger is not applied in the MC then set the SF to the efficiency + if(!trg_applied_in_mc_) { + xtrg_et_sf = ele_xtrg*tau_trg; + xtrg_OR_sf = ele_trg*(1-tau_trg) + ele_xtrg*tau_trg; + single_e_sf = ele_trg; + } + + xtrg_et_sf_mvadm = ele_xtrg / ele_xtrg_mc *tau_trg_mvadm; + + if((era_ == era::data_2017 || era_ == era::data_2017UL) && is_embedded_ && e_pt<40 && fabs(e_eta)>1.479){ + // electron triggers in this eta/pT region don't work properly for the embedding in 2017 so set the SF to the data efficiency and have all events pass the trigger in HTTTriggerFilter - this works for the 2018 but needs to be checked for the 2016 legacy! + single_e_sf = ele_trg; + xtrg_et_sf = ele_xtrg*tau_trg_data; + xtrg_OR_sf = (e_pt >= e_high_pt_cut) ? single_e_sf : xtrg_et_sf; + tau_trg_ic = tau_trg_ic_data; + tau_trg_mvadm = tau_trg_mvadm_data; + xtrg_et_sf_mvadm = tau_trg_mvadm_data*ele_xtrg; + et_trg_or = ele_trg + (ele_xtrg - ele_trg)*tau_trg_mvadm_data; + } - bool pass_single_offline = (e_pt>e_high_pt_cut); - bool pass_cross_offline = (t_pt>35); + bool pass_single_offline = (e_pt>e_high_pt_cut); + bool pass_cross_offline = (t_pt>35); - if (!pass_cross_offline) et_trg_or = single_e_sf; - else if(!pass_single_offline) et_trg_or = xtrg_et_sf_mvadm; + if (!pass_cross_offline) et_trg_or = single_e_sf; + else if(!pass_single_offline) et_trg_or = xtrg_et_sf_mvadm; - event->Add("et_trg_or",et_trg_or); - event->Add("et_trg_cross",xtrg_et_sf_mvadm); - event->Add("et_trg_single",single_e_sf); + event->Add("et_trg_or",et_trg_or); + event->Add("et_trg_cross",xtrg_et_sf_mvadm); + event->Add("et_trg_single",single_e_sf); - // for 2016 we only use the single electron trigger - if(era_ == era::data_2016 || era_ == era::data_2016UL_preVFP || era_ == era::data_2016UL_postVFP) { - xtrg_et_sf=0.; - xtrg_OR_sf=single_e_sf; - } + // for 2016 we only use the single electron trigger + if(era_ == era::data_2016 || era_ == era::data_2016UL_preVFP || era_ == era::data_2016UL_postVFP) { + xtrg_et_sf=0.; + xtrg_OR_sf=single_e_sf; + } - if(era_ != era::data_2016 || era_ != era::data_2016UL_preVFP || era_ != era::data_2016UL_postVFP) { - tau_trg_ic = (tau_trg==0) ? tau_trg_ic : tau_trg_ic/tau_trg; - tau_trg_mvadm = (tau_trg==0) ? tau_trg_mvadm : tau_trg_mvadm/tau_trg; - tau_trg_ic = (e_pt>=e_high_pt_cut) ? 1. : tau_trg_ic; - tau_trg_mvadm = (e_pt>=e_high_pt_cut) ? 1. : tau_trg_mvadm; - event->Add("wt_tau_trg_ic",tau_trg_ic); - event->Add("wt_tau_trg_mvadm",tau_trg_mvadm); - } else { - event->Add("wt_tau_trg_ic", 1.); - event->Add("wt_tau_trg_mvadm", 1.); - } + if(era_ != era::data_2016 || era_ != era::data_2016UL_preVFP || era_ != era::data_2016UL_postVFP) { + tau_trg_ic = (tau_trg==0) ? tau_trg_ic : tau_trg_ic/tau_trg; + tau_trg_mvadm = (tau_trg==0) ? tau_trg_mvadm : tau_trg_mvadm/tau_trg; + tau_trg_ic = (e_pt>=e_high_pt_cut) ? 1. : tau_trg_ic; + tau_trg_mvadm = (e_pt>=e_high_pt_cut) ? 1. : tau_trg_mvadm; + event->Add("wt_tau_trg_ic",tau_trg_ic); + event->Add("wt_tau_trg_mvadm",tau_trg_mvadm); + } else { + event->Add("wt_tau_trg_ic", 1.); + event->Add("wt_tau_trg_mvadm", 1.); + } - eventInfo->set_weight("trigger", xtrg_OR_sf, false); + eventInfo->set_weight("trigger", xtrg_OR_sf, false); - std::vector args_etau = std::vector{e_pt,e_eta,e_iso,t_pt,t_dm,t_signed_eta}; - std::string extra = ""; - if(is_embedded_){ - args_etau = std::vector{e_pt,e_eta,e_iso,t_pt,t_dm,t_signed_eta,t_phi}; - extra="_embed"; - } + std::vector args_etau = std::vector{e_pt,e_eta,e_iso,t_pt,t_dm,t_signed_eta}; + std::string extra = ""; + if(is_embedded_){ + args_etau = std::vector{e_pt,e_eta,e_iso,t_pt,t_dm,t_signed_eta,t_phi}; + extra="_embed"; + } - if(era_ == era::data_2017 || era_ == era::data_2017UL){ - // in 2017 these is an additional factor recommended by the EGammas POG to correct electron triggers - xtrg_OR_sf*=0.991; - single_e_sf*=0.991; - xtrg_et_sf*=0.991; - } + if(era_ == era::data_2017 || era_ == era::data_2017UL){ + // in 2017 these is an additional factor recommended by the EGammas POG to correct electron triggers + xtrg_OR_sf*=0.991; + single_e_sf*=0.991; + xtrg_et_sf*=0.991; + } - std::vector systs = {"_crosslep_up","_crosslep_down","_singlelep_up","_singlelep_down","_singletau_up","_singletau_down","_dm0_up","_dm0_down","_dm1_up","_dm1_down","_dm10_up","_dm10_down","_dm11_up","_dm11_down"}; + std::vector systs = {"_crosslep_up","_crosslep_down","_singlelep_up","_singlelep_down","_singletau_up","_singletau_down","_dm0_up","_dm0_down","_dm1_up","_dm1_down","_dm10_up","_dm10_down","_dm11_up","_dm11_down"}; - double wt_tau_trg_mssm = fns_["et_trg"+extra+"_ratio"]->eval(args_etau.data()); - eventInfo->set_weight("et_triggerweight_ic", wt_tau_trg_mssm, false); - event->Add("wt_tau_trg_mssm", xtrg_OR_sf > 0. ? wt_tau_trg_mssm/xtrg_OR_sf : 0.); - for (auto s: systs) { - double wt_tau_trg_mssm_syst = fns_["et_trg"+extra+"_ratio"+s]->eval(args_etau.data()); - event->Add("wt_tau_trg_mssm"+s, wt_tau_trg_mssm > 0. ? wt_tau_trg_mssm_syst/wt_tau_trg_mssm : 0.); - } - event->Add("wt_tau_trg_mssm_doubleonly", 1.); - - double trigweight_up=1., trigweight_down=1.; - double tau_trg_dm0_up=1.; - double tau_trg_dm1_up=1.; - double tau_trg_dm10_up=1.; - double tau_trg_dm11_up=1.; - double tau_trg_dm0_down=1.; - double tau_trg_dm1_down=1.; - double tau_trg_dm10_down=1.; - double tau_trg_dm11_down=1.; + double wt_tau_trg_mssm = fns_["et_trg"+extra+"_ratio"]->eval(args_etau.data()); + eventInfo->set_weight("et_triggerweight_ic", wt_tau_trg_mssm, false); + event->Add("wt_tau_trg_mssm", xtrg_OR_sf > 0. ? wt_tau_trg_mssm/xtrg_OR_sf : 0.); + for (auto s: systs) { + double wt_tau_trg_mssm_syst = fns_["et_trg"+extra+"_ratio"+s]->eval(args_etau.data()); + event->Add("wt_tau_trg_mssm"+s, wt_tau_trg_mssm > 0. ? wt_tau_trg_mssm_syst/wt_tau_trg_mssm : 0.); + } + event->Add("wt_tau_trg_mssm_doubleonly", 1.); + + double trigweight_up=1., trigweight_down=1.; + double tau_trg_dm0_up=1.; + double tau_trg_dm1_up=1.; + double tau_trg_dm10_up=1.; + double tau_trg_dm11_up=1.; + double tau_trg_dm0_down=1.; + double tau_trg_dm1_down=1.; + double tau_trg_dm10_down=1.; + double tau_trg_dm11_down=1.; + + double tau_trg_mvadm0_up=1; + double tau_trg_mvadm1_up=1; + double tau_trg_mvadm2_up=1; + double tau_trg_mvadm10_up=1; + double tau_trg_mvadm11_up=1; + double tau_trg_mvadm0_down=1; + double tau_trg_mvadm1_down=1; + double tau_trg_mvadm2_down=1; + double tau_trg_mvadm10_down=1; + double tau_trg_mvadm11_down=1; + + + if(era_ == era::data_2017 || era_ == era::data_2017UL || era_ == era::data_2018 || era_ == era::data_2018UL) { + + if(e_pteval(args_4.data())>0){ + tau_trg_dm0_up=fns_["t_trg_30_ratio_dm0_up"]->eval(args_4.data())/fns_["t_trg_30_ratio"]->eval(args_4.data()); + tau_trg_dm1_up=fns_["t_trg_30_ratio_dm1_up"]->eval(args_4.data())/fns_["t_trg_30_ratio"]->eval(args_4.data()); + tau_trg_dm10_up=fns_["t_trg_30_ratio_dm10_up"]->eval(args_4.data())/fns_["t_trg_30_ratio"]->eval(args_4.data()); + tau_trg_dm11_up=fns_["t_trg_30_ratio_dm11_up"]->eval(args_4.data())/fns_["t_trg_30_ratio"]->eval(args_4.data()); + tau_trg_dm0_down=fns_["t_trg_30_ratio_dm0_down"]->eval(args_4.data())/fns_["t_trg_30_ratio"]->eval(args_4.data()); + tau_trg_dm1_down=fns_["t_trg_30_ratio_dm1_down"]->eval(args_4.data())/fns_["t_trg_30_ratio"]->eval(args_4.data()); + tau_trg_dm10_down=fns_["t_trg_30_ratio_dm10_down"]->eval(args_4.data())/fns_["t_trg_30_ratio"]->eval(args_4.data()); + tau_trg_dm11_down=fns_["t_trg_30_ratio_dm11_down"]->eval(args_4.data())/fns_["t_trg_30_ratio"]->eval(args_4.data()); + } + if(fns_["t_trg_30_ic_mvadm_ratio"]->eval(args_mvadm.data())>0){ + tau_trg_mvadm0_up =fns_["t_trg_30_ic_mvadm_ratio_mvadm0_up"]->eval(args_mvadm.data()) /fns_["t_trg_30_ic_mvadm_ratio"]->eval(args_mvadm.data()); + tau_trg_mvadm1_up =fns_["t_trg_30_ic_mvadm_ratio_mvadm1_up"]->eval(args_mvadm.data()) /fns_["t_trg_30_ic_mvadm_ratio"]->eval(args_mvadm.data()); + tau_trg_mvadm2_up =fns_["t_trg_30_ic_mvadm_ratio_mvadm2_up"]->eval(args_mvadm.data()) /fns_["t_trg_30_ic_mvadm_ratio"]->eval(args_mvadm.data()); + tau_trg_mvadm10_up =fns_["t_trg_30_ic_mvadm_ratio_mvadm10_up"]->eval(args_mvadm.data()) /fns_["t_trg_30_ic_mvadm_ratio"]->eval(args_mvadm.data()); + tau_trg_mvadm11_up =fns_["t_trg_30_ic_mvadm_ratio_mvadm11_up"]->eval(args_mvadm.data()) /fns_["t_trg_30_ic_mvadm_ratio"]->eval(args_mvadm.data()); + tau_trg_mvadm0_down =fns_["t_trg_30_ic_mvadm_ratio_mvadm0_down"]->eval(args_mvadm.data()) /fns_["t_trg_30_ic_mvadm_ratio"]->eval(args_mvadm.data()); + tau_trg_mvadm1_down =fns_["t_trg_30_ic_mvadm_ratio_mvadm1_down"]->eval(args_mvadm.data()) /fns_["t_trg_30_ic_mvadm_ratio"]->eval(args_mvadm.data()); + tau_trg_mvadm2_down =fns_["t_trg_30_ic_mvadm_ratio_mvadm2_down"]->eval(args_mvadm.data()) /fns_["t_trg_30_ic_mvadm_ratio"]->eval(args_mvadm.data()); + tau_trg_mvadm10_down=fns_["t_trg_30_ic_mvadm_ratio_mvadm10_down"]->eval(args_mvadm.data())/fns_["t_trg_30_ic_mvadm_ratio"]->eval(args_mvadm.data()); + tau_trg_mvadm11_down=fns_["t_trg_30_ic_mvadm_ratio_mvadm11_down"]->eval(args_mvadm.data())/fns_["t_trg_30_ic_mvadm_ratio"]->eval(args_mvadm.data()); + } + + } else { + if(fns_["t_trg_30_embed_ratio"]->eval(args_3.data())>0) { + tau_trg_dm0_up=fns_["t_trg_30_embed_ratio_dm0_up"]->eval(args_3.data())/fns_["t_trg_30_embed_ratio"]->eval(args_3.data()); + tau_trg_dm1_up=fns_["t_trg_30_embed_ratio_dm1_up"]->eval(args_3.data())/fns_["t_trg_30_embed_ratio"]->eval(args_3.data()); + tau_trg_dm10_up=fns_["t_trg_30_embed_ratio_dm10_up"]->eval(args_3.data())/fns_["t_trg_30_embed_ratio"]->eval(args_3.data()); + tau_trg_dm11_up=fns_["t_trg_30_embed_ratio_dm11_up"]->eval(args_3.data())/fns_["t_trg_30_embed_ratio"]->eval(args_3.data()); + tau_trg_dm0_down=fns_["t_trg_30_embed_ratio_dm0_down"]->eval(args_3.data())/fns_["t_trg_30_embed_ratio"]->eval(args_3.data()); + tau_trg_dm1_down=fns_["t_trg_30_embed_ratio_dm1_down"]->eval(args_3.data())/fns_["t_trg_30_embed_ratio"]->eval(args_3.data()); + tau_trg_dm10_down=fns_["t_trg_30_embed_ratio_dm10_down"]->eval(args_3.data())/fns_["t_trg_30_embed_ratio"]->eval(args_3.data()); + tau_trg_dm11_down=fns_["t_trg_30_embed_ratio_dm11_down"]->eval(args_3.data())/fns_["t_trg_30_embed_ratio"]->eval(args_3.data()); + } + if(fns_["t_trg_30_ic_mvadm_embed_ratio"]->eval(args_mvadm.data())>0){ + tau_trg_mvadm0_up =fns_["t_trg_30_ic_mvadm_embed_ratio_mvadm0_up"]->eval(args_mvadm.data()) /fns_["t_trg_30_ic_mvadm_embed_ratio"]->eval(args_mvadm.data()); + tau_trg_mvadm1_up =fns_["t_trg_30_ic_mvadm_embed_ratio_mvadm1_up"]->eval(args_mvadm.data()) /fns_["t_trg_30_ic_mvadm_embed_ratio"]->eval(args_mvadm.data()); + tau_trg_mvadm2_up =fns_["t_trg_30_ic_mvadm_embed_ratio_mvadm2_up"]->eval(args_mvadm.data()) /fns_["t_trg_30_ic_mvadm_embed_ratio"]->eval(args_mvadm.data()); + tau_trg_mvadm10_up =fns_["t_trg_30_ic_mvadm_embed_ratio_mvadm10_up"]->eval(args_mvadm.data()) /fns_["t_trg_30_ic_mvadm_embed_ratio"]->eval(args_mvadm.data()); + tau_trg_mvadm11_up =fns_["t_trg_30_ic_mvadm_embed_ratio_mvadm11_up"]->eval(args_mvadm.data()) /fns_["t_trg_30_ic_mvadm_embed_ratio"]->eval(args_mvadm.data()); + tau_trg_mvadm0_down =fns_["t_trg_30_ic_mvadm_embed_ratio_mvadm0_down"]->eval(args_mvadm.data()) /fns_["t_trg_30_ic_mvadm_embed_ratio"]->eval(args_mvadm.data()); + tau_trg_mvadm1_down =fns_["t_trg_30_ic_mvadm_embed_ratio_mvadm1_down"]->eval(args_mvadm.data()) /fns_["t_trg_30_ic_mvadm_embed_ratio"]->eval(args_mvadm.data()); + tau_trg_mvadm2_down =fns_["t_trg_30_ic_mvadm_embed_ratio_mvadm2_down"]->eval(args_mvadm.data()) /fns_["t_trg_30_ic_mvadm_embed_ratio"]->eval(args_mvadm.data()); + tau_trg_mvadm10_down=fns_["t_trg_30_ic_mvadm_embed_ratio_mvadm10_down"]->eval(args_mvadm.data())/fns_["t_trg_30_ic_mvadm_embed_ratio"]->eval(args_mvadm.data()); + tau_trg_mvadm11_down=fns_["t_trg_30_ic_mvadm_embed_ratio_mvadm11_down"]->eval(args_mvadm.data())/fns_["t_trg_30_ic_mvadm_embed_ratio"]->eval(args_mvadm.data()); + } + } + } - double tau_trg_mvadm0_up=1; - double tau_trg_mvadm1_up=1; - double tau_trg_mvadm2_up=1; - double tau_trg_mvadm10_up=1; - double tau_trg_mvadm11_up=1; - double tau_trg_mvadm0_down=1; - double tau_trg_mvadm1_down=1; - double tau_trg_mvadm2_down=1; - double tau_trg_mvadm10_down=1; - double tau_trg_mvadm11_down=1; + tau_trg_dm0_up = std::isnan(tau_trg_dm0_up) ? 0 : tau_trg_dm0_up; + tau_trg_dm0_down = std::isnan(tau_trg_dm0_down) ? 0 : tau_trg_dm0_down; + tau_trg_dm1_up = std::isnan(tau_trg_dm1_up) ? 0 : tau_trg_dm1_up; + tau_trg_dm1_down = std::isnan(tau_trg_dm1_down) ? 0 : tau_trg_dm1_down; + tau_trg_dm10_up = std::isnan(tau_trg_dm10_up) ? 0 : tau_trg_dm10_up; + tau_trg_dm10_down = std::isnan(tau_trg_dm10_down) ? 0 : tau_trg_dm10_down; + tau_trg_dm11_up = std::isnan(tau_trg_dm11_up) ? 0 : tau_trg_dm11_up; + tau_trg_dm11_down = std::isnan(tau_trg_dm11_down) ? 0 : tau_trg_dm11_down; + + tau_trg_mvadm0_up = std::isnan(tau_trg_mvadm0_up) ? 0 : tau_trg_mvadm0_up; + tau_trg_mvadm0_down = std::isnan(tau_trg_mvadm0_down) ? 0 : tau_trg_mvadm0_down; + tau_trg_mvadm1_up = std::isnan(tau_trg_mvadm1_up) ? 0 : tau_trg_mvadm1_up; + tau_trg_mvadm1_down = std::isnan(tau_trg_mvadm1_down) ? 0 : tau_trg_mvadm1_down; + tau_trg_mvadm2_up = std::isnan(tau_trg_mvadm2_up) ? 0 : tau_trg_mvadm2_up; + tau_trg_mvadm2_down = std::isnan(tau_trg_mvadm2_down) ? 0 : tau_trg_mvadm2_down; + tau_trg_mvadm10_up = std::isnan(tau_trg_mvadm10_up) ? 0 : tau_trg_mvadm10_up; + tau_trg_mvadm10_down = std::isnan(tau_trg_mvadm10_down) ? 0 : tau_trg_mvadm10_down; + tau_trg_mvadm11_up = std::isnan(tau_trg_mvadm11_up) ? 0 : tau_trg_mvadm11_up; + tau_trg_mvadm11_down = std::isnan(tau_trg_mvadm11_down) ? 0 : tau_trg_mvadm11_down; + + event->Add("wt_tau_trg_dm0_up",tau_trg_dm0_up); + event->Add("wt_tau_trg_dm1_up",tau_trg_dm1_up); + event->Add("wt_tau_trg_dm10_up",tau_trg_dm10_up); + event->Add("wt_tau_trg_dm11_up",tau_trg_dm11_up); + event->Add("wt_tau_trg_dm0_down",tau_trg_dm0_down); + event->Add("wt_tau_trg_dm1_down",tau_trg_dm1_down); + event->Add("wt_tau_trg_dm10_down",tau_trg_dm10_down); + event->Add("wt_tau_trg_dm11_down",tau_trg_dm11_down); + + event->Add("wt_tau_trg_mvadm0_up" ,tau_trg_mvadm0_up); + event->Add("wt_tau_trg_mvadm1_up" ,tau_trg_mvadm1_up); + event->Add("wt_tau_trg_mvadm2_up" ,tau_trg_mvadm2_up); + event->Add("wt_tau_trg_mvadm10_up" ,tau_trg_mvadm10_up); + event->Add("wt_tau_trg_mvadm11_up" ,tau_trg_mvadm11_up); + event->Add("wt_tau_trg_mvadm0_down" ,tau_trg_mvadm0_down); + event->Add("wt_tau_trg_mvadm1_down" ,tau_trg_mvadm1_down); + event->Add("wt_tau_trg_mvadm2_down" ,tau_trg_mvadm2_down); + event->Add("wt_tau_trg_mvadm10_down",tau_trg_mvadm10_down); + event->Add("wt_tau_trg_mvadm11_down",tau_trg_mvadm11_down); + + } + + event->Add("trigweight_up", trigweight_up); + event->Add("trigweight_down", trigweight_down); + // have xtrg OR as default but save others to check + event->Add("single_l_sf", xtrg_OR_sf==0 ? single_e_sf : single_e_sf/xtrg_OR_sf ); + event->Add("xtrg_sf", xtrg_OR_sf==0 ? xtrg_et_sf : xtrg_et_sf/xtrg_OR_sf); - if(era_ == era::data_2017 || era_ == era::data_2017UL || era_ == era::data_2018 || era_ == era::data_2018UL) { + ele_trg = xtrg_OR_sf; + ele_trg_mc = 1.0; - if(e_pt2) ele_trg=2; + weight *= (ele_trg * tau_trg); + event->Add("trigweight_1", ele_trg); + event->Add("trigweight_2", xtrg_et_sf_mvadm); + } + } else if (channel_ == channel::mt) { + Muon const* muon = dynamic_cast(dilepton[0]->GetCandidate("lepton1")); + double pt = muon->pt(); + double m_eta = fabs(muon->eta()); + if(era_ == era::data_2022_preEE || era_ == era::data_2022_postEE){ + // specify all Run-3 SF here + auto args_1 = std::vector{pt,m_eta}; + double mu_trg_sf = fns_["m_trg_ratio"]->eval(args_1.data()); + eventInfo->set_weight("trigger", mu_trg_sf); + event->Add("trigweight_1", mu_trg_sf); + event->Add("trigweight_2", double(1.0)); + } else { + + double m_signed_eta = muon->eta(); + double m_iso = PF04IsolationVal(muon, 0.5, 0); + Tau const* tau = dynamic_cast(dilepton[0]->GetCandidate("lepton2")); + double t_pt = tau->pt(); + double t_signed_eta = tau->eta(); + double t_phi = tau->phi(); + double mu_trg = 1.0; + double tau_trg = 1.0; + double mu_trg_mc = 1.0; + double tau_trg_mc = 1.0; + auto args_1 = std::vector{pt,m_signed_eta,m_iso}; + auto args_1_noiso = std::vector{pt,m_signed_eta}; + mu_trg = fns_["m_trg_binned_data"]->eval(args_1_noiso.data()); + if(!is_embedded_) mu_trg_mc = fns_["m_trg_binned_mc"]->eval(args_1_noiso.data()); + else mu_trg_mc = fns_["m_trg_binned_embed"]->eval(args_1.data()); + double single_m_sf = mu_trg / mu_trg_mc; + double t_dm = tau->decay_mode(); + auto args_2 = std::vector{pt,m_signed_eta}; + auto args_3 = std::vector{t_pt,t_signed_eta,t_phi,t_dm}; + auto args_4 = std::vector{t_pt,t_dm}; + double t_mvadm = tau->GetTauID(MVADM2017); + auto args_mvadm = std::vector{t_pt,t_mvadm}; + + double m_high_pt_cut = 25; + if(era_ == era::data_2016 || era_ == era::data_2016UL_preVFP || era_ == era::data_2016UL_postVFP) m_high_pt_cut = 23; + + double mu_xtrg = fns_["m_crosstrg_data"]->eval(args_1.data()); + double mu_xtrg_mc; + if(is_embedded_) mu_xtrg_mc = fns_["m_crosstrg_embed"]->eval(args_2.data()); + else mu_xtrg_mc = fns_["m_crosstrg_mc"]->eval(args_2.data()); + + double tau_trg_ic=1., tau_trg_mvadm=1.; + + if(is_embedded_) { + tau_trg_mc = 1.; + tau_trg = fns_["t_trg_27_embed_ratio"]->eval(args_3.data()); + tau_trg_ic = fns_["t_trg_27_ic_embed_ratio"]->eval(args_4.data()); + tau_trg_mvadm = fns_["t_trg_27_ic_mvadm_embed_ratio"]->eval(args_mvadm.data()); + + } + else { + tau_trg_mc = 1.; + tau_trg = fns_["t_trg_27_ratio"]->eval(args_4.data()); + tau_trg_ic = fns_["t_trg_27_ic_ratio"]->eval(args_4.data()); + tau_trg_mvadm = fns_["t_trg_27_ic_mvadm_ratio"]->eval(args_mvadm.data()); + } + + double xtrg_mt_sf = (mu_xtrg_mc*tau_trg_mc) > 0 ? (mu_xtrg*tau_trg)/(mu_xtrg_mc*tau_trg_mc) : 0.0; + + double xtrg_OR_sf = (pt>=m_high_pt_cut) ? single_m_sf : xtrg_mt_sf ; + + // if trigger is not applied in the MC then set the SF to the efficiency + if(!trg_applied_in_mc_) { + xtrg_mt_sf = mu_xtrg*tau_trg; + xtrg_OR_sf = mu_trg*(1-tau_trg) + mu_xtrg*tau_trg; + single_m_sf = mu_trg; + } + // Tau Leg Scale Factor + double tau_trg_tt_leg; + tau_trg_tt_leg = fns_["t_trg_35_ratio"]->eval(args_4.data()); + event->Add("tau_leg_SF", tau_trg_tt_leg); + std::vector args_mutau = std::vector{pt,m_signed_eta,m_iso,t_pt,t_dm,t_signed_eta}; + std::string extra = ""; + if(is_embedded_){ + args_mutau = std::vector{pt,m_signed_eta,m_iso,t_pt,t_dm,t_signed_eta,t_phi}; + extra="_embed"; + } + + std::vector systs = {"_crosslep_up","_crosslep_down","_singlelep_up","_singlelep_down","_singletau_up","_singletau_down","_dm0_up","_dm0_down","_dm1_up","_dm1_down","_dm10_up","_dm10_down","_dm11_up","_dm11_down"}; + + double wt_tau_trg_mssm = fns_["mt_trg"+extra+"_ratio"]->eval(args_mutau.data()); + eventInfo->set_weight("mt_triggerweight_ic", wt_tau_trg_mssm, false); + event->Add("wt_tau_trg_mssm", xtrg_OR_sf > 0. ? wt_tau_trg_mssm/xtrg_OR_sf : 0.); + for (auto s: systs) { + double wt_tau_trg_mssm_syst = fns_["mt_trg"+extra+"_ratio"+s]->eval(args_mutau.data()); + event->Add("wt_tau_trg_mssm"+s, wt_tau_trg_mssm > 0. ? wt_tau_trg_mssm_syst/wt_tau_trg_mssm : 0.); + } + event->Add("wt_tau_trg_mssm_doubleonly", 1.); + + tau_trg_ic = (tau_trg==0) ? tau_trg_ic : tau_trg_ic/tau_trg; + tau_trg_mvadm = (tau_trg==0) ? tau_trg_mvadm : tau_trg_mvadm/tau_trg; + tau_trg_ic = (pt>=m_high_pt_cut) ? 1. : tau_trg_ic; + tau_trg_mvadm = (pt>=m_high_pt_cut) ? 1. : tau_trg_mvadm; + + event->Add("wt_tau_trg_ic",tau_trg_ic); + event->Add("wt_tau_trg_mvadm",tau_trg_mvadm); + + double tau_trg_dm0_up=1.; + double tau_trg_dm1_up=1.; + double tau_trg_dm10_up=1.; + double tau_trg_dm11_up=1.; + double tau_trg_dm0_down=1.; + double tau_trg_dm1_down=1.; + double tau_trg_dm10_down=1.; + double tau_trg_dm11_down=1.; + + double tau_trg_mvadm0_up=1.; + double tau_trg_mvadm1_up=1.; + double tau_trg_mvadm2_up=1.; + double tau_trg_mvadm10_up=1.; + double tau_trg_mvadm11_up=1.; + double tau_trg_mvadm0_down=1.; + double tau_trg_mvadm1_down=1.; + double tau_trg_mvadm2_down=1.; + double tau_trg_mvadm10_down=1.; + double tau_trg_mvadm11_down=1.; + + if(pteval(args_4.data())>0){ - tau_trg_dm0_up=fns_["t_trg_30_ratio_dm0_up"]->eval(args_4.data())/fns_["t_trg_30_ratio"]->eval(args_4.data()); - tau_trg_dm1_up=fns_["t_trg_30_ratio_dm1_up"]->eval(args_4.data())/fns_["t_trg_30_ratio"]->eval(args_4.data()); - tau_trg_dm10_up=fns_["t_trg_30_ratio_dm10_up"]->eval(args_4.data())/fns_["t_trg_30_ratio"]->eval(args_4.data()); - tau_trg_dm11_up=fns_["t_trg_30_ratio_dm11_up"]->eval(args_4.data())/fns_["t_trg_30_ratio"]->eval(args_4.data()); - tau_trg_dm0_down=fns_["t_trg_30_ratio_dm0_down"]->eval(args_4.data())/fns_["t_trg_30_ratio"]->eval(args_4.data()); - tau_trg_dm1_down=fns_["t_trg_30_ratio_dm1_down"]->eval(args_4.data())/fns_["t_trg_30_ratio"]->eval(args_4.data()); - tau_trg_dm10_down=fns_["t_trg_30_ratio_dm10_down"]->eval(args_4.data())/fns_["t_trg_30_ratio"]->eval(args_4.data()); - tau_trg_dm11_down=fns_["t_trg_30_ratio_dm11_down"]->eval(args_4.data())/fns_["t_trg_30_ratio"]->eval(args_4.data()); + if(fns_["t_trg_27_ratio"]->eval(args_4.data())>0){ + tau_trg_dm0_up=fns_["t_trg_27_ratio_dm0_up"]->eval(args_4.data())/fns_["t_trg_27_ratio"]->eval(args_4.data()); + tau_trg_dm1_up=fns_["t_trg_27_ratio_dm1_up"]->eval(args_4.data())/fns_["t_trg_27_ratio"]->eval(args_4.data()); + tau_trg_dm10_up=fns_["t_trg_27_ratio_dm10_up"]->eval(args_4.data())/fns_["t_trg_27_ratio"]->eval(args_4.data()); + tau_trg_dm11_up=fns_["t_trg_27_ratio_dm11_up"]->eval(args_4.data())/fns_["t_trg_27_ratio"]->eval(args_4.data()); + tau_trg_dm0_down=fns_["t_trg_27_ratio_dm0_down"]->eval(args_4.data())/fns_["t_trg_27_ratio"]->eval(args_4.data()); + tau_trg_dm1_down=fns_["t_trg_27_ratio_dm1_down"]->eval(args_4.data())/fns_["t_trg_27_ratio"]->eval(args_4.data()); + tau_trg_dm10_down=fns_["t_trg_27_ratio_dm10_down"]->eval(args_4.data())/fns_["t_trg_27_ratio"]->eval(args_4.data()); + tau_trg_dm11_down=fns_["t_trg_27_ratio_dm11_down"]->eval(args_4.data())/fns_["t_trg_27_ratio"]->eval(args_4.data()); } - if(fns_["t_trg_30_ic_mvadm_ratio"]->eval(args_mvadm.data())>0){ - tau_trg_mvadm0_up =fns_["t_trg_30_ic_mvadm_ratio_mvadm0_up"]->eval(args_mvadm.data()) /fns_["t_trg_30_ic_mvadm_ratio"]->eval(args_mvadm.data()); - tau_trg_mvadm1_up =fns_["t_trg_30_ic_mvadm_ratio_mvadm1_up"]->eval(args_mvadm.data()) /fns_["t_trg_30_ic_mvadm_ratio"]->eval(args_mvadm.data()); - tau_trg_mvadm2_up =fns_["t_trg_30_ic_mvadm_ratio_mvadm2_up"]->eval(args_mvadm.data()) /fns_["t_trg_30_ic_mvadm_ratio"]->eval(args_mvadm.data()); - tau_trg_mvadm10_up =fns_["t_trg_30_ic_mvadm_ratio_mvadm10_up"]->eval(args_mvadm.data()) /fns_["t_trg_30_ic_mvadm_ratio"]->eval(args_mvadm.data()); - tau_trg_mvadm11_up =fns_["t_trg_30_ic_mvadm_ratio_mvadm11_up"]->eval(args_mvadm.data()) /fns_["t_trg_30_ic_mvadm_ratio"]->eval(args_mvadm.data()); - tau_trg_mvadm0_down =fns_["t_trg_30_ic_mvadm_ratio_mvadm0_down"]->eval(args_mvadm.data()) /fns_["t_trg_30_ic_mvadm_ratio"]->eval(args_mvadm.data()); - tau_trg_mvadm1_down =fns_["t_trg_30_ic_mvadm_ratio_mvadm1_down"]->eval(args_mvadm.data()) /fns_["t_trg_30_ic_mvadm_ratio"]->eval(args_mvadm.data()); - tau_trg_mvadm2_down =fns_["t_trg_30_ic_mvadm_ratio_mvadm2_down"]->eval(args_mvadm.data()) /fns_["t_trg_30_ic_mvadm_ratio"]->eval(args_mvadm.data()); - tau_trg_mvadm10_down=fns_["t_trg_30_ic_mvadm_ratio_mvadm10_down"]->eval(args_mvadm.data())/fns_["t_trg_30_ic_mvadm_ratio"]->eval(args_mvadm.data()); - tau_trg_mvadm11_down=fns_["t_trg_30_ic_mvadm_ratio_mvadm11_down"]->eval(args_mvadm.data())/fns_["t_trg_30_ic_mvadm_ratio"]->eval(args_mvadm.data()); + if(fns_["t_trg_27_ic_mvadm_ratio"]->eval(args_mvadm.data())>0){ + tau_trg_mvadm0_up =fns_["t_trg_27_ic_mvadm_ratio_mvadm0_up"]->eval(args_mvadm.data()) /fns_["t_trg_27_ic_mvadm_ratio"]->eval(args_mvadm.data()); + tau_trg_mvadm1_up =fns_["t_trg_27_ic_mvadm_ratio_mvadm1_up"]->eval(args_mvadm.data()) /fns_["t_trg_27_ic_mvadm_ratio"]->eval(args_mvadm.data()); + tau_trg_mvadm2_up =fns_["t_trg_27_ic_mvadm_ratio_mvadm2_up"]->eval(args_mvadm.data()) /fns_["t_trg_27_ic_mvadm_ratio"]->eval(args_mvadm.data()); + tau_trg_mvadm10_up =fns_["t_trg_27_ic_mvadm_ratio_mvadm10_up"]->eval(args_mvadm.data()) /fns_["t_trg_27_ic_mvadm_ratio"]->eval(args_mvadm.data()); + tau_trg_mvadm11_up =fns_["t_trg_27_ic_mvadm_ratio_mvadm11_up"]->eval(args_mvadm.data()) /fns_["t_trg_27_ic_mvadm_ratio"]->eval(args_mvadm.data()); + tau_trg_mvadm0_down =fns_["t_trg_27_ic_mvadm_ratio_mvadm0_down"]->eval(args_mvadm.data()) /fns_["t_trg_27_ic_mvadm_ratio"]->eval(args_mvadm.data()); + tau_trg_mvadm1_down =fns_["t_trg_27_ic_mvadm_ratio_mvadm1_down"]->eval(args_mvadm.data()) /fns_["t_trg_27_ic_mvadm_ratio"]->eval(args_mvadm.data()); + tau_trg_mvadm2_down =fns_["t_trg_27_ic_mvadm_ratio_mvadm2_down"]->eval(args_mvadm.data()) /fns_["t_trg_27_ic_mvadm_ratio"]->eval(args_mvadm.data()); + tau_trg_mvadm10_down=fns_["t_trg_27_ic_mvadm_ratio_mvadm10_down"]->eval(args_mvadm.data())/fns_["t_trg_27_ic_mvadm_ratio"]->eval(args_mvadm.data()); + tau_trg_mvadm11_down=fns_["t_trg_27_ic_mvadm_ratio_mvadm11_down"]->eval(args_mvadm.data())/fns_["t_trg_27_ic_mvadm_ratio"]->eval(args_mvadm.data()); } - + } else { - if(fns_["t_trg_30_embed_ratio"]->eval(args_3.data())>0) { - tau_trg_dm0_up=fns_["t_trg_30_embed_ratio_dm0_up"]->eval(args_3.data())/fns_["t_trg_30_embed_ratio"]->eval(args_3.data()); - tau_trg_dm1_up=fns_["t_trg_30_embed_ratio_dm1_up"]->eval(args_3.data())/fns_["t_trg_30_embed_ratio"]->eval(args_3.data()); - tau_trg_dm10_up=fns_["t_trg_30_embed_ratio_dm10_up"]->eval(args_3.data())/fns_["t_trg_30_embed_ratio"]->eval(args_3.data()); - tau_trg_dm11_up=fns_["t_trg_30_embed_ratio_dm11_up"]->eval(args_3.data())/fns_["t_trg_30_embed_ratio"]->eval(args_3.data()); - tau_trg_dm0_down=fns_["t_trg_30_embed_ratio_dm0_down"]->eval(args_3.data())/fns_["t_trg_30_embed_ratio"]->eval(args_3.data()); - tau_trg_dm1_down=fns_["t_trg_30_embed_ratio_dm1_down"]->eval(args_3.data())/fns_["t_trg_30_embed_ratio"]->eval(args_3.data()); - tau_trg_dm10_down=fns_["t_trg_30_embed_ratio_dm10_down"]->eval(args_3.data())/fns_["t_trg_30_embed_ratio"]->eval(args_3.data()); - tau_trg_dm11_down=fns_["t_trg_30_embed_ratio_dm11_down"]->eval(args_3.data())/fns_["t_trg_30_embed_ratio"]->eval(args_3.data()); + if(fns_["t_trg_27_embed_ratio"]->eval(args_3.data())>0) { + tau_trg_dm0_up=fns_["t_trg_27_embed_ratio_dm0_up"]->eval(args_3.data())/fns_["t_trg_27_embed_ratio"]->eval(args_3.data()); + tau_trg_dm1_up=fns_["t_trg_27_embed_ratio_dm1_up"]->eval(args_3.data())/fns_["t_trg_27_embed_ratio"]->eval(args_3.data()); + tau_trg_dm10_up=fns_["t_trg_27_embed_ratio_dm10_up"]->eval(args_3.data())/fns_["t_trg_27_embed_ratio"]->eval(args_3.data()); + tau_trg_dm11_up=fns_["t_trg_27_embed_ratio_dm11_up"]->eval(args_3.data())/fns_["t_trg_27_embed_ratio"]->eval(args_3.data()); + tau_trg_dm0_down=fns_["t_trg_27_embed_ratio_dm0_down"]->eval(args_3.data())/fns_["t_trg_27_embed_ratio"]->eval(args_3.data()); + tau_trg_dm1_down=fns_["t_trg_27_embed_ratio_dm1_down"]->eval(args_3.data())/fns_["t_trg_27_embed_ratio"]->eval(args_3.data()); + tau_trg_dm10_down=fns_["t_trg_27_embed_ratio_dm10_down"]->eval(args_3.data())/fns_["t_trg_27_embed_ratio"]->eval(args_3.data()); + tau_trg_dm11_down=fns_["t_trg_27_embed_ratio_dm11_down"]->eval(args_3.data())/fns_["t_trg_27_embed_ratio"]->eval(args_3.data()); } - if(fns_["t_trg_30_ic_mvadm_embed_ratio"]->eval(args_mvadm.data())>0){ - tau_trg_mvadm0_up =fns_["t_trg_30_ic_mvadm_embed_ratio_mvadm0_up"]->eval(args_mvadm.data()) /fns_["t_trg_30_ic_mvadm_embed_ratio"]->eval(args_mvadm.data()); - tau_trg_mvadm1_up =fns_["t_trg_30_ic_mvadm_embed_ratio_mvadm1_up"]->eval(args_mvadm.data()) /fns_["t_trg_30_ic_mvadm_embed_ratio"]->eval(args_mvadm.data()); - tau_trg_mvadm2_up =fns_["t_trg_30_ic_mvadm_embed_ratio_mvadm2_up"]->eval(args_mvadm.data()) /fns_["t_trg_30_ic_mvadm_embed_ratio"]->eval(args_mvadm.data()); - tau_trg_mvadm10_up =fns_["t_trg_30_ic_mvadm_embed_ratio_mvadm10_up"]->eval(args_mvadm.data()) /fns_["t_trg_30_ic_mvadm_embed_ratio"]->eval(args_mvadm.data()); - tau_trg_mvadm11_up =fns_["t_trg_30_ic_mvadm_embed_ratio_mvadm11_up"]->eval(args_mvadm.data()) /fns_["t_trg_30_ic_mvadm_embed_ratio"]->eval(args_mvadm.data()); - tau_trg_mvadm0_down =fns_["t_trg_30_ic_mvadm_embed_ratio_mvadm0_down"]->eval(args_mvadm.data()) /fns_["t_trg_30_ic_mvadm_embed_ratio"]->eval(args_mvadm.data()); - tau_trg_mvadm1_down =fns_["t_trg_30_ic_mvadm_embed_ratio_mvadm1_down"]->eval(args_mvadm.data()) /fns_["t_trg_30_ic_mvadm_embed_ratio"]->eval(args_mvadm.data()); - tau_trg_mvadm2_down =fns_["t_trg_30_ic_mvadm_embed_ratio_mvadm2_down"]->eval(args_mvadm.data()) /fns_["t_trg_30_ic_mvadm_embed_ratio"]->eval(args_mvadm.data()); - tau_trg_mvadm10_down=fns_["t_trg_30_ic_mvadm_embed_ratio_mvadm10_down"]->eval(args_mvadm.data())/fns_["t_trg_30_ic_mvadm_embed_ratio"]->eval(args_mvadm.data()); - tau_trg_mvadm11_down=fns_["t_trg_30_ic_mvadm_embed_ratio_mvadm11_down"]->eval(args_mvadm.data())/fns_["t_trg_30_ic_mvadm_embed_ratio"]->eval(args_mvadm.data()); - } + if(fns_["t_trg_27_ic_mvadm_embed_ratio"]->eval(args_mvadm.data())>0){ + tau_trg_mvadm0_up =fns_["t_trg_27_ic_mvadm_embed_ratio_mvadm0_up"]->eval(args_mvadm.data()) /fns_["t_trg_27_ic_mvadm_embed_ratio"]->eval(args_mvadm.data()); + tau_trg_mvadm1_up =fns_["t_trg_27_ic_mvadm_embed_ratio_mvadm1_up"]->eval(args_mvadm.data()) /fns_["t_trg_27_ic_mvadm_embed_ratio"]->eval(args_mvadm.data()); + tau_trg_mvadm2_up =fns_["t_trg_27_ic_mvadm_embed_ratio_mvadm2_up"]->eval(args_mvadm.data()) /fns_["t_trg_27_ic_mvadm_embed_ratio"]->eval(args_mvadm.data()); + tau_trg_mvadm10_up =fns_["t_trg_27_ic_mvadm_embed_ratio_mvadm10_up"]->eval(args_mvadm.data()) /fns_["t_trg_27_ic_mvadm_embed_ratio"]->eval(args_mvadm.data()); + tau_trg_mvadm11_up =fns_["t_trg_27_ic_mvadm_embed_ratio_mvadm11_up"]->eval(args_mvadm.data()) /fns_["t_trg_27_ic_mvadm_embed_ratio"]->eval(args_mvadm.data()); + tau_trg_mvadm0_down =fns_["t_trg_27_ic_mvadm_embed_ratio_mvadm0_down"]->eval(args_mvadm.data()) /fns_["t_trg_27_ic_mvadm_embed_ratio"]->eval(args_mvadm.data()); + tau_trg_mvadm1_down =fns_["t_trg_27_ic_mvadm_embed_ratio_mvadm1_down"]->eval(args_mvadm.data()) /fns_["t_trg_27_ic_mvadm_embed_ratio"]->eval(args_mvadm.data()); + tau_trg_mvadm2_down =fns_["t_trg_27_ic_mvadm_embed_ratio_mvadm2_down"]->eval(args_mvadm.data()) /fns_["t_trg_27_ic_mvadm_embed_ratio"]->eval(args_mvadm.data()); + tau_trg_mvadm10_down=fns_["t_trg_27_ic_mvadm_embed_ratio_mvadm10_down"]->eval(args_mvadm.data())/fns_["t_trg_27_ic_mvadm_embed_ratio"]->eval(args_mvadm.data()); + tau_trg_mvadm11_down=fns_["t_trg_27_ic_mvadm_embed_ratio_mvadm11_down"]->eval(args_mvadm.data())/fns_["t_trg_27_ic_mvadm_embed_ratio"]->eval(args_mvadm.data()); + } + } } - + tau_trg_dm0_up = std::isnan(tau_trg_dm0_up) ? 0 : tau_trg_dm0_up; tau_trg_dm0_down = std::isnan(tau_trg_dm0_down) ? 0 : tau_trg_dm0_down; tau_trg_dm1_up = std::isnan(tau_trg_dm1_up) ? 0 : tau_trg_dm1_up; @@ -2539,7 +2796,7 @@ int HTTWeights::Execute(TreeEvent *event) { tau_trg_dm10_down = std::isnan(tau_trg_dm10_down) ? 0 : tau_trg_dm10_down; tau_trg_dm11_up = std::isnan(tau_trg_dm11_up) ? 0 : tau_trg_dm11_up; tau_trg_dm11_down = std::isnan(tau_trg_dm11_down) ? 0 : tau_trg_dm11_down; - + tau_trg_mvadm0_up = std::isnan(tau_trg_mvadm0_up) ? 0 : tau_trg_mvadm0_up; tau_trg_mvadm0_down = std::isnan(tau_trg_mvadm0_down) ? 0 : tau_trg_mvadm0_down; tau_trg_mvadm1_up = std::isnan(tau_trg_mvadm1_up) ? 0 : tau_trg_mvadm1_up; @@ -2550,7 +2807,7 @@ int HTTWeights::Execute(TreeEvent *event) { tau_trg_mvadm10_down = std::isnan(tau_trg_mvadm10_down) ? 0 : tau_trg_mvadm10_down; tau_trg_mvadm11_up = std::isnan(tau_trg_mvadm11_up) ? 0 : tau_trg_mvadm11_up; tau_trg_mvadm11_down = std::isnan(tau_trg_mvadm11_down) ? 0 : tau_trg_mvadm11_down; - + event->Add("wt_tau_trg_dm0_up",tau_trg_dm0_up); event->Add("wt_tau_trg_dm1_up",tau_trg_dm1_up); event->Add("wt_tau_trg_dm10_up",tau_trg_dm10_up); @@ -2559,7 +2816,7 @@ int HTTWeights::Execute(TreeEvent *event) { event->Add("wt_tau_trg_dm1_down",tau_trg_dm1_down); event->Add("wt_tau_trg_dm10_down",tau_trg_dm10_down); event->Add("wt_tau_trg_dm11_down",tau_trg_dm11_down); - + event->Add("wt_tau_trg_mvadm0_up" ,tau_trg_mvadm0_up); event->Add("wt_tau_trg_mvadm1_up" ,tau_trg_mvadm1_up); event->Add("wt_tau_trg_mvadm2_up" ,tau_trg_mvadm2_up); @@ -2570,262 +2827,27 @@ int HTTWeights::Execute(TreeEvent *event) { event->Add("wt_tau_trg_mvadm2_down" ,tau_trg_mvadm2_down); event->Add("wt_tau_trg_mvadm10_down",tau_trg_mvadm10_down); event->Add("wt_tau_trg_mvadm11_down",tau_trg_mvadm11_down); - - } - - event->Add("trigweight_up", trigweight_up); - event->Add("trigweight_down", trigweight_down); - - // have xtrg OR as default but save others to check - event->Add("single_l_sf", xtrg_OR_sf==0 ? single_e_sf : single_e_sf/xtrg_OR_sf ); - event->Add("xtrg_sf", xtrg_OR_sf==0 ? xtrg_et_sf : xtrg_et_sf/xtrg_OR_sf); - - ele_trg = xtrg_OR_sf; - ele_trg_mc = 1.0; - - tau_trg = 1.0; - tau_trg_mc = 1.0; - - xtrg_et_sf_mvadm = xtrg_OR_sf==0 ? xtrg_et_sf_mvadm : xtrg_et_sf_mvadm/xtrg_OR_sf; - - if (trg_applied_in_mc_) { - ele_trg = ele_trg / ele_trg_mc; - tau_trg = tau_trg / tau_trg_mc; - } - if(ele_trg>2) ele_trg=2; - weight *= (ele_trg * tau_trg); - event->Add("trigweight_1", ele_trg); - event->Add("trigweight_2", xtrg_et_sf_mvadm); - } else if (channel_ == channel::mt) { - Muon const* muon = dynamic_cast(dilepton[0]->GetCandidate("lepton1")); - double pt = muon->pt(); - double m_signed_eta = muon->eta(); - double m_iso = PF04IsolationVal(muon, 0.5, 0); - Tau const* tau = dynamic_cast(dilepton[0]->GetCandidate("lepton2")); - double t_pt = tau->pt(); - double t_signed_eta = tau->eta(); - double t_phi = tau->phi(); - double mu_trg = 1.0; - double tau_trg = 1.0; - double mu_trg_mc = 1.0; - double tau_trg_mc = 1.0; - auto args_1 = std::vector{pt,m_signed_eta,m_iso}; - auto args_1_noiso = std::vector{pt,m_signed_eta}; - mu_trg = fns_["m_trg_binned_data"]->eval(args_1_noiso.data()); - if(!is_embedded_) mu_trg_mc = fns_["m_trg_binned_mc"]->eval(args_1_noiso.data()); - else mu_trg_mc = fns_["m_trg_binned_embed"]->eval(args_1.data()); - if(era_ == era::data_2022_preEE || era_ == era::data_2022_postEE){ - if (trg_applied_in_mc_) { - mu_trg = mu_trg / mu_trg_mc; - } - weight *= mu_trg ; - event->Add("trigweight_1", mu_trg); - event->Add("trigweight_2", double(1.0)); - }else { - double single_m_sf = mu_trg / mu_trg_mc; - double t_dm = tau->decay_mode(); - auto args_2 = std::vector{pt,m_signed_eta}; - auto args_3 = std::vector{t_pt,t_signed_eta,t_phi,t_dm}; - auto args_4 = std::vector{t_pt,t_dm}; - double t_mvadm = tau->GetTauID(MVADM2017); - auto args_mvadm = std::vector{t_pt,t_mvadm}; - - double m_high_pt_cut = 25; - if(era_ == era::data_2016 || era_ == era::data_2016UL_preVFP || era_ == era::data_2016UL_postVFP) m_high_pt_cut = 23; - - double mu_xtrg = fns_["m_crosstrg_data"]->eval(args_1.data()); - double mu_xtrg_mc; - if(is_embedded_) mu_xtrg_mc = fns_["m_crosstrg_embed"]->eval(args_2.data()); - else mu_xtrg_mc = fns_["m_crosstrg_mc"]->eval(args_2.data()); - - double tau_trg_ic=1., tau_trg_mvadm=1.; - - if(is_embedded_) { - tau_trg_mc = 1.; - tau_trg = fns_["t_trg_27_embed_ratio"]->eval(args_3.data()); - tau_trg_ic = fns_["t_trg_27_ic_embed_ratio"]->eval(args_4.data()); - tau_trg_mvadm = fns_["t_trg_27_ic_mvadm_embed_ratio"]->eval(args_mvadm.data()); - - } - else { - tau_trg_mc = 1.; - tau_trg = fns_["t_trg_27_ratio"]->eval(args_4.data()); - tau_trg_ic = fns_["t_trg_27_ic_ratio"]->eval(args_4.data()); - tau_trg_mvadm = fns_["t_trg_27_ic_mvadm_ratio"]->eval(args_mvadm.data()); - } - - double xtrg_mt_sf = (mu_xtrg_mc*tau_trg_mc) > 0 ? (mu_xtrg*tau_trg)/(mu_xtrg_mc*tau_trg_mc) : 0.0; - - double xtrg_OR_sf = (pt>=m_high_pt_cut) ? single_m_sf : xtrg_mt_sf ; - - // if trigger is not applied in the MC then set the SF to the efficiency - if(!trg_applied_in_mc_) { - xtrg_mt_sf = mu_xtrg*tau_trg; - xtrg_OR_sf = mu_trg*(1-tau_trg) + mu_xtrg*tau_trg; - single_m_sf = mu_trg; - } - // Tau Leg Scale Factor - double tau_trg_tt_leg; - tau_trg_tt_leg = fns_["t_trg_35_ratio"]->eval(args_4.data()); - event->Add("tau_leg_SF", tau_trg_tt_leg); - std::vector args_mutau = std::vector{pt,m_signed_eta,m_iso,t_pt,t_dm,t_signed_eta}; - std::string extra = ""; - if(is_embedded_){ - args_mutau = std::vector{pt,m_signed_eta,m_iso,t_pt,t_dm,t_signed_eta,t_phi}; - extra="_embed"; - } - - std::vector systs = {"_crosslep_up","_crosslep_down","_singlelep_up","_singlelep_down","_singletau_up","_singletau_down","_dm0_up","_dm0_down","_dm1_up","_dm1_down","_dm10_up","_dm10_down","_dm11_up","_dm11_down"}; - - double wt_tau_trg_mssm = fns_["mt_trg"+extra+"_ratio"]->eval(args_mutau.data()); - eventInfo->set_weight("mt_triggerweight_ic", wt_tau_trg_mssm, false); - event->Add("wt_tau_trg_mssm", xtrg_OR_sf > 0. ? wt_tau_trg_mssm/xtrg_OR_sf : 0.); - for (auto s: systs) { - double wt_tau_trg_mssm_syst = fns_["mt_trg"+extra+"_ratio"+s]->eval(args_mutau.data()); - event->Add("wt_tau_trg_mssm"+s, wt_tau_trg_mssm > 0. ? wt_tau_trg_mssm_syst/wt_tau_trg_mssm : 0.); - } - event->Add("wt_tau_trg_mssm_doubleonly", 1.); - - tau_trg_ic = (tau_trg==0) ? tau_trg_ic : tau_trg_ic/tau_trg; - tau_trg_mvadm = (tau_trg==0) ? tau_trg_mvadm : tau_trg_mvadm/tau_trg; - tau_trg_ic = (pt>=m_high_pt_cut) ? 1. : tau_trg_ic; - tau_trg_mvadm = (pt>=m_high_pt_cut) ? 1. : tau_trg_mvadm; - - event->Add("wt_tau_trg_ic",tau_trg_ic); - event->Add("wt_tau_trg_mvadm",tau_trg_mvadm); - - double tau_trg_dm0_up=1.; - double tau_trg_dm1_up=1.; - double tau_trg_dm10_up=1.; - double tau_trg_dm11_up=1.; - double tau_trg_dm0_down=1.; - double tau_trg_dm1_down=1.; - double tau_trg_dm10_down=1.; - double tau_trg_dm11_down=1.; - - double tau_trg_mvadm0_up=1.; - double tau_trg_mvadm1_up=1.; - double tau_trg_mvadm2_up=1.; - double tau_trg_mvadm10_up=1.; - double tau_trg_mvadm11_up=1.; - double tau_trg_mvadm0_down=1.; - double tau_trg_mvadm1_down=1.; - double tau_trg_mvadm2_down=1.; - double tau_trg_mvadm10_down=1.; - double tau_trg_mvadm11_down=1.; - - if(pteval(args_4.data())>0){ - tau_trg_dm0_up=fns_["t_trg_27_ratio_dm0_up"]->eval(args_4.data())/fns_["t_trg_27_ratio"]->eval(args_4.data()); - tau_trg_dm1_up=fns_["t_trg_27_ratio_dm1_up"]->eval(args_4.data())/fns_["t_trg_27_ratio"]->eval(args_4.data()); - tau_trg_dm10_up=fns_["t_trg_27_ratio_dm10_up"]->eval(args_4.data())/fns_["t_trg_27_ratio"]->eval(args_4.data()); - tau_trg_dm11_up=fns_["t_trg_27_ratio_dm11_up"]->eval(args_4.data())/fns_["t_trg_27_ratio"]->eval(args_4.data()); - tau_trg_dm0_down=fns_["t_trg_27_ratio_dm0_down"]->eval(args_4.data())/fns_["t_trg_27_ratio"]->eval(args_4.data()); - tau_trg_dm1_down=fns_["t_trg_27_ratio_dm1_down"]->eval(args_4.data())/fns_["t_trg_27_ratio"]->eval(args_4.data()); - tau_trg_dm10_down=fns_["t_trg_27_ratio_dm10_down"]->eval(args_4.data())/fns_["t_trg_27_ratio"]->eval(args_4.data()); - tau_trg_dm11_down=fns_["t_trg_27_ratio_dm11_down"]->eval(args_4.data())/fns_["t_trg_27_ratio"]->eval(args_4.data()); - } - if(fns_["t_trg_27_ic_mvadm_ratio"]->eval(args_mvadm.data())>0){ - tau_trg_mvadm0_up =fns_["t_trg_27_ic_mvadm_ratio_mvadm0_up"]->eval(args_mvadm.data()) /fns_["t_trg_27_ic_mvadm_ratio"]->eval(args_mvadm.data()); - tau_trg_mvadm1_up =fns_["t_trg_27_ic_mvadm_ratio_mvadm1_up"]->eval(args_mvadm.data()) /fns_["t_trg_27_ic_mvadm_ratio"]->eval(args_mvadm.data()); - tau_trg_mvadm2_up =fns_["t_trg_27_ic_mvadm_ratio_mvadm2_up"]->eval(args_mvadm.data()) /fns_["t_trg_27_ic_mvadm_ratio"]->eval(args_mvadm.data()); - tau_trg_mvadm10_up =fns_["t_trg_27_ic_mvadm_ratio_mvadm10_up"]->eval(args_mvadm.data()) /fns_["t_trg_27_ic_mvadm_ratio"]->eval(args_mvadm.data()); - tau_trg_mvadm11_up =fns_["t_trg_27_ic_mvadm_ratio_mvadm11_up"]->eval(args_mvadm.data()) /fns_["t_trg_27_ic_mvadm_ratio"]->eval(args_mvadm.data()); - tau_trg_mvadm0_down =fns_["t_trg_27_ic_mvadm_ratio_mvadm0_down"]->eval(args_mvadm.data()) /fns_["t_trg_27_ic_mvadm_ratio"]->eval(args_mvadm.data()); - tau_trg_mvadm1_down =fns_["t_trg_27_ic_mvadm_ratio_mvadm1_down"]->eval(args_mvadm.data()) /fns_["t_trg_27_ic_mvadm_ratio"]->eval(args_mvadm.data()); - tau_trg_mvadm2_down =fns_["t_trg_27_ic_mvadm_ratio_mvadm2_down"]->eval(args_mvadm.data()) /fns_["t_trg_27_ic_mvadm_ratio"]->eval(args_mvadm.data()); - tau_trg_mvadm10_down=fns_["t_trg_27_ic_mvadm_ratio_mvadm10_down"]->eval(args_mvadm.data())/fns_["t_trg_27_ic_mvadm_ratio"]->eval(args_mvadm.data()); - tau_trg_mvadm11_down=fns_["t_trg_27_ic_mvadm_ratio_mvadm11_down"]->eval(args_mvadm.data())/fns_["t_trg_27_ic_mvadm_ratio"]->eval(args_mvadm.data()); - } - - } else { - if(fns_["t_trg_27_embed_ratio"]->eval(args_3.data())>0) { - tau_trg_dm0_up=fns_["t_trg_27_embed_ratio_dm0_up"]->eval(args_3.data())/fns_["t_trg_27_embed_ratio"]->eval(args_3.data()); - tau_trg_dm1_up=fns_["t_trg_27_embed_ratio_dm1_up"]->eval(args_3.data())/fns_["t_trg_27_embed_ratio"]->eval(args_3.data()); - tau_trg_dm10_up=fns_["t_trg_27_embed_ratio_dm10_up"]->eval(args_3.data())/fns_["t_trg_27_embed_ratio"]->eval(args_3.data()); - tau_trg_dm11_up=fns_["t_trg_27_embed_ratio_dm11_up"]->eval(args_3.data())/fns_["t_trg_27_embed_ratio"]->eval(args_3.data()); - tau_trg_dm0_down=fns_["t_trg_27_embed_ratio_dm0_down"]->eval(args_3.data())/fns_["t_trg_27_embed_ratio"]->eval(args_3.data()); - tau_trg_dm1_down=fns_["t_trg_27_embed_ratio_dm1_down"]->eval(args_3.data())/fns_["t_trg_27_embed_ratio"]->eval(args_3.data()); - tau_trg_dm10_down=fns_["t_trg_27_embed_ratio_dm10_down"]->eval(args_3.data())/fns_["t_trg_27_embed_ratio"]->eval(args_3.data()); - tau_trg_dm11_down=fns_["t_trg_27_embed_ratio_dm11_down"]->eval(args_3.data())/fns_["t_trg_27_embed_ratio"]->eval(args_3.data()); - } - if(fns_["t_trg_27_ic_mvadm_embed_ratio"]->eval(args_mvadm.data())>0){ - tau_trg_mvadm0_up =fns_["t_trg_27_ic_mvadm_embed_ratio_mvadm0_up"]->eval(args_mvadm.data()) /fns_["t_trg_27_ic_mvadm_embed_ratio"]->eval(args_mvadm.data()); - tau_trg_mvadm1_up =fns_["t_trg_27_ic_mvadm_embed_ratio_mvadm1_up"]->eval(args_mvadm.data()) /fns_["t_trg_27_ic_mvadm_embed_ratio"]->eval(args_mvadm.data()); - tau_trg_mvadm2_up =fns_["t_trg_27_ic_mvadm_embed_ratio_mvadm2_up"]->eval(args_mvadm.data()) /fns_["t_trg_27_ic_mvadm_embed_ratio"]->eval(args_mvadm.data()); - tau_trg_mvadm10_up =fns_["t_trg_27_ic_mvadm_embed_ratio_mvadm10_up"]->eval(args_mvadm.data()) /fns_["t_trg_27_ic_mvadm_embed_ratio"]->eval(args_mvadm.data()); - tau_trg_mvadm11_up =fns_["t_trg_27_ic_mvadm_embed_ratio_mvadm11_up"]->eval(args_mvadm.data()) /fns_["t_trg_27_ic_mvadm_embed_ratio"]->eval(args_mvadm.data()); - tau_trg_mvadm0_down =fns_["t_trg_27_ic_mvadm_embed_ratio_mvadm0_down"]->eval(args_mvadm.data()) /fns_["t_trg_27_ic_mvadm_embed_ratio"]->eval(args_mvadm.data()); - tau_trg_mvadm1_down =fns_["t_trg_27_ic_mvadm_embed_ratio_mvadm1_down"]->eval(args_mvadm.data()) /fns_["t_trg_27_ic_mvadm_embed_ratio"]->eval(args_mvadm.data()); - tau_trg_mvadm2_down =fns_["t_trg_27_ic_mvadm_embed_ratio_mvadm2_down"]->eval(args_mvadm.data()) /fns_["t_trg_27_ic_mvadm_embed_ratio"]->eval(args_mvadm.data()); - tau_trg_mvadm10_down=fns_["t_trg_27_ic_mvadm_embed_ratio_mvadm10_down"]->eval(args_mvadm.data())/fns_["t_trg_27_ic_mvadm_embed_ratio"]->eval(args_mvadm.data()); - tau_trg_mvadm11_down=fns_["t_trg_27_ic_mvadm_embed_ratio_mvadm11_down"]->eval(args_mvadm.data())/fns_["t_trg_27_ic_mvadm_embed_ratio"]->eval(args_mvadm.data()); - } - - } - } - - tau_trg_dm0_up = std::isnan(tau_trg_dm0_up) ? 0 : tau_trg_dm0_up; - tau_trg_dm0_down = std::isnan(tau_trg_dm0_down) ? 0 : tau_trg_dm0_down; - tau_trg_dm1_up = std::isnan(tau_trg_dm1_up) ? 0 : tau_trg_dm1_up; - tau_trg_dm1_down = std::isnan(tau_trg_dm1_down) ? 0 : tau_trg_dm1_down; - tau_trg_dm10_up = std::isnan(tau_trg_dm10_up) ? 0 : tau_trg_dm10_up; - tau_trg_dm10_down = std::isnan(tau_trg_dm10_down) ? 0 : tau_trg_dm10_down; - tau_trg_dm11_up = std::isnan(tau_trg_dm11_up) ? 0 : tau_trg_dm11_up; - tau_trg_dm11_down = std::isnan(tau_trg_dm11_down) ? 0 : tau_trg_dm11_down; - - tau_trg_mvadm0_up = std::isnan(tau_trg_mvadm0_up) ? 0 : tau_trg_mvadm0_up; - tau_trg_mvadm0_down = std::isnan(tau_trg_mvadm0_down) ? 0 : tau_trg_mvadm0_down; - tau_trg_mvadm1_up = std::isnan(tau_trg_mvadm1_up) ? 0 : tau_trg_mvadm1_up; - tau_trg_mvadm1_down = std::isnan(tau_trg_mvadm1_down) ? 0 : tau_trg_mvadm1_down; - tau_trg_mvadm2_up = std::isnan(tau_trg_mvadm2_up) ? 0 : tau_trg_mvadm2_up; - tau_trg_mvadm2_down = std::isnan(tau_trg_mvadm2_down) ? 0 : tau_trg_mvadm2_down; - tau_trg_mvadm10_up = std::isnan(tau_trg_mvadm10_up) ? 0 : tau_trg_mvadm10_up; - tau_trg_mvadm10_down = std::isnan(tau_trg_mvadm10_down) ? 0 : tau_trg_mvadm10_down; - tau_trg_mvadm11_up = std::isnan(tau_trg_mvadm11_up) ? 0 : tau_trg_mvadm11_up; - tau_trg_mvadm11_down = std::isnan(tau_trg_mvadm11_down) ? 0 : tau_trg_mvadm11_down; - - event->Add("wt_tau_trg_dm0_up",tau_trg_dm0_up); - event->Add("wt_tau_trg_dm1_up",tau_trg_dm1_up); - event->Add("wt_tau_trg_dm10_up",tau_trg_dm10_up); - event->Add("wt_tau_trg_dm11_up",tau_trg_dm11_up); - event->Add("wt_tau_trg_dm0_down",tau_trg_dm0_down); - event->Add("wt_tau_trg_dm1_down",tau_trg_dm1_down); - event->Add("wt_tau_trg_dm10_down",tau_trg_dm10_down); - event->Add("wt_tau_trg_dm11_down",tau_trg_dm11_down); - - event->Add("wt_tau_trg_mvadm0_up" ,tau_trg_mvadm0_up); - event->Add("wt_tau_trg_mvadm1_up" ,tau_trg_mvadm1_up); - event->Add("wt_tau_trg_mvadm2_up" ,tau_trg_mvadm2_up); - event->Add("wt_tau_trg_mvadm10_up" ,tau_trg_mvadm10_up); - event->Add("wt_tau_trg_mvadm11_up" ,tau_trg_mvadm11_up); - event->Add("wt_tau_trg_mvadm0_down" ,tau_trg_mvadm0_down); - event->Add("wt_tau_trg_mvadm1_down" ,tau_trg_mvadm1_down); - event->Add("wt_tau_trg_mvadm2_down" ,tau_trg_mvadm2_down); - event->Add("wt_tau_trg_mvadm10_down",tau_trg_mvadm10_down); - event->Add("wt_tau_trg_mvadm11_down",tau_trg_mvadm11_down); - - - // have xtrg OR as default but save others to check - event->Add("single_l_sf", xtrg_OR_sf==0 ? single_m_sf : single_m_sf/xtrg_OR_sf); - event->Add("xtrg_sf", xtrg_OR_sf==0 ? xtrg_mt_sf : xtrg_mt_sf/xtrg_OR_sf); - - mu_trg = xtrg_OR_sf; - mu_trg_mc = 1.0; - - tau_trg = 1.0; - tau_trg_mc = 1.0; - - if (trg_applied_in_mc_) { - mu_trg = mu_trg / mu_trg_mc; - tau_trg = tau_trg / tau_trg_mc; + + + // have xtrg OR as default but save others to check + event->Add("single_l_sf", xtrg_OR_sf==0 ? single_m_sf : single_m_sf/xtrg_OR_sf); + event->Add("xtrg_sf", xtrg_OR_sf==0 ? xtrg_mt_sf : xtrg_mt_sf/xtrg_OR_sf); + + mu_trg = xtrg_OR_sf; + mu_trg_mc = 1.0; + + tau_trg = 1.0; + tau_trg_mc = 1.0; + + if (trg_applied_in_mc_) { + mu_trg = mu_trg / mu_trg_mc; + tau_trg = tau_trg / tau_trg_mc; + } + if(mu_trg>2) mu_trg=2; + weight *= (mu_trg * tau_trg); + event->Add("trigweight_1", mu_trg); + event->Add("trigweight_2", tau_trg); } - if(mu_trg>2) mu_trg=2; - weight *= (mu_trg * tau_trg); - event->Add("trigweight_1", mu_trg); - event->Add("trigweight_2", tau_trg); - } } else if (channel_ == channel::em) { Electron const* elec = dynamic_cast(dilepton[0]->GetCandidate("lepton1")); Muon const* muon = dynamic_cast(dilepton[0]->GetCandidate("lepton2")); @@ -2843,7 +2865,9 @@ int HTTWeights::Execute(TreeEvent *event) { double e_trg_12 = 1.0; double e_trg_12_mc = 1.0; double e_trg=1.; - double e_iso = PF03EAIsolationVal(elec, eventInfo->jet_rho()); //lepton_rho + double e_iso=0.; + if(era_ == era::data_2022_preEE || era_ == era::data_2022_postEE) e_iso = PF03EAIsolationValRun3(elec, eventInfo->jet_rho()); + else e_iso = PF03EAIsolationVal(elec, eventInfo->jet_rho()); auto args_1_2 = std::vector{e_pt,e_eta,e_iso}; auto args_2_2 = std::vector{m_pt,m_eta,m_iso}; @@ -3090,67 +3114,81 @@ int HTTWeights::Execute(TreeEvent *event) { Electron const* elec = dynamic_cast(dilepton[0]->GetCandidate("lepton1")); double e1_pt = elec->pt(); double e1_eta = fabs(elec->sc_eta()); - double e_iso_1 = PF03EAIsolationVal(elec, eventInfo->jet_rho()); - double ele1_trg = 1.0; - double ele2_trg = 1.0; - double ele1_trg_mc = 1.0; - double ele2_trg_mc = 1.0; - auto args_1 = std::vector{e1_pt,e1_eta,e_iso_1}; - auto args_1_noiso = std::vector{e1_pt,e1_eta}; - ele1_trg = fns_["e_trg_binned_data"]->eval(args_1_noiso.data()); - if(is_embedded_) ele1_trg_mc = fns_["e_trg_binned_embed"]->eval(args_1.data()); - else ele1_trg_mc = fns_["e_trg_binned_mc"]->eval(args_1_noiso.data()); - ele2_trg = 1.0; - ele2_trg_mc = 1.0; - - // cout << "ele1_trg: " << ele1_trg << endl; - // cout << "ele1_trg_mc: " << ele1_trg_mc << endl; - // cout << "e1_pt: " << e1_pt << endl; - // cout << "e1_eta: " << e1_eta << endl; - // cout << "e_iso_1: " << e_iso_1 << endl; - - if (trg_applied_in_mc_) { - ele1_trg = ele1_trg / ele1_trg_mc; - ele2_trg = ele2_trg / ele2_trg_mc; - if(ele1_trg_mc == 0){ - ele1_trg = 0; - } - if(ele2_trg_mc ==0){ - ele2_trg_mc =0; - } - + if(era_ == era::data_2022_preEE || era_ == era::data_2022_postEE){ + // specify all Run-3 SF here + auto args_1 = std::vector{e1_pt,e1_eta}; + double ele_trg_sf = fns_["e_trg_ratio"]->eval(args_1.data()); + eventInfo->set_weight("trigger", ele_trg_sf); + event->Add("trigweight_1", ele_trg_sf); + event->Add("trigweight_2", double(1.0)); + } else { + + double e_iso_1 = PF03EAIsolationVal(elec, eventInfo->jet_rho()); + double ele1_trg = 1.0; + double ele2_trg = 1.0; + double ele1_trg_mc = 1.0; + double ele2_trg_mc = 1.0; + auto args_1 = std::vector{e1_pt,e1_eta,e_iso_1}; + auto args_1_noiso = std::vector{e1_pt,e1_eta}; + ele1_trg = fns_["e_trg_binned_data"]->eval(args_1_noiso.data()); + if(is_embedded_) ele1_trg_mc = fns_["e_trg_binned_embed"]->eval(args_1.data()); + else ele1_trg_mc = fns_["e_trg_binned_mc"]->eval(args_1_noiso.data()); + ele2_trg = 1.0; + ele2_trg_mc = 1.0; + + if (trg_applied_in_mc_) { + ele1_trg = ele1_trg / ele1_trg_mc; + ele2_trg = ele2_trg / ele2_trg_mc; + if(ele1_trg_mc == 0){ + ele1_trg = 0; + } + if(ele2_trg_mc ==0){ + ele2_trg_mc =0; + } + + } + weight *= (ele1_trg * ele2_trg); + event->Add("trigweight_1", ele1_trg); + event->Add("trigweight_2", ele2_trg); } - weight *= (ele1_trg * ele2_trg); - event->Add("trigweight_1", ele1_trg); - event->Add("trigweight_2", ele2_trg); } else if (channel_ == channel::zmm) { Muon const* muon = dynamic_cast(dilepton[0]->GetCandidate("lepton1")); double pt1 = muon->pt(); - double m1_signed_eta = muon->eta(); - double m_iso_1 = PF04IsolationVal(muon, 0.5, 0); - double mu1_trg = 1.0; - double mu2_trg = 1.0; - double mu1_trg_mc = 1.0; - double mu2_trg_mc = 1.0; - auto args_1 = std::vector{pt1,m1_signed_eta,m_iso_1}; - auto args_1_noiso = std::vector{pt1,m1_signed_eta}; - auto args_2 = std::vector{pt1,m1_signed_eta}; - mu1_trg = fns_["m_trg_binned_data"]->eval(args_1_noiso.data()); - if (is_embedded_) { - mu1_trg_mc = fns_["m_trg_binned_embed"]->eval(args_1.data()); + double m1_eta = fabs(muon->eta()); + if(era_ == era::data_2022_preEE || era_ == era::data_2022_postEE){ + // specify all Run-3 SF here + auto args_1 = std::vector{pt1,m1_eta}; + double mu_trg_sf = fns_["m_trg_ratio"]->eval(args_1.data()); + eventInfo->set_weight("trigger", mu_trg_sf); + event->Add("trigweight_1", mu_trg_sf); + event->Add("trigweight_2", double(1.0)); } else { - mu1_trg_mc = fns_["m_trg_binned_mc"]->eval(args_1_noiso.data()); - } - mu2_trg = 1.0; - mu2_trg_mc = 1.0; + double m1_signed_eta = muon->eta(); + double m_iso_1 = PF04IsolationVal(muon, 0.5, 0); + double mu1_trg = 1.0; + double mu2_trg = 1.0; + double mu1_trg_mc = 1.0; + double mu2_trg_mc = 1.0; + auto args_1 = std::vector{pt1,m1_signed_eta,m_iso_1}; + auto args_1_noiso = std::vector{pt1,m1_signed_eta}; + auto args_2 = std::vector{pt1,m1_signed_eta}; + mu1_trg = fns_["m_trg_binned_data"]->eval(args_1_noiso.data()); + if (is_embedded_) { + mu1_trg_mc = fns_["m_trg_binned_embed"]->eval(args_1.data()); + } else { + mu1_trg_mc = fns_["m_trg_binned_mc"]->eval(args_1_noiso.data()); + } + mu2_trg = 1.0; + mu2_trg_mc = 1.0; - if (trg_applied_in_mc_) { - mu1_trg = mu1_trg / mu1_trg_mc; - mu2_trg = mu2_trg / mu2_trg_mc; + if (trg_applied_in_mc_) { + mu1_trg = mu1_trg / mu1_trg_mc; + mu2_trg = mu2_trg / mu2_trg_mc; + } + weight *= (mu1_trg * mu2_trg); + event->Add("trigweight_1", mu1_trg); + event->Add("trigweight_2", mu2_trg); } - weight *= (mu1_trg * mu2_trg); - event->Add("trigweight_1", mu1_trg); - event->Add("trigweight_2", mu2_trg); } } @@ -3158,36 +3196,60 @@ int HTTWeights::Execute(TreeEvent *event) { if (channel_ == channel::et) { Electron const* elec = dynamic_cast(dilepton[0]->GetCandidate("lepton1")); double pt = elec->pt(); - double e_iso = PF03EAIsolationVal(elec, eventInfo->jet_rho()); - double e_sceta = elec->sc_eta(); - auto args_1 = std::vector{pt,e_sceta,e_iso}; - auto args_1_noiso = std::vector{pt,e_sceta}; - double ele_idiso=1.; - if(is_embedded_){ - ele_idiso = fns_["e_idiso_embed_ratio"]->eval(args_1.data()); + double e_sceta = fabs(elec->sc_eta()); + if(era_ == era::data_2022_preEE || era_ == era::data_2022_postEE){ + // specify all Run-3 SF here + auto args_1 = std::vector{pt,e_sceta}; + double ele_id_sf = fns_["e_id_ratio"]->eval(args_1.data()); + double ele_iso_sf = fns_["e_iso_ratio"]->eval(args_1.data()); + event->Add("idisoweight_1",ele_id_sf*ele_iso_sf); + eventInfo->set_weight("elec_id", ele_id_sf); + eventInfo->set_weight("elec_iso", ele_iso_sf); } else { - ele_idiso = fns_["e_idiso_ratio"]->eval(args_1_noiso.data()); + + double e_iso=0.; + e_iso = PF03EAIsolationVal(elec, eventInfo->jet_rho()); + auto args_1 = std::vector{pt,e_sceta,e_iso}; + auto args_1_noiso = std::vector{pt,e_sceta}; + double ele_idiso=1.; + if(is_embedded_){ + ele_idiso = fns_["e_idiso_embed_ratio"]->eval(args_1.data()); + } else { + ele_idiso = fns_["e_idiso_ratio"]->eval(args_1_noiso.data()); + } + eventInfo->set_weight("idiso", ele_idiso, false); + event->Add("idisoweight_1",ele_idiso); + weight *= (ele_idiso); } - eventInfo->set_weight("idiso", ele_idiso, false); - event->Add("idisoweight_1",ele_idiso); - weight *= (ele_idiso); } else if (channel_ == channel::mt) { Muon const* muon = dynamic_cast(dilepton[0]->GetCandidate("lepton1")); double pt = muon->pt(); - double m_signed_eta = muon->eta(); - double m_iso = PF04IsolationVal(muon, 0.5, 0); - double mu_idiso=1.0; - auto args_1 = std::vector{pt,m_signed_eta,m_iso}; - auto args_1_noiso = std::vector{pt,m_signed_eta}; - if(is_embedded_){ - mu_idiso = fns_["m_idiso_embed_ratio"]->eval(args_1.data()); - } else{ - mu_idiso = fns_["m_idiso_ratio"]->eval(args_1_noiso.data()); - } + double m_eta = fabs(muon->eta()); + if(era_ == era::data_2022_preEE || era_ == era::data_2022_postEE){ + // specify all Run-3 SF here + auto args_1 = std::vector{pt,m_eta}; + double mu_id_sf = fns_["m_id_ratio"]->eval(args_1.data()); + double mu_iso_sf = fns_["m_iso_ratio"]->eval(args_1.data()); + event->Add("idisoweight_1",mu_id_sf*mu_iso_sf); + eventInfo->set_weight("muon_id", mu_id_sf); + eventInfo->set_weight("muon_iso", mu_iso_sf); + } else { - weight *= mu_idiso; - event->Add("idisoweight_1", mu_idiso); - eventInfo->set_weight("idiso", mu_idiso, false); + double m_signed_eta = muon->eta(); + double m_iso = PF04IsolationVal(muon, 0.5, 0); + double mu_idiso=1.0; + auto args_1 = std::vector{pt,m_signed_eta,m_iso}; + auto args_1_noiso = std::vector{pt,m_signed_eta}; + if(is_embedded_){ + mu_idiso = fns_["m_idiso_embed_ratio"]->eval(args_1.data()); + } else{ + mu_idiso = fns_["m_idiso_ratio"]->eval(args_1_noiso.data()); + } + + weight *= mu_idiso; + event->Add("idisoweight_1", mu_idiso); + eventInfo->set_weight("idiso", mu_idiso, false); + } } else if (channel_ == channel::em) { Electron const* elec = dynamic_cast(dilepton[0]->GetCandidate("lepton1")); Muon const* muon = dynamic_cast(dilepton[0]->GetCandidate("lepton2")); @@ -3198,7 +3260,9 @@ int HTTWeights::Execute(TreeEvent *event) { double m_idiso = 1.0; double e_idiso = 1.0; double m_iso = PF04IsolationVal(muon, 0.5, 0); - double e_iso = PF03EAIsolationVal(elec, eventInfo->jet_rho()); //lepton_rho + double e_iso=0.; + if(era_ == era::data_2022_preEE || era_ == era::data_2022_postEE) e_iso = PF03EAIsolationValRun3(elec, eventInfo->jet_rho()); + else e_iso = PF03EAIsolationVal(elec, eventInfo->jet_rho()); double e_sceta = elec->sc_eta(); auto args_1 = std::vector{e_pt,e_sceta,e_iso}; auto args_1_noiso = std::vector{e_pt, e_sceta}; @@ -3222,63 +3286,106 @@ int HTTWeights::Execute(TreeEvent *event) { Muon const* muon_1 = dynamic_cast(dilepton[0]->GetCandidate("lepton1")); Muon const* muon_2 = dynamic_cast(dilepton[0]->GetCandidate("lepton2")); double m_1_pt = muon_1->pt(); - double m_1_signed_eta = muon_1->eta(); double m_2_pt = muon_2->pt(); - double m_2_signed_eta = muon_2->eta(); - double m_1_iso = PF04IsolationVal(muon_1,0.5,0); - double m_2_iso = PF04IsolationVal(muon_2,0.5,0); - double m_1_idiso = 1.0; - double m_2_idiso = 1.0; - auto args1_2_noiso = std::vector{m_1_pt,m_1_signed_eta}; - auto args2_2_noiso = std::vector{m_2_pt,m_2_signed_eta}; - auto args1_2 = std::vector{m_1_pt,m_1_signed_eta,m_1_iso}; - auto args2_2 = std::vector{m_2_pt,m_2_signed_eta,m_2_iso}; - if(is_embedded_){ - m_1_idiso = fns_["m_idiso_embed_ratio"]->eval(args1_2.data()); - m_2_idiso = fns_["m_idiso_embed_ratio"]->eval(args2_2.data()); + double m_1_eta = fabs(muon_1->eta()); + double m_2_eta = fabs(muon_2->eta()); + + if(era_ == era::data_2022_preEE || era_ == era::data_2022_postEE){ + // specify all Run-3 SF here + auto args_1 = std::vector{m_1_pt,m_1_eta}; + auto args_2 = std::vector{m_2_pt,m_2_eta}; + double mu_1_id_sf = fns_["m_id_ratio"]->eval(args_1.data()); + double mu_1_iso_sf = fns_["m_iso_ratio"]->eval(args_1.data()); + double mu_2_id_sf = fns_["m_id_ratio"]->eval(args_2.data()); + double mu_2_iso_sf = fns_["m_iso_ratio"]->eval(args_2.data()); + + event->Add("idisoweight_1", mu_1_id_sf*mu_1_iso_sf); + event->Add("idisoweight_2", mu_2_id_sf*mu_1_iso_sf); + + eventInfo->set_weight("muon_1_id", mu_1_id_sf); + eventInfo->set_weight("muon_1_iso", mu_1_iso_sf); + eventInfo->set_weight("muon_2_id", mu_2_id_sf); + eventInfo->set_weight("muon_2_iso", mu_2_iso_sf); } else { - m_1_idiso = fns_["m_idiso_ratio"]->eval(args1_2_noiso.data()); - m_2_idiso = fns_["m_idiso_ratio"]->eval(args2_2_noiso.data()); + double m_1_signed_eta = muon_1->eta(); + double m_2_signed_eta = muon_2->eta(); + double m_1_iso = PF04IsolationVal(muon_1,0.5,0); + double m_2_iso = PF04IsolationVal(muon_2,0.5,0); + double m_1_idiso = 1.0; + double m_2_idiso = 1.0; + auto args1_2_noiso = std::vector{m_1_pt,m_1_signed_eta}; + auto args2_2_noiso = std::vector{m_2_pt,m_2_signed_eta}; + auto args1_2 = std::vector{m_1_pt,m_1_signed_eta,m_1_iso}; + auto args2_2 = std::vector{m_2_pt,m_2_signed_eta,m_2_iso}; + if(is_embedded_){ + m_1_idiso = fns_["m_idiso_embed_ratio"]->eval(args1_2.data()); + m_2_idiso = fns_["m_idiso_embed_ratio"]->eval(args2_2.data()); + } else { + m_1_idiso = fns_["m_idiso_ratio"]->eval(args1_2_noiso.data()); + m_2_idiso = fns_["m_idiso_ratio"]->eval(args2_2_noiso.data()); + } + + weight *= (m_1_idiso * m_2_idiso); + event->Add("idisoweight_1", m_1_idiso); + event->Add("idisoweight_2", m_2_idiso); + event->Add("isoweight_1", double(1.0)); + event->Add("isoweight_2", double(1.0)); } - - weight *= (m_1_idiso * m_2_idiso); - event->Add("idisoweight_1", m_1_idiso); - event->Add("idisoweight_2", m_2_idiso); - event->Add("isoweight_1", double(1.0)); - event->Add("isoweight_2", double(1.0)); } else if (channel_ == channel::zee){ Electron const* ele_1 = dynamic_cast(dilepton[0]->GetCandidate("lepton1")); Electron const* ele_2 = dynamic_cast(dilepton[0]->GetCandidate("lepton2")); double e_1_pt = ele_1->pt(); double e_2_pt = ele_2->pt(); - double e_1_idiso = 1.0; - double e_2_idiso = 1.0; - double e_1_iso = PF03EAIsolationVal(ele_1, eventInfo->jet_rho()); - double e_2_iso = PF03EAIsolationVal(ele_2, eventInfo->jet_rho()); - double e_1_sceta = ele_1->sc_eta(); - double e_2_sceta = ele_2->sc_eta(); - - auto args1_1_noiso = std::vector{e_1_pt,e_1_sceta}; - auto args2_1_noiso = std::vector{e_2_pt,e_2_sceta}; - auto args1_1 = std::vector{e_1_pt,e_1_sceta,e_1_iso}; - auto args2_1 = std::vector{e_2_pt,e_2_sceta,e_2_iso}; - - if(is_embedded_){ - e_1_idiso = fns_["e_idiso_embed_ratio"]->eval(args1_1.data()); - e_2_idiso = fns_["e_idiso_embed_ratio"]->eval(args2_1.data()); + double e_1_sceta = fabs(ele_1->sc_eta()); + double e_2_sceta = fabs(ele_2->sc_eta()); + + if(era_ == era::data_2022_preEE || era_ == era::data_2022_postEE){ + // specify all Run-3 SF here + auto args_1 = std::vector{e_1_pt,e_1_sceta}; + auto args_2 = std::vector{e_2_pt,e_2_sceta}; + double e_1_id_sf = fns_["e_id_ratio"]->eval(args_1.data()); + double e_1_iso_sf = fns_["e_iso_ratio"]->eval(args_1.data()); + double e_2_id_sf = fns_["e_id_ratio"]->eval(args_2.data()); + double e_2_iso_sf = fns_["e_iso_ratio"]->eval(args_2.data()); + + event->Add("idisoweight_1", e_1_id_sf*e_1_iso_sf); + event->Add("idisoweight_2", e_2_id_sf*e_1_iso_sf); + + eventInfo->set_weight("elec_1_id", e_1_id_sf); + eventInfo->set_weight("elec_1_iso", e_1_iso_sf); + eventInfo->set_weight("elec_2_id", e_2_id_sf); + eventInfo->set_weight("elec_2_iso", e_2_iso_sf); } else { - e_1_idiso = fns_["e_idiso_ratio"]->eval(args1_1_noiso.data()); - e_2_idiso = fns_["e_idiso_ratio"]->eval(args2_1_noiso.data()); - } - weight *= (e_1_idiso * e_2_idiso); - event->Add("idisoweight_1", e_1_idiso); - event->Add("idisoweight_2", e_2_idiso); - event->Add("isoweight_1", double(1.0)); - event->Add("isoweight_2", double(1.0)); - } + double e_1_idiso = 1.0; + double e_2_idiso = 1.0; + + double e_1_iso=0., e_2_iso=0.; + e_1_iso = PF03EAIsolationVal(ele_1, eventInfo->jet_rho()); + e_2_iso = PF03EAIsolationVal(ele_2, eventInfo->jet_rho()); + + auto args1_1_noiso = std::vector{e_1_pt,e_1_sceta}; + auto args2_1_noiso = std::vector{e_2_pt,e_2_sceta}; + auto args1_1 = std::vector{e_1_pt,e_1_sceta,e_1_iso}; + auto args2_1 = std::vector{e_2_pt,e_2_sceta,e_2_iso}; + + if(is_embedded_){ + e_1_idiso = fns_["e_idiso_embed_ratio"]->eval(args1_1.data()); + e_2_idiso = fns_["e_idiso_embed_ratio"]->eval(args2_1.data()); + } else { + e_1_idiso = fns_["e_idiso_ratio"]->eval(args1_1_noiso.data()); + e_2_idiso = fns_["e_idiso_ratio"]->eval(args2_1_noiso.data()); + } + + weight *= (e_1_idiso * e_2_idiso); + event->Add("idisoweight_1", e_1_idiso); + event->Add("idisoweight_2", e_2_idiso); + event->Add("isoweight_1", double(1.0)); + event->Add("isoweight_2", double(1.0)); + } + } } - eventInfo->set_weight("lepton", weight); + if(!(era_ == era::data_2022_preEE || era_ == era::data_2022_postEE)) eventInfo->set_weight("lepton", weight); if(do_etau_fakerate_) { double etau_fakerate_1=1.0;