From a4f2258683d90e4623e39f0408d8cf0737ed452b Mon Sep 17 00:00:00 2001 From: Matthias Komm Date: Thu, 15 Jun 2023 11:47:06 +0200 Subject: [PATCH] up --- config/procs.txt | 120 ++++++++++++++++++++++++++++++++- histo/sample.py | 2 + limits/exec_histo.sh | 2 +- limits/make_hist_sub_condor.py | 10 +-- limits/make_hists.py | 16 ++--- limits/merge_hists.sh | 4 +- 6 files changed, 137 insertions(+), 17 deletions(-) diff --git a/config/procs.txt b/config/procs.txt index 9624176..accd656 100644 --- a/config/procs.txt +++ b/config/procs.txt @@ -172,4 +172,122 @@ HNL_dirac_pt20_ctau1p0e02_massHNL4p5_Vall1p438e-03 HNL_dirac_pt20_ctau1p0e02_massHNL6p0_Vall6p496e-04 HNL_dirac_pt20_ctau1p0e-03_massHNL16p0_Vall1p551e-02 HNL_dirac_pt20_ctau1p0e03_massHNL2p0_Vall4p066e-03 -HNL_dirac_pt20_ctau1p0e03_massHNL3p0_Vall1p388e-03 \ No newline at end of file +HNL_dirac_pt20_ctau1p0e03_massHNL3p0_Vall1p388e-03 +HNL_majorana_ntau_ctau1p0e-01_massHNL10p0_Vall3p721e-03 +HNL_majorana_ntau_ctau1p0e-01_massHNL12p0_Vall2p314e-03 +HNL_majorana_ntau_ctau1p0e-01_massHNL14p0_Vall1p551e-03 +HNL_majorana_ntau_ctau1p0e-01_massHNL16p0_Vall1p097e-03 +HNL_majorana_ntau_ctau1p0e-01_massHNL18p0_Vall8p092e-04 +HNL_majorana_ntau_ctau1p0e-01_massHNL20p0_Vall6p165e-04 +HNL_majorana_ntau_ctau1p0e-01_massHNL8p0_Vall6p702e-03 +HNL_majorana_ntau_ctau1p0e-02_massHNL10p0_Vall1p177e-02 +HNL_majorana_ntau_ctau1p0e-02_massHNL12p0_Vall7p319e-03 +HNL_majorana_ntau_ctau1p0e-02_massHNL14p0_Vall4p904e-03 +HNL_majorana_ntau_ctau1p0e-02_massHNL16p0_Vall3p470e-03 +HNL_majorana_ntau_ctau1p0e-02_massHNL18p0_Vall2p559e-03 +HNL_majorana_ntau_ctau1p0e-02_massHNL20p0_Vall1p950e-03 +HNL_majorana_ntau_ctau1p0e-03_massHNL12p0_Vall2p314e-02 +HNL_majorana_ntau_ctau1p0e-03_massHNL14p0_Vall1p551e-02 +HNL_majorana_ntau_ctau1p0e-03_massHNL16p0_Vall1p097e-02 +HNL_majorana_ntau_ctau1p0e-03_massHNL18p0_Vall8p092e-03 +HNL_majorana_ntau_ctau1p0e-03_massHNL20p0_Vall6p165e-03 +HNL_majorana_ntau_ctau1p0e-04_massHNL14p0_Vall4p904e-02 +HNL_majorana_ntau_ctau1p0e-04_massHNL16p0_Vall3p470e-02 +HNL_majorana_ntau_ctau1p0e-04_massHNL18p0_Vall2p559e-02 +HNL_majorana_ntau_ctau1p0e-04_massHNL20p0_Vall1p950e-02 +HNL_majorana_ntau_ctau1p0e00_massHNL10p0_Vall1p177e-03 +HNL_majorana_ntau_ctau1p0e00_massHNL12p0_Vall7p319e-04 +HNL_majorana_ntau_ctau1p0e00_massHNL14p0_Vall4p904e-04 +HNL_majorana_ntau_ctau1p0e00_massHNL16p0_Vall3p470e-04 +HNL_majorana_ntau_ctau1p0e00_massHNL18p0_Vall2p559e-04 +HNL_majorana_ntau_ctau1p0e00_massHNL4p5_Vall1p016e-02 +HNL_majorana_ntau_ctau1p0e00_massHNL6p0_Vall4p597e-03 +HNL_majorana_ntau_ctau1p0e00_massHNL8p0_Vall2p119e-03 +HNL_majorana_ntau_ctau1p0e01_massHNL10p0_Vall3p721e-04 +HNL_majorana_ntau_ctau1p0e01_massHNL12p0_Vall2p314e-04 +HNL_majorana_ntau_ctau1p0e01_massHNL14p0_Vall1p551e-04 +HNL_majorana_ntau_ctau1p0e01_massHNL16p0_Vall1p097e-04 +HNL_majorana_ntau_ctau1p0e01_massHNL18p0_Vall8p092e-05 +HNL_majorana_ntau_ctau1p0e01_massHNL1p0_Vall1p668e-01 +HNL_majorana_ntau_ctau1p0e01_massHNL1p5_Vall5p965e-02 +HNL_majorana_ntau_ctau1p0e01_massHNL2p0_Vall2p871e-02 +HNL_majorana_ntau_ctau1p0e01_massHNL3p0_Vall9p825e-03 +HNL_majorana_ntau_ctau1p0e01_massHNL4p5_Vall3p213e-03 +HNL_majorana_ntau_ctau1p0e01_massHNL6p0_Vall1p454e-03 +HNL_majorana_ntau_ctau1p0e01_massHNL8p0_Vall6p702e-04 +HNL_majorana_ntau_ctau1p0e02_massHNL10p0_Vall1p177e-04 +HNL_majorana_ntau_ctau1p0e02_massHNL1p0_Vall5p274e-02 +HNL_majorana_ntau_ctau1p0e02_massHNL1p5_Vall1p886e-02 +HNL_majorana_ntau_ctau1p0e02_massHNL2p0_Vall9p078e-03 +HNL_majorana_ntau_ctau1p0e02_massHNL3p0_Vall3p107e-03 +HNL_majorana_ntau_ctau1p0e02_massHNL4p5_Vall1p016e-03 +HNL_majorana_ntau_ctau1p0e02_massHNL6p0_Vall4p597e-04 +HNL_majorana_ntau_ctau1p0e02_massHNL8p0_Vall2p119e-04 +HNL_majorana_ntau_ctau1p0e03_massHNL1p0_Vall1p668e-02 +HNL_majorana_ntau_ctau1p0e03_massHNL1p5_Vall5p965e-03 +HNL_majorana_ntau_ctau1p0e03_massHNL2p0_Vall2p871e-03 +HNL_majorana_ntau_ctau1p0e03_massHNL3p0_Vall9p825e-04 +HNL_majorana_ntau_ctau1p0e03_massHNL4p5_Vall3p213e-04 +HNL_majorana_ntau_ctau1p0e03_massHNL6p0_Vall1p454e-04 +HNL_majorana_ntau_ctau1p0e04_massHNL1p0_Vall5p274e-03 +HNL_majorana_ntau_ctau1p0e04_massHNL1p5_Vall1p886e-03 +HNL_majorana_ntau_ctau1p0e04_massHNL2p0_Vall9p078e-04 +HNL_dirac_ntau_ctau1p0e-01_massHNL10p0_Vall5p262e-03 +HNL_dirac_ntau_ctau1p0e-01_massHNL12p0_Vall3p272e-03 +HNL_dirac_ntau_ctau1p0e-01_massHNL14p0_Vall2p193e-03 +HNL_dirac_ntau_ctau1p0e-01_massHNL16p0_Vall1p551e-03 +HNL_dirac_ntau_ctau1p0e-01_massHNL18p0_Vall1p144e-03 +HNL_dirac_ntau_ctau1p0e-01_massHNL20p0_Vall8p709e-04 +HNL_dirac_ntau_ctau1p0e-01_massHNL8p0_Vall9p475e-03 +HNL_dirac_ntau_ctau1p0e-02_massHNL10p0_Vall1p664e-02 +HNL_dirac_ntau_ctau1p0e-02_massHNL12p0_Vall1p035e-02 +HNL_dirac_ntau_ctau1p0e-02_massHNL14p0_Vall6p933e-03 +HNL_dirac_ntau_ctau1p0e-02_massHNL16p0_Vall4p905e-03 +HNL_dirac_ntau_ctau1p0e-02_massHNL18p0_Vall3p617e-03 +HNL_dirac_ntau_ctau1p0e-02_massHNL20p0_Vall2p754e-03 +HNL_dirac_ntau_ctau1p0e-03_massHNL12p0_Vall3p272e-02 +HNL_dirac_ntau_ctau1p0e-03_massHNL14p0_Vall2p193e-02 +HNL_dirac_ntau_ctau1p0e-03_massHNL16p0_Vall1p551e-02 +HNL_dirac_ntau_ctau1p0e-03_massHNL18p0_Vall1p144e-02 +HNL_dirac_ntau_ctau1p0e-03_massHNL20p0_Vall8p709e-03 +HNL_dirac_ntau_ctau1p0e-04_massHNL14p0_Vall6p933e-02 +HNL_dirac_ntau_ctau1p0e-04_massHNL16p0_Vall4p905e-02 +HNL_dirac_ntau_ctau1p0e-04_massHNL18p0_Vall3p617e-02 +HNL_dirac_ntau_ctau1p0e-04_massHNL20p0_Vall2p754e-02 +HNL_dirac_ntau_ctau1p0e00_massHNL10p0_Vall1p664e-03 +HNL_dirac_ntau_ctau1p0e00_massHNL12p0_Vall1p035e-03 +HNL_dirac_ntau_ctau1p0e00_massHNL14p0_Vall6p933e-04 +HNL_dirac_ntau_ctau1p0e00_massHNL16p0_Vall4p905e-04 +HNL_dirac_ntau_ctau1p0e00_massHNL18p0_Vall3p617e-04 +HNL_dirac_ntau_ctau1p0e00_massHNL4p5_Vall1p438e-02 +HNL_dirac_ntau_ctau1p0e00_massHNL6p0_Vall6p496e-03 +HNL_dirac_ntau_ctau1p0e00_massHNL8p0_Vall2p996e-03 +HNL_dirac_ntau_ctau1p0e01_massHNL10p0_Vall5p262e-04 +HNL_dirac_ntau_ctau1p0e01_massHNL12p0_Vall3p272e-04 +HNL_dirac_ntau_ctau1p0e01_massHNL14p0_Vall2p193e-04 +HNL_dirac_ntau_ctau1p0e01_massHNL16p0_Vall1p551e-04 +HNL_dirac_ntau_ctau1p0e01_massHNL18p0_Vall1p144e-04 +HNL_dirac_ntau_ctau1p0e01_massHNL1p0_Vall2p359e-01 +HNL_dirac_ntau_ctau1p0e01_massHNL1p5_Vall8p442e-02 +HNL_dirac_ntau_ctau1p0e01_massHNL2p0_Vall4p066e-02 +HNL_dirac_ntau_ctau1p0e01_massHNL3p0_Vall1p388e-02 +HNL_dirac_ntau_ctau1p0e01_massHNL4p5_Vall4p549e-03 +HNL_dirac_ntau_ctau1p0e01_massHNL6p0_Vall2p054e-03 +HNL_dirac_ntau_ctau1p0e01_massHNL8p0_Vall9p475e-04 +HNL_dirac_ntau_ctau1p0e02_massHNL10p0_Vall1p664e-04 +HNL_dirac_ntau_ctau1p0e02_massHNL1p0_Vall7p460e-02 +HNL_dirac_ntau_ctau1p0e02_massHNL1p5_Vall2p670e-02 +HNL_dirac_ntau_ctau1p0e02_massHNL2p0_Vall1p286e-02 +HNL_dirac_ntau_ctau1p0e02_massHNL3p0_Vall4p390e-03 +HNL_dirac_ntau_ctau1p0e02_massHNL4p5_Vall1p438e-03 +HNL_dirac_ntau_ctau1p0e02_massHNL6p0_Vall6p496e-04 +HNL_dirac_ntau_ctau1p0e02_massHNL8p0_Vall2p996e-04 +HNL_dirac_ntau_ctau1p0e03_massHNL1p0_Vall2p359e-02 +HNL_dirac_ntau_ctau1p0e03_massHNL1p5_Vall8p442e-03 +HNL_dirac_ntau_ctau1p0e03_massHNL2p0_Vall4p066e-03 +HNL_dirac_ntau_ctau1p0e03_massHNL3p0_Vall1p388e-03 +HNL_dirac_ntau_ctau1p0e03_massHNL4p5_Vall4p549e-04 +HNL_dirac_ntau_ctau1p0e03_massHNL6p0_Vall2p054e-04 +HNL_dirac_ntau_ctau1p0e04_massHNL1p0_Vall7p460e-03 +HNL_dirac_ntau_ctau1p0e04_massHNL1p5_Vall2p670e-03 +HNL_dirac_ntau_ctau1p0e04_massHNL2p0_Vall1p286e-03 diff --git a/histo/sample.py b/histo/sample.py index f9ed0c8..882e30c 100644 --- a/histo/sample.py +++ b/histo/sample.py @@ -42,6 +42,8 @@ def __init__(self, name, ntuple_path, paths, isMC=True, year="2016", cut=None, l self.yieldsHNL.update(json.load(json_file)) with open("/nfs/dust/cms/user/mkomm/HNL/LLP/filterTable.json") as json_file: gen_filter = json.load(json_file) + with open("/nfs/dust/cms/user/mkomm/HNL/LLP/filterLPairTable.json") as json_file: + gen_filter.update(json.load(json_file)) with open("/nfs/dust/cms/user/mkomm/HNL/LLP/gridpackLookupTable.json") as lookup_table_file: lookup_table = json.load(lookup_table_file) diff --git a/limits/exec_histo.sh b/limits/exec_histo.sh index 89a5264..3a08355 100755 --- a/limits/exec_histo.sh +++ b/limits/exec_histo.sh @@ -6,6 +6,6 @@ export PATH=/nfs/dust/cms/user/mkomm/HNL/histo/env/bin:$PATH source activate hnl which python which conda -python -u make_hists.py "$@" +python -u make_hists.py "$@" || return 1 date diff --git a/limits/make_hist_sub_condor.py b/limits/make_hist_sub_condor.py index e746056..7316fe8 100644 --- a/limits/make_hist_sub_condor.py +++ b/limits/make_hist_sub_condor.py @@ -19,17 +19,17 @@ procsbkg = [] procsHNL = [] procsData = [] -years = ["2016", "2017", "2018"] +years = ["2016"]#, "2017", "2018"] import yaml with open("../config/samples.yml") as samples_file: samples_dict = yaml.load(samples_file, Loader=yaml.FullLoader) for l in samples_dict: - if "HNL" in l: + if ("HNL" in l) and ("ntau" in l): procsHNL.append(l) - elif l == "muon" or l == "electron": - procsData.append(l) + #elif l == "muon" or l == "electron": + # procsData.append(l) else: continue procsbkg.append(l) @@ -45,7 +45,7 @@ Request_CPUs = 1 Request_Memory = 2.5GB -+RequestRuntime = 9000 ++RequestRuntime = 10440 Should_Transfer_Files = NO Requirements = ( OpSysAndVer == "CentOS7" ) diff --git a/limits/make_hists.py b/limits/make_hists.py index 889d52d..6185c30 100644 --- a/limits/make_hists.py +++ b/limits/make_hists.py @@ -258,12 +258,12 @@ def make_hist(process, category_variable, thresholds, weight, cut, region, syst #parser.add_argument("--output_path", default="/nfs/dust/cms/user/mkomm/HNL/histo/limits/hists_19Jan23") #parser.add_argument("--ntuple_path", default="/vols/cms/hsfar/nanoAOD_friends/21Sep20") #parser.add_argument("--output_path", default="/vols/cms/hsfar/hists") -#parser.add_argument("--ntuple_path", default="/nfs/dust/cms/user/mkomm/HNL/ntuples/24May20") -#parser.add_argument("--output_path", default="/nfs/dust/cms/user/mkomm/HNL/histo/limits/hists") +parser.add_argument("--ntuple_path", default="/nfs/dust/cms/user/mkomm/HNL/ntuples/09Mar23") +parser.add_argument("--output_path", default="/nfs/dust/cms/user/mkomm/HNL/histo/limits/hists_09Mar23") #parser.add_argument("--ntuple_path", default="/vols/cms/hsfar/nanoAOD_friends/19Jan23") -parser.add_argument("--ntuple_path", default="/vols/cms/hsfar/nanoAOD_friends/09Mar23") -parser.add_argument("--output_path", default="/vols/cms/mkomm/HNL/histo/limits/hists") +#parser.add_argument("--ntuple_path", default="/vols/cms/hsfar/nanoAOD_friends/09Mar23") +#parser.add_argument("--output_path", default="/vols/cms/mkomm/HNL/histo/limits/hists_09Mar23") parser.add_argument("--data", action="store_true", default=False) parser.add_argument("--test", action="store_true", dest="oneFile", default=False) @@ -353,8 +353,8 @@ def make_hist(process, category_variable, thresholds, weight, cut, region, syst systematics_rates["lepton2_track"] = "resolvedLepton_track_reco" systematics_shapes = ["nominal", "jesTotal", "jer", "unclEn"] -systematics_rates = {} -systematics_shapes = ["nominal"] +#systematics_rates = {} +#systematics_shapes = ["nominal"] #################################### if len(args.couplings)==0: # couplings to consider @@ -521,7 +521,7 @@ def make_hist(process, category_variable, thresholds, weight, cut, region, syst root_file.cd() root_file.mkdir(category_name+"_"+region) root_file.cd(category_name+"_"+region) -''' + if "HNL" in proc: for coupling in couplings: histNominal = list(filter(lambda x: x['name']=="HNL_coupling_"+str(coupling), histsList))[0]['hist'] @@ -546,7 +546,7 @@ def make_hist(process, category_variable, thresholds, weight, cut, region, syst d = c histUp.SetBinContent(ibin+1,u) histDown.SetBinContent(ibin+1,d) -''' + for histDict in histsList: #histDict['hist'].SetDirectory(root_file) write_hist(histDict['hist'], category_dict, histDict['name'], isMC=histDict['isMC']) diff --git a/limits/merge_hists.sh b/limits/merge_hists.sh index 76152aa..be3fad0 100755 --- a/limits/merge_hists.sh +++ b/limits/merge_hists.sh @@ -1,7 +1,7 @@ n_lines=$(wc -l < ../config/procs.txt) -years=(2016 2017 2018) +years=(2016) #years=($1) -histPath="hists_19Jan23" +histPath="hists_09Mar23" echo "number of lines" $n_lines mkdir -p hists_merged