diff --git a/scripts/dump_processed.py b/scripts/dump_processed.py index 5e958be7..b4c7979d 100644 --- a/scripts/dump_processed.py +++ b/scripts/dump_processed.py @@ -31,7 +31,9 @@ def dump_lumi(output, fname): json.dump(dicts, outfile, indent=2) lumi_in_pb = os.popen( - f"export PATH=$HOME/.local/bin:/cvmfs/cms-bril.cern.ch/brilconda3/bin:$PATH; brilcalc lumi -c web -i {fname}_lumi.json -u /pb " + # Using recommended temporary Run 3 normtag + # https://twiki.cern.ch/twiki/bin/viewauth/CMS/BrilcalcQuickStart + f"source /cvmfs/cms-bril.cern.ch/cms-lumi-pog/brilws-docker/brilws-env; eval \'brilcalc lumi --normtag /cvmfs/cms-bril.cern.ch/cms-lumi-pog/Normtags/normtag_PHYSICS.json -c web -i {fname}_lumi.json -u /pb \'" ).read() lumi_in_pb = lumi_in_pb[ lumi_in_pb.find("#Summary:") : lumi_in_pb.find("#Check JSON:") diff --git a/scripts/fetch.py b/scripts/fetch.py index d627fbf0..33c0bfa4 100644 --- a/scripts/fetch.py +++ b/scripts/fetch.py @@ -371,7 +371,7 @@ def validate(file): return fin["Events"].num_entries except: print("retries", n_tries, file) - n_tries += n_tries + n_tries += 1 if not_able_open: return f"FailedRetries: {file}" diff --git a/src/BTVNanoCommissioning/utils/histogrammer.py b/src/BTVNanoCommissioning/utils/histogrammer.py index 71db820b..a0cbd0ac 100644 --- a/src/BTVNanoCommissioning/utils/histogrammer.py +++ b/src/BTVNanoCommissioning/utils/histogrammer.py @@ -707,7 +707,15 @@ def histo_writter(pruned_ev, output, weights, systematics, isSyst, SF_map): # define Jet flavor # Reduce the jet to the correct dimension in the plot - nj = 4 if "jet4" in output.keys() else 2 if "jet2" in output.keys() else 1 + found4jets = False + found2jets = False + for key in output.keys(): + if "jet3" in key: # Because 0-indexing + found4jets = True + break + if "jet1" in key: # Because 0-indexing + found2jets = True + nj = 4 if found4jets else 2 if found2jets else 1 pruned_ev.SelJet = pruned_ev.SelJet if nj == 1 else pruned_ev.SelJet[:, :nj] if "var" in str(ak.type(pruned_ev.SelJet.pt)) and nj == 1: pruned_ev.SelJet = pruned_ev.SelJet[:, 0]