diff --git a/RA5/Library/TriggerSF_Moriond2017_cxx.d b/RA5/Library/TriggerSF_Moriond2017_cxx.d new file mode 100644 index 0000000..3d0d474 --- /dev/null +++ b/RA5/Library/TriggerSF_Moriond2017_cxx.d @@ -0,0 +1,4 @@ + +# DO NOT DELETE +./TriggerSF_Moriond2017_cxx.so: /cvmfs/cms.cern.ch/slc6_amd64_gcc630/lcg/root/6.10.08/include/RVersion.h /cvmfs/cms.cern.ch/slc6_amd64_gcc630/lcg/root/6.10.08/include/RConfig.h /cvmfs/cms.cern.ch/slc6_amd64_gcc630/lcg/root/6.10.08/include/TClass.h /cvmfs/cms.cern.ch/slc6_amd64_gcc630/lcg/root/6.10.08/include/TDictAttributeMap.h /cvmfs/cms.cern.ch/slc6_amd64_gcc630/lcg/root/6.10.08/include/TInterpreter.h /cvmfs/cms.cern.ch/slc6_amd64_gcc630/lcg/root/6.10.08/include/TROOT.h /cvmfs/cms.cern.ch/slc6_amd64_gcc630/lcg/root/6.10.08/include/TBuffer.h /cvmfs/cms.cern.ch/slc6_amd64_gcc630/lcg/root/6.10.08/include/TMemberInspector.h /cvmfs/cms.cern.ch/slc6_amd64_gcc630/lcg/root/6.10.08/include/TError.h /cvmfs/cms.cern.ch/slc6_amd64_gcc630/lcg/root/6.10.08/include/RtypesImp.h /cvmfs/cms.cern.ch/slc6_amd64_gcc630/lcg/root/6.10.08/include/TIsAProxy.h /cvmfs/cms.cern.ch/slc6_amd64_gcc630/lcg/root/6.10.08/include/TFileMergeInfo.h /cvmfs/cms.cern.ch/slc6_amd64_gcc630/lcg/root/6.10.08/include/TCollectionProxyInfo.h /cvmfs/cms.cern.ch/slc6_amd64_gcc630/cms/cmssw/CMSSW_9_4_4/external/slc6_amd64_gcc630/bin/rootcling +TriggerSF_Moriond2017_cxx__ROOTBUILDVERSION= 6.10/09 diff --git a/RA5/Library/TriggerSF_Moriond2017_cxx_ACLiC_dict_rdict.pcm b/RA5/Library/TriggerSF_Moriond2017_cxx_ACLiC_dict_rdict.pcm new file mode 100644 index 0000000..b7028b6 Binary files /dev/null and b/RA5/Library/TriggerSF_Moriond2017_cxx_ACLiC_dict_rdict.pcm differ diff --git a/RA5/plot_RPV_cfg.py b/RA5/plot_RPV_cfg.py index 21307d1..acb3329 100644 --- a/RA5/plot_RPV_cfg.py +++ b/RA5/plot_RPV_cfg.py @@ -21,15 +21,19 @@ from RA5.Dataset.Run2016.Sept18_v1_Data import * from RA5.Dataset.Run2016.Sept18_v1_skim import * -if where == "hpg": - out_path = "/cms/data/store/user/t2/users/klo/HPG/RA5/RPV/DataMCDistributions/2018-09-12_HLTEmulation/" - outputDir = out_path - endModuleOutputDir = out_path -elif where == "ihepa": +#if where == "hpg": + #out_path = "/cms/data/store/user/t2/users/klo/HPG/RA5/RPV/DataMCDistributions/2018-09-12_HLTEmulation/" + #outputDir = out_path + #endModuleOutputDir = out_path +#elif where == "ihepa": #out_path = "RPV/DataMCDistribution/2018-09-19_OnlyMET0To50/" - out_path = "RPV/DataMCDistribution/2018-09-19/" - outputDir = "/raid/raid7/lucien/SUSY/RA5/"+out_path - endModuleOutputDir = "/home/lucien/public_html/SUSY/RA5/"+out_path + #out_path = "RPV/DataMCDistribution/2018-09-19/" + #outputDir = "/raid/raid7/lucien/SUSY/RA5/"+out_path + #endModuleOutputDir = "/home/lucien/public_html/SUSY/RA5/"+out_path + +#out_path = "" +outputDir = "./testPlot/" +endModuleOutputDir = "/home/kshi/public_html/RA5/tightleptons/" lepCats = ["HH","HL","LL"] nCores = 5 diff --git a/RPV/BTag_ZMuMu/AllSample/DataMCDistribution.root b/RPV/BTag_ZMuMu/AllSample/DataMCDistribution.root new file mode 100644 index 0000000..db0ef78 Binary files /dev/null and b/RPV/BTag_ZMuMu/AllSample/DataMCDistribution.root differ diff --git a/RPV/BTag_ZMuMu/AllSample/hadd.sh b/RPV/BTag_ZMuMu/AllSample/hadd.sh new file mode 100644 index 0000000..ab0632d --- /dev/null +++ b/RPV/BTag_ZMuMu/AllSample/hadd.sh @@ -0,0 +1 @@ +hadd -f ./BTag_ZMuMu/AllSample/DataMCDistribution.root ./BTag_ZMuMu/T_tch/*_DataMCDistribution.root ./BTag_ZMuMu/TBar_tWch/*_DataMCDistribution.root ./BTag_ZMuMu/ZGTo2LG/*_DataMCDistribution.root ./BTag_ZMuMu/WWW_4f/*_DataMCDistribution.root ./BTag_ZMuMu/TToLeptons_sch/*_DataMCDistribution.root ./BTag_ZMuMu/DYJetsToLL_M50_NLO/*_DataMCDistribution.root ./BTag_ZMuMu/TT_Powheg/*_DataMCDistribution.root ./BTag_ZMuMu/DYJetsToLL_M10to50/*_DataMCDistribution.root ./BTag_ZMuMu/WZTo3LNu/*_DataMCDistribution.root ./BTag_ZMuMu/WJetsToLNu/*_DataMCDistribution.root ./BTag_ZMuMu/ttZJets/*_DataMCDistribution.root ./BTag_ZMuMu/T_tWch/*_DataMCDistribution.root ./BTag_ZMuMu/WWZ/*_DataMCDistribution.root ./BTag_ZMuMu/WZZ/*_DataMCDistribution.root ./BTag_ZMuMu/ZZZ/*_DataMCDistribution.root ./BTag_ZMuMu/ttWJets/*_DataMCDistribution.root \ No newline at end of file diff --git a/RPV/BTag_ZMuMu/DYJetsToLL_M10to50/DYJetsToLL_M10to50_0_DataMCDistribution.root b/RPV/BTag_ZMuMu/DYJetsToLL_M10to50/DYJetsToLL_M10to50_0_DataMCDistribution.root new file mode 100644 index 0000000..09a243d Binary files /dev/null and b/RPV/BTag_ZMuMu/DYJetsToLL_M10to50/DYJetsToLL_M10to50_0_DataMCDistribution.root differ diff --git a/RPV/BTag_ZMuMu/DYJetsToLL_M10to50/DataMCDistribution.root b/RPV/BTag_ZMuMu/DYJetsToLL_M10to50/DataMCDistribution.root new file mode 100644 index 0000000..c4ed816 Binary files /dev/null and b/RPV/BTag_ZMuMu/DYJetsToLL_M10to50/DataMCDistribution.root differ diff --git a/RPV/BTag_ZMuMu/DYJetsToLL_M10to50/hadd.sh b/RPV/BTag_ZMuMu/DYJetsToLL_M10to50/hadd.sh new file mode 100644 index 0000000..99a8399 --- /dev/null +++ b/RPV/BTag_ZMuMu/DYJetsToLL_M10to50/hadd.sh @@ -0,0 +1 @@ +hadd -f ./BTag_ZMuMu/DYJetsToLL_M10to50/DataMCDistribution.root ./BTag_ZMuMu/DYJetsToLL_M10to50/*_DataMCDistribution.root \ No newline at end of file diff --git a/RPV/BTag_ZMuMu/DYJetsToLL_M50_NLO/DYJetsToLL_M50_NLO_0_DataMCDistribution.root b/RPV/BTag_ZMuMu/DYJetsToLL_M50_NLO/DYJetsToLL_M50_NLO_0_DataMCDistribution.root new file mode 100644 index 0000000..cccc43a Binary files /dev/null and b/RPV/BTag_ZMuMu/DYJetsToLL_M50_NLO/DYJetsToLL_M50_NLO_0_DataMCDistribution.root differ diff --git a/RPV/BTag_ZMuMu/DYJetsToLL_M50_NLO/DataMCDistribution.root b/RPV/BTag_ZMuMu/DYJetsToLL_M50_NLO/DataMCDistribution.root new file mode 100644 index 0000000..a89d82a Binary files /dev/null and b/RPV/BTag_ZMuMu/DYJetsToLL_M50_NLO/DataMCDistribution.root differ diff --git a/RPV/BTag_ZMuMu/DYJetsToLL_M50_NLO/hadd.sh b/RPV/BTag_ZMuMu/DYJetsToLL_M50_NLO/hadd.sh new file mode 100644 index 0000000..77e963a --- /dev/null +++ b/RPV/BTag_ZMuMu/DYJetsToLL_M50_NLO/hadd.sh @@ -0,0 +1 @@ +hadd -f ./BTag_ZMuMu/DYJetsToLL_M50_NLO/DataMCDistribution.root ./BTag_ZMuMu/DYJetsToLL_M50_NLO/*_DataMCDistribution.root \ No newline at end of file diff --git a/RPV/BTag_ZMuMu/TBar_tWch/DataMCDistribution.root b/RPV/BTag_ZMuMu/TBar_tWch/DataMCDistribution.root new file mode 100644 index 0000000..d5bf535 Binary files /dev/null and b/RPV/BTag_ZMuMu/TBar_tWch/DataMCDistribution.root differ diff --git a/RPV/BTag_ZMuMu/TBar_tWch/TBar_tWch_0_DataMCDistribution.root b/RPV/BTag_ZMuMu/TBar_tWch/TBar_tWch_0_DataMCDistribution.root new file mode 100644 index 0000000..144c683 Binary files /dev/null and b/RPV/BTag_ZMuMu/TBar_tWch/TBar_tWch_0_DataMCDistribution.root differ diff --git a/RPV/BTag_ZMuMu/TBar_tWch/hadd.sh b/RPV/BTag_ZMuMu/TBar_tWch/hadd.sh new file mode 100644 index 0000000..6c1c6cc --- /dev/null +++ b/RPV/BTag_ZMuMu/TBar_tWch/hadd.sh @@ -0,0 +1 @@ +hadd -f ./BTag_ZMuMu/TBar_tWch/DataMCDistribution.root ./BTag_ZMuMu/TBar_tWch/*_DataMCDistribution.root \ No newline at end of file diff --git a/RPV/BTag_ZMuMu/TT_Powheg/DataMCDistribution.root b/RPV/BTag_ZMuMu/TT_Powheg/DataMCDistribution.root new file mode 100644 index 0000000..a2d7688 Binary files /dev/null and b/RPV/BTag_ZMuMu/TT_Powheg/DataMCDistribution.root differ diff --git a/RPV/BTag_ZMuMu/TT_Powheg/TT_Powheg_0_DataMCDistribution.root b/RPV/BTag_ZMuMu/TT_Powheg/TT_Powheg_0_DataMCDistribution.root new file mode 100644 index 0000000..dc322d6 Binary files /dev/null and b/RPV/BTag_ZMuMu/TT_Powheg/TT_Powheg_0_DataMCDistribution.root differ diff --git a/RPV/BTag_ZMuMu/TT_Powheg/hadd.sh b/RPV/BTag_ZMuMu/TT_Powheg/hadd.sh new file mode 100644 index 0000000..b8e948d --- /dev/null +++ b/RPV/BTag_ZMuMu/TT_Powheg/hadd.sh @@ -0,0 +1 @@ +hadd -f ./BTag_ZMuMu/TT_Powheg/DataMCDistribution.root ./BTag_ZMuMu/TT_Powheg/*_DataMCDistribution.root \ No newline at end of file diff --git a/RPV/BTag_ZMuMu/TToLeptons_sch/DataMCDistribution.root b/RPV/BTag_ZMuMu/TToLeptons_sch/DataMCDistribution.root new file mode 100644 index 0000000..5981fc4 Binary files /dev/null and b/RPV/BTag_ZMuMu/TToLeptons_sch/DataMCDistribution.root differ diff --git a/RPV/BTag_ZMuMu/TToLeptons_sch/TToLeptons_sch_0_DataMCDistribution.root b/RPV/BTag_ZMuMu/TToLeptons_sch/TToLeptons_sch_0_DataMCDistribution.root new file mode 100644 index 0000000..6195639 Binary files /dev/null and b/RPV/BTag_ZMuMu/TToLeptons_sch/TToLeptons_sch_0_DataMCDistribution.root differ diff --git a/RPV/BTag_ZMuMu/TToLeptons_sch/hadd.sh b/RPV/BTag_ZMuMu/TToLeptons_sch/hadd.sh new file mode 100644 index 0000000..42777a4 --- /dev/null +++ b/RPV/BTag_ZMuMu/TToLeptons_sch/hadd.sh @@ -0,0 +1 @@ +hadd -f ./BTag_ZMuMu/TToLeptons_sch/DataMCDistribution.root ./BTag_ZMuMu/TToLeptons_sch/*_DataMCDistribution.root \ No newline at end of file diff --git a/RPV/BTag_ZMuMu/T_tWch/DataMCDistribution.root b/RPV/BTag_ZMuMu/T_tWch/DataMCDistribution.root new file mode 100644 index 0000000..58b05c8 Binary files /dev/null and b/RPV/BTag_ZMuMu/T_tWch/DataMCDistribution.root differ diff --git a/RPV/BTag_ZMuMu/T_tWch/T_tWch_0_DataMCDistribution.root b/RPV/BTag_ZMuMu/T_tWch/T_tWch_0_DataMCDistribution.root new file mode 100644 index 0000000..e92911c Binary files /dev/null and b/RPV/BTag_ZMuMu/T_tWch/T_tWch_0_DataMCDistribution.root differ diff --git a/RPV/BTag_ZMuMu/T_tWch/hadd.sh b/RPV/BTag_ZMuMu/T_tWch/hadd.sh new file mode 100644 index 0000000..06fcbb7 --- /dev/null +++ b/RPV/BTag_ZMuMu/T_tWch/hadd.sh @@ -0,0 +1 @@ +hadd -f ./BTag_ZMuMu/T_tWch/DataMCDistribution.root ./BTag_ZMuMu/T_tWch/*_DataMCDistribution.root \ No newline at end of file diff --git a/RPV/BTag_ZMuMu/T_tch/DataMCDistribution.root b/RPV/BTag_ZMuMu/T_tch/DataMCDistribution.root new file mode 100644 index 0000000..929658a Binary files /dev/null and b/RPV/BTag_ZMuMu/T_tch/DataMCDistribution.root differ diff --git a/RPV/BTag_ZMuMu/T_tch/T_tch_0_DataMCDistribution.root b/RPV/BTag_ZMuMu/T_tch/T_tch_0_DataMCDistribution.root new file mode 100644 index 0000000..df1ab68 Binary files /dev/null and b/RPV/BTag_ZMuMu/T_tch/T_tch_0_DataMCDistribution.root differ diff --git a/RPV/BTag_ZMuMu/T_tch/hadd.sh b/RPV/BTag_ZMuMu/T_tch/hadd.sh new file mode 100644 index 0000000..9cdf201 --- /dev/null +++ b/RPV/BTag_ZMuMu/T_tch/hadd.sh @@ -0,0 +1 @@ +hadd -f ./BTag_ZMuMu/T_tch/DataMCDistribution.root ./BTag_ZMuMu/T_tch/*_DataMCDistribution.root \ No newline at end of file diff --git a/RPV/BTag_ZMuMu/WJetsToLNu/DataMCDistribution.root b/RPV/BTag_ZMuMu/WJetsToLNu/DataMCDistribution.root new file mode 100644 index 0000000..2adc79f Binary files /dev/null and b/RPV/BTag_ZMuMu/WJetsToLNu/DataMCDistribution.root differ diff --git a/RPV/BTag_ZMuMu/WJetsToLNu/WJetsToLNu_0_DataMCDistribution.root b/RPV/BTag_ZMuMu/WJetsToLNu/WJetsToLNu_0_DataMCDistribution.root new file mode 100644 index 0000000..0a26a8e Binary files /dev/null and b/RPV/BTag_ZMuMu/WJetsToLNu/WJetsToLNu_0_DataMCDistribution.root differ diff --git a/RPV/BTag_ZMuMu/WJetsToLNu/hadd.sh b/RPV/BTag_ZMuMu/WJetsToLNu/hadd.sh new file mode 100644 index 0000000..dabfc35 --- /dev/null +++ b/RPV/BTag_ZMuMu/WJetsToLNu/hadd.sh @@ -0,0 +1 @@ +hadd -f ./BTag_ZMuMu/WJetsToLNu/DataMCDistribution.root ./BTag_ZMuMu/WJetsToLNu/*_DataMCDistribution.root \ No newline at end of file diff --git a/RPV/BTag_ZMuMu/WWW_4f/DataMCDistribution.root b/RPV/BTag_ZMuMu/WWW_4f/DataMCDistribution.root new file mode 100644 index 0000000..c2e8b18 Binary files /dev/null and b/RPV/BTag_ZMuMu/WWW_4f/DataMCDistribution.root differ diff --git a/RPV/BTag_ZMuMu/WWW_4f/WWW_4f_0_DataMCDistribution.root b/RPV/BTag_ZMuMu/WWW_4f/WWW_4f_0_DataMCDistribution.root new file mode 100644 index 0000000..c1f6c2a Binary files /dev/null and b/RPV/BTag_ZMuMu/WWW_4f/WWW_4f_0_DataMCDistribution.root differ diff --git a/RPV/BTag_ZMuMu/WWW_4f/hadd.sh b/RPV/BTag_ZMuMu/WWW_4f/hadd.sh new file mode 100644 index 0000000..2e057b5 --- /dev/null +++ b/RPV/BTag_ZMuMu/WWW_4f/hadd.sh @@ -0,0 +1 @@ +hadd -f ./BTag_ZMuMu/WWW_4f/DataMCDistribution.root ./BTag_ZMuMu/WWW_4f/*_DataMCDistribution.root \ No newline at end of file diff --git a/RPV/BTag_ZMuMu/WWZ/DataMCDistribution.root b/RPV/BTag_ZMuMu/WWZ/DataMCDistribution.root new file mode 100644 index 0000000..e98f2f2 Binary files /dev/null and b/RPV/BTag_ZMuMu/WWZ/DataMCDistribution.root differ diff --git a/RPV/BTag_ZMuMu/WWZ/WWZ_0_DataMCDistribution.root b/RPV/BTag_ZMuMu/WWZ/WWZ_0_DataMCDistribution.root new file mode 100644 index 0000000..e2926c8 Binary files /dev/null and b/RPV/BTag_ZMuMu/WWZ/WWZ_0_DataMCDistribution.root differ diff --git a/RPV/BTag_ZMuMu/WWZ/hadd.sh b/RPV/BTag_ZMuMu/WWZ/hadd.sh new file mode 100644 index 0000000..11ac596 --- /dev/null +++ b/RPV/BTag_ZMuMu/WWZ/hadd.sh @@ -0,0 +1 @@ +hadd -f ./BTag_ZMuMu/WWZ/DataMCDistribution.root ./BTag_ZMuMu/WWZ/*_DataMCDistribution.root \ No newline at end of file diff --git a/RPV/BTag_ZMuMu/WZTo3LNu/DataMCDistribution.root b/RPV/BTag_ZMuMu/WZTo3LNu/DataMCDistribution.root new file mode 100644 index 0000000..a27b953 Binary files /dev/null and b/RPV/BTag_ZMuMu/WZTo3LNu/DataMCDistribution.root differ diff --git a/RPV/BTag_ZMuMu/WZTo3LNu/WZTo3LNu_0_DataMCDistribution.root b/RPV/BTag_ZMuMu/WZTo3LNu/WZTo3LNu_0_DataMCDistribution.root new file mode 100644 index 0000000..e653647 Binary files /dev/null and b/RPV/BTag_ZMuMu/WZTo3LNu/WZTo3LNu_0_DataMCDistribution.root differ diff --git a/RPV/BTag_ZMuMu/WZTo3LNu/hadd.sh b/RPV/BTag_ZMuMu/WZTo3LNu/hadd.sh new file mode 100644 index 0000000..721b167 --- /dev/null +++ b/RPV/BTag_ZMuMu/WZTo3LNu/hadd.sh @@ -0,0 +1 @@ +hadd -f ./BTag_ZMuMu/WZTo3LNu/DataMCDistribution.root ./BTag_ZMuMu/WZTo3LNu/*_DataMCDistribution.root \ No newline at end of file diff --git a/RPV/BTag_ZMuMu/WZZ/DataMCDistribution.root b/RPV/BTag_ZMuMu/WZZ/DataMCDistribution.root new file mode 100644 index 0000000..3df9ae3 Binary files /dev/null and b/RPV/BTag_ZMuMu/WZZ/DataMCDistribution.root differ diff --git a/RPV/BTag_ZMuMu/WZZ/WZZ_0_DataMCDistribution.root b/RPV/BTag_ZMuMu/WZZ/WZZ_0_DataMCDistribution.root new file mode 100644 index 0000000..9dbed92 Binary files /dev/null and b/RPV/BTag_ZMuMu/WZZ/WZZ_0_DataMCDistribution.root differ diff --git a/RPV/BTag_ZMuMu/WZZ/hadd.sh b/RPV/BTag_ZMuMu/WZZ/hadd.sh new file mode 100644 index 0000000..aa2b123 --- /dev/null +++ b/RPV/BTag_ZMuMu/WZZ/hadd.sh @@ -0,0 +1 @@ +hadd -f ./BTag_ZMuMu/WZZ/DataMCDistribution.root ./BTag_ZMuMu/WZZ/*_DataMCDistribution.root \ No newline at end of file diff --git a/RPV/BTag_ZMuMu/ZGTo2LG/DataMCDistribution.root b/RPV/BTag_ZMuMu/ZGTo2LG/DataMCDistribution.root new file mode 100644 index 0000000..e0dbff4 Binary files /dev/null and b/RPV/BTag_ZMuMu/ZGTo2LG/DataMCDistribution.root differ diff --git a/RPV/BTag_ZMuMu/ZGTo2LG/ZGTo2LG_0_DataMCDistribution.root b/RPV/BTag_ZMuMu/ZGTo2LG/ZGTo2LG_0_DataMCDistribution.root new file mode 100644 index 0000000..2b28238 Binary files /dev/null and b/RPV/BTag_ZMuMu/ZGTo2LG/ZGTo2LG_0_DataMCDistribution.root differ diff --git a/RPV/BTag_ZMuMu/ZGTo2LG/hadd.sh b/RPV/BTag_ZMuMu/ZGTo2LG/hadd.sh new file mode 100644 index 0000000..8b3c5a3 --- /dev/null +++ b/RPV/BTag_ZMuMu/ZGTo2LG/hadd.sh @@ -0,0 +1 @@ +hadd -f ./BTag_ZMuMu/ZGTo2LG/DataMCDistribution.root ./BTag_ZMuMu/ZGTo2LG/*_DataMCDistribution.root \ No newline at end of file diff --git a/RPV/BTag_ZMuMu/ZZZ/DataMCDistribution.root b/RPV/BTag_ZMuMu/ZZZ/DataMCDistribution.root new file mode 100644 index 0000000..d0c628d Binary files /dev/null and b/RPV/BTag_ZMuMu/ZZZ/DataMCDistribution.root differ diff --git a/RPV/BTag_ZMuMu/ZZZ/ZZZ_0_DataMCDistribution.root b/RPV/BTag_ZMuMu/ZZZ/ZZZ_0_DataMCDistribution.root new file mode 100644 index 0000000..6bd8356 Binary files /dev/null and b/RPV/BTag_ZMuMu/ZZZ/ZZZ_0_DataMCDistribution.root differ diff --git a/RPV/BTag_ZMuMu/ZZZ/hadd.sh b/RPV/BTag_ZMuMu/ZZZ/hadd.sh new file mode 100644 index 0000000..9de65eb --- /dev/null +++ b/RPV/BTag_ZMuMu/ZZZ/hadd.sh @@ -0,0 +1 @@ +hadd -f ./BTag_ZMuMu/ZZZ/DataMCDistribution.root ./BTag_ZMuMu/ZZZ/*_DataMCDistribution.root \ No newline at end of file diff --git a/RPV/BTag_ZMuMu/gitDetails.txt b/RPV/BTag_ZMuMu/gitDetails.txt new file mode 100644 index 0000000..9245d0c --- /dev/null +++ b/RPV/BTag_ZMuMu/gitDetails.txt @@ -0,0 +1 @@ +v0.0-247-g9659973 diff --git a/RPV/BTag_ZMuMu/gitVerboseDetails.txt b/RPV/BTag_ZMuMu/gitVerboseDetails.txt new file mode 100644 index 0000000..42f5050 --- /dev/null +++ b/RPV/BTag_ZMuMu/gitVerboseDetails.txt @@ -0,0 +1,478 @@ +diff --git a/RPV/BTag_ZMuMu/DYJetsToLL_M10to50/DYJetsToLL_M10to50_0_DataMCDistribution.root b/RPV/BTag_ZMuMu/DYJetsToLL_M10to50/DYJetsToLL_M10to50_0_DataMCDistribution.root +index fc53f3f..9d52ef5 100644 +Binary files a/RPV/BTag_ZMuMu/DYJetsToLL_M10to50/DYJetsToLL_M10to50_0_DataMCDistribution.root and b/RPV/BTag_ZMuMu/DYJetsToLL_M10to50/DYJetsToLL_M10to50_0_DataMCDistribution.root differ +diff --git a/RPV/BTag_ZMuMu/DYJetsToLL_M10to50/DataMCDistribution.root b/RPV/BTag_ZMuMu/DYJetsToLL_M10to50/DataMCDistribution.root +deleted file mode 100644 +index 379f759..0000000 +Binary files a/RPV/BTag_ZMuMu/DYJetsToLL_M10to50/DataMCDistribution.root and /dev/null differ +diff --git a/RPV/BTag_ZMuMu/DYJetsToLL_M10to50/hadd.sh b/RPV/BTag_ZMuMu/DYJetsToLL_M10to50/hadd.sh +deleted file mode 100644 +index 99a8399..0000000 +--- a/RPV/BTag_ZMuMu/DYJetsToLL_M10to50/hadd.sh ++++ /dev/null +@@ -1 +0,0 @@ +-hadd -f ./BTag_ZMuMu/DYJetsToLL_M10to50/DataMCDistribution.root ./BTag_ZMuMu/DYJetsToLL_M10to50/*_DataMCDistribution.root +\ No newline at end of file +diff --git a/RPV/BTag_ZMuMu/DYJetsToLL_M50_NLO/DYJetsToLL_M50_NLO_0_DataMCDistribution.root b/RPV/BTag_ZMuMu/DYJetsToLL_M50_NLO/DYJetsToLL_M50_NLO_0_DataMCDistribution.root +index f6e67fe..0ca5586 100644 +Binary files a/RPV/BTag_ZMuMu/DYJetsToLL_M50_NLO/DYJetsToLL_M50_NLO_0_DataMCDistribution.root and b/RPV/BTag_ZMuMu/DYJetsToLL_M50_NLO/DYJetsToLL_M50_NLO_0_DataMCDistribution.root differ +diff --git a/RPV/BTag_ZMuMu/DYJetsToLL_M50_NLO/DataMCDistribution.root b/RPV/BTag_ZMuMu/DYJetsToLL_M50_NLO/DataMCDistribution.root +deleted file mode 100644 +index e8cb1ab..0000000 +Binary files a/RPV/BTag_ZMuMu/DYJetsToLL_M50_NLO/DataMCDistribution.root and /dev/null differ +diff --git a/RPV/BTag_ZMuMu/DYJetsToLL_M50_NLO/hadd.sh b/RPV/BTag_ZMuMu/DYJetsToLL_M50_NLO/hadd.sh +deleted file mode 100644 +index 77e963a..0000000 +--- a/RPV/BTag_ZMuMu/DYJetsToLL_M50_NLO/hadd.sh ++++ /dev/null +@@ -1 +0,0 @@ +-hadd -f ./BTag_ZMuMu/DYJetsToLL_M50_NLO/DataMCDistribution.root ./BTag_ZMuMu/DYJetsToLL_M50_NLO/*_DataMCDistribution.root +\ No newline at end of file +diff --git a/RPV/BTag_ZMuMu/TBar_tWch/DataMCDistribution.root b/RPV/BTag_ZMuMu/TBar_tWch/DataMCDistribution.root +deleted file mode 100644 +index 920b118..0000000 +Binary files a/RPV/BTag_ZMuMu/TBar_tWch/DataMCDistribution.root and /dev/null differ +diff --git a/RPV/BTag_ZMuMu/TBar_tWch/TBar_tWch_0_DataMCDistribution.root b/RPV/BTag_ZMuMu/TBar_tWch/TBar_tWch_0_DataMCDistribution.root +index 560d8e4..c3ea458 100644 +Binary files a/RPV/BTag_ZMuMu/TBar_tWch/TBar_tWch_0_DataMCDistribution.root and b/RPV/BTag_ZMuMu/TBar_tWch/TBar_tWch_0_DataMCDistribution.root differ +diff --git a/RPV/BTag_ZMuMu/TBar_tWch/hadd.sh b/RPV/BTag_ZMuMu/TBar_tWch/hadd.sh +deleted file mode 100644 +index 6c1c6cc..0000000 +--- a/RPV/BTag_ZMuMu/TBar_tWch/hadd.sh ++++ /dev/null +@@ -1 +0,0 @@ +-hadd -f ./BTag_ZMuMu/TBar_tWch/DataMCDistribution.root ./BTag_ZMuMu/TBar_tWch/*_DataMCDistribution.root +\ No newline at end of file +diff --git a/RPV/BTag_ZMuMu/TT_Powheg/DataMCDistribution.root b/RPV/BTag_ZMuMu/TT_Powheg/DataMCDistribution.root +deleted file mode 100644 +index 9a6e4b7..0000000 +Binary files a/RPV/BTag_ZMuMu/TT_Powheg/DataMCDistribution.root and /dev/null differ +diff --git a/RPV/BTag_ZMuMu/TT_Powheg/TT_Powheg_0_DataMCDistribution.root b/RPV/BTag_ZMuMu/TT_Powheg/TT_Powheg_0_DataMCDistribution.root +index 349be9b..0b20f88 100644 +Binary files a/RPV/BTag_ZMuMu/TT_Powheg/TT_Powheg_0_DataMCDistribution.root and b/RPV/BTag_ZMuMu/TT_Powheg/TT_Powheg_0_DataMCDistribution.root differ +diff --git a/RPV/BTag_ZMuMu/TT_Powheg/hadd.sh b/RPV/BTag_ZMuMu/TT_Powheg/hadd.sh +deleted file mode 100644 +index b8e948d..0000000 +--- a/RPV/BTag_ZMuMu/TT_Powheg/hadd.sh ++++ /dev/null +@@ -1 +0,0 @@ +-hadd -f ./BTag_ZMuMu/TT_Powheg/DataMCDistribution.root ./BTag_ZMuMu/TT_Powheg/*_DataMCDistribution.root +\ No newline at end of file +diff --git a/RPV/BTag_ZMuMu/TToLeptons_sch/DataMCDistribution.root b/RPV/BTag_ZMuMu/TToLeptons_sch/DataMCDistribution.root +deleted file mode 100644 +index e92ad6e..0000000 +Binary files a/RPV/BTag_ZMuMu/TToLeptons_sch/DataMCDistribution.root and /dev/null differ +diff --git a/RPV/BTag_ZMuMu/TToLeptons_sch/TToLeptons_sch_0_DataMCDistribution.root b/RPV/BTag_ZMuMu/TToLeptons_sch/TToLeptons_sch_0_DataMCDistribution.root +index 702c950..5b08526 100644 +Binary files a/RPV/BTag_ZMuMu/TToLeptons_sch/TToLeptons_sch_0_DataMCDistribution.root and b/RPV/BTag_ZMuMu/TToLeptons_sch/TToLeptons_sch_0_DataMCDistribution.root differ +diff --git a/RPV/BTag_ZMuMu/TToLeptons_sch/hadd.sh b/RPV/BTag_ZMuMu/TToLeptons_sch/hadd.sh +deleted file mode 100644 +index 42777a4..0000000 +--- a/RPV/BTag_ZMuMu/TToLeptons_sch/hadd.sh ++++ /dev/null +@@ -1 +0,0 @@ +-hadd -f ./BTag_ZMuMu/TToLeptons_sch/DataMCDistribution.root ./BTag_ZMuMu/TToLeptons_sch/*_DataMCDistribution.root +\ No newline at end of file +diff --git a/RPV/BTag_ZMuMu/T_tWch/DataMCDistribution.root b/RPV/BTag_ZMuMu/T_tWch/DataMCDistribution.root +deleted file mode 100644 +index f5bd5ad..0000000 +Binary files a/RPV/BTag_ZMuMu/T_tWch/DataMCDistribution.root and /dev/null differ +diff --git a/RPV/BTag_ZMuMu/T_tWch/T_tWch_0_DataMCDistribution.root b/RPV/BTag_ZMuMu/T_tWch/T_tWch_0_DataMCDistribution.root +index a674270..d00a2dc 100644 +Binary files a/RPV/BTag_ZMuMu/T_tWch/T_tWch_0_DataMCDistribution.root and b/RPV/BTag_ZMuMu/T_tWch/T_tWch_0_DataMCDistribution.root differ +diff --git a/RPV/BTag_ZMuMu/T_tWch/hadd.sh b/RPV/BTag_ZMuMu/T_tWch/hadd.sh +deleted file mode 100644 +index 06fcbb7..0000000 +--- a/RPV/BTag_ZMuMu/T_tWch/hadd.sh ++++ /dev/null +@@ -1 +0,0 @@ +-hadd -f ./BTag_ZMuMu/T_tWch/DataMCDistribution.root ./BTag_ZMuMu/T_tWch/*_DataMCDistribution.root +\ No newline at end of file +diff --git a/RPV/BTag_ZMuMu/T_tch/DataMCDistribution.root b/RPV/BTag_ZMuMu/T_tch/DataMCDistribution.root +deleted file mode 100644 +index 8deebee..0000000 +Binary files a/RPV/BTag_ZMuMu/T_tch/DataMCDistribution.root and /dev/null differ +diff --git a/RPV/BTag_ZMuMu/T_tch/T_tch_0_DataMCDistribution.root b/RPV/BTag_ZMuMu/T_tch/T_tch_0_DataMCDistribution.root +index 987a1d1..5c8be91 100644 +Binary files a/RPV/BTag_ZMuMu/T_tch/T_tch_0_DataMCDistribution.root and b/RPV/BTag_ZMuMu/T_tch/T_tch_0_DataMCDistribution.root differ +diff --git a/RPV/BTag_ZMuMu/T_tch/hadd.sh b/RPV/BTag_ZMuMu/T_tch/hadd.sh +deleted file mode 100644 +index 9cdf201..0000000 +--- a/RPV/BTag_ZMuMu/T_tch/hadd.sh ++++ /dev/null +@@ -1 +0,0 @@ +-hadd -f ./BTag_ZMuMu/T_tch/DataMCDistribution.root ./BTag_ZMuMu/T_tch/*_DataMCDistribution.root +\ No newline at end of file +diff --git a/RPV/BTag_ZMuMu/WJetsToLNu/DataMCDistribution.root b/RPV/BTag_ZMuMu/WJetsToLNu/DataMCDistribution.root +deleted file mode 100644 +index 976e195..0000000 +Binary files a/RPV/BTag_ZMuMu/WJetsToLNu/DataMCDistribution.root and /dev/null differ +diff --git a/RPV/BTag_ZMuMu/WJetsToLNu/WJetsToLNu_0_DataMCDistribution.root b/RPV/BTag_ZMuMu/WJetsToLNu/WJetsToLNu_0_DataMCDistribution.root +index 411e6f5..30b8a4f 100644 +Binary files a/RPV/BTag_ZMuMu/WJetsToLNu/WJetsToLNu_0_DataMCDistribution.root and b/RPV/BTag_ZMuMu/WJetsToLNu/WJetsToLNu_0_DataMCDistribution.root differ +diff --git a/RPV/BTag_ZMuMu/WJetsToLNu/hadd.sh b/RPV/BTag_ZMuMu/WJetsToLNu/hadd.sh +deleted file mode 100644 +index dabfc35..0000000 +--- a/RPV/BTag_ZMuMu/WJetsToLNu/hadd.sh ++++ /dev/null +@@ -1 +0,0 @@ +-hadd -f ./BTag_ZMuMu/WJetsToLNu/DataMCDistribution.root ./BTag_ZMuMu/WJetsToLNu/*_DataMCDistribution.root +\ No newline at end of file +diff --git a/RPV/BTag_ZMuMu/WWW_4f/DataMCDistribution.root b/RPV/BTag_ZMuMu/WWW_4f/DataMCDistribution.root +deleted file mode 100644 +index 5913877..0000000 +Binary files a/RPV/BTag_ZMuMu/WWW_4f/DataMCDistribution.root and /dev/null differ +diff --git a/RPV/BTag_ZMuMu/WWW_4f/WWW_4f_0_DataMCDistribution.root b/RPV/BTag_ZMuMu/WWW_4f/WWW_4f_0_DataMCDistribution.root +index 69b36cd..feecb6a 100644 +Binary files a/RPV/BTag_ZMuMu/WWW_4f/WWW_4f_0_DataMCDistribution.root and b/RPV/BTag_ZMuMu/WWW_4f/WWW_4f_0_DataMCDistribution.root differ +diff --git a/RPV/BTag_ZMuMu/WWW_4f/hadd.sh b/RPV/BTag_ZMuMu/WWW_4f/hadd.sh +deleted file mode 100644 +index 2e057b5..0000000 +--- a/RPV/BTag_ZMuMu/WWW_4f/hadd.sh ++++ /dev/null +@@ -1 +0,0 @@ +-hadd -f ./BTag_ZMuMu/WWW_4f/DataMCDistribution.root ./BTag_ZMuMu/WWW_4f/*_DataMCDistribution.root +\ No newline at end of file +diff --git a/RPV/BTag_ZMuMu/WWZ/DataMCDistribution.root b/RPV/BTag_ZMuMu/WWZ/DataMCDistribution.root +deleted file mode 100644 +index 85d20a7..0000000 +Binary files a/RPV/BTag_ZMuMu/WWZ/DataMCDistribution.root and /dev/null differ +diff --git a/RPV/BTag_ZMuMu/WWZ/WWZ_0_DataMCDistribution.root b/RPV/BTag_ZMuMu/WWZ/WWZ_0_DataMCDistribution.root +index 3e71ec6..33edb5a 100644 +Binary files a/RPV/BTag_ZMuMu/WWZ/WWZ_0_DataMCDistribution.root and b/RPV/BTag_ZMuMu/WWZ/WWZ_0_DataMCDistribution.root differ +diff --git a/RPV/BTag_ZMuMu/WWZ/hadd.sh b/RPV/BTag_ZMuMu/WWZ/hadd.sh +deleted file mode 100644 +index 11ac596..0000000 +--- a/RPV/BTag_ZMuMu/WWZ/hadd.sh ++++ /dev/null +@@ -1 +0,0 @@ +-hadd -f ./BTag_ZMuMu/WWZ/DataMCDistribution.root ./BTag_ZMuMu/WWZ/*_DataMCDistribution.root +\ No newline at end of file +diff --git a/RPV/BTag_ZMuMu/WZTo3LNu/DataMCDistribution.root b/RPV/BTag_ZMuMu/WZTo3LNu/DataMCDistribution.root +deleted file mode 100644 +index 0bb853c..0000000 +Binary files a/RPV/BTag_ZMuMu/WZTo3LNu/DataMCDistribution.root and /dev/null differ +diff --git a/RPV/BTag_ZMuMu/WZTo3LNu/WZTo3LNu_0_DataMCDistribution.root b/RPV/BTag_ZMuMu/WZTo3LNu/WZTo3LNu_0_DataMCDistribution.root +index c92fa19..f3cafaa 100644 +Binary files a/RPV/BTag_ZMuMu/WZTo3LNu/WZTo3LNu_0_DataMCDistribution.root and b/RPV/BTag_ZMuMu/WZTo3LNu/WZTo3LNu_0_DataMCDistribution.root differ +diff --git a/RPV/BTag_ZMuMu/WZTo3LNu/hadd.sh b/RPV/BTag_ZMuMu/WZTo3LNu/hadd.sh +deleted file mode 100644 +index 721b167..0000000 +--- a/RPV/BTag_ZMuMu/WZTo3LNu/hadd.sh ++++ /dev/null +@@ -1 +0,0 @@ +-hadd -f ./BTag_ZMuMu/WZTo3LNu/DataMCDistribution.root ./BTag_ZMuMu/WZTo3LNu/*_DataMCDistribution.root +\ No newline at end of file +diff --git a/RPV/BTag_ZMuMu/WZZ/DataMCDistribution.root b/RPV/BTag_ZMuMu/WZZ/DataMCDistribution.root +deleted file mode 100644 +index e76b6ee..0000000 +Binary files a/RPV/BTag_ZMuMu/WZZ/DataMCDistribution.root and /dev/null differ +diff --git a/RPV/BTag_ZMuMu/WZZ/WZZ_0_DataMCDistribution.root b/RPV/BTag_ZMuMu/WZZ/WZZ_0_DataMCDistribution.root +index ae25afc..67fa90f 100644 +Binary files a/RPV/BTag_ZMuMu/WZZ/WZZ_0_DataMCDistribution.root and b/RPV/BTag_ZMuMu/WZZ/WZZ_0_DataMCDistribution.root differ +diff --git a/RPV/BTag_ZMuMu/WZZ/hadd.sh b/RPV/BTag_ZMuMu/WZZ/hadd.sh +deleted file mode 100644 +index aa2b123..0000000 +--- a/RPV/BTag_ZMuMu/WZZ/hadd.sh ++++ /dev/null +@@ -1 +0,0 @@ +-hadd -f ./BTag_ZMuMu/WZZ/DataMCDistribution.root ./BTag_ZMuMu/WZZ/*_DataMCDistribution.root +\ No newline at end of file +diff --git a/RPV/BTag_ZMuMu/ZGTo2LG/DataMCDistribution.root b/RPV/BTag_ZMuMu/ZGTo2LG/DataMCDistribution.root +deleted file mode 100644 +index 684982d..0000000 +Binary files a/RPV/BTag_ZMuMu/ZGTo2LG/DataMCDistribution.root and /dev/null differ +diff --git a/RPV/BTag_ZMuMu/ZGTo2LG/ZGTo2LG_0_DataMCDistribution.root b/RPV/BTag_ZMuMu/ZGTo2LG/ZGTo2LG_0_DataMCDistribution.root +index 7c96abf..bdcced1 100644 +Binary files a/RPV/BTag_ZMuMu/ZGTo2LG/ZGTo2LG_0_DataMCDistribution.root and b/RPV/BTag_ZMuMu/ZGTo2LG/ZGTo2LG_0_DataMCDistribution.root differ +diff --git a/RPV/BTag_ZMuMu/ZGTo2LG/hadd.sh b/RPV/BTag_ZMuMu/ZGTo2LG/hadd.sh +deleted file mode 100644 +index 8b3c5a3..0000000 +--- a/RPV/BTag_ZMuMu/ZGTo2LG/hadd.sh ++++ /dev/null +@@ -1 +0,0 @@ +-hadd -f ./BTag_ZMuMu/ZGTo2LG/DataMCDistribution.root ./BTag_ZMuMu/ZGTo2LG/*_DataMCDistribution.root +\ No newline at end of file +diff --git a/RPV/BTag_ZMuMu/ZZZ/DataMCDistribution.root b/RPV/BTag_ZMuMu/ZZZ/DataMCDistribution.root +deleted file mode 100644 +index fe4d830..0000000 +Binary files a/RPV/BTag_ZMuMu/ZZZ/DataMCDistribution.root and /dev/null differ +diff --git a/RPV/BTag_ZMuMu/ZZZ/ZZZ_0_DataMCDistribution.root b/RPV/BTag_ZMuMu/ZZZ/ZZZ_0_DataMCDistribution.root +index 713c21a..1b369e7 100644 +Binary files a/RPV/BTag_ZMuMu/ZZZ/ZZZ_0_DataMCDistribution.root and b/RPV/BTag_ZMuMu/ZZZ/ZZZ_0_DataMCDistribution.root differ +diff --git a/RPV/BTag_ZMuMu/ZZZ/hadd.sh b/RPV/BTag_ZMuMu/ZZZ/hadd.sh +deleted file mode 100644 +index 9de65eb..0000000 +--- a/RPV/BTag_ZMuMu/ZZZ/hadd.sh ++++ /dev/null +@@ -1 +0,0 @@ +-hadd -f ./BTag_ZMuMu/ZZZ/DataMCDistribution.root ./BTag_ZMuMu/ZZZ/*_DataMCDistribution.root +\ No newline at end of file +diff --git a/RPV/BTag_ZMuMu/gitDetails.txt b/RPV/BTag_ZMuMu/gitDetails.txt +index 10e2b37..9245d0c 100644 +--- a/RPV/BTag_ZMuMu/gitDetails.txt ++++ b/RPV/BTag_ZMuMu/gitDetails.txt +@@ -1 +1 @@ +-v0.0-203-g7c6a9fb ++v0.0-247-g9659973 +diff --git a/RPV/BTag_ZMuMu/gitVerboseDetails.txt b/RPV/BTag_ZMuMu/gitVerboseDetails.txt +index fbd84d0..e69de29 100644 +--- a/RPV/BTag_ZMuMu/gitVerboseDetails.txt ++++ b/RPV/BTag_ZMuMu/gitVerboseDetails.txt +@@ -1,168 +0,0 @@ +-diff --git a/RPV/Producer/AnalysisProducer.py b/RPV/Producer/AnalysisProducer.py +-index 0978b5f..b3535c7 100644 +---- a/RPV/Producer/AnalysisProducer.py +-+++ b/RPV/Producer/AnalysisProducer.py +-@@ -19,6 +19,10 @@ class AnalysisProducer(Module): +- event.jets.sort(key=lambda x: x.pt,reverse=True) +- event.nJet40 = len(event.jets) +- +-+ event.jets25 = [p for p in event.LooseJets if p.pt > 25] +-+ event.jets25.sort(key=lambda x: x.pt,reverse=True) +-+ event.nJet25 = len(event.jets25) +-+ +- event.ht40 = 0. +- for ps in [event.jets,event.leps]: +- for p in ps: +-diff --git a/RPV/SkimTree/NanoAOD/Run2016/ZToMuMu_MC.py b/RPV/SkimTree/NanoAOD/Run2016/ZToMuMu_MC.py +-index 7eeaa63..5b70ef2 100644 +---- a/RPV/SkimTree/NanoAOD/Run2016/ZToMuMu_MC.py +-+++ b/RPV/SkimTree/NanoAOD/Run2016/ZToMuMu_MC.py +-@@ -8,12 +8,12 @@ fileName = "SkimTree.root" +- common_path = "/raid/raid7/kshi/SUSY/RPV/SkimTree/mc/ZToMuMu/" +- inUFTier2 = False +- #sumw_path = "/raid/raid7/lucien/SUSY/RPV/SumGenWeight/NanoAOD_InclusiveSelection_v2/%s/EventWeight.root" +--sumw_path = "/raid/raid7/kshi/SUSY/RPV/sum_weight/ZToMuMu/%s/EventWeight.root" +-+sumw_path = "/raid/raid7/kshi/SUSY/RPV/sum_weight/%s/EventWeight.root" +- +- sampleNames = [n for n in os.listdir(common_path) if os.path.isdir(os.path.join(common_path, n))] +- allMCSamples = [] +- for sampleName in sampleNames: +-- if sampleName != "DYJetsToLL_M50_NLO": +-+ if sampleName != "DYJetsToLL_M50_LO": +- tmpList = ComponentList([Component(sampleName,"/".join([common_path,sampleName,fileName]),"Events",inUFTier2,maxEvents=-1)],) +- tmpDataset = Dataset(sampleName,tmpList,xs=xs_dict[sampleName]) +- tmpDataset.setSumWeight(sumw_path%sampleName) +-diff --git a/RPV/Skimmer/HLTSkimmer.py b/RPV/Skimmer/HLTSkimmer.py +-index d0d4eb6..2514801 100644 +---- a/RPV/Skimmer/HLTSkimmer.py +-+++ b/RPV/Skimmer/HLTSkimmer.py +-@@ -7,7 +7,7 @@ class HLTSkimmer(Module): +- +- def analyze(self,event): +- if(self.dataset.isMC): +-- return True #event.HLT_IsoMu24[0] or event.HLT_IsoTkMu24[0] +-+ return event.HLT_IsoMu24[0] or event.HLT_IsoTkMu24[0] +- #return event.HLT_IsoMu22[0] or event.HLT_IsoTkMu22[0] or event.HLT_IsoMu24[0] or event.HLT_IsoTkMu24[0] or event.HLT_Ele27_eta2p1_WPTight_Gsf[0] or event.HLT_Ele27_eta2p1_WPTight_Gsf[0] +- +- else: +-diff --git a/RPV/Skimmer/TTbarSkimmer.py b/RPV/Skimmer/TTbarSkimmer.py +-index 4a090e1..c7087f9 100644 +---- a/RPV/Skimmer/TTbarSkimmer.py +-+++ b/RPV/Skimmer/TTbarSkimmer.py +-@@ -24,16 +24,20 @@ class TTbarSkimmer(Module): +- if len(event.muons) < 1 or len(event.muons) > 1: return False +- if len(event.eles) < 1 or len(event.eles) > 1: return False +- +-- temp = False +-+ #temp = False +- +-- for i in range(0,len(event.jets)): +-- if event.jets[i].btagCSVV2 >= self.csvCut: +-- temp = True +-- break +-- else: +-- temp = False +-+ #for i in range(0,len(event.jets)): +-+ #if event.jets[i].btagCSVV2 >= self.csvCut: +-+ #temp = True +-+ #break +-+ #else: +-+ #temp = False +-+ +-+ #if not temp: return False +-+ +-+ if len(event.jets) <= 0: +-+ return False +- +-- if not temp: return False +- +- event.nMuon40 = len(event.muons) +- +-diff --git a/RPV/Weighter/Triggereff.py b/RPV/Weighter/Triggereff.py +-index b0bf14b..f7569ad 100644 +---- a/RPV/Weighter/Triggereff.py +-+++ b/RPV/Weighter/Triggereff.py +-@@ -7,7 +7,7 @@ from math import sqrt +- +- class Triggereff(Module): +- +-- def __init__(self, name, filenameTrigeff = [(20.2,'EfficienciesAndSF_RunBtoF.root'),(16.6,'EfficienciesAndSF_Period4.root')], Trigeffhistpath2 = "IsoMu24_OR_IsoTkMu24_PtEtaBins/pt_abseta_ratio", Trigeffhistpath = "IsoMu24_OR_IsoTkMu24_PtEtaBins/efficienciesDATA/pt_abseta_DATA", flatTrigSyst = 0.): +-+ def __init__(self, name, filenameTrigeff = [(20.2,'EfficienciesAndSF_RunBtoF.root'),(16.6,'EfficienciesAndSF_Period4.root')], Trigeffhistpath = "IsoMu24_OR_IsoTkMu24_PtEtaBins/pt_abseta_ratio", Trigeffhistpath2 = "IsoMu24_OR_IsoTkMu24_PtEtaBins/efficienciesDATA/pt_abseta_DATA", flatTrigSyst = 0.): +- self.filenameTrigeff = [(weight, "/home/kshi/SUSY/CMSSW_8_0_25/src/UF-PyNTupleRunner/DataMC/Trigger_Eff/Run2016/"+filename) for (weight, filename) in filenameTrigeff] +- self.flatTrigSyst = flatTrigSyst +- self.Trigeffhistpath = Trigeffhistpath +-diff --git a/RPV/plot_TTbar_cfg.py b/RPV/plot_TTbar_cfg.py +-index 569efff..260d21a 100644 +---- a/RPV/plot_TTbar_cfg.py +-+++ b/RPV/plot_TTbar_cfg.py +-@@ -14,6 +14,8 @@ from RPV.Producer.AnalysisProducer import AnalysisProducer +- from RPV.Skimmer.TTbarSkimmer import TTbarSkimmer +- from RPV.Skimmer.HLTSkimmer import HLTSkimmer +- from RPV.Weighter.Triggereff import Triggereff +-+from RPV.Weighter.Btageff import Btageff +-+from RPV.Weighter.BtagscaleFactor import BtagscaleFactor +- +- from Plotter.Plotter import Plotter +- from Plotter.PlotEndModule import PlotEndModule +-@@ -63,7 +65,7 @@ plots = [ +- Plot("muonPt1", ["TH1D","muonPt1","",20,0., 500.], LambdaFunc('x: x.muons[0].pt if len(x.muons) > 0 else None')), +- Plot("muonPt2", ["TH1D","muonPt2","",20,0., 500.], LambdaFunc('x: x.muons[1].pt if len(x.muons) > 1 else None')), +- Plot("nGoodPV", ["TH1D","nGoodPV","",30,0.0,60.0], LambdaFunc('x: x.PV_npvsGood[0]')), +-- #Plot("m0_bl", ["TH1D","m0_bl1","",16,0., 800.], LambdaFunc('x: x.m0_bl[0]')), +-+ #Plot("m0_bl", ["TH1D","m0_bl1","",16,0., 800.], LambdaFunc('x: x.m0_bl[0]')), +- #Plot("m1_bl", ["TH1D","m1_bl1","",16,0., 800.], LambdaFunc('x: x.m1_bl[0]')), +- #Plot("m_asym_bl", ["TH1D","m_asym_bl","",20,0., 1.], LambdaFunc('x: x.m_asym_bl[0]')), +- #Plot("m_ct", ["TH1D","m_ct","",16,0., 800.], LambdaFunc('x: x.m_ct[0]')), +-@@ -80,6 +82,9 @@ hltSkimmer = HLTSkimmer("HLTSkim",cutflow="htCR") +- jsonSkimmer = JSONSkimmer("JSONSkim") +- metSkimmer = METFilter("METSkim") +- triggereff = Triggereff("Triggereff") +-+btageff = Btageff("Btageff") +-+btagscalefactor = BtagscaleFactor("BtagscaleFactor") +-+ +- +- sequence = Sequence() +- sequence.add(metSkimmer) +-@@ -93,10 +98,12 @@ sequence.add(puWeighter) +- sequence.add(anaProducer) +- sequence.add(eventSkimmer) +- sequence.add(triggereff) +-+sequence.add(btageff) +-+sequence.add(btagscalefactor) +- sequence.add(plotter) +- +- endSequence = EndSequence(skipHadd=justEndSequence) +--endModuleOutputDir = "/home/kshi/public_html/dataPlot/TTbar/NLO_DYJets/" +-+endModuleOutputDir = "/home/kshi/public_html/dataPlot/TTbar/NLO_DYJets/Btageff_ratio/" +- endSequence.add(PlotEndModule(endModuleOutputDir,plots)) +- +- outputInfo = OutputInfo("OutputInfo") +-diff --git a/RPV/skimTree_TTbar_mc_cfg.py b/RPV/skimTree_TTbar_mc_cfg.py +-index 73935f6..da89ca7 100644 +---- a/RPV/skimTree_TTbar_mc_cfg.py +-+++ b/RPV/skimTree_TTbar_mc_cfg.py +-@@ -10,9 +10,9 @@ from RPV.Producer.TreeProducer import TreeProducer +- from RPV.Producer.AnalysisProducer import AnalysisProducer +- from RPV.Skimmer.TTbarSkimmer import TTbarSkimmer +- +--nCores = 8 +-+nCores = 1 +- #outputDir = "/raid/raid7/lucien/SUSY/RPV/SkimTree/ZMuMu/2018-06-19/BkgMC_ZMuMuSelection_v1/" +--outputDir = "/raid/raid7/kshi/SUSY/RPV/SkimTree/mc/TTbar/" +-+outputDir = "/raid/raid7/kshi/SUSY/RPV/SkimTree/mc/TTbar_Btageff/" +- nEvents = -1 +- disableProgressBar = False +- justEndSequence = False +-diff --git a/RPV/skimTree_ZToMuMu_mc_cfg.py b/RPV/skimTree_ZToMuMu_mc_cfg.py +-index 8486bed..c223493 100644 +---- a/RPV/skimTree_ZToMuMu_mc_cfg.py +-+++ b/RPV/skimTree_ZToMuMu_mc_cfg.py +-@@ -10,7 +10,7 @@ from RPV.Producer.TreeProducer import TreeProducer +- from RPV.Producer.AnalysisProducer import AnalysisProducer +- from RPV.Skimmer.ZMuMuSkimmer import ZMuMuSkimmer +- +--nCores = 4 +-+nCores = 8 +- #outputDir = "/raid/raid7/lucien/SUSY/RPV/SkimTree/ZMuMu/2018-06-19/BkgMC_ZMuMuSelection_v1/" +- outputDir = "/raid/raid7/kshi/SUSY/RPV/SkimTree/mc/ZToMuMu/" +- nEvents = -1 +diff --git a/RPV/BTag_ZMuMu/ttWJets/DataMCDistribution.root b/RPV/BTag_ZMuMu/ttWJets/DataMCDistribution.root +deleted file mode 100644 +index 54c963d..0000000 +Binary files a/RPV/BTag_ZMuMu/ttWJets/DataMCDistribution.root and /dev/null differ +diff --git a/RPV/BTag_ZMuMu/ttWJets/hadd.sh b/RPV/BTag_ZMuMu/ttWJets/hadd.sh +deleted file mode 100644 +index e196256..0000000 +--- a/RPV/BTag_ZMuMu/ttWJets/hadd.sh ++++ /dev/null +@@ -1 +0,0 @@ +-hadd -f ./BTag_ZMuMu/ttWJets/DataMCDistribution.root ./BTag_ZMuMu/ttWJets/*_DataMCDistribution.root +\ No newline at end of file +diff --git a/RPV/BTag_ZMuMu/ttWJets/ttWJets_0_DataMCDistribution.root b/RPV/BTag_ZMuMu/ttWJets/ttWJets_0_DataMCDistribution.root +index 89e2a2e..d1ed339 100644 +Binary files a/RPV/BTag_ZMuMu/ttWJets/ttWJets_0_DataMCDistribution.root and b/RPV/BTag_ZMuMu/ttWJets/ttWJets_0_DataMCDistribution.root differ +diff --git a/RPV/BTag_ZMuMu/ttZJets/DataMCDistribution.root b/RPV/BTag_ZMuMu/ttZJets/DataMCDistribution.root +deleted file mode 100644 +index 1f01506..0000000 +Binary files a/RPV/BTag_ZMuMu/ttZJets/DataMCDistribution.root and /dev/null differ +diff --git a/RPV/BTag_ZMuMu/ttZJets/hadd.sh b/RPV/BTag_ZMuMu/ttZJets/hadd.sh +deleted file mode 100644 +index 273fc60..0000000 +--- a/RPV/BTag_ZMuMu/ttZJets/hadd.sh ++++ /dev/null +@@ -1 +0,0 @@ +-hadd -f ./BTag_ZMuMu/ttZJets/DataMCDistribution.root ./BTag_ZMuMu/ttZJets/*_DataMCDistribution.root +\ No newline at end of file +diff --git a/RPV/BTag_ZMuMu/ttZJets/ttZJets_0_DataMCDistribution.root b/RPV/BTag_ZMuMu/ttZJets/ttZJets_0_DataMCDistribution.root +index 72e05e1..3e35ebd 100644 +Binary files a/RPV/BTag_ZMuMu/ttZJets/ttZJets_0_DataMCDistribution.root and b/RPV/BTag_ZMuMu/ttZJets/ttZJets_0_DataMCDistribution.root differ +diff --git a/RPV/Weighter/Btageff.py b/RPV/Weighter/Btageff.py +index 4f76625..84b0aa1 100644 +--- a/RPV/Weighter/Btageff.py ++++ b/RPV/Weighter/Btageff.py +@@ -1,6 +1,6 @@ + import ROOT + from Core.Module import Module +-import os,array ++import os,array,numpy + + class Btageff(Module): + +@@ -22,18 +22,26 @@ class Btageff(Module): + #self.writer.book("CTageffDem","TH2D","CTageffDem",10,0.,200.,10,-2.4,2.4) + #self.writer.book("LTageffNum","TH2D","LTageffNum",10,0.,200.,10,-2.4,2.4) + #self.writer.book("LTageffDem","TH2D","LTageffDem",10,0.,200.,10,-2.4,2.4) ++ pt_bins = numpy.array([20,30,50,70,100,140,200,300,600,1000], dtype='float64') ++ eta_bins = numpy.array([-2.4,-1.42,0,1.42,2.4], dtype='float64') + if "BTageffNum" not in self.writer.objs: +- self.writer.book("BTageffNum","TH2D","BTageffNum","",10,0.,200.,10,-2.4,2.4) ++ #self.writer.book("BTageffNum","TH2D","BTageffNum","",10,0.,200.,10,-2.4,2.4) ++ self.writer.book("BTageffNum","TH2D","BTageffNum","",9,pt_bins,4,eta_bins) + if "BTageffDem" not in self.writer.objs: +- self.writer.book("BTageffDem","TH2D","BTageffDem","",10,0.,200.,10,-2.4,2.4) ++ #self.writer.book("BTageffDem","TH2D","BTageffDem","",10,0.,200.,10,-2.4,2.4) ++ self.writer.book("BTageffDem","TH2D","BTageffDem","",9,pt_bins,4,eta_bins) + if "CTageffNum" not in self.writer.objs: +- self.writer.book("CTageffNum","TH2D","CTageffNum","",10,0.,200.,10,-2.4,2.4) ++ #self.writer.book("CTageffNum","TH2D","CTageffNum","",10,0.,200.,10,-2.4,2.4) ++ self.writer.book("CTageffNum","TH2D","CTageffNum","",9,pt_bins,4,eta_bins) + if "CTageffDem" not in self.writer.objs: +- self.writer.book("CTageffDem","TH2D","CTageffDem","",10,0.,200.,10,-2.4,2.4) ++ #self.writer.book("CTageffDem","TH2D","CTageffDem","",10,0.,200.,10,-2.4,2.4) ++ self.writer.book("CTageffDem","TH2D","CTageffDem","",9,pt_bins,4,eta_bins) + if "LTageffNum" not in self.writer.objs: +- self.writer.book("LTageffNum","TH2D","LTageffNum","",10,0.,200.,10,-2.4,2.4) ++ #self.writer.book("LTageffNum","TH2D","LTageffNum","",10,0.,200.,10,-2.4,2.4) ++ self.writer.book("LTageffNum","TH2D","LTageffNum","",9,pt_bins,4,eta_bins) + if "LTageffDem" not in self.writer.objs: +- self.writer.book("LTageffDem","TH2D","LTageffDem","",10,0.,200.,10,-2.4,2.4) ++ #self.writer.book("LTageffDem","TH2D","LTageffDem","",10,0.,200.,10,-2.4,2.4) ++ self.writer.book("LTageffDem","TH2D","LTageffDem","",9,pt_bins,4,eta_bins) + + + +diff --git a/RPV/btageff_cfg.py b/RPV/btageff_cfg.py +index 1885fd9..255f1da 100644 +--- a/RPV/btageff_cfg.py ++++ b/RPV/btageff_cfg.py +@@ -41,7 +41,7 @@ nCores = 1 + outputDir = "./BTag_ZMuMu/" + nEvents = -1 + disableProgressBar = False +-justEndSequence = True ++justEndSequence = False + haddSamples = True + componentList = allMCSamples + #componentList = allDataSamples + allMCSamples diff --git a/RPV/BTag_ZMuMu/ttWJets/DataMCDistribution.root b/RPV/BTag_ZMuMu/ttWJets/DataMCDistribution.root new file mode 100644 index 0000000..c226f4c Binary files /dev/null and b/RPV/BTag_ZMuMu/ttWJets/DataMCDistribution.root differ diff --git a/RPV/BTag_ZMuMu/ttWJets/hadd.sh b/RPV/BTag_ZMuMu/ttWJets/hadd.sh new file mode 100644 index 0000000..e196256 --- /dev/null +++ b/RPV/BTag_ZMuMu/ttWJets/hadd.sh @@ -0,0 +1 @@ +hadd -f ./BTag_ZMuMu/ttWJets/DataMCDistribution.root ./BTag_ZMuMu/ttWJets/*_DataMCDistribution.root \ No newline at end of file diff --git a/RPV/BTag_ZMuMu/ttWJets/ttWJets_0_DataMCDistribution.root b/RPV/BTag_ZMuMu/ttWJets/ttWJets_0_DataMCDistribution.root new file mode 100644 index 0000000..e6b261b Binary files /dev/null and b/RPV/BTag_ZMuMu/ttWJets/ttWJets_0_DataMCDistribution.root differ diff --git a/RPV/BTag_ZMuMu/ttZJets/DataMCDistribution.root b/RPV/BTag_ZMuMu/ttZJets/DataMCDistribution.root new file mode 100644 index 0000000..382833e Binary files /dev/null and b/RPV/BTag_ZMuMu/ttZJets/DataMCDistribution.root differ diff --git a/RPV/BTag_ZMuMu/ttZJets/hadd.sh b/RPV/BTag_ZMuMu/ttZJets/hadd.sh new file mode 100644 index 0000000..273fc60 --- /dev/null +++ b/RPV/BTag_ZMuMu/ttZJets/hadd.sh @@ -0,0 +1 @@ +hadd -f ./BTag_ZMuMu/ttZJets/DataMCDistribution.root ./BTag_ZMuMu/ttZJets/*_DataMCDistribution.root \ No newline at end of file diff --git a/RPV/BTag_ZMuMu/ttZJets/ttZJets_0_DataMCDistribution.root b/RPV/BTag_ZMuMu/ttZJets/ttZJets_0_DataMCDistribution.root new file mode 100644 index 0000000..8a1a6d0 Binary files /dev/null and b/RPV/BTag_ZMuMu/ttZJets/ttZJets_0_DataMCDistribution.root differ diff --git a/RPV/Module/Btageff_ratio.py b/RPV/Module/Btageff_ratio.py new file mode 100644 index 0000000..d5c9b54 --- /dev/null +++ b/RPV/Module/Btageff_ratio.py @@ -0,0 +1,99 @@ +from Core.EndModule import EndModule + +import os,ROOT,numpy + +from array import array + +class Btageff_ratio(EndModule): + def __init__(self,outputDir): + self.outputDir = outputDir + + def begin(self,collector): + for isample,sample in enumerate(collector.mcSamples if not collector.mergeSamples else collector.mergeSamples): + h1 = ROOT.TH2D("BTageff"+sample, "BTageff"+sample, 10,0.,200.,10,-2.4,2.4) + h2 = ROOT.TH2D("CTageff"+sample, "CTageff"+sample, 10,0.,200.,10,-2.4,2.4) + h3 = ROOT.TH2D("LTageff"+sample, "LTageff"+sample, 10,0.,200.,10,-2.4,2.4) + + + #if "BTageff"+sample not in self.writer.objs: + #self.writer.book("BTageff"+sample,"TH2D","BTageff"+sample,"",10,0.,200.,10,-2.4,2.4) + #if "CTageff"+sample not in self.writer.objs: + #self.writer.book("CTageff"+sample,"TH2D","CTageff"+sample,"",10,0.,200.,10,-2.4,2.4) + #if "LTageff"+sample not in self.writer.objs: + #self.writer.book("LTageff"+sample,"TH2D","LTageff"+sample,"",10,0.,200.,10,-2.4,2.4) + + def __call__(self,collector): + #self.begin(collector) + self.analyze(collector) + + def analyze(self,collector): + + hist_name = ["BTageffNum", "BTageffDem", "CTageffNum", "CTageffDem", "LTageffNum", "LTageffDem"] + pt_bins = numpy.array([20, 30, 50, 70, 100, 140, 200, 300, 600, 1000], dtype='float64') + eta_bins = numpy.array([-2.4,-1.42,0.,1.42,2.4], dtype='float64') + histList = [] + for isample,sample in enumerate(collector.mcSamples if not collector.mergeSamples else collector.mergeSamples): + #if not collector.mergeSamples and collector.sampleDict[sample].isSignal: continuei + print(sample) + h1 = ROOT.TH2D("BTageff"+sample, "BTageff"+sample, 9,pt_bins,4,eta_bins) + h2 = ROOT.TH2D("CTageff"+sample, "CTageff"+sample, 9,pt_bins,4,eta_bins) + h3 = ROOT.TH2D("LTageff"+sample, "LTageff"+sample, 9,pt_bins,4,eta_bins) + c1 = ROOT.TCanvas("BTageff"+sample) + c2 = ROOT.TCanvas("CTageff"+sample) + c3 = ROOT.TCanvas("LTageff"+sample) + + for p in hist_name: + h = collector.getObj(sample,p) + histList.append([h,sample,p]) + for h,s,p in histList: + if s == sample: + if p == "BTageffNum": + h1 = h + h1.SetBins(9,pt_bins,4,eta_bins) + if p == "BTageffDem": #and Btemp != None: + h.SetBins(9,pt_bins,4,eta_bins) + h1.Divide(h) + c1.cd() + h1.SetStats(0) + h1.Draw("colz") + c1.SaveAs("BTageff"+sample+".png") + #h1.SaveAs("BTageff"+sample+".png") + #self.writer.objs["BTageff"+sample] = Btemp + if p == "CTageffNum": + h2 = h + h2.SetBins(9,pt_bins,4,eta_bins) + if p == "CTageffDem": #and Ctemp != None: + h.SetBins(9,pt_bins,4,eta_bins) + h2.Divide(h) + c2.cd() + h2.SetStats(0) + h2.Draw("colz") + c2.SaveAs("CTageff"+sample+".png") + #h2.SaveAs("CTageff"+sample+".png") + #self.writer.objs["CTageff"+sample] = Ctemp + if p == "LTageffNum": + h3 = h + h3.SetBins(9,pt_bins,4,eta_bins) + if p == "LTageffDem": #and Ltemp != None: + h.SetBins(9,pt_bins,4,eta_bins) + h3.Divide(h) + c3.cd() + h3.SetStats(0) + h3.Draw("colz") + c3.SaveAs("LTageff"+sample+".png") + #h3.SaveAs("LTageff"+sample+".png") + #self.writer.objs["LTageff"+sample] = Ltemp + + h = collector.getObj("AllSample","BTageffNum") + h1 = h + h1.SetBins(1,20.,1000.,1,-2.4,2.4) + h1.SaveAs("text.png") + h = collector.getObj("AllSample","BTageffDem") + h.SetBins(1,20.,1000.,1,-2.4,2.4) + h1.Divide(h) + c1.cd() + h1.SetStats(0) + h1.Draw("colz") + c1.SaveAs("BTageffAllSample.png") + + return True diff --git a/RPV/Producer/AnalysisProducer.py b/RPV/Producer/AnalysisProducer.py index 0978b5f..b3535c7 100644 --- a/RPV/Producer/AnalysisProducer.py +++ b/RPV/Producer/AnalysisProducer.py @@ -19,6 +19,10 @@ def analyze(self,event): event.jets.sort(key=lambda x: x.pt,reverse=True) event.nJet40 = len(event.jets) + event.jets25 = [p for p in event.LooseJets if p.pt > 25] + event.jets25.sort(key=lambda x: x.pt,reverse=True) + event.nJet25 = len(event.jets25) + event.ht40 = 0. for ps in [event.jets,event.leps]: for p in ps: diff --git a/RPV/SkimTree/NanoAOD/Run2016/TTbarBtageff_MC.py b/RPV/SkimTree/NanoAOD/Run2016/TTbarBtageff_MC.py new file mode 100644 index 0000000..4e2a4f7 --- /dev/null +++ b/RPV/SkimTree/NanoAOD/Run2016/TTbarBtageff_MC.py @@ -0,0 +1,19 @@ +import os +from Core.ComponentList import * +from Core.Dataset import Dataset +from DataMC.NanoAOD.CrossSection import xs_dict + +fileName = "SkimTree.root" +#common_path = "/raid/raid7/lucien/SUSY/RPV/SkimTree/ZMuMu/2018-06-19/BkgMC_ZMuMuSelection_v1/" +common_path = "/raid/raid7/kshi/SUSY/RPV/SkimTree/mc/TTbar_Btageff" +inUFTier2 = False +#sumw_path = "/raid/raid7/lucien/SUSY/RPV/SumGenWeight/NanoAOD_InclusiveSelection_v2/%s/EventWeight.root" +sumw_path = "/raid/raid7/kshi/SUSY/RPV/sum_weight/%s/EventWeight.root" + +sampleNames = [n for n in os.listdir(common_path) if os.path.isdir(os.path.join(common_path, n))] +allMCSamples = [] +for sampleName in sampleNames: + tmpList = ComponentList([Component(sampleName,"/".join([common_path,sampleName,fileName]),"Events",inUFTier2,maxEvents=-1)],) + tmpDataset = Dataset(sampleName,tmpList,xs=xs_dict[sampleName]) + tmpDataset.setSumWeight(sumw_path%sampleName) + allMCSamples.append(tmpDataset) diff --git a/RPV/SkimTree/NanoAOD/Run2016/ZToMuMu_MC.py b/RPV/SkimTree/NanoAOD/Run2016/ZToMuMu_MC.py index 7eeaa63..5b70ef2 100644 --- a/RPV/SkimTree/NanoAOD/Run2016/ZToMuMu_MC.py +++ b/RPV/SkimTree/NanoAOD/Run2016/ZToMuMu_MC.py @@ -8,12 +8,12 @@ common_path = "/raid/raid7/kshi/SUSY/RPV/SkimTree/mc/ZToMuMu/" inUFTier2 = False #sumw_path = "/raid/raid7/lucien/SUSY/RPV/SumGenWeight/NanoAOD_InclusiveSelection_v2/%s/EventWeight.root" -sumw_path = "/raid/raid7/kshi/SUSY/RPV/sum_weight/ZToMuMu/%s/EventWeight.root" +sumw_path = "/raid/raid7/kshi/SUSY/RPV/sum_weight/%s/EventWeight.root" sampleNames = [n for n in os.listdir(common_path) if os.path.isdir(os.path.join(common_path, n))] allMCSamples = [] for sampleName in sampleNames: - if sampleName != "DYJetsToLL_M50_NLO": + if sampleName != "DYJetsToLL_M50_LO": tmpList = ComponentList([Component(sampleName,"/".join([common_path,sampleName,fileName]),"Events",inUFTier2,maxEvents=-1)],) tmpDataset = Dataset(sampleName,tmpList,xs=xs_dict[sampleName]) tmpDataset.setSumWeight(sumw_path%sampleName) diff --git a/RPV/Skimmer/HLTSkimmer.py b/RPV/Skimmer/HLTSkimmer.py index d0d4eb6..2514801 100644 --- a/RPV/Skimmer/HLTSkimmer.py +++ b/RPV/Skimmer/HLTSkimmer.py @@ -7,7 +7,7 @@ def __init__(self,name,cutflow="LooseSignal"): def analyze(self,event): if(self.dataset.isMC): - return True #event.HLT_IsoMu24[0] or event.HLT_IsoTkMu24[0] + return event.HLT_IsoMu24[0] or event.HLT_IsoTkMu24[0] #return event.HLT_IsoMu22[0] or event.HLT_IsoTkMu22[0] or event.HLT_IsoMu24[0] or event.HLT_IsoTkMu24[0] or event.HLT_Ele27_eta2p1_WPTight_Gsf[0] or event.HLT_Ele27_eta2p1_WPTight_Gsf[0] else: diff --git a/RPV/Skimmer/TTbarSkimmer.py b/RPV/Skimmer/TTbarSkimmer.py index 4a090e1..c7087f9 100644 --- a/RPV/Skimmer/TTbarSkimmer.py +++ b/RPV/Skimmer/TTbarSkimmer.py @@ -24,16 +24,20 @@ def analyze(self,event): if len(event.muons) < 1 or len(event.muons) > 1: return False if len(event.eles) < 1 or len(event.eles) > 1: return False - temp = False + #temp = False - for i in range(0,len(event.jets)): - if event.jets[i].btagCSVV2 >= self.csvCut: - temp = True - break - else: - temp = False + #for i in range(0,len(event.jets)): + #if event.jets[i].btagCSVV2 >= self.csvCut: + #temp = True + #break + #else: + #temp = False + + #if not temp: return False + + if len(event.jets) <= 0: + return False - if not temp: return False event.nMuon40 = len(event.muons) diff --git a/RPV/Weighter/Btageff.py b/RPV/Weighter/Btageff.py new file mode 100644 index 0000000..84b0aa1 --- /dev/null +++ b/RPV/Weighter/Btageff.py @@ -0,0 +1,69 @@ +import ROOT +from Core.Module import Module +import os,array,numpy + +class Btageff(Module): + + def __init__(self,name): + super(Btageff,self).__init__(name) + + def begin(self): + #pt_bins = [0.,20.,40.,200.] + #array_pt_bins = array('d',pt_bins) + #self.writer.book("BTageffNum","TH2D","BTageffNum",3,array_pt_bins,10,-2.4,2.4) + #self.writer.book("BTageffDem","TH2D","BTageffDem",3,array_pt_bins,10,-2.4,2.4) + #self.writer.book("CTageffNum","TH2D","CTageffNum",3,array_pt_bins,10,-2.4,2.4) + #self.writer.book("CTageffDem","TH2D","CTageffDem",3,array_pt_bins,10,-2.4,2.4) + #self.writer.book("LTageffNum","TH2D","LTageffNum",3,array_pt_bins,10,-2.4,2.4) + #self.writer.book("LTageffDem","TH2D","LTageffDem",3,array_pt_bins,10,-2.4,2.4) + #self.writer.book("BTageffNum","TH2D","BTageffNum",10,0.,200.,10,-2.4,2.4) + #self.writer.book("BTageffDem","TH2D","BTageffDem",10,0.,200.,10,-2.4,2.4) + #self.writer.book("CTageffNum","TH2D","CTageffNum",10,0.,200.,10,-2.4,2.4) + #self.writer.book("CTageffDem","TH2D","CTageffDem",10,0.,200.,10,-2.4,2.4) + #self.writer.book("LTageffNum","TH2D","LTageffNum",10,0.,200.,10,-2.4,2.4) + #self.writer.book("LTageffDem","TH2D","LTageffDem",10,0.,200.,10,-2.4,2.4) + pt_bins = numpy.array([20,30,50,70,100,140,200,300,600,1000], dtype='float64') + eta_bins = numpy.array([-2.4,-1.42,0,1.42,2.4], dtype='float64') + if "BTageffNum" not in self.writer.objs: + #self.writer.book("BTageffNum","TH2D","BTageffNum","",10,0.,200.,10,-2.4,2.4) + self.writer.book("BTageffNum","TH2D","BTageffNum","",9,pt_bins,4,eta_bins) + if "BTageffDem" not in self.writer.objs: + #self.writer.book("BTageffDem","TH2D","BTageffDem","",10,0.,200.,10,-2.4,2.4) + self.writer.book("BTageffDem","TH2D","BTageffDem","",9,pt_bins,4,eta_bins) + if "CTageffNum" not in self.writer.objs: + #self.writer.book("CTageffNum","TH2D","CTageffNum","",10,0.,200.,10,-2.4,2.4) + self.writer.book("CTageffNum","TH2D","CTageffNum","",9,pt_bins,4,eta_bins) + if "CTageffDem" not in self.writer.objs: + #self.writer.book("CTageffDem","TH2D","CTageffDem","",10,0.,200.,10,-2.4,2.4) + self.writer.book("CTageffDem","TH2D","CTageffDem","",9,pt_bins,4,eta_bins) + if "LTageffNum" not in self.writer.objs: + #self.writer.book("LTageffNum","TH2D","LTageffNum","",10,0.,200.,10,-2.4,2.4) + self.writer.book("LTageffNum","TH2D","LTageffNum","",9,pt_bins,4,eta_bins) + if "LTageffDem" not in self.writer.objs: + #self.writer.book("LTageffDem","TH2D","LTageffDem","",10,0.,200.,10,-2.4,2.4) + self.writer.book("LTageffDem","TH2D","LTageffDem","",9,pt_bins,4,eta_bins) + + + + def analyze(self, event): + if self.dataset.isData: return True + for jet in event.jets25: + if abs(jet.hadronFlavour) == 5: + self.writer.objs["BTageffDem"].Fill(jet.pt,jet.eta,event.weight) + if jet.btagCSVV2 > 0.8484: + self.writer.objs["BTageffNum"].Fill(jet.pt,jet.eta,event.weight) + + if abs(jet.hadronFlavour) == 4: + self.writer.objs["CTageffDem"].Fill(jet.pt,jet.eta,event.weight) + if jet.btagCSVV2 > 0.8484: + self.writer.objs["CTageffNum"].Fill(jet.pt,jet.eta,event.weight) + + if abs(jet.hadronFlavour) == 0: + self.writer.objs["LTageffDem"].Fill(jet.pt,jet.eta,event.weight) + if jet.btagCSVV2 > 0.8484: + self.writer.objs["LTageffNum"].Fill(jet.pt,jet.eta,event.weight) + + return True + + + diff --git a/RPV/Weighter/BtagscaleFactor.py b/RPV/Weighter/BtagscaleFactor.py new file mode 100644 index 0000000..e69de29 diff --git a/RPV/Weighter/Triggereff.py b/RPV/Weighter/Triggereff.py index b0bf14b..f7569ad 100644 --- a/RPV/Weighter/Triggereff.py +++ b/RPV/Weighter/Triggereff.py @@ -7,7 +7,7 @@ class Triggereff(Module): - def __init__(self, name, filenameTrigeff = [(20.2,'EfficienciesAndSF_RunBtoF.root'),(16.6,'EfficienciesAndSF_Period4.root')], Trigeffhistpath2 = "IsoMu24_OR_IsoTkMu24_PtEtaBins/pt_abseta_ratio", Trigeffhistpath = "IsoMu24_OR_IsoTkMu24_PtEtaBins/efficienciesDATA/pt_abseta_DATA", flatTrigSyst = 0.): + def __init__(self, name, filenameTrigeff = [(20.2,'EfficienciesAndSF_RunBtoF.root'),(16.6,'EfficienciesAndSF_Period4.root')], Trigeffhistpath = "IsoMu24_OR_IsoTkMu24_PtEtaBins/pt_abseta_ratio", Trigeffhistpath2 = "IsoMu24_OR_IsoTkMu24_PtEtaBins/efficienciesDATA/pt_abseta_DATA", flatTrigSyst = 0.): self.filenameTrigeff = [(weight, "/home/kshi/SUSY/CMSSW_8_0_25/src/UF-PyNTupleRunner/DataMC/Trigger_Eff/Run2016/"+filename) for (weight, filename) in filenameTrigeff] self.flatTrigSyst = flatTrigSyst self.Trigeffhistpath = Trigeffhistpath diff --git a/RPV/Weighter/WeightBTagSF.py b/RPV/Weighter/WeightBTagSF.py new file mode 100644 index 0000000..4a40bbf --- /dev/null +++ b/RPV/Weighter/WeightBTagSF.py @@ -0,0 +1,455 @@ +from Module import Module +from PhysObject.PhysObject import PhysObjects +from Data.BTagWorkingPoints import BTagWorkingPoints +import os +import csv +import pickle +import re +from math import * + +supportedTaggers = ["CSV","DeepCSV"] +jetFlavoursDict = { 0:"2", 4:"1", 5:"0" } +jetFlavourHeavy = ("0","1") +jetFlavourLight = ("2") +measTypeDict = { "0":"comb", "1":"comb", "2":"incl" } +bcfEtaPhiBin = ( (-2.4, 2.4), (20.0, 1000.0) ) +bcfPtBins = [0,20,30,40,50,60,70,80,100,120,160,210,260,320,400,500,670,800,1000,999999] + +class WeightBTagSF(Module): + """ + Carry out b-tag efficiency SF reweighting from SF and Eff pickle files + following Method 1(a) in https://twiki.cern.ch/twiki/bin/view/CMS/BTagSFMethods + + Also fullsim/fastsim corrections according to: + https://twiki.cern.ch/twiki/bin/viewauth/CMS/Btag2015FastSimCorrectionFactors + """ + def __init__(self,name,applySystVariation=True,era="2016Moriond17",tagger = "CSV", btagDisc = 'CSVv2IVFM', opPoint = '1',forceSFToUnity=False,fileTag=""): + super(WeightBTagSF,self).__init__(name) + + # working point: 0=Loose, 1=Medium, 2=Tight + self._opPoint = opPoint + if not tagger in supportedTaggers: raise ValueError("Tagger {0} is not supported.".format(tagger)) + self._tagger = tagger + if not btagDisc in BTagWorkingPoints: raise ValueError("B-tag discrminator {0} not found".format(btagDisc)) + self._btagDisc = btagDisc + + # hadronFlavour to csvFlavour conversion + self._jetFlavorsDict = jetFlavoursDict + self._jetFlavorsHeavy = jetFlavourHeavy + self._jetFlavorsLight = jetFlavourLight + + # use incl for light jets, comb for b,c jets + self._measTypeDict = measTypeDict + + self._btagDiscWP = BTagWorkingPoints[self._btagDisc][1] + + self._applySystVariation = applySystVariation + self._forceSFToUnity = forceSFToUnity + + self._bcfEtaPhiBin = bcfEtaPhiBin + self._bcfPtBins = bcfPtBins + + self.era = era + self.fileTag = fileTag + + + def beginJob(self,events,eventFunctions): + + if self._sample.isData: return True + if not self._PSet.reweightTrees: return True + + # Turn off reweighting for on-off comparison + if not self._applySystVariation and self._PSet.systVar == "Up": + return True + + if self._PSet.systVar is None: self.sysType = "central" + elif self._PSet.systVar == "Up": self.sysType = "up" + elif self._PSet.systVar == "Down": self.sysType = "down" + + self.bsfFile = os.environ['ALPHATOOLSDIR']+"/Data/BTagging/"+self.era+"/btagScaleFactors"+self.fileTag+".p" + #self.bsfFile = os.environ['ALPHATOOLSDIR']+"/Data/BTagging/"+self.era+"/btagScaleFactors_CSVv2_Moriond17_B_F.p" + #self.bsfFile = os.environ['ALPHATOOLSDIR']+"/Data/BTagging/"+self.era+"/btagScaleFactors_CSVv2_Moriond17_G_H.p" + + self.applyCF = False + if "SMS" in self._sample.name: + self.applyCF = True + + if "T1" in self._sample.parent or "T5" in self._sample.parent: mSUS = int(re.findall('(?<=mGluino-)\d+', self._sample.name)[0]) + elif "T2qq" in self._sample.parent: mSUS = int(re.findall('(?<=mSquark-)\d+', self._sample.name)[0]) + elif "T2tt" in self._sample.parent: mSUS = int(re.findall('(?<=mStop-)\d+', self._sample.name)[0]) + elif "T2cc" in self._sample.parent: mSUS = int(re.findall('(?<=mStop-)\d+', self._sample.name)[0]) + elif "T2-4bd" in self._sample.parent: mSUS = int(re.findall('(?<=mStop-)\d+', self._sample.name)[0]) + elif "T2mixed" in self._sample.parent: mSUS = int(re.findall('(?<=mStop-)\d+', self._sample.name)[0]) + elif "T2bb" in self._sample.parent: mSUS = int(re.findall('(?<=mSbottom-)\d+',self._sample.name)[0]) + elif "T2tb" in self._sample.parent: mSUS = int(re.findall('(?<=mStop-)\d+',self._sample.name)[0]) + elif "T2bW_X05" in self._sample.parent: mSUS = int(re.findall('(?<=mStop-)\d+',self._sample.name)[0]) + mLSP = int(self._sample.name.split("mLSP-")[1].split("_")[0]) + + splitting = splittingType(mSUS,mLSP) + parent = self._sample.parent + + self.bcfFile = os.environ['ALPHATOOLSDIR']+"/Data/BTagging/"+self.era+"/btagScaleFactors_"+parent+"_"+splitting+".p" + self.effFile = os.environ['ALPHATOOLSDIR']+"/Data/BTagging/"+self.era+"/btagEfficiencies_"+parent+"_"+splitting+".p" + + if not os.path.exists(self.bcfFile): + self.bcfFile = os.environ['ALPHATOOLSDIR']+"/Data/BTagging/"+self.era+"/btagScaleFactors_combined.p" + + if not os.path.exists(self.effFile): + print "WARNING: b-tag efficiencies not available for sample", self._sample.name + print "Will only apply nominal scale factors" + self.applyCF = False + self.effFile = os.environ['ALPHATOOLSDIR']+"/Data/BTagging/"+self.era+"/btagEfficiencies_"+self._PSet.name+".p" + + elif "DM" in self._sample.name: + self.effFile = os.environ['ALPHATOOLSDIR']+"/Data/BTagging/"+self.era+"/btagEfficiencies_DM.p" + else: + self.effFile = os.environ['ALPHATOOLSDIR']+"/Data/BTagging/"+self.era+"/btagEfficiencies_"+self._PSet.name.replace("_Up","").replace("_Down","")+".p" + + self.bsfDict = pickle.load( open(self.bsfFile,"rb") ) + #if not self._opPoint in self.bsfDict: raise ValueError("Operation point {0} not found in bsfDict".format(self._opPoint)) + self.effDict = pickle.load( open(self.effFile,"rb") ) + #if not self._opPoint in self.effDict['All'].keys(): raise ValueError("Operation point {0} not found in effDict".format(self._opPoint)) + self.bcfDict = pickle.load( open(self.bcfFile,"rb") ) if self.applyCF else None + + self.evalDict = self.makeEvalDict(self.bsfDict) + + @staticmethod + def makeEvalDict(bsfDict): + evalDict = {} + for op,measDict in bsfDict.iteritems(): + if op not in evalDict: evalDict[op] = {} + for meas,sysDict in measDict.iteritems(): + if meas not in evalDict[op]: evalDict[op][meas] = {} + for sys,flavDict in sysDict.iteritems(): + if sys not in evalDict[op][meas]: evalDict[op][meas][sys] = {} + for flav,etaptDict in flavDict.iteritems(): + if flav not in evalDict[op][meas][sys]: evalDict[op][meas][sys][flav] = {} + for etapt,sf in etaptDict.iteritems(): + evalDict[op][meas][sys][flav][etapt] = eval("lambda x: "+bsfDict[op][meas][sys][flav][etapt]) + return evalDict + + @staticmethod + def returnJetInfo(jet,jetFlavDict,measTypeDict,bsfDict,opPoint,sysType,bcfPtBins): + jetPt = jet.pt + jetEta = abs(jet.eta) + jetFlav = jetFlavDict[jet.hadronFlavour] + measType = measTypeDict[jetFlav] + etaptBins = bsfDict[opPoint][measType][sysType][jetFlav] + etaptBins_Up = bsfDict[opPoint][measType]["up"][jetFlav] + etaptBins_Do = bsfDict[opPoint][measType]["down"][jetFlav] + + minPt = min(etaptbin[1][0] for etaptbin in etaptBins) + maxPt = max(etaptbin[1][1] for etaptbin in etaptBins) + + doubleUncertainty = False + + if jetPt < minPt: + jetPtSF = minPt + 1E-4 + doubleUncertainty = True + elif jetPt > maxPt: + jetPtSF = maxPt - 1E-4 + doubleUncertainty = True + else: + jetPtSF = jetPt + + minPtCF = bcfPtBins[1] + maxPtCF = bcfPtBins[-2] + + doubleUncertaintyCF = False + + if jetPt < minPtCF: + jetPtCF = minPtCF + 1E-4 + doubleUncertaintyCF = True + elif jetPt > maxPtCF: + jetPtCF = maxPtCF - 1E-4 + doubleUncertaintyCF = True + else: + jetPtCF = jetPt + + skipEvent = False + + for etaptBin in etaptBins: + if etaptBin[0][0] <= jetEta < etaptBin[0][1] and etaptBin[1][0] <= jetPtSF < etaptBin[1][1] : + break + else: + # ignore jets outside tracker acceptance + skipEvent = True + + for etaptBin_Up in etaptBins_Up: + if etaptBin_Up[0][0] <= jetEta < etaptBin_Up[0][1] and etaptBin_Up[1][0] <= jetPtSF < etaptBin_Up[1][1] : + break + + for etaptBin_Do in etaptBins_Do: + if etaptBin_Do[0][0] <= jetEta < etaptBin_Do[0][1] and etaptBin_Do[1][0] <= jetPtSF < etaptBin_Do[1][1] : + break + if skipEvent: + return False + else: + return jetFlav,measType,etaptBin,etaptBin_Up,etaptBin_Do,doubleUncertainty,jetPtSF,doubleUncertaintyCF,jetPtCF + + @staticmethod + def safe_div(num, den, fail_val=1.): + try: + ratio = num / den + except ZeroDivisionError: + ratio = fail_val + return ratio + + def analyze(self,event,key=None): + + if self._sample.isData: return True + if not self._PSet.reweightTrees: return True + + # Turn off reweighting for on-off comparison + if not self._applySystVariation and self._PSet.systVar == "Up": + return True + + mcTag = 1. + mcNoTag = 1. + dataTag = 1. + dataNoTag = 1. + + mcTag_Up = 1. + mcNoTag_Up = 1. + dataTag_Up = 1. + dataNoTag_Up = 1. + + mcTag_Do = 1. + mcNoTag_Do = 1. + dataTag_Do = 1. + dataNoTag_Do = 1. + + mcTagLight_Up = 1. + mcNoTagLight_Up = 1. + dataTagLight_Up = 1. + dataNoTagLight_Up = 1. + + mcTagLight_Do = 1. + mcNoTagLight_Do = 1. + dataTagLight_Do = 1. + dataNoTagLight_Do = 1. + + mcTagCFb_Up = 1. + mcNoTagCFb_Up = 1. + dataTagCFb_Up = 1. + dataNoTagCFb_Up = 1. + + mcTagCFb_Do = 1. + mcNoTagCFb_Do = 1. + dataTagCFb_Do = 1. + dataNoTagCFb_Do = 1. + + mcTagCFc_Up = 1. + mcNoTagCFc_Up = 1. + dataTagCFc_Up = 1. + dataNoTagCFc_Up = 1. + + mcTagCFc_Do = 1. + mcNoTagCFc_Do = 1. + dataTagCFc_Do = 1. + dataNoTagCFc_Do = 1. + + mcTagCFl_Up = 1. + mcNoTagCFl_Up = 1. + dataTagCFl_Up = 1. + dataNoTagCFl_Up = 1. + + mcTagCFl_Do = 1. + mcNoTagCFl_Do = 1. + dataTagCFl_Do = 1. + dataNoTagCFl_Do = 1. + + if not getattr(event,"jets",None): event.jets = PhysObjects(event,"jet") + + for jet in event.jets: + + results = self.returnJetInfo(jet,self._jetFlavorsDict,self._measTypeDict,self.bsfDict,self._opPoint,self.sysType,self._bcfPtBins) + + if results != False: + jetFlav,measType,etaptBin,etaptBin_Up,etaptBin_Do,doubleUncertainty,jetPtSF,doubleUncertaintyCF,jetPtCF = results + else: + # Skip jet if this is out of tracker acceptance + continue + + # scale factor + x = jetPtSF + SF = self.evalDict[self._opPoint][measType][self.sysType][jetFlav][etaptBin](x) + SF_Up = self.evalDict[self._opPoint][measType]["up"][jetFlav][etaptBin_Up](x) if jetFlav in self._jetFlavorsHeavy else SF + SF_Do = self.evalDict[self._opPoint][measType]["down"][jetFlav][etaptBin_Do](x) if jetFlav in self._jetFlavorsHeavy else SF + SFLight_Up = self.evalDict[self._opPoint][measType]["up"][jetFlav][etaptBin_Up](x) if jetFlav in self._jetFlavorsLight else SF + SFLight_Do = self.evalDict[self._opPoint][measType]["down"][jetFlav][etaptBin_Do](x) if jetFlav in self._jetFlavorsLight else SF + + CF = evalCF(self.bcfDict[self._opPoint]["fastsim"][self.sysType][jetFlav][self._bcfEtaPhiBin],jetPtCF,self._bcfPtBins) if self.applyCF else 1. + CFb_Up = evalCF(self.bcfDict[self._opPoint]["fastsim"]["up"][jetFlav][self._bcfEtaPhiBin],jetPtCF,self._bcfPtBins) if self.applyCF and jetFlav == "0" else 1. + CFb_Do = evalCF(self.bcfDict[self._opPoint]["fastsim"]["down"][jetFlav][self._bcfEtaPhiBin],jetPtCF,self._bcfPtBins) if self.applyCF and jetFlav == "0" else 1. + CFc_Up = evalCF(self.bcfDict[self._opPoint]["fastsim"]["up"][jetFlav][self._bcfEtaPhiBin],jetPtCF,self._bcfPtBins) if self.applyCF and jetFlav == "1" else 1. + CFc_Do = evalCF(self.bcfDict[self._opPoint]["fastsim"]["down"][jetFlav][self._bcfEtaPhiBin],jetPtCF,self._bcfPtBins) if self.applyCF and jetFlav == "1" else 1. + CFl_Up = evalCF(self.bcfDict[self._opPoint]["fastsim"]["up"][jetFlav][self._bcfEtaPhiBin],jetPtCF,self._bcfPtBins) if self.applyCF and jetFlav == "2" else 1. + CFl_Do = evalCF(self.bcfDict[self._opPoint]["fastsim"]["down"][jetFlav][self._bcfEtaPhiBin],jetPtCF,self._bcfPtBins) if self.applyCF and jetFlav == "2" else 1. + + if doubleUncertainty: + SF_Up = 2*(SF_Up - SF) + SF + SF_Do = 2*(SF_Do - SF) + SF + + SFLight_Up = 2*(SFLight_Up - SF) + SF + SFLight_Do = 2*(SFLight_Do - SF) + SF + + if doubleUncertaintyCF: + CFb_Up = 2*(CFb_Up - CF) + CF + CFb_Do = 2*(CFb_Do - CF) + CF + + CFc_Up = 2*(CFc_Up - CF) + CF + CFc_Do = 2*(CFc_Do - CF) + CF + + CFl_Up = 2*(CFl_Up - CF) + CF + CFl_Do = 2*(CFl_Do - CF) + CF + + + # efficiency + sampleKey = self.effDict.keys()[0] if self.applyCF else "All" + if "DM" in self._sample.name: sampleKey = self._sample.name + eff = self.effDict[sampleKey][self._opPoint][measType][self.sysType][jetFlav][etaptBin] + eff_Up = self.effDict[sampleKey][self._opPoint][measType]["up"][jetFlav][etaptBin_Up] if jetFlav in self._jetFlavorsHeavy else eff + eff_Do = self.effDict[sampleKey][self._opPoint][measType]["down"][jetFlav][etaptBin_Do] if jetFlav in self._jetFlavorsHeavy else eff + effLight_Up = self.effDict[sampleKey][self._opPoint][measType]["up"][jetFlav][etaptBin_Up] if jetFlav in self._jetFlavorsLight else eff + effLight_Do = self.effDict[sampleKey][self._opPoint][measType]["down"][jetFlav][etaptBin_Up] if jetFlav in self._jetFlavorsLight else eff + + effCFb_Up = self.effDict[sampleKey][self._opPoint][measType]["up"][jetFlav][etaptBin_Up] if self.applyCF and jetFlav == "0" else eff + effCFb_Do = self.effDict[sampleKey][self._opPoint][measType]["down"][jetFlav][etaptBin_Up] if self.applyCF and jetFlav == "0" else eff + effCFc_Up = self.effDict[sampleKey][self._opPoint][measType]["up"][jetFlav][etaptBin_Up] if self.applyCF and jetFlav == "1" else eff + effCFc_Do = self.effDict[sampleKey][self._opPoint][measType]["down"][jetFlav][etaptBin_Up] if self.applyCF and jetFlav == "1" else eff + effCFl_Up = self.effDict[sampleKey][self._opPoint][measType]["up"][jetFlav][etaptBin_Up] if self.applyCF and jetFlav == "2" else eff + effCFl_Do = self.effDict[sampleKey][self._opPoint][measType]["down"][jetFlav][etaptBin_Up] if self.applyCF and jetFlav == "2" else eff + + # tagged + if getattr(jet,"btag"+self._tagger) > self._btagDiscWP: + + mcTag *= eff + dataTag *= eff * SF * CF + + mcTag_Up *= eff_Up + dataTag_Up *= eff_Up * SF_Up * CF + + mcTag_Do *= eff_Do + dataTag_Do *= eff_Do * SF_Do * CF + + mcTagLight_Up *= effLight_Up + dataTagLight_Up *= effLight_Up * SFLight_Up * CF + + mcTagLight_Do *= effLight_Do + dataTagLight_Do *= effLight_Do * SFLight_Do * CF + + mcTagCFb_Up *= effCFb_Up + dataTagCFb_Up *= effCFb_Up * SF * CFb_Up + + mcTagCFb_Do *= effCFb_Do + dataTagCFb_Do *= effCFb_Do * SF * CFb_Do + + mcTagCFc_Up *= effCFc_Up + dataTagCFc_Up *= effCFc_Up * SF * CFc_Up + + mcTagCFc_Do *= effCFc_Do + dataTagCFc_Do *= effCFc_Do * SF * CFc_Do + + mcTagCFl_Up *= effCFl_Up + dataTagCFl_Up *= effCFl_Up * SF * CFl_Up + + mcTagCFl_Do *= effCFl_Do + dataTagCFl_Do *= effCFl_Do * SF * CFl_Do + + # not tagged + else: + + mcNoTag *= (1 - eff) + dataNoTag *= (1 - eff * SF * CF) + + mcNoTag_Up *= (1 - eff_Up) + dataNoTag_Up *= (1 - eff_Up * SF_Up * CF) + + mcNoTag_Do *= (1 - eff_Do) + dataNoTag_Do *= (1 - eff_Do * SF_Do * CF) + + mcNoTagLight_Up *= (1 - effLight_Up) + dataNoTagLight_Up *= (1 - effLight_Up * SFLight_Up * CF) + + mcNoTagLight_Do *= (1 - effLight_Do) + dataNoTagLight_Do *= (1 - effLight_Do * SFLight_Do * CF) + + mcNoTagCFb_Up *= (1 - effCFb_Up) + dataNoTagCFb_Up *= (1 - effCFb_Up * SF * CFb_Up) + + mcNoTagCFb_Do *= (1 - effCFb_Do) + dataNoTagCFb_Do *= (1 - effCFb_Do * SF * CFb_Do) + + mcNoTagCFc_Up *= (1 - effCFc_Up) + dataNoTagCFc_Up *= (1 - effCFc_Up * SF * CFc_Up) + + mcNoTagCFc_Do *= (1 - effCFc_Do) + dataNoTagCFc_Do *= (1 - effCFc_Do * SF * CFc_Do) + + mcNoTagCFl_Up *= (1 - effCFl_Up) + dataNoTagCFl_Up *= (1 - effCFl_Up * SF * CFl_Up) + + mcNoTagCFl_Do *= (1 - effCFl_Do) + dataNoTagCFl_Do *= (1 - effCFl_Do * SF * CFl_Do) + + + event.bsfWeight = self.safe_div(dataTag * dataNoTag, mcTag * mcNoTag) + + event.bsfWeight_Up = self.safe_div(dataTag_Up * dataNoTag_Up, mcTag_Up * mcNoTag_Up, event.bsfWeight) + event.bsfWeight_Down = self.safe_div(dataTag_Do * dataNoTag_Do, mcTag_Do * mcNoTag_Do, event.bsfWeight) + + event.bsfLightWeight_Up = self.safe_div(dataTagLight_Up * dataNoTagLight_Up, mcTagLight_Up * mcNoTagLight_Up, event.bsfWeight) + event.bsfLightWeight_Down = self.safe_div(dataTagLight_Do * dataNoTagLight_Do, mcTagLight_Do * mcNoTagLight_Do, event.bsfWeight) + + event.bsfCFbWeight_Up = self.safe_div(dataTagCFb_Up * dataNoTagCFb_Up, mcTagCFb_Up * mcNoTagCFb_Up, event.bsfWeight) + event.bsfCFbWeight_Down = self.safe_div(dataTagCFb_Do * dataNoTagCFb_Do, mcTagCFb_Do * mcNoTagCFb_Do, event.bsfWeight) + + event.bsfCFcWeight_Up = self.safe_div(dataTagCFc_Up * dataNoTagCFc_Up, mcTagCFc_Up * mcNoTagCFc_Up, event.bsfWeight) + event.bsfCFcWeight_Down = self.safe_div(dataTagCFc_Do * dataNoTagCFc_Do, mcTagCFc_Do * mcNoTagCFc_Do, event.bsfWeight) + + event.bsfCFlWeight_Up = self.safe_div(dataTagCFl_Up * dataNoTagCFl_Up, mcTagCFl_Up * mcNoTagCFl_Up, event.bsfWeight) + event.bsfCFlWeight_Down = self.safe_div(dataTagCFl_Do * dataNoTagCFl_Do, mcTagCFl_Do * mcNoTagCFl_Do, event.bsfWeight) + + event.bsfWeight_Up /= event.bsfWeight + event.bsfWeight_Down /= event.bsfWeight + + event.bsfLightWeight_Up /= event.bsfWeight + event.bsfLightWeight_Down /= event.bsfWeight + + event.bsfCFbWeight_Up /= event.bsfWeight + event.bsfCFbWeight_Down /= event.bsfWeight + + event.bsfCFcWeight_Up /= event.bsfWeight + event.bsfCFcWeight_Down /= event.bsfWeight + + event.bsfCFlWeight_Up /= event.bsfWeight + event.bsfCFlWeight_Down /= event.bsfWeight + + if self._forceSFToUnity: event.bsfWeight = 1. + event.weight *= event.bsfWeight + + return True + + + +def splittingType(mSUS,mLSP): + + if mSUS - mLSP < 401: + return "compressed" + else: + return "uncompressed" + + +def evalCF(formula,x,ptBins): + + # FIXME: This is a horrible hack + CFs = map( float, re.findall("\d+\.\d+", formula) ) + + for i in range(len(ptBins)-1): + if ptBins[i] <= x < ptBins[i+1]: + return CFs[i-1] + + else: + sys.exit("Jet pT out of bounds") + diff --git a/RPV/btageff_cfg.py b/RPV/btageff_cfg.py new file mode 100644 index 0000000..255f1da --- /dev/null +++ b/RPV/btageff_cfg.py @@ -0,0 +1,96 @@ +# UF Framework specifics +from Core.Sequence import Sequence +from Core.OutputInfo import OutputInfo +from Core.EndSequence import EndSequence + +from NanoAOD.Weighter.XSWeighter import XSWeighter +from NanoAOD.Weighter.PUWeighter import PUWeighter +from NanoAOD.Skimmer.JSONSkimmer import JSONSkimmer +from NanoAOD.Skimmer.METFilter import METFilter + +from RPV.Producer.PhysObjProducer import PhysObjProducer,JetProducer +from RPV.Producer.AnalysisProducer import AnalysisProducer + +from RPV.Skimmer.TTbarSkimmer import TTbarSkimmer +#from RPV.Skimmer.ZMuMuSkimmer import ZMuMuSkimmer +from RPV.Skimmer.HLTSkimmer import HLTSkimmer +from RPV.Weighter.Triggereff import Triggereff +from RPV.Weighter.Btageff import Btageff +#from RPV.Weighter.BtagscaleFactor import BtagscaleFactor + +from Plotter.Plotter import Plotter +from Plotter.PlotEndModule import PlotEndModule +from RPV.Module.Btageff_ratio import Btageff_ratio +from Plotter.Plot import Plot + +#from Core.Utils.LambdaFunc import LambdaFunc + +import os + +useSkimTree = True +if useSkimTree: + from RPV.SkimTree.NanoAOD.Run2016.TTbarBtageff_MC import allMCSamples + #from RPV.SkimTree.NanoAOD.Run2016.ZToMuMu_Data import allDataSamples +else: + from DataMC.NanoAOD.Run2016 import * + +#out_path = "StopToBLep/DataMCDistributions/DataMC_ZToMuMuSelection_v1/2018-06-19/" + +nCores = 1 +#outputDir = "/raid/raid7/lucien/SUSY/RPV/"+out_path +outputDir = "./BTag_ZMuMu/" +nEvents = -1 +disableProgressBar = False +justEndSequence = False +haddSamples = True +componentList = allMCSamples +#componentList = allDataSamples + allMCSamples +for dataset in componentList: + if dataset.isMC: + dataset.lumi = 35.9 + for component in dataset.componentList: + component.maxEvents = nEvents + +plots = [] + +puWeighter = PUWeighter("PUWeighter",os.environ["BASE_PATH"]+"/DataMC/Pileup/puWeightsRun2016_NTrueInt_FullDataset--Cert_271036-284044_13TeV_23Sep2016ReReco_Collisions16_JSON.txt",doNTrueInt=True,applySystVariation=True) +xsWeighter = XSWeighter("XSWeighter") +mediumMuonProducer = PhysObjProducer("MediumMuonProducer","Muon","MediumMuons","Moriond17MediumMuon") +mediumElectronProducer = PhysObjProducer("MediumElectronProducer","Electron","MediumElectrons","Moriond17MediumElectron") +jetProducer = JetProducer("JetProducer","Jet",["MediumMuons","MediumElectrons"],"LooseJets","Moriond17LooseJet",0.4) +plotter = Plotter("Plotter",plots) +anaProducer = AnalysisProducer("AnaProducer") +eventSkimmer = TTbarSkimmer("TTbarSkim") +#eventSkimmer = ZMuMuSkimmer("ZMuMuSkim") +hltSkimmer = HLTSkimmer("HLTSkim",cutflow="htCR") +jsonSkimmer = JSONSkimmer("JSONSkim") +metSkimmer = METFilter("METSkim") +triggereff = Triggereff("Triggereff") +btageff = Btageff("Btageff") +#btagscalefactor = BtagscaleFactor("BtagscaleFactor") + + +sequence = Sequence() +sequence.add(metSkimmer) +sequence.add(jsonSkimmer) +sequence.add(hltSkimmer) +sequence.add(mediumMuonProducer) +sequence.add(mediumElectronProducer) +sequence.add(jetProducer) +sequence.add(xsWeighter) +sequence.add(puWeighter) +sequence.add(anaProducer) +sequence.add(eventSkimmer) +sequence.add(triggereff) +sequence.add(btageff) +#sequence.add(btagscalefactor) +sequence.add(plotter) + +endSequence = EndSequence(skipHadd=justEndSequence,haddAllSamples=haddSamples) +endModuleOutputDir = "/home/kshi/public_html/test/" +endSequence.add(PlotEndModule(endModuleOutputDir,plots)) +endSequence.add(Btageff_ratio(endModuleOutputDir)) + +outputInfo = OutputInfo("OutputInfo") +outputInfo.outputDir = outputDir +outputInfo.TFileName = "DataMCDistribution.root" diff --git a/RPV/plot_TTbar_cfg.py b/RPV/plot_TTbar_cfg.py index 569efff..260d21a 100644 --- a/RPV/plot_TTbar_cfg.py +++ b/RPV/plot_TTbar_cfg.py @@ -14,6 +14,8 @@ from RPV.Skimmer.TTbarSkimmer import TTbarSkimmer from RPV.Skimmer.HLTSkimmer import HLTSkimmer from RPV.Weighter.Triggereff import Triggereff +from RPV.Weighter.Btageff import Btageff +from RPV.Weighter.BtagscaleFactor import BtagscaleFactor from Plotter.Plotter import Plotter from Plotter.PlotEndModule import PlotEndModule @@ -63,7 +65,7 @@ Plot("muonPt1", ["TH1D","muonPt1","",20,0., 500.], LambdaFunc('x: x.muons[0].pt if len(x.muons) > 0 else None')), Plot("muonPt2", ["TH1D","muonPt2","",20,0., 500.], LambdaFunc('x: x.muons[1].pt if len(x.muons) > 1 else None')), Plot("nGoodPV", ["TH1D","nGoodPV","",30,0.0,60.0], LambdaFunc('x: x.PV_npvsGood[0]')), - #Plot("m0_bl", ["TH1D","m0_bl1","",16,0., 800.], LambdaFunc('x: x.m0_bl[0]')), + #Plot("m0_bl", ["TH1D","m0_bl1","",16,0., 800.], LambdaFunc('x: x.m0_bl[0]')), #Plot("m1_bl", ["TH1D","m1_bl1","",16,0., 800.], LambdaFunc('x: x.m1_bl[0]')), #Plot("m_asym_bl", ["TH1D","m_asym_bl","",20,0., 1.], LambdaFunc('x: x.m_asym_bl[0]')), #Plot("m_ct", ["TH1D","m_ct","",16,0., 800.], LambdaFunc('x: x.m_ct[0]')), @@ -80,6 +82,9 @@ jsonSkimmer = JSONSkimmer("JSONSkim") metSkimmer = METFilter("METSkim") triggereff = Triggereff("Triggereff") +btageff = Btageff("Btageff") +btagscalefactor = BtagscaleFactor("BtagscaleFactor") + sequence = Sequence() sequence.add(metSkimmer) @@ -93,10 +98,12 @@ sequence.add(anaProducer) sequence.add(eventSkimmer) sequence.add(triggereff) +sequence.add(btageff) +sequence.add(btagscalefactor) sequence.add(plotter) endSequence = EndSequence(skipHadd=justEndSequence) -endModuleOutputDir = "/home/kshi/public_html/dataPlot/TTbar/NLO_DYJets/" +endModuleOutputDir = "/home/kshi/public_html/dataPlot/TTbar/NLO_DYJets/Btageff_ratio/" endSequence.add(PlotEndModule(endModuleOutputDir,plots)) outputInfo = OutputInfo("OutputInfo") diff --git a/RPV/skimTree_TTbar_mc_cfg.py b/RPV/skimTree_TTbar_mc_cfg.py index 73935f6..da89ca7 100644 --- a/RPV/skimTree_TTbar_mc_cfg.py +++ b/RPV/skimTree_TTbar_mc_cfg.py @@ -10,9 +10,9 @@ from RPV.Producer.AnalysisProducer import AnalysisProducer from RPV.Skimmer.TTbarSkimmer import TTbarSkimmer -nCores = 8 +nCores = 1 #outputDir = "/raid/raid7/lucien/SUSY/RPV/SkimTree/ZMuMu/2018-06-19/BkgMC_ZMuMuSelection_v1/" -outputDir = "/raid/raid7/kshi/SUSY/RPV/SkimTree/mc/TTbar/" +outputDir = "/raid/raid7/kshi/SUSY/RPV/SkimTree/mc/TTbar_Btageff/" nEvents = -1 disableProgressBar = False justEndSequence = False diff --git a/RPV/skimTree_ZToMuMu_mc_cfg.py b/RPV/skimTree_ZToMuMu_mc_cfg.py index 8486bed..c223493 100644 --- a/RPV/skimTree_ZToMuMu_mc_cfg.py +++ b/RPV/skimTree_ZToMuMu_mc_cfg.py @@ -10,7 +10,7 @@ from RPV.Producer.AnalysisProducer import AnalysisProducer from RPV.Skimmer.ZMuMuSkimmer import ZMuMuSkimmer -nCores = 4 +nCores = 8 #outputDir = "/raid/raid7/lucien/SUSY/RPV/SkimTree/ZMuMu/2018-06-19/BkgMC_ZMuMuSelection_v1/" outputDir = "/raid/raid7/kshi/SUSY/RPV/SkimTree/mc/ZToMuMu/" nEvents = -1