From e2d8930c29127ed022988934fd4c3ca5b1c9a6c7 Mon Sep 17 00:00:00 2001 From: ccaillol Date: Mon, 28 Oct 2019 13:24:40 -0400 Subject: [PATCH] medium tt --- FFcode/bin/BuildFile.xml | 4 ++ FFcode/bin/ControlPlots_tt.cc | 75 +++++++++++++++++--------------- FFcode/bin/OSSScorrection_tt.cc | 75 +++++++++++++++----------------- FFcode/bin/RawFF_tt.cc | 56 ++++++++++++------------ FFcode/bin/Set1_correction_tt.cc | 68 +++++++++++++---------------- FFcode/interface/ApplyFF.h | 4 +- FFcode/python/Draw_closure_tt.py | 11 ++++- FFcode/python/Draw_control_tt.py | 4 +- FFcode/python/Draw_raw.py | 2 +- FFcode/python/Draw_raw_tt.py | 2 +- Fit_FF_et.cc | 2 +- Fit_FF_mt.cc | 2 +- Fit_FF_tt.cc | 27 ++++++++++-- Fit_FFclosure_tt.cc | 4 +- 14 files changed, 179 insertions(+), 157 deletions(-) diff --git a/FFcode/bin/BuildFile.xml b/FFcode/bin/BuildFile.xml index 8119b91..47698c7 100644 --- a/FFcode/bin/BuildFile.xml +++ b/FFcode/bin/BuildFile.xml @@ -6,9 +6,13 @@ + + + + diff --git a/FFcode/bin/ControlPlots_tt.cc b/FFcode/bin/ControlPlots_tt.cc index 76b3390..a78dee5 100644 --- a/FFcode/bin/ControlPlots_tt.cc +++ b/FFcode/bin/ControlPlots_tt.cc @@ -287,6 +287,9 @@ int main(int argc, char** argv) { TFile fmvisclosure ("FF_QCDcorrectionOSSS_tt.root"); TF1* mvisclosure=(TF1*) fmvisclosure.Get("closure_OSSS_mvis_tt_qcd"); + TFile ftau2closure ("FF_corrections_1.root"); + TF1* tau2closure=(TF1*) ftau2closure.Get("closure_tau2pt_tt_qcd"); + string datapath = string(std::getenv("CMSSW_BASE"))+"/src/ComputeFF2018/FFcode/data/"; reweight::LumiReWeighting* LumiWeights_12; @@ -315,12 +318,12 @@ int main(int argc, char** argv) { TFile *ftauid_2018 = new TFile((datapath+"TauID_SF_dm_DeepTau2017v2p1VSjet_2018ReReco.root").c_str()); TFile *ftauid_2017 = new TFile((datapath+"TauID_SF_dm_DeepTau2017v2p1VSjet_2017ReReco.root").c_str()); TFile *ftauid_2016 = new TFile((datapath+"TauID_SF_dm_DeepTau2017v2p1VSjet_2016Legacy.root").c_str()); - TH1F *fct_tauid_2018= (TH1F*) ftauid_2018->Get("Loose"); + /*TH1F *fct_tauid_2018= (TH1F*) ftauid_2018->Get("Loose"); TH1F *fct_tauid_2017= (TH1F*) ftauid_2017->Get("Loose"); - TH1F *fct_tauid_2016= (TH1F*) ftauid_2016->Get("Loose"); - /*TH1F *fct_tauid_2018= (TH1F*) ftauid_2018->Get("Medium"); + TH1F *fct_tauid_2016= (TH1F*) ftauid_2016->Get("Loose");*/ + TH1F *fct_tauid_2018= (TH1F*) ftauid_2018->Get("Medium"); TH1F *fct_tauid_2017= (TH1F*) ftauid_2017->Get("Medium"); - TH1F *fct_tauid_2016= (TH1F*) ftauid_2016->Get("Medium");*/ + TH1F *fct_tauid_2016= (TH1F*) ftauid_2016->Get("Medium"); TFile fwmc((datapath+"htt_scalefactors_legacy_2018.root").c_str()); @@ -338,7 +341,7 @@ int main(int argc, char** argv) { } TauTriggerSFs2017* etsf=new TauTriggerSFs2017(string(std::getenv("CMSSW_BASE"))+"/src/TauAnalysisTools/TauTriggerSFs/data/tauTriggerEfficiencies2018.root","ditau", "2018", "tight", "MVAv2"); - if (year=="2017") etsf=new TauTriggerSFs2017(string(std::getenv("CMSSW_BASE"))+"/src/TauAnalysisTools/TauTriggerSFs/data/tauTriggerEfficiencies2017.root","ditau", "2017", "tight", "MVAv2"); + if (year=="2017") etsf=new TauTriggerSFs2017(string(std::getenv("CMSSW_BASE"))+"/src/TauAnalysisTools/TauTriggerSFs/data/tauTriggerEfficiencies2017.root","ditau", "2017", "loose", "MVAv2"); else if (year=="2016") etsf=new TauTriggerSFs2017(string(std::getenv("CMSSW_BASE"))+"/src/TauAnalysisTools/TauTriggerSFs/data/tauTriggerEfficiencies2017.root","ditau", "2016", "tight", "MVAv2"); Int_t nentries_wtn = (Int_t) arbre->GetEntries(); @@ -376,7 +379,7 @@ int main(int argc, char** argv) { int mydm1=l1_decayMode; int mydm2=l2_decayMode; if (!byVVVLooseDeepVSe_2 or !byVLooseDeepVSmu_2 or !byVVVLooseDeepVSe_1 or !byVLooseDeepVSmu_1) continue; - /*float signalRegion=(byMediumDeepVSjet_1); + float signalRegion=(byMediumDeepVSjet_1); float antiisoRegion=(byVVVLooseDeepVSjet_1 && !byMediumDeepVSjet_1); float iso2=(byMediumDeepVSjet_2); float gen1=gen_match_1; @@ -392,9 +395,9 @@ int main(int argc, char** argv) { gen2=gen_match_1; mydm1=l2_decayMode; mydm2=l1_decayMode; - }*/ + } - float signalRegion=(byLooseDeepVSjet_1); + /*float signalRegion=(byLooseDeepVSjet_1); float antiisoRegion=(byVVVLooseDeepVSjet_1 && !byLooseDeepVSjet_1); float iso2=(byLooseDeepVSjet_2); float gen1=gen_match_1; @@ -410,11 +413,11 @@ int main(int argc, char** argv) { gen2=gen_match_1; mydm1=l2_decayMode; mydm2=l1_decayMode; - } + }*/ if (mytau1.DeltaR(mytau2)<0.5) continue; - if (year=="2018"){ + if (year=="2018"){ if (sample=="W"){ weight=51.542; if (numGenJets==1) weight=9.0452; @@ -423,14 +426,14 @@ int main(int argc, char** argv) { else if (numGenJets==4) weight=3.1984; } if (sample=="DY"){ - weight=3.6089; - if (numGenJets==1) weight=0.62727; - else if (numGenJets==2) weight=0.54991; - else if (numGenJets==3) weight=0.5971; - else if (numGenJets==4) weight=0.81783; + weight=3.62347; + if (numGenJets==1) weight=0.62980; + else if (numGenJets==2) weight=0.55213; + else if (numGenJets==3) weight=0.5995; + else if (numGenJets==4) weight=0.82114; } - } - else if (year=="2017"){ + } + else if (year=="2017"){ if (sample=="W"){ weight=23.8336; if (numGenJets==1) weight=3.1468; @@ -439,14 +442,14 @@ int main(int argc, char** argv) { else if (numGenJets==4) weight=2.1954; } if (sample=="DY"){ - weight=2.6774; - if (numGenJets==1) weight=0.7362; - else if (numGenJets==2) weight=0.96091; - else if (numGenJets==3) weight=1.70488; - else if (numGenJets==4) weight=0.243131; + weight=2.5805; + if (numGenJets==1) weight=0.71000; + else if (numGenJets==2) weight=0.921125; + else if (numGenJets==3) weight=1.6508; + else if (numGenJets==4) weight=0.21935; } - } - else if (year=="2016"){ + } + else if (year=="2016"){ if (sample=="W"){ weight=25.3918; if (numGenJets==1) weight=5.76634; @@ -455,13 +458,13 @@ int main(int argc, char** argv) { else if (numGenJets==4) weight=1.9645; } if (sample=="DY"){ - weight=1.52656; - if (numGenJets==1) weight=0.4180; - else if (numGenJets==2) weight=0.45093; - else if (numGenJets==3) weight=0.52897; - else if (numGenJets==4) weight=0.597; + weight=1.49237; + if (numGenJets==1) weight=0.47595; + else if (numGenJets==2) weight=0.49308; + else if (numGenJets==3) weight=0.50555; + else if (numGenJets==4) weight=0.41466; } - } + } if (gen1==6) continue; @@ -480,19 +483,19 @@ int main(int argc, char** argv) { if (dm2>10) dm2=10; int bin1=fct_tauid_2018->GetXaxis()->FindBin(dm1); int bin2=fct_tauid_2018->GetXaxis()->FindBin(dm2); - /*if (year=="2018" && byMediumDeepVSjet_1 && sample!="embedded" && sample!="data_obs" && gen_match_1==5) aweight=aweight*fct_tauid_2018->GetBinContent(bin1); + if (year=="2018" && byMediumDeepVSjet_1 && sample!="embedded" && sample!="data_obs" && gen_match_1==5) aweight=aweight*fct_tauid_2018->GetBinContent(bin1); if (year=="2017" && byMediumDeepVSjet_1 && sample!="embedded" && sample!="data_obs" && gen_match_1==5) aweight=aweight*fct_tauid_2017->GetBinContent(bin1); if (year=="2016" && byMediumDeepVSjet_1 && sample!="embedded" && sample!="data_obs" && gen_match_1==5) aweight=aweight*fct_tauid_2016->GetBinContent(bin1); if (year=="2018" && byMediumDeepVSjet_2 && sample!="embedded" && sample!="data_obs" && gen_match_2==5) aweight=aweight*fct_tauid_2018->GetBinContent(bin2); if (year=="2017" && byMediumDeepVSjet_2 && sample!="embedded" && sample!="data_obs" && gen_match_2==5) aweight=aweight*fct_tauid_2017->GetBinContent(bin2); - if (year=="2016" && byMediumDeepVSjet_2 && sample!="embedded" && sample!="data_obs" && gen_match_2==5) aweight=aweight*fct_tauid_2016->GetBinContent(bin2);*/ + if (year=="2016" && byMediumDeepVSjet_2 && sample!="embedded" && sample!="data_obs" && gen_match_2==5) aweight=aweight*fct_tauid_2016->GetBinContent(bin2); - if (year=="2018" && byLooseDeepVSjet_1 && sample!="embedded" && sample!="data_obs" && gen_match_1==5) aweight=aweight*fct_tauid_2018->GetBinContent(bin1); + /*if (year=="2018" && byLooseDeepVSjet_1 && sample!="embedded" && sample!="data_obs" && gen_match_1==5) aweight=aweight*fct_tauid_2018->GetBinContent(bin1); if (year=="2017" && byLooseDeepVSjet_1 && sample!="embedded" && sample!="data_obs" && gen_match_1==5) aweight=aweight*fct_tauid_2017->GetBinContent(bin1); if (year=="2016" && byLooseDeepVSjet_1 && sample!="embedded" && sample!="data_obs" && gen_match_1==5) aweight=aweight*fct_tauid_2016->GetBinContent(bin1); if (year=="2018" && byLooseDeepVSjet_2 && sample!="embedded" && sample!="data_obs" && gen_match_2==5) aweight=aweight*fct_tauid_2018->GetBinContent(bin2); if (year=="2017" && byLooseDeepVSjet_2 && sample!="embedded" && sample!="data_obs" && gen_match_2==5) aweight=aweight*fct_tauid_2017->GetBinContent(bin2); - if (year=="2016" && byLooseDeepVSjet_2 && sample!="embedded" && sample!="data_obs" && gen_match_2==5) aweight=aweight*fct_tauid_2016->GetBinContent(bin2); + if (year=="2016" && byLooseDeepVSjet_2 && sample!="embedded" && sample!="data_obs" && gen_match_2==5) aweight=aweight*fct_tauid_2016->GetBinContent(bin2);*/ TLorentzVector mymet; mymet.SetPtEtaPhiM(met,0,metphi,0); @@ -524,8 +527,8 @@ int main(int argc, char** argv) { //************************* Fill histograms ********************** float weight2=1.0; - float FF=get_raw_FF(mytau1.Pt(),ff_qcd_0jet)*get_mvis_closure((mytau1+mytau2).M(),mvisclosure); - if (njets>0) FF=get_raw_FF(mytau1.Pt(),ff_qcd_1jet)*get_mvis_closure((mytau1+mytau2).M(),mvisclosure); + float FF=get_raw_FF(mytau1.Pt(),ff_qcd_0jet)*get_mvis_closure((mytau1+mytau2).M(),mvisclosure)*get_mvis_closure(mytau2.Pt(),tau2closure); + if (njets>0) FF=get_raw_FF(mytau1.Pt(),ff_qcd_1jet)*get_mvis_closure((mytau1+mytau2).M(),mvisclosure)*get_mvis_closure(mytau2.Pt(),tau2closure); if (!is_includedInEmbedded){ if (isL or isT){ diff --git a/FFcode/bin/OSSScorrection_tt.cc b/FFcode/bin/OSSScorrection_tt.cc index a7a0e91..ecef264 100644 --- a/FFcode/bin/OSSScorrection_tt.cc +++ b/FFcode/bin/OSSScorrection_tt.cc @@ -302,12 +302,12 @@ int main(int argc, char** argv) { TFile *ftauid_2018 = new TFile((datapath+"TauID_SF_dm_DeepTau2017v2p1VSjet_2018ReReco.root").c_str()); TFile *ftauid_2017 = new TFile((datapath+"TauID_SF_dm_DeepTau2017v2p1VSjet_2017ReReco.root").c_str()); TFile *ftauid_2016 = new TFile((datapath+"TauID_SF_dm_DeepTau2017v2p1VSjet_2016Legacy.root").c_str()); - TH1F *fct_tauid_2018= (TH1F*) ftauid_2018->Get("Loose"); + /*TH1F *fct_tauid_2018= (TH1F*) ftauid_2018->Get("Loose"); TH1F *fct_tauid_2017= (TH1F*) ftauid_2017->Get("Loose"); - TH1F *fct_tauid_2016= (TH1F*) ftauid_2016->Get("Loose"); - /*TH1F *fct_tauid_2018= (TH1F*) ftauid_2018->Get("Medium"); + TH1F *fct_tauid_2016= (TH1F*) ftauid_2016->Get("Loose");*/ + TH1F *fct_tauid_2018= (TH1F*) ftauid_2018->Get("Medium"); TH1F *fct_tauid_2017= (TH1F*) ftauid_2017->Get("Medium"); - TH1F *fct_tauid_2016= (TH1F*) ftauid_2016->Get("Medium");*/ + TH1F *fct_tauid_2016= (TH1F*) ftauid_2016->Get("Medium"); TFile fwmc((datapath+"htt_scalefactors_legacy_2018.root").c_str()); @@ -332,8 +332,11 @@ int main(int argc, char** argv) { TFile fmvisclosure ("FF_corrections_tt.root"); TF1* mvisclosure_qcdloose=(TF1*) fmvisclosure.Get("closure_mvis_tt_qcdloose"); + TFile ftau2closure ("FF_corrections_1.root"); + TF1* tau2closure=(TF1*) ftau2closure.Get("closure_tau2pt_tt_qcdloose"); + TauTriggerSFs2017* etsf=new TauTriggerSFs2017(string(std::getenv("CMSSW_BASE"))+"/src/TauAnalysisTools/TauTriggerSFs/data/tauTriggerEfficiencies2018.root","ditau", "2018", "tight", "MVAv2"); - if (year=="2017") etsf=new TauTriggerSFs2017(string(std::getenv("CMSSW_BASE"))+"/src/TauAnalysisTools/TauTriggerSFs/data/tauTriggerEfficiencies2017.root","ditau", "2017", "tight", "MVAv2"); + if (year=="2017") etsf=new TauTriggerSFs2017(string(std::getenv("CMSSW_BASE"))+"/src/TauAnalysisTools/TauTriggerSFs/data/tauTriggerEfficiencies2017.root","ditau", "2017", "loose", "MVAv2"); else if (year=="2016") etsf=new TauTriggerSFs2017(string(std::getenv("CMSSW_BASE"))+"/src/TauAnalysisTools/TauTriggerSFs/data/tauTriggerEfficiencies2017.root","ditau", "2016", "tight", "MVAv2"); @@ -360,7 +363,7 @@ int main(int argc, char** argv) { TLorentzVector mytau1; mytau1.SetPtEtaPhiM(pt_1,eta_1,phi_1,m_1); if (!byVVVLooseDeepVSe_2 or !byVLooseDeepVSmu_2 or !byVVVLooseDeepVSe_1 or !byVLooseDeepVSmu_1) continue; - /*float signalRegion=(byMediumDeepVSjet_1); + float signalRegion=(byMediumDeepVSjet_1); float antiisoRegion=(byVVVLooseDeepVSjet_1 && !byMediumDeepVSjet_1); float iso2=(byMediumDeepVSjet_2); int mydm1=l1_decayMode; @@ -378,9 +381,9 @@ int main(int argc, char** argv) { mydm1=l2_decayMode; gen1=gen_match_2; gen2=gen_match_1; - }*/ + } - float signalRegion=(byLooseDeepVSjet_1); + /*float signalRegion=(byLooseDeepVSjet_1); float antiisoRegion=(byVVVLooseDeepVSjet_1 && !byLooseDeepVSjet_1); float iso2=(byLooseDeepVSjet_2); int mydm1=l1_decayMode; @@ -398,11 +401,11 @@ int main(int argc, char** argv) { mydm1=l2_decayMode; gen1=gen_match_2; gen2=gen_match_1; - } + }*/ if (mytau1.DeltaR(mytau2)<0.5) continue; - if (year=="2018"){ + if (year=="2018"){ if (sample=="W"){ weight=51.542; if (numGenJets==1) weight=9.0452; @@ -411,13 +414,13 @@ int main(int argc, char** argv) { else if (numGenJets==4) weight=3.1984; } if (sample=="DY"){ - weight=3.6089; - if (numGenJets==1) weight=0.62727; - else if (numGenJets==2) weight=0.54991; - else if (numGenJets==3) weight=0.5971; - else if (numGenJets==4) weight=0.81783; + weight=3.62347; + if (numGenJets==1) weight=0.62980; + else if (numGenJets==2) weight=0.55213; + else if (numGenJets==3) weight=0.5995; + else if (numGenJets==4) weight=0.82114; } - } + } else if (year=="2017"){ if (sample=="W"){ weight=23.8336; @@ -427,15 +430,11 @@ int main(int argc, char** argv) { else if (numGenJets==4) weight=2.1954; } if (sample=="DY"){ - weight=2.6774; - if (numGenJets==1) - weight=0.7362; - else if (numGenJets==2) - weight=0.96091; - else if (numGenJets==3) - weight=1.70488; - else if (numGenJets==4) - weight=0.243131; + weight=2.5805; + if (numGenJets==1) weight=0.71000; + else if (numGenJets==2) weight=0.921125; + else if (numGenJets==3) weight=1.6508; + else if (numGenJets==4) weight=0.21935; } } else if (year=="2016"){ @@ -447,15 +446,11 @@ int main(int argc, char** argv) { else if (numGenJets==4) weight=1.9645; } if (sample=="DY"){ - weight=1.52656; - if (numGenJets==1) - weight=0.4180; - else if (numGenJets==2) - weight=0.45093; - else if (numGenJets==3) - weight=0.52897; - else if (numGenJets==4) - weight=0.597; + weight=1.49237; + if (numGenJets==1) weight=0.47595; + else if (numGenJets==2) weight=0.49308; + else if (numGenJets==3) weight=0.50555; + else if (numGenJets==4) weight=0.41466; } } @@ -473,19 +468,19 @@ int main(int argc, char** argv) { if (dm2>10) dm2=10; int bin1=fct_tauid_2018->GetXaxis()->FindBin(dm1); int bin2=fct_tauid_2018->GetXaxis()->FindBin(dm2); - /*if (year=="2018" && byMediumDeepVSjet_1 && sample!="embedded" && sample!="data_obs" && gen_match_1==5) aweight=aweight*fct_tauid_2018->GetBinContent(bin1); + if (year=="2018" && byMediumDeepVSjet_1 && sample!="embedded" && sample!="data_obs" && gen_match_1==5) aweight=aweight*fct_tauid_2018->GetBinContent(bin1); if (year=="2017" && byMediumDeepVSjet_1 && sample!="embedded" && sample!="data_obs" && gen_match_1==5) aweight=aweight*fct_tauid_2017->GetBinContent(bin1); if (year=="2016" && byMediumDeepVSjet_1 && sample!="embedded" && sample!="data_obs" && gen_match_1==5) aweight=aweight*fct_tauid_2016->GetBinContent(bin1); if (year=="2018" && byMediumDeepVSjet_2 && sample!="embedded" && sample!="data_obs" && gen_match_2==5) aweight=aweight*fct_tauid_2018->GetBinContent(bin2); if (year=="2017" && byMediumDeepVSjet_2 && sample!="embedded" && sample!="data_obs" && gen_match_2==5) aweight=aweight*fct_tauid_2017->GetBinContent(bin2); - if (year=="2016" && byMediumDeepVSjet_2 && sample!="embedded" && sample!="data_obs" && gen_match_2==5) aweight=aweight*fct_tauid_2016->GetBinContent(bin2);*/ + if (year=="2016" && byMediumDeepVSjet_2 && sample!="embedded" && sample!="data_obs" && gen_match_2==5) aweight=aweight*fct_tauid_2016->GetBinContent(bin2); - if (year=="2018" && byLooseDeepVSjet_1 && sample!="embedded" && sample!="data_obs" && gen_match_1==5) aweight=aweight*fct_tauid_2018->GetBinContent(bin1); + /*if (year=="2018" && byLooseDeepVSjet_1 && sample!="embedded" && sample!="data_obs" && gen_match_1==5) aweight=aweight*fct_tauid_2018->GetBinContent(bin1); if (year=="2017" && byLooseDeepVSjet_1 && sample!="embedded" && sample!="data_obs" && gen_match_1==5) aweight=aweight*fct_tauid_2017->GetBinContent(bin1); if (year=="2016" && byLooseDeepVSjet_1 && sample!="embedded" && sample!="data_obs" && gen_match_1==5) aweight=aweight*fct_tauid_2016->GetBinContent(bin1); if (year=="2018" && byLooseDeepVSjet_2 && sample!="embedded" && sample!="data_obs" && gen_match_2==5) aweight=aweight*fct_tauid_2018->GetBinContent(bin2); if (year=="2017" && byLooseDeepVSjet_2 && sample!="embedded" && sample!="data_obs" && gen_match_2==5) aweight=aweight*fct_tauid_2017->GetBinContent(bin2); - if (year=="2016" && byLooseDeepVSjet_2 && sample!="embedded" && sample!="data_obs" && gen_match_2==5) aweight=aweight*fct_tauid_2016->GetBinContent(bin2); + if (year=="2016" && byLooseDeepVSjet_2 && sample!="embedded" && sample!="data_obs" && gen_match_2==5) aweight=aweight*fct_tauid_2016->GetBinContent(bin2);*/ TLorentzVector mymet; @@ -519,8 +514,8 @@ int main(int argc, char** argv) { float weight2=1.0; float myvar=(mytau1+mytau2).M(); - float ff_qcd=get_raw_FF(mytau1.Pt(),ff_qcd_0jet);//*get_mvis_closure((myele+mytau).M(),mvisclosure_qcdloose); - if (njets>0) ff_qcd=get_raw_FF(mytau1.Pt(),ff_qcd_1jet);//*get_mvis_closure((myele+mytau).M(),mvisclosure_qcdloose); + float ff_qcd=get_raw_FF(mytau1.Pt(),ff_qcd_0jet);//*get_mvis_closure(mytau2.Pt(),tau2closure);//*get_mvis_closure((myele+mytau).M(),mvisclosure_qcdloose); + if (njets>0) ff_qcd=get_raw_FF(mytau1.Pt(),ff_qcd_1jet);//*get_mvis_closure(mytau2.Pt(),tau2closure);//*get_mvis_closure((myele+mytau).M(),mvisclosure_qcdloose); if (!is_includedInEmbedded){ diff --git a/FFcode/bin/RawFF_tt.cc b/FFcode/bin/RawFF_tt.cc index 7f73e93..21e9899 100644 --- a/FFcode/bin/RawFF_tt.cc +++ b/FFcode/bin/RawFF_tt.cc @@ -326,12 +326,12 @@ int main(int argc, char** argv) { TFile *ftauid_2018 = new TFile((datapath+"TauID_SF_dm_DeepTau2017v2p1VSjet_2018ReReco.root").c_str()); TFile *ftauid_2017 = new TFile((datapath+"TauID_SF_dm_DeepTau2017v2p1VSjet_2017ReReco.root").c_str()); TFile *ftauid_2016 = new TFile((datapath+"TauID_SF_dm_DeepTau2017v2p1VSjet_2016Legacy.root").c_str()); - TH1F *fct_tauid_2018= (TH1F*) ftauid_2018->Get("Loose"); + /*TH1F *fct_tauid_2018= (TH1F*) ftauid_2018->Get("Loose"); TH1F *fct_tauid_2017= (TH1F*) ftauid_2017->Get("Loose"); - TH1F *fct_tauid_2016= (TH1F*) ftauid_2016->Get("Loose"); - /*TH1F *fct_tauid_2018= (TH1F*) ftauid_2018->Get("Medium"); + TH1F *fct_tauid_2016= (TH1F*) ftauid_2016->Get("Loose");*/ + TH1F *fct_tauid_2018= (TH1F*) ftauid_2018->Get("Medium"); TH1F *fct_tauid_2017= (TH1F*) ftauid_2017->Get("Medium"); - TH1F *fct_tauid_2016= (TH1F*) ftauid_2016->Get("Medium");*/ + TH1F *fct_tauid_2016= (TH1F*) ftauid_2016->Get("Medium"); TFile fwmc((datapath+"htt_scalefactors_legacy_2018.root").c_str()); RooWorkspace *wmc = (RooWorkspace*)fwmc.Get("w"); @@ -348,7 +348,7 @@ int main(int argc, char** argv) { } TauTriggerSFs2017* etsf=new TauTriggerSFs2017(string(std::getenv("CMSSW_BASE"))+"/src/TauAnalysisTools/TauTriggerSFs/data/tauTriggerEfficiencies2018.root","ditau", "2018", "tight", "MVAv2"); - if (year=="2017") etsf=new TauTriggerSFs2017(string(std::getenv("CMSSW_BASE"))+"/src/TauAnalysisTools/TauTriggerSFs/data/tauTriggerEfficiencies2017.root","ditau", "2017", "tight", "MVAv2"); + if (year=="2017") etsf=new TauTriggerSFs2017(string(std::getenv("CMSSW_BASE"))+"/src/TauAnalysisTools/TauTriggerSFs/data/tauTriggerEfficiencies2017.root","ditau", "2017", "loose", "MVAv2"); else if (year=="2016") etsf=new TauTriggerSFs2017(string(std::getenv("CMSSW_BASE"))+"/src/TauAnalysisTools/TauTriggerSFs/data/tauTriggerEfficiencies2017.root","ditau", "2016", "tight", "MVAv2"); Int_t nentries_wtn = (Int_t) arbre->GetEntries(); @@ -388,7 +388,7 @@ int main(int argc, char** argv) { float gen1=gen_match_1; float gen2=gen_match_2; - /*float signalRegion=(byMediumDeepVSjet_1); + float signalRegion=(byMediumDeepVSjet_1); float antiisoRegion=(byVVVLooseDeepVSjet_1 && !byMediumDeepVSjet_1); float iso2=(byMediumDeepVSjet_2); @@ -402,9 +402,9 @@ int main(int argc, char** argv) { mydm2=l1_decayMode; gen1=gen_match_2; gen2=gen_match_1; - }*/ + } - float signalRegion=(byLooseDeepVSjet_1); + /*float signalRegion=(byLooseDeepVSjet_1); float antiisoRegion=(byVVVLooseDeepVSjet_1 && !byLooseDeepVSjet_1); float iso2=(byLooseDeepVSjet_2); @@ -418,7 +418,7 @@ int main(int argc, char** argv) { mydm2=l1_decayMode; gen1=gen_match_2; gen2=gen_match_1; - } + }*/ if (mytau1.DeltaR(mytau2)<0.5) continue; @@ -431,11 +431,11 @@ int main(int argc, char** argv) { else if (numGenJets==4) weight=3.1984; } if (sample=="DY"){ - weight=3.6089; - if (numGenJets==1) weight=0.62727; - else if (numGenJets==2) weight=0.54991; - else if (numGenJets==3) weight=0.5971; - else if (numGenJets==4) weight=0.81783; + weight=3.62347; + if (numGenJets==1) weight=0.62980; + else if (numGenJets==2) weight=0.55213; + else if (numGenJets==3) weight=0.5995; + else if (numGenJets==4) weight=0.82114; } } else if (year=="2017"){ @@ -447,11 +447,11 @@ int main(int argc, char** argv) { else if (numGenJets==4) weight=2.1954; } if (sample=="DY"){ - weight=2.6774; - if (numGenJets==1) weight=0.7362; - else if (numGenJets==2) weight=0.96091; - else if (numGenJets==3) weight=1.70488; - else if (numGenJets==4) weight=0.243131; + weight=2.5805; + if (numGenJets==1) weight=0.71000; + else if (numGenJets==2) weight=0.921125; + else if (numGenJets==3) weight=1.6508; + else if (numGenJets==4) weight=0.21935; } } else if (year=="2016"){ @@ -463,11 +463,11 @@ int main(int argc, char** argv) { else if (numGenJets==4) weight=1.9645; } if (sample=="DY"){ - weight=1.52656; - if (numGenJets==1) weight=0.4180; - else if (numGenJets==2) weight=0.45093; - else if (numGenJets==3) weight=0.52897; - else if (numGenJets==4) weight=0.597; + weight=1.49237; + if (numGenJets==1) weight=0.47595; + else if (numGenJets==2) weight=0.49308; + else if (numGenJets==3) weight=0.50555; + else if (numGenJets==4) weight=0.41466; } } @@ -485,18 +485,18 @@ int main(int argc, char** argv) { if (dm2>10) dm2=10; int bin1=fct_tauid_2018->GetXaxis()->FindBin(dm1); int bin2=fct_tauid_2018->GetXaxis()->FindBin(dm2); - /*if (year=="2018" && byMediumDeepVSjet_1 && sample!="embedded" && sample!="data_obs" && gen_match_1==5) aweight=aweight*fct_tauid_2018->GetBinContent(bin1); + if (year=="2018" && byMediumDeepVSjet_1 && sample!="embedded" && sample!="data_obs" && gen_match_1==5) aweight=aweight*fct_tauid_2018->GetBinContent(bin1); if (year=="2017" && byMediumDeepVSjet_1 && sample!="embedded" && sample!="data_obs" && gen_match_1==5) aweight=aweight*fct_tauid_2017->GetBinContent(bin1); if (year=="2016" && byMediumDeepVSjet_1 && sample!="embedded" && sample!="data_obs" && gen_match_1==5) aweight=aweight*fct_tauid_2016->GetBinContent(bin1); if (year=="2018" && byMediumDeepVSjet_2 && sample!="embedded" && sample!="data_obs" && gen_match_2==5) aweight=aweight*fct_tauid_2018->GetBinContent(bin2); if (year=="2017" && byMediumDeepVSjet_2 && sample!="embedded" && sample!="data_obs" && gen_match_2==5) aweight=aweight*fct_tauid_2017->GetBinContent(bin2); - if (year=="2016" && byMediumDeepVSjet_2 && sample!="embedded" && sample!="data_obs" && gen_match_2==5) aweight=aweight*fct_tauid_2016->GetBinContent(bin2);*/ - if (year=="2018" && byLooseDeepVSjet_1 && sample!="embedded" && sample!="data_obs" && gen_match_1==5) aweight=aweight*fct_tauid_2018->GetBinContent(bin1); + if (year=="2016" && byMediumDeepVSjet_2 && sample!="embedded" && sample!="data_obs" && gen_match_2==5) aweight=aweight*fct_tauid_2016->GetBinContent(bin2); + /*if (year=="2018" && byLooseDeepVSjet_1 && sample!="embedded" && sample!="data_obs" && gen_match_1==5) aweight=aweight*fct_tauid_2018->GetBinContent(bin1); if (year=="2017" && byLooseDeepVSjet_1 && sample!="embedded" && sample!="data_obs" && gen_match_1==5) aweight=aweight*fct_tauid_2017->GetBinContent(bin1); if (year=="2016" && byLooseDeepVSjet_1 && sample!="embedded" && sample!="data_obs" && gen_match_1==5) aweight=aweight*fct_tauid_2016->GetBinContent(bin1); if (year=="2018" && byLooseDeepVSjet_2 && sample!="embedded" && sample!="data_obs" && gen_match_2==5) aweight=aweight*fct_tauid_2018->GetBinContent(bin2); if (year=="2017" && byLooseDeepVSjet_2 && sample!="embedded" && sample!="data_obs" && gen_match_2==5) aweight=aweight*fct_tauid_2017->GetBinContent(bin2); - if (year=="2016" && byLooseDeepVSjet_2 && sample!="embedded" && sample!="data_obs" && gen_match_2==5) aweight=aweight*fct_tauid_2016->GetBinContent(bin2); + if (year=="2016" && byLooseDeepVSjet_2 && sample!="embedded" && sample!="data_obs" && gen_match_2==5) aweight=aweight*fct_tauid_2016->GetBinContent(bin2);*/ TLorentzVector mymet; mymet.SetPtEtaPhiM(met,0,metphi,0); diff --git a/FFcode/bin/Set1_correction_tt.cc b/FFcode/bin/Set1_correction_tt.cc index a1f0c5a..27407db 100644 --- a/FFcode/bin/Set1_correction_tt.cc +++ b/FFcode/bin/Set1_correction_tt.cc @@ -347,12 +347,12 @@ int main(int argc, char** argv) { TFile *ftauid_2018 = new TFile((datapath+"TauID_SF_dm_DeepTau2017v2p1VSjet_2018ReReco.root").c_str()); TFile *ftauid_2017 = new TFile((datapath+"TauID_SF_dm_DeepTau2017v2p1VSjet_2017ReReco.root").c_str()); TFile *ftauid_2016 = new TFile((datapath+"TauID_SF_dm_DeepTau2017v2p1VSjet_2016Legacy.root").c_str()); - TH1F *fct_tauid_2018= (TH1F*) ftauid_2018->Get("Loose"); + /*TH1F *fct_tauid_2018= (TH1F*) ftauid_2018->Get("Loose"); TH1F *fct_tauid_2017= (TH1F*) ftauid_2017->Get("Loose"); - TH1F *fct_tauid_2016= (TH1F*) ftauid_2016->Get("Loose"); - /*TH1F *fct_tauid_2018= (TH1F*) ftauid_2018->Get("Medium"); + TH1F *fct_tauid_2016= (TH1F*) ftauid_2016->Get("Loose");*/ + TH1F *fct_tauid_2018= (TH1F*) ftauid_2018->Get("Medium"); TH1F *fct_tauid_2017= (TH1F*) ftauid_2017->Get("Medium"); - TH1F *fct_tauid_2016= (TH1F*) ftauid_2016->Get("Medium");*/ + TH1F *fct_tauid_2016= (TH1F*) ftauid_2016->Get("Medium"); TFile fwmc((datapath+"htt_scalefactors_legacy_2018.root").c_str()); RooWorkspace *wmc = (RooWorkspace*)fwmc.Get("w"); @@ -376,7 +376,7 @@ int main(int argc, char** argv) { TF1* ff_looseSSqcd_1jet=(TF1*) frawff.Get("rawFF_tt_qcd_1jetSSloose"); TauTriggerSFs2017* etsf=new TauTriggerSFs2017(string(std::getenv("CMSSW_BASE"))+"/src/TauAnalysisTools/TauTriggerSFs/data/tauTriggerEfficiencies2018.root","ditau", "2018", "tight", "MVAv2"); - if (year=="2017") etsf=new TauTriggerSFs2017(string(std::getenv("CMSSW_BASE"))+"/src/TauAnalysisTools/TauTriggerSFs/data/tauTriggerEfficiencies2017.root","ditau", "2017", "tight", "MVAv2"); + if (year=="2017") etsf=new TauTriggerSFs2017(string(std::getenv("CMSSW_BASE"))+"/src/TauAnalysisTools/TauTriggerSFs/data/tauTriggerEfficiencies2017.root","ditau", "2017", "loose", "MVAv2"); else if (year=="2016") etsf=new TauTriggerSFs2017(string(std::getenv("CMSSW_BASE"))+"/src/TauAnalysisTools/TauTriggerSFs/data/tauTriggerEfficiencies2017.root","ditau", "2016", "tight", "MVAv2"); Int_t nentries_wtn = (Int_t) arbre->GetEntries(); @@ -403,7 +403,7 @@ int main(int argc, char** argv) { mytau1.SetPtEtaPhiM(pt_1,eta_1,phi_1,m_1); if (!byVVVLooseDeepVSe_2 or !byVLooseDeepVSmu_2 or !byVVVLooseDeepVSe_1 or !byVLooseDeepVSmu_1) continue; - /*float signalRegion=(byMediumDeepVSjet_1); + float signalRegion=(byMediumDeepVSjet_1); float antiisoRegion=(byVVVLooseDeepVSjet_1 && !byMediumDeepVSjet_1); float iso2=byMediumDeepVSjet_2; int mydm1=l1_decayMode; @@ -421,9 +421,9 @@ int main(int argc, char** argv) { mydm2=l1_decayMode; gen1=gen_match_2; gen2=gen_match_1; - }*/ + } - float signalRegion=(byLooseDeepVSjet_1); + /*float signalRegion=(byLooseDeepVSjet_1); float antiisoRegion=(byVVVLooseDeepVSjet_1 && !byLooseDeepVSjet_1); float iso2=byLooseDeepVSjet_2; int mydm1=l1_decayMode; @@ -441,11 +441,11 @@ int main(int argc, char** argv) { mydm2=l1_decayMode; gen1=gen_match_2; gen2=gen_match_1; - } + }*/ if (mytau1.DeltaR(mytau2)<0.5) continue; - if (year=="2018"){ + if (year=="2018"){ if (sample=="W"){ weight=51.542; if (numGenJets==1) weight=9.0452; @@ -454,13 +454,13 @@ int main(int argc, char** argv) { else if (numGenJets==4) weight=3.1984; } if (sample=="DY"){ - weight=3.6089; - if (numGenJets==1) weight=0.62727; - else if (numGenJets==2) weight=0.54991; - else if (numGenJets==3) weight=0.5971; - else if (numGenJets==4) weight=0.81783; + weight=3.62347; + if (numGenJets==1) weight=0.62980; + else if (numGenJets==2) weight=0.55213; + else if (numGenJets==3) weight=0.5995; + else if (numGenJets==4) weight=0.82114; } - } + } else if (year=="2017"){ if (sample=="W"){ weight=23.8336; @@ -470,15 +470,11 @@ int main(int argc, char** argv) { else if (numGenJets==4) weight=2.1954; } if (sample=="DY"){ - weight=2.6774; - if (numGenJets==1) - weight=0.7362; - else if (numGenJets==2) - weight=0.96091; - else if (numGenJets==3) - weight=1.70488; - else if (numGenJets==4) - weight=0.243131; + weight=2.5805; + if (numGenJets==1) weight=0.71000; + else if (numGenJets==2) weight=0.921125; + else if (numGenJets==3) weight=1.6508; + else if (numGenJets==4) weight=0.21935; } } else if (year=="2016"){ @@ -490,15 +486,11 @@ int main(int argc, char** argv) { else if (numGenJets==4) weight=1.9645; } if (sample=="DY"){ - weight=1.52656; - if (numGenJets==1) - weight=0.4180; - else if (numGenJets==2) - weight=0.45093; - else if (numGenJets==3) - weight=0.52897; - else if (numGenJets==4) - weight=0.597; + weight=1.49237; + if (numGenJets==1) weight=0.47595; + else if (numGenJets==2) weight=0.49308; + else if (numGenJets==3) weight=0.50555; + else if (numGenJets==4) weight=0.41466; } } @@ -516,19 +508,19 @@ int main(int argc, char** argv) { if (dm2>10) dm2=10; int bin1=fct_tauid_2018->GetXaxis()->FindBin(dm1); int bin2=fct_tauid_2018->GetXaxis()->FindBin(dm2); - /*if (year=="2018" && byMediumDeepVSjet_1 && sample!="embedded" && sample!="data_obs" && gen_match_1==5) aweight=aweight*fct_tauid_2018->GetBinContent(bin1); + if (year=="2018" && byMediumDeepVSjet_1 && sample!="embedded" && sample!="data_obs" && gen_match_1==5) aweight=aweight*fct_tauid_2018->GetBinContent(bin1); if (year=="2017" && byMediumDeepVSjet_1 && sample!="embedded" && sample!="data_obs" && gen_match_1==5) aweight=aweight*fct_tauid_2017->GetBinContent(bin1); if (year=="2016" && byMediumDeepVSjet_1 && sample!="embedded" && sample!="data_obs" && gen_match_1==5) aweight=aweight*fct_tauid_2016->GetBinContent(bin1); if (year=="2018" && byMediumDeepVSjet_2 && sample!="embedded" && sample!="data_obs" && gen_match_2==5) aweight=aweight*fct_tauid_2018->GetBinContent(bin2); if (year=="2017" && byMediumDeepVSjet_2 && sample!="embedded" && sample!="data_obs" && gen_match_2==5) aweight=aweight*fct_tauid_2017->GetBinContent(bin2); - if (year=="2016" && byMediumDeepVSjet_2 && sample!="embedded" && sample!="data_obs" && gen_match_2==5) aweight=aweight*fct_tauid_2016->GetBinContent(bin2);*/ + if (year=="2016" && byMediumDeepVSjet_2 && sample!="embedded" && sample!="data_obs" && gen_match_2==5) aweight=aweight*fct_tauid_2016->GetBinContent(bin2); - if (year=="2018" && byLooseDeepVSjet_1 && sample!="embedded" && sample!="data_obs" && gen_match_1==5) aweight=aweight*fct_tauid_2018->GetBinContent(bin1); + /*if (year=="2018" && byLooseDeepVSjet_1 && sample!="embedded" && sample!="data_obs" && gen_match_1==5) aweight=aweight*fct_tauid_2018->GetBinContent(bin1); if (year=="2017" && byLooseDeepVSjet_1 && sample!="embedded" && sample!="data_obs" && gen_match_1==5) aweight=aweight*fct_tauid_2017->GetBinContent(bin1); if (year=="2016" && byLooseDeepVSjet_1 && sample!="embedded" && sample!="data_obs" && gen_match_1==5) aweight=aweight*fct_tauid_2016->GetBinContent(bin1); if (year=="2018" && byLooseDeepVSjet_2 && sample!="embedded" && sample!="data_obs" && gen_match_2==5) aweight=aweight*fct_tauid_2018->GetBinContent(bin2); if (year=="2017" && byLooseDeepVSjet_2 && sample!="embedded" && sample!="data_obs" && gen_match_2==5) aweight=aweight*fct_tauid_2017->GetBinContent(bin2); - if (year=="2016" && byLooseDeepVSjet_2 && sample!="embedded" && sample!="data_obs" && gen_match_2==5) aweight=aweight*fct_tauid_2016->GetBinContent(bin2); + if (year=="2016" && byLooseDeepVSjet_2 && sample!="embedded" && sample!="data_obs" && gen_match_2==5) aweight=aweight*fct_tauid_2016->GetBinContent(bin2);*/ TLorentzVector mymet; diff --git a/FFcode/interface/ApplyFF.h b/FFcode/interface/ApplyFF.h index ed197c8..c4a24ef 100644 --- a/FFcode/interface/ApplyFF.h +++ b/FFcode/interface/ApplyFF.h @@ -10,8 +10,8 @@ float get_raw_FF(float pt, TF1* fct){ float get_mvis_closure(float mvis, TF1* fct){ float corr=1.0; corr=fct->Eval(mvis); - if (mvis>300) corr=fct->Eval(300); - if (mvis<50) corr=fct->Eval(50); + //if (mvis>300) corr=fct->Eval(300); + //if (mvis<50) corr=fct->Eval(50); return corr; } diff --git a/FFcode/python/Draw_closure_tt.py b/FFcode/python/Draw_closure_tt.py index 0608bc3..6a241c5 100755 --- a/FFcode/python/Draw_closure_tt.py +++ b/FFcode/python/Draw_closure_tt.py @@ -15,7 +15,7 @@ def add_lumi(datayear): lumi.SetTextSize(0.06) lumi.SetTextFont ( 42 ) if datayear=="2018": - lumi.AddText("2018, 59.5 fb^{-1} (13 TeV)") + lumi.AddText("2018, 59.7 fb^{-1} (13 TeV)") elif datayear=="2017": lumi.AddText("2017, 41.5 fb^{-1} (13 TeV)") elif datayear=="2016": @@ -199,7 +199,14 @@ def Draw_closure_tt(year): h1.Divide(hwoE) h3.Divide(hwoE) h1.GetXaxis().SetTitle("Bin number") - h1.GetXaxis().SetTitle("#tau_{h} p_{T} (GeV)") + h1.GetXaxis().SetTitle("m_{vis} (GeV)") + if i==1 or i==5: + h1.GetXaxis().SetTitle("Leading #tau_{h} p_{T} (GeV)") + if i==2 or i==6: + h1.GetXaxis().SetTitle("Subleading #tau_{h} p_{T} (GeV)") + if i==3 or i==7: + h1.GetXaxis().SetTitle("MET (GeV)") + h1.GetXaxis().SetLabelSize(0.08) h1.GetYaxis().SetLabelSize(0.08) h1.GetYaxis().SetTitle("Obs./Exp.") diff --git a/FFcode/python/Draw_control_tt.py b/FFcode/python/Draw_control_tt.py index 7f14013..043ceaa 100755 --- a/FFcode/python/Draw_control_tt.py +++ b/FFcode/python/Draw_control_tt.py @@ -16,7 +16,7 @@ def add_lumi(datayear): lumi.SetTextSize(0.06) lumi.SetTextFont ( 42 ) if datayear=="2018": - lumi.AddText("2018, 59.5 fb^{-1} (13 TeV)") + lumi.AddText("2018, 59.7 fb^{-1} (13 TeV)") elif datayear=="2017": lumi.AddText("2017, 41.5 fb^{-1} (13 TeV)") elif datayear=="2016": @@ -203,7 +203,7 @@ def Draw_control_tt(year): if i==2: h1.GetXaxis().SetTitle("Leading #tau p_{T} (GeV)") if i==3: - h1.GetXaxis().SetTitle("Higgs #p_{T} (GeV)") + h1.GetXaxis().SetTitle("Higgs p_{T} (GeV)") if i==4: h1.GetXaxis().SetTitle("MET (GeV)") h1.GetXaxis().SetLabelSize(0.08) diff --git a/FFcode/python/Draw_raw.py b/FFcode/python/Draw_raw.py index d8fe0fe..bfbaa6e 100755 --- a/FFcode/python/Draw_raw.py +++ b/FFcode/python/Draw_raw.py @@ -16,7 +16,7 @@ def add_lumi(datayear): lumi.SetTextSize(0.06) lumi.SetTextFont ( 42 ) if datayear=="2018": - lumi.AddText("2018, 59.5 fb^{-1} (13 TeV)") + lumi.AddText("2018, 59.7 fb^{-1} (13 TeV)") elif datayear=="2017": lumi.AddText("2017, 41.5 fb^{-1} (13 TeV)") elif datayear=="2016": diff --git a/FFcode/python/Draw_raw_tt.py b/FFcode/python/Draw_raw_tt.py index b95b8df..8d9de49 100755 --- a/FFcode/python/Draw_raw_tt.py +++ b/FFcode/python/Draw_raw_tt.py @@ -15,7 +15,7 @@ def add_lumi(datayear): lumi.SetTextSize(0.06) lumi.SetTextFont ( 42 ) if datayear=="2018": - lumi.AddText("2018, 59.5 fb^{-1} (13 TeV)") + lumi.AddText("2018, 59.7 fb^{-1} (13 TeV)") elif datayear=="2017": lumi.AddText("2017, 41.5 fb^{-1} (13 TeV)") elif datayear=="2016": diff --git a/Fit_FF_et.cc b/Fit_FF_et.cc index ebaf146..a458e25 100644 --- a/Fit_FF_et.cc +++ b/Fit_FF_et.cc @@ -129,7 +129,7 @@ TF1 *M_FR(int WP, std::string type, std::string files, std::string num, std::str t.SetTextSize(0.04); if (year==2016) t.DrawLatex(0.55, .96, "35.9 fb^{-1} (2016, 13 TeV)"); else if (year==2017) t.DrawLatex(0.55, .96, "41.5 fb^{-1} (2017, 13 TeV)"); - else if (year==2018) t.DrawLatex(0.55, .96, "59.5 fb^{-1} (2018, 13 TeV)"); + else if (year==2018) t.DrawLatex(0.55, .96, "59.7 fb^{-1} (2018, 13 TeV)"); if (type.find("Line2P") < 140){ theFit2->Draw("SAME"); theFit2->SetLineColor(2); diff --git a/Fit_FF_mt.cc b/Fit_FF_mt.cc index c4495f3..54de668 100644 --- a/Fit_FF_mt.cc +++ b/Fit_FF_mt.cc @@ -145,7 +145,7 @@ TF1 *M_FR(int WP, std::string type, std::string files, std::string num, std::str t.SetTextSize(0.04); if (year==2016) t.DrawLatex(0.55, .96, "35.9 fb^{-1} (2016, 13 TeV)"); else if (year==2017) t.DrawLatex(0.55, .96, "41.5 fb^{-1} (2017, 13 TeV)"); - else if (year==2018) t.DrawLatex(0.55, .96, "59.5 fb^{-1} (2018, 13 TeV)"); + else if (year==2018) t.DrawLatex(0.55, .96, "59.7 fb^{-1} (2018, 13 TeV)"); if (type.find("Line2P") < 140){ theFit2->Draw("SAME"); theFit2->SetLineColor(2); diff --git a/Fit_FF_tt.cc b/Fit_FF_tt.cc index f95c205..a7271a8 100644 --- a/Fit_FF_tt.cc +++ b/Fit_FF_tt.cc @@ -104,6 +104,27 @@ TF1 *M_FR(int WP, std::string type, std::string files, std::string num, std::str theFit->SetParameter(2, 70); theFit->SetParameter(3, 21); + if (year==2017 and name.find("0jet")<140){ + theFit->SetParameter(0, 0.20); + theFit->SetParameter(1, 3.0); + theFit->SetParameter(2, 11.0); + theFit->SetParameter(3, 1.2); + } + + if (year==2017 and name.find("1jet")<140){ + theFit->SetParameter(0, 0.15); + theFit->SetParameter(1, 20.0); + theFit->SetParameter(2, 10.0); + theFit->SetParameter(3, 0.8); + } + + if (year==2018 and name.find("1jet")<140){ + theFit->SetParameter(0, 0.174); + theFit->SetParameter(1, 2.0); + theFit->SetParameter(2, 10.0); + theFit->SetParameter(3, 2.2); + } + theFit2->SetParameter(0, 0.09); theFit2->SetParameter(1, 0.00001); @@ -138,7 +159,7 @@ TF1 *M_FR(int WP, std::string type, std::string files, std::string num, std::str t.SetTextSize(0.04); if (year==2016) t.DrawLatex(0.55, .96, "35.9 fb^{-1} (2016, 13 TeV)"); else if (year==2017) t.DrawLatex(0.55, .96, "41.5 fb^{-1} (2017, 13 TeV)"); - else if (year==2018) t.DrawLatex(0.55, .96, "59.5 fb^{-1} (2018, 13 TeV)"); + else if (year==2018) t.DrawLatex(0.55, .96, "59.7 fb^{-1} (2018, 13 TeV)"); if (type.find("Line2P") < 140){ theFit2->Draw("SAME"); theFit2->SetLineColor(2); @@ -246,10 +267,10 @@ void Fit_FF_tt(int year) { Double_t fMax = 1000; TF1* m11 = M_FR(1, "a", "files_rawFF_tt/DataSub.root", "tt_0jet_qcd_iso", "tt_0jet_qcd_anti", "rawFF_tt_qcd_0jet", Fit_Value_tau, fMin, fMax, year); - TF1* m12 = M_FR(2, "exp", "files_rawFF_tt/DataSub.root", "tt_1jet_qcd_iso", "tt_1jet_qcd_anti", "rawFF_tt_qcd_1jet", Fit_Value_tau, fMin, fMax, year); + TF1* m12 = M_FR(2, "a", "files_rawFF_tt/DataSub.root", "tt_1jet_qcd_iso", "tt_1jet_qcd_anti", "rawFF_tt_qcd_1jet", Fit_Value_tau, fMin, fMax, year); TF1* m18 = M_FR(8, "a", "files_rawFF_tt/DataSub.root", "tt_0SSloose_qcd_iso", "tt_0SSloose_qcd_anti", "rawFF_tt_qcd_0jetSSloose", Fit_Value_tau, fMin, fMax, year); - TF1* m19 = M_FR(9, "exp", "files_rawFF_tt/DataSub.root", "tt_1SSloose_qcd_iso", "tt_1SSloose_qcd_anti", "rawFF_tt_qcd_1jetSSloose", Fit_Value_tau, fMin, fMax, year); + TF1* m19 = M_FR(9, "a", "files_rawFF_tt/DataSub.root", "tt_1SSloose_qcd_iso", "tt_1SSloose_qcd_anti", "rawFF_tt_qcd_1jetSSloose", Fit_Value_tau, fMin, fMax, year); } diff --git a/Fit_FFclosure_tt.cc b/Fit_FFclosure_tt.cc index 897f5f7..829e65d 100644 --- a/Fit_FFclosure_tt.cc +++ b/Fit_FFclosure_tt.cc @@ -69,7 +69,7 @@ Double_t fitFunc_Exp3Par(Double_t *x, Double_t *par) { Double_t fitFunc_Line2Par(Double_t *x, Double_t *par) { //return par[0] + par[1] * x[0] + par[2] * x[0]* x[0];// + par[3] * x[0]* x[0] *x[0]; - return par[0] + par[1]* (x[0]-150); + return par[0] + par[1]* (x[0]-60); // return par[0] + par[1]*x[0] + par[2]*(TMath::Landau(x[0],par[3],par[4],0)); //return par[0] + par[1]*(TMath::Exp(par[2] * x[0]-par[3])); } @@ -214,7 +214,7 @@ TF1 *M_FR(int WP, std::string type, std::string files, std::string num, std::str canvas->SaveAs(outNaming.c_str()); - TFile *FR_H = new TFile("FF_corrections_tt.root", "UPDATE"); + TFile *FR_H = new TFile("FF_corrections_1.root", "UPDATE"); FR_H->cd(); theFit->SetName(TString(name)); theFit->Write();