diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 00000000..9846a80c --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,29 @@ + +# This file is a template, and might need editing before it works on your project. +# This is a sample GitLab CI/CD configuration file that should run without any modifications. +# It demonstrates a basic 3 stage CI/CD pipeline. Instead of real tests or scripts, +# it uses echo commands to simulate the pipeline execution. +# +# A pipeline is composed of independent jobs that run scripts, grouped into stages. +# Stages run in sequential order, but jobs within stages run in parallel. +# +# For more information, see: https://docs.gitlab.com/ee/ci/yaml/index.html#stages +# +# You can copy and paste this template into a new `.gitlab-ci.yml` file. +# You should not add this template to an existing `.gitlab-ci.yml` file by using the `include:` keyword. +# +# To contribute improvements to CI/CD templates, please follow the Development guide at: +# https://docs.gitlab.com/ee/development/cicd/templates.html +# This specific template is located at: +# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Getting-Started.gitlab-ci.yml + +stages: # List of stages for jobs, and their order of execution + - deploy + +deploy-job: # This job runs in the deploy stage. + stage: deploy # It only runs when *both* jobs in the test stage complete successfully. + script: + - 'curl --fail --request POST --form token=$MY_TRIGGER_TOKEN --form ref=master "https://gitlab.cern.ch/cms-analysis/btv/software-and-algorithms/autobtv/trigger/pipeline"' + rules: + - if: $CI_COMMIT_TAG + environment: production \ No newline at end of file diff --git a/scripts/fetch.py b/scripts/fetch.py index 44a1bfb2..bb217123 100644 --- a/scripts/fetch.py +++ b/scripts/fetch.py @@ -61,7 +61,7 @@ parser.add_argument( "--whitelist_sites", help="White list fot sites", - default="T2_DE_DESY,T2_DE_RWTH,T2_CH_CERN", + default=None, ) parser.add_argument( "--blacklist_sites", @@ -197,7 +197,7 @@ def getFilesFromDas(args): .read() .split("\n") ) - + print("Number of files: ", len(flist)) import json dataset = dataset[:-1] if "\n" in dataset else dataset diff --git a/scripts/suball.py b/scripts/suball.py index bf00af23..c6280f75 100644 --- a/scripts/suball.py +++ b/scripts/suball.py @@ -1,6 +1,7 @@ import os, argparse from BTVNanoCommissioning.workflows import workflows from BTVNanoCommissioning.utils.sample import predefined_sample +from BTVNanoCommissioning.utils.AK4_parameters import correction_config import os, sys, inspect current_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) @@ -10,6 +11,42 @@ from runner import config_parser, scaleout_parser, debug_parser +# Get lumi +def get_lumi_from_web(year): + import requests + import re + + year = str(year) + # Define the URL of the directory + url = ( + f"https://cms-service-dqmdc.web.cern.ch/CAF/certification/Collisions{year[2:]}/" + ) + + # Send a request to fetch the HTML content of the webpage + response = requests.get(url) + html_content = response.text + + # Use regex to find all href links that contain 'Golden.json' but do not contain 'era' + # Ensures it only captures the URL part within href="..." and not any other content. + goldenjson_files = re.findall(r'href="([^"]*Golden\.json[^"]*)"', html_content) + + # Filter out any matches that contain 'era' in the filename + goldenjson_files = [file for file in goldenjson_files if "era" not in file] + + # If there are any such files, find the latest one (assuming the files are sorted lexicographically) + if goldenjson_files: + latest_file = sorted(goldenjson_files)[ + -1 + ] # Assuming lexicographical sorting works for the dates + os.system(f"wget {url}/{latest_file}") + os.system(f"mv {latest_file} src/BTVNanoCommissioning/data/lumiMasks/.") + return latest_file + else: + raise ( + f"No files for Year{year} containing 'Golden.json' (excluding 'era') were found." + ) + + ### Manage workflow in one script # EXAMPLE: python scripts/suball.py --scheme default_comissioning --campaign Summer23 --DAS_campaign "*Run2023D*Sep2023*,*Run3Summer23BPixNanoAODv12-130X*" --year 2023 # prerequest a new campaign should create a entry in AK4_parameters.py @@ -26,7 +63,7 @@ parser.add_argument( "-sc", "--scheme", - default="CAMPAIGN_prompt_dataMC", + default="Validation", choices=list(workflows.keys()) + ["Validation", "SF", "default_comissioning"], help="Choose the function for dump luminosity(`lumi`)/failed files(`failed`) into json", ) @@ -43,6 +80,11 @@ action="store_true", help="not transfered to https://btvweb.web.cern.ch/Commissioning/dataMC/", ) + parser.add_argument( + "--debug", + action="store_true", + help="Run local debug test with small set of dataset with iterative executor", + ) args = parser.parse_args() # summarize diffeerent group for study @@ -64,8 +106,26 @@ if args.scheme in workflows.keys(): workflow_group["test"] = [args.scheme] args.scheme = "test" + # Check lumiMask exists and replace the Validation + input_lumi_json = correction_config[args.campaign]["lumiMask"] + if args.campaign != "prompt_dataMC" and not os.path.exists( + f"src/BTVNanoCommissioning/data/lumiMasks/{input_lumi_json}" + ): + raise f"src/BTVNanoCommissioning/data/lumiMasks/{input_lumi_json} not exist" + + if ( + args.campaign == "prompt_dataMC" + and correction_config[args.campaign]["lumiMask"] == "$PROMPT_DATAMC" + ): + input_lumi_json = get_lumi_from_web(args.year) + os.system( + f"sed -i 's/$PROMPT_DATAMC/{input_lumi_json}/g' src/BTVNanoCommissioning/utils/AK4_parameters.py" + ) + print(f"======>{input_lumi_json} is used for {args.year}") for wf in workflow_group[args.scheme]: + if args.debug: + print(f"======{wf} in {args.scheme}=====") overwrite = "--overwrite" if args.overwrite else "" ## creating dataset if ( @@ -74,19 +134,37 @@ ) or args.overwrite ): + if args.debug: + print( + f"Creating MC dataset: python scripts/fetch.py -c {args.campaign} --from_workflow {wf} --DAS_campaign {args.DAS_campaign} --year {args.year} {overwrite} --skipvalidation" + ) + os.system( f"python scripts/fetch.py -c {args.campaign} --from_workflow {wf} --DAS_campaign {args.DAS_campaign} --year {args.year} {overwrite} --skipvalidation" ) + if args.debug: + os.system(f"ls metadata/{args.campaign}/*.json") + ## Run the workflows for types in predefined_sample[wf].keys(): + if (types != "data" or types != "MC") and args.scheme == "Validation": continue + print( + f"hists_{wf}_{types}_{args.campaign}_{args.year}_{wf}/hists_{wf}_{types}_{args.campaign}_{args.year}_{wf}.coffea" + ) if ( not os.path.exists( f"hists_{wf}_{types}_{args.campaign}_{args.year}_{wf}/hists_{wf}_{types}_{args.campaign}_{args.year}_{wf}.coffea" ) or args.overwrite ): + if not os.path.exists( + f"metadata/{args.campaign}/{types}_{args.campaign}_{args.year}_{wf}.json" + ): + raise Exception( + f"metadata/{args.campaign}/{types}_{args.campaign}_{args.year}_{wf}.json not exist" + ) runner_config_required = f"python runner.py --wf {wf} --json metadata/{args.campaign}/{types}_{args.campaign}_{args.year}_{wf}.json {overwrite} --campaign {args.campaign} --year {args.year}" runner_config = "" for key, value in vars(args).items(): @@ -100,6 +178,7 @@ "DAS_campaign", "version", "local", + "debug", ]: continue if key in [ @@ -112,14 +191,27 @@ if value == True: runner_config += f" --{key}" elif value is not None: - if "Validation" == args.scheme and types == "MC": + if ( + "Validation" == args.scheme + and types == "MC" + and "limit" not in key + ): runner_config += " --limit 50" + else: runner_config += f" --{key}={value}" runner_config = runner_config_required + runner_config - print(runner_config) - os.system(runner_config) + if args.debug: + print(f"run the workflow: {runner_config}") + with open( + f"config_{args.year}_{args.campaign}_{args.scheme}_{args.version}.txt", + "w", + ) as config_list: + config_list.write(runner_config) + os.system(runner_config) + if args.debug: + print(f"workflow is finished for {wf}!") # Get luminosity if ( os.path.exists( @@ -127,10 +219,20 @@ ) or args.overwrite ): + if args.debug: + print( + f"Get the luminosity from hists_{wf}_data_{args.campaign}_{args.year}_{wf}/hists_{wf}_data_{args.campaign}_{args.year}_{wf}.coffea" + ) + if not os.path.exists( + f"hists_{wf}_data_{args.campaign}_{args.year}_{wf}/hists_{wf}_data_{args.campaign}_{args.year}_{wf}.coffea " + ): + raise Exception( + f"hists_{wf}_data_{args.campaign}_{args.year}_{wf}/hists_{wf}_data_{args.campaign}_{args.year}_{wf}.coffea not exist" + ) lumi = os.popen( f"python scripts/dump_processed.py -t all -c hists_{wf}_data_{args.campaign}_{args.year}_{wf}/hists_{wf}_data_{args.campaign}_{args.year}_{wf}.coffea --json metadata/{args.campaign}/data_{args.campaign}_{args.year}_{wf}.json -n {args.campaign}_{args.year}_{wf}" ).read() - + print(lumi) lumi = int( round( float( @@ -145,14 +247,19 @@ ) if os.path.exists( f"hists_{wf}_MC_{args.campaign}_{args.year}_{wf}/hists_{wf}_MC_{args.campaign}_{args.year}_{wf}.coffea" + ) and os.path.exists( + f"hists_{wf}_data_{args.campaign}_{args.year}_{wf}/hists_{wf}_data_{args.campaign}_{args.year}_{wf}.coffea" ): - print(lumi) + if args.debug: + print(f"Plot the dataMC for {wf}") os.system( f'python scripts/plotdataMC.py -i "hists_{wf}_*_{args.campaign}_{args.year}_{wf}/hists_{wf}_*_{args.campaign}_{args.year}_{wf}.coffea" --lumi {lumi} -p {wf} -v all --ext {args.campaign}_{args.year}{args.version}' ) ## Inspired from Uttiya, create remote directory # https://github.com/cms-btv-pog/BTVNanoCommissioning/blob/14e654feeb4b4d738ee43ab913efb343ea65fd1d/scripts/submit/createremotedir.sh # create remote direcotry + if args.debug: + print(f"Upload plots&coffea to eos: {wf}") if not args.local: os.system(f"mkdir -p {args.campaign}{args.version}/{wf}") os.system(f"cp scripts/index.php {args.campaign}{args.version}/.") @@ -172,5 +279,10 @@ ) else: raise Exception( - f"No input coffea hists_{wf}_data_{args.campaign}_{args.year}_{wf}/hists_{wf}_data_{args.campaign}_{args.year}_{wf}.coffea" + f"No input coffea hists_{wf}_data_{args.campaign}_{args.year}_{wf}/hists_{wf}_data_{args.campaign}_{args.year}_{wf}.coffea or hists_{wf}_MC_{args.campaign}_{args.year}_{wf}/hists_{wf}_MC_{args.campaign}_{args.year}_{wf}.coffea" ) + # revert prompt_dataMC lumimask + if args.campaign == "prompt_dataMC": + os.system( + f"sed -i 's/{input_lumi_json}/$PROMPT_DATAMC/g' src/BTVNanoCommissioning/utils/AK4_parameters.py" + ) diff --git a/src/BTVNanoCommissioning/helpers/definitions.py b/src/BTVNanoCommissioning/helpers/definitions.py index 5575c4c5..ae84477d 100644 --- a/src/BTVNanoCommissioning/helpers/definitions.py +++ b/src/BTVNanoCommissioning/helpers/definitions.py @@ -6382,14 +6382,12 @@ def axes_name(var): elif "UParT" in var: unit = unit + " UParTAK4" else: - unit = unit + " DeepCSV" + unit = unit # output node if "CvL" in var: unit = unit + " CvL" elif "CvB" in var: unit = unit + " CvB" - elif "CvNotB" in var: - unit = unit + " CvNotB" elif "B_b" in var or "ProbB" in var: unit = unit + " Prob(b)" elif "B_bb" in var: diff --git a/src/BTVNanoCommissioning/helpers/func.py b/src/BTVNanoCommissioning/helpers/func.py index 5cedef95..804261fc 100644 --- a/src/BTVNanoCommissioning/helpers/func.py +++ b/src/BTVNanoCommissioning/helpers/func.py @@ -1,8 +1,10 @@ import awkward as ak import numpy as np from coffea import processor -import psutil, os +import psutil, os, gzip, importlib, cloudpickle import uproot +from coffea.jetmet_tools import JECStack, CorrectedJetsFactory, CorrectedMETFactory +from coffea.lookup_tools import extractor import collections @@ -67,6 +69,122 @@ def _is_rootcompat(a): return False +jec_name_map = { + "JetPt": "pt", + "JetPhi": "phi", + "JetMass": "mass", + "JetEta": "eta", + "JetA": "area", + "ptGenJet": "pt_gen", + "ptRaw": "pt_raw", + "massRaw": "mass_raw", + "Rho": "event_rho", + "METpt": "pt", + "METphi": "phi", + "JetPhi": "phi", + "UnClusteredEnergyDeltaX": "MetUnclustEnUpDeltaX", + "UnClusteredEnergyDeltaY": "MetUnclustEnUpDeltaY", +} + + +def _load_jmefactory(year, campaign, jme_compiles): + _jet_path = f"BTVNanoCommissioning.data.JME.{year}_{campaign}" + with importlib.resources.path(_jet_path, jme_compiles) as filename: + with gzip.open(filename) as fin: + jme_facrory = cloudpickle.load(fin) + + return jme_facrory + + +def __jet_factory_factory__(files): + ext = extractor() + ext.add_weight_sets([f"* * {file}" for file in files]) + ext.finalize() + jec_stack = JECStack(ext.make_evaluator()) + return CorrectedJetsFactory(jec_name_map, jec_stack) + + +def _jet_factories_(campaign, factory_map): + factory_info = { + j: __jet_factory_factory__(files=factory_map[j]) for j in factory_map.keys() + } + return factory_info + + +def _compile_jec_(year, campaign, factory_map, name): + # jme stuff not pickleable in coffea + import cloudpickle + + # add postfix to txt files + update_factory = {} + directory_path = f"src/BTVNanoCommissioning/data/JME/{year}_{campaign}/" + files_in_directory = os.listdir(directory_path) + for t in factory_map: + if t == "name": + continue + update_factory[t] = [] + for f in factory_map[t]: + if "Resolution" in f: + if not os.path.exists( + f"src/BTVNanoCommissioning/data/JME/{year}_{campaign}/{f}.jr.txt" + ) and os.path.exists( + f"src/BTVNanoCommissioning/data/JME/{year}_{campaign}/{f}.txt" + ): + os.system( + f"mv src/BTVNanoCommissioning/data/JME/{year}_{campaign}/{f}.txt src/BTVNanoCommissioning/data/JME/{year}_{campaign}/{f}.jr.txt" + ) + update_factory[t].append( + f"src/BTVNanoCommissioning/data/JME/{year}_{campaign}/{f}.jr.txt" + ) + elif "SF" in f: + if not os.path.exists( + f"src/BTVNanoCommissioning/data/JME/{year}_{campaign}/{f}.jersf.txt" + ) and os.path.exists( + f"src/BTVNanoCommissioning/data/JME/{year}_{campaign}/{f}.txt" + ): + os.system( + f"mv src/BTVNanoCommissioning/data/JME/{year}_{campaign}/{f}.txt src/BTVNanoCommissioning/data/JME/{year}_{campaign}/{f}.jersf.txt" + ) + update_factory[t].append( + f"src/BTVNanoCommissioning/data/JME/{year}_{campaign}/{f}.jersf.txt" + ) + elif "Uncertainty" in f: + if not os.path.exists( + f"src/BTVNanoCommissioning/data/JME/{year}_{campaign}/{f}.junc.txt" + ) and os.path.exists( + f"src/BTVNanoCommissioning/data/JME/{year}_{campaign}/{f}.txt" + ): + os.system( + f"mv src/BTVNanoCommissioning/data/JME/{year}_{campaign}/{f}.txt src/BTVNanoCommissioning/data/JME/{year}_{campaign}/{f}.junc.txt" + ) + update_factory[t].append( + f"src/BTVNanoCommissioning/data/JME/{year}_{campaign}/{f}.junc.txt" + ) + else: + if not os.path.exists( + f"src/BTVNanoCommissioning/data/JME/{year}_{campaign}/{f}.jec.txt" + ) and os.path.exists( + f"src/BTVNanoCommissioning/data/JME/{year}_{campaign}/{f}.txt" + ): + os.system( + f"mv src/BTVNanoCommissioning/data/JME/{year}_{campaign}/{f}.txt src/BTVNanoCommissioning/data/JME/{year}_{campaign}/{f}.jec.txt" + ) + update_factory[t].append( + f"src/BTVNanoCommissioning/data/JME/{year}_{campaign}/{f}.jec.txt" + ) + + with gzip.open( + f"src/BTVNanoCommissioning/data/JME/{year}_{campaign}/{name}.pkl.gz", "wb" + ) as fout: + cloudpickle.dump( + { + "jet_factory": _jet_factories_(campaign, update_factory), + "met_factory": CorrectedMETFactory(jec_name_map), + }, + fout, + ) + + def PFCand_link(events, event_level, jetindx): if str(ak.type(jetindx)).count("*") > 1: jetindx = jetindx[event_level] diff --git a/src/BTVNanoCommissioning/helpers/update_branch.py b/src/BTVNanoCommissioning/helpers/update_branch.py index 81115994..3539bb97 100644 --- a/src/BTVNanoCommissioning/helpers/update_branch.py +++ b/src/BTVNanoCommissioning/helpers/update_branch.py @@ -90,7 +90,7 @@ def missing_branch(events): "btagDeepFlavCvB": jets.btagDeepFlavCvB, }, ) - if not hasattr(events.Jet, "btagPNetCvNotB"): + if not hasattr(events.Jet, "btagPNetCvNotB") and hasattr(events.Jet, "btagPNetB"): jets = events.Jet jets["btagPNetCvNotB"] = ( jets.btagPNetCvB * jets.btagPNetB / (1.0 - jets.btagPNetB) ** 2 @@ -99,7 +99,9 @@ def missing_branch(events): events.Jet, {"btagPNetCvNotB": jets.btagPNetCvNotB}, ) - if not hasattr(events.Jet, "btagRobustParTAK4CvNotB"): + if not hasattr(events.Jet, "btagRobustParTAK4CvNotB") and hasattr( + events.Jet, "btagRobustParTAK4B" + ): jets = events.Jet jets["btagRobustParTAK4CvNotB"] = ( jets.btagRobustParTAK4CvB diff --git a/src/BTVNanoCommissioning/utils/AK4_parameters.py b/src/BTVNanoCommissioning/utils/AK4_parameters.py index 8ceb69c1..feae2f96 100644 --- a/src/BTVNanoCommissioning/utils/AK4_parameters.py +++ b/src/BTVNanoCommissioning/utils/AK4_parameters.py @@ -92,21 +92,30 @@ "Summer23": { "lumiMask": "Cert_Collisions2023_366442_370790_Golden.json", "PU": "puwei_Summer23.histo.root", - # "JME": { - # "MC": "Summer23Prompt23_V1", - # "Run2023C-22Sep2023_v1": "Summer23Prompt23_RunCv123_V1", - # "Run2023C-22Sep2023_v2": "Summer23Prompt23_RunCv123_V1", - # "Run2023C-22Sep2023_v3": "Summer23Prompt23_RunCv123_V1", - # "Run2023C-22Sep2023_v4": "Summer23Prompt23_RunCv4_V1", - # }, - "JME": "jec_compiled.pkl.gz", - "LSF": { - "mu_ID": "NUM_TightID_DEN_TrackerMuons", - "mu_Iso": "NUM_TightPFIso_DEN_TightID", - "ele_ID 2023PromptC Electron-ID-SF": "Tight", - "ele_Reco_low 2023PromptC Electron-ID-SF": "RecoBelow20", - "ele_Reco_med 2023PromptC Electron-ID-SF": "Reco20to75", - "ele_Reco_high 2023PromptC Electron-ID-SF": "RecoAbove75", + "JME": { + "name": "V1_AK4PFPuppi", + "MC": [ + "Summer23Prompt23_V1_MC_L1FastJet_AK4PFPuppi", + "Summer23Prompt23_V1_MC_L2Relative_AK4PFPuppi", + "Summer23Prompt23_V1_MC_L2Residual_AK4PFPuppi", + "Summer23Prompt23_V1_MC_L3Absolute_AK4PFPuppi", + "Summer23Prompt23_V1_MC_UncertaintySources_AK4PFPuppi", + "Summer23Prompt23_V1_MC_Uncertainty_AK4PFPuppi", + "Summer23Prompt23_JRV1_MC_SF_AK4PFPuppi", + "Summer23Prompt23_JRV1_MC_PtResolution_AK4PFPuppi", + ], + "dataCv123": [ + "Summer23Prompt23_RunCv123_V1_DATA_L1FastJet_AK4PFPuppi", + "Summer23Prompt23_RunCv123_V1_DATA_L2Relative_AK4PFPuppi", + "Summer23Prompt23_RunCv123_V1_DATA_L3Absolute_AK4PFPuppi", + "Summer23Prompt23_RunCv123_V1_DATA_L2L3Residual_AK4PFPuppi", + ], + "dataCv4": [ + "Summer23Prompt23_RunCv4_V1_DATA_L1FastJet_AK4PFPuppi", + "Summer23Prompt23_RunCv4_V1_DATA_L2Relative_AK4PFPuppi", + "Summer23Prompt23_RunCv4_V1_DATA_L3Absolute_AK4PFPuppi", + "Summer23Prompt23_RunCv4_V1_DATA_L2L3Residual_AK4PFPuppi", + ], }, "jetveto": {"Run2023BC jetvetomap_all": "Summer23Prompt23_RunC_v1.histo.root"}, "JPCalib": { @@ -142,7 +151,5 @@ "MC": "calibeHistoWrite_MC2023_Summer23BPix.root", }, }, - "CAMPAIGN_prompt_dataMC": { - "lumiMask": "Cert_Collisions2024_378981_381594_Golden.json" - }, + "prompt_dataMC": {"lumiMask": "$PROMPT_DATAMC"}, } diff --git a/src/BTVNanoCommissioning/utils/compile_jec.py b/src/BTVNanoCommissioning/utils/compile_jec.py deleted file mode 100644 index 8f14aa42..00000000 --- a/src/BTVNanoCommissioning/utils/compile_jec.py +++ /dev/null @@ -1,348 +0,0 @@ -import importlib.resources -import contextlib -from coffea.lookup_tools import extractor -from coffea.jetmet_tools import JECStack, CorrectedJetsFactory, CorrectedMETFactory - - -jec_name_map = { - "JetPt": "pt", - "JetPhi": "phi", - "JetMass": "mass", - "JetEta": "eta", - "JetA": "area", - "ptGenJet": "pt_gen", - "ptRaw": "pt_raw", - "massRaw": "mass_raw", - "Rho": "event_rho", - "METpt": "pt", - "METphi": "phi", - "JetPhi": "phi", - "UnClusteredEnergyDeltaX": "MetUnclustEnUpDeltaX", - "UnClusteredEnergyDeltaY": "MetUnclustEnUpDeltaY", -} - - -def jet_factory_factory(files): - ext = extractor() - ext.add_weight_sets([f"* * {file}" for file in files]) - ext.finalize() - jec_stack = JECStack(ext.make_evaluator()) - - return CorrectedJetsFactory(jec_name_map, jec_stack) - - -jet_factory = { - "Rereco17_94X": { - "mc": [ - "src/BTVNanoCommissioning/data/JME/Rereco17_94X/MC/Fall17_V3b_MC_PtResolution_AK4PFchs.jr.txt", - "src/BTVNanoCommissioning/data/JME/Rereco17_94X/MC/Fall17_V3b_MC_SF_AK4PFchs.jersf.txt", - "src/BTVNanoCommissioning/data/JME/Rereco17_94X/MC/Fall17_17Nov2017_V32_MC_L1FastJet_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/Rereco17_94X/MC/Fall17_17Nov2017_V32_MC_L2Relative_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/Rereco17_94X/MC/Fall17_17Nov2017_V32_MC_L3Absolute_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/Rereco17_94X/MC/Fall17_17Nov2017_V32_MC_L2L3Residual_AK4PFchs.jec.txt", - ], - "data": [ - "src/BTVNanoCommissioning/data/JME/Rereco17_94X/RunDE/Fall17_17Nov2017DE_V32_DATA_L1FastJet_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/Rereco17_94X/RunDE/Fall17_17Nov2017DE_V32_DATA_L2Relative_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/Rereco17_94X/RunDE/Fall17_17Nov2017DE_V32_DATA_L3Absolute_AK4PFchs.jec.txt", - ], - }, - "2016preVFP_UL": { - "mc": [ - "src/BTVNanoCommissioning/data/JME/2016preVFP_UL/Summer19UL16APV_V7_MC_L1FastJet_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/2016preVFP_UL/Summer19UL16APV_V7_MC_L2Relative_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/2016preVFP_UL/Summer19UL16APV_V7_MC_L3Absolute_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/2016preVFP_UL/Summer20UL16APV_JRV3_DATA_PtResolution_AK4PFchs.jr.txt", - "src/BTVNanoCommissioning/data/JME/2016preVFP_UL/Summer20UL16APV_JRV3_MC_SF_AK4PFchs.jersf.txt", - "src/BTVNanoCommissioning/data/JME/2016preVFP_UL/RegroupedV2_Summer19UL16APV_V7_MC_UncertaintySources_AK4PFchs.junc.txt", - "src/BTVNanoCommissioning/data/JME/2016preVFP_UL/Summer19UL16APV_V7_MC_Uncertainty_AK4PFchs.junc.txt", - ], - "dataBCD": [ - "src/BTVNanoCommissioning/data/JME/2016preVFP_UL/Summer19UL16APV_RunBCD_V7_DATA_L1FastJet_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/2016preVFP_UL/Summer19UL16APV_RunBCD_V7_DATA_L2L3Residual_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/2016preVFP_UL/Summer19UL16APV_RunBCD_V7_DATA_L2Relative_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/2016preVFP_UL/Summer19UL16APV_RunBCD_V7_DATA_L3Absolute_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/2016preVFP_UL/Summer20UL16APV_JRV3_DATA_SF_AK4PFchs.jersf.txt", - "src/BTVNanoCommissioning/data/JME/2016preVFP_UL/Summer20UL16APV_JRV3_DATA_PtResolution_AK4PFchs.jr.txt", - "src/BTVNanoCommissioning/data/JME/2016preVFP_UL/Summer19UL16APV_RunBCD_V7_DATA_UncertaintySources_AK4PFchs.junc.txt", - "src/BTVNanoCommissioning/data/JME/2016preVFP_UL/Summer19UL16APV_RunBCD_V7_DATA_Uncertainty_AK4PFchs.junc.txt", - ], - "dataEF": [ - "src/BTVNanoCommissioning/data/JME/2016preVFP_UL/Summer19UL16APV_RunEF_V7_DATA_L1FastJet_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/2016preVFP_UL/Summer19UL16APV_RunEF_V7_DATA_L2L3Residual_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/2016preVFP_UL/Summer19UL16APV_RunEF_V7_DATA_L2Relative_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/2016preVFP_UL/Summer19UL16APV_RunEF_V7_DATA_L3Absolute_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/2016preVFP_UL/Summer20UL16APV_JRV3_DATA_SF_AK4PFchs.jersf.txt", - "src/BTVNanoCommissioning/data/JME/2016preVFP_UL/Summer20UL16APV_JRV3_DATA_PtResolution_AK4PFchs.jr.txt", - "src/BTVNanoCommissioning/data/JME/2016preVFP_UL/Summer19UL16APV_RunEF_V7_DATA_Uncertainty_AK4PFchs.junc.txt", - "src/BTVNanoCommissioning/data/JME/2016preVFP_UL/Summer19UL16APV_RunEF_V7_DATA_UncertaintySources_AK4PFchs.junc.txt", - ], - }, - "2016postVFP_UL": { - "mc": [ - "src/BTVNanoCommissioning/data/JME/2016postVFP_UL/RegroupedV2_Summer19UL16_V7_MC_UncertaintySources_AK4PFchs.junc.txt", - "src/BTVNanoCommissioning/data/JME/2016postVFP_UL/Summer19UL16_V7_MC_L1FastJet_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/2016postVFP_UL/Summer19UL16_V7_MC_L2Relative_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/2016postVFP_UL/Summer19UL16_V7_MC_L3Absolute_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/2016postVFP_UL/Summer19UL16_V7_MC_Uncertainty_AK4PFchs.junc.txt", - "src/BTVNanoCommissioning/data/JME/2016postVFP_UL/Summer20UL16_JRV3_MC_PtResolution_AK4PFchs.jr.txt", - "src/BTVNanoCommissioning/data/JME/2016postVFP_UL/Summer20UL16_JRV3_MC_SF_AK4PFchs.jersf.txt", - ], - "dataFGH": [ - "src/BTVNanoCommissioning/data/JME/2016postVFP_UL/Summer20UL16_JRV3_DATA_PtResolution_AK4PFchs.jr.txt", - "src/BTVNanoCommissioning/data/JME/2016postVFP_UL/Summer20UL16_JRV3_DATA_SF_AK4PFchs.jersf.txt", - "src/BTVNanoCommissioning/data/JME/2016postVFP_UL/Summer19UL16_RunFGH_V7_DATA_L1FastJet_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/2016postVFP_UL/Summer19UL16_RunFGH_V7_DATA_L2L3Residual_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/2016postVFP_UL/Summer19UL16_RunFGH_V7_DATA_L2Relative_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/2016postVFP_UL/Summer19UL16_RunFGH_V7_DATA_L3Absolute_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/2016postVFP_UL/Summer19UL16_RunFGH_V7_DATA_Uncertainty_AK4PFchs.junc.txt", - "src/BTVNanoCommissioning/data/JME/2016postVFP_UL/Summer19UL16_RunFGH_V7_DATA_UncertaintySources_AK4PFchs.junc.txt", - ], - }, - "2017_UL": { - "mc": [ - "src/BTVNanoCommissioning/data/JME/2017_UL/RegroupedV2_Summer19UL17_V5_MC_UncertaintySources_AK4PFchs.junc.txt", - "src/BTVNanoCommissioning/data/JME/2017_UL/Summer19UL17_JRV2_MC_PtResolution_AK4PFchs.jr.txt", - "src/BTVNanoCommissioning/data/JME/2017_UL/Summer19UL17_JRV2_MC_SF_AK4PFchs.jersf.txt", - "src/BTVNanoCommissioning/data/JME/2017_UL/Summer19UL17_V5_MC_L1FastJet_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/2017_UL/Summer19UL17_V5_MC_L2Relative_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/2017_UL/Summer19UL17_V5_MC_L3Absolute_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/2017_UL/Summer19UL17_V5_MC_Uncertainty_AK4PFchs.junc.txt", - ], - "dataB": [ - "src/BTVNanoCommissioning/data/JME/2017_UL/Summer19UL17_RunB_V5_DATA_L1FastJet_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/2017_UL/Summer19UL17_RunB_V5_DATA_L2L3Residual_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/2017_UL/Summer19UL17_RunB_V5_DATA_L2Relative_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/2017_UL/Summer19UL17_RunB_V5_DATA_L3Absolute_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/2017_UL/Summer19UL17_RunB_V5_DATA_Uncertainty_AK4PFchs.junc.txt", - "src/BTVNanoCommissioning/data/JME/2017_UL/Summer19UL17_RunB_V5_DATA_UncertaintySources_AK4PFchs.junc.txt", - ], - "dataC": [ - "src/BTVNanoCommissioning/data/JME/2017_UL/Summer19UL17_RunC_V5_DATA_L1FastJet_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/2017_UL/Summer19UL17_RunC_V5_DATA_L2L3Residual_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/2017_UL/Summer19UL17_RunC_V5_DATA_L2Relative_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/2017_UL/Summer19UL17_RunC_V5_DATA_L3Absolute_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/2017_UL/Summer19UL17_RunC_V5_DATA_Uncertainty_AK4PFchs.junc.txt", - "src/BTVNanoCommissioning/data/JME/2017_UL/Summer19UL17_RunC_V5_DATA_UncertaintySources_AK4PFchs.junc.txt", - ], - "dataD": [ - "src/BTVNanoCommissioning/data/JME/2017_UL/Summer19UL17_RunD_V5_DATA_L1FastJet_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/2017_UL/Summer19UL17_RunD_V5_DATA_L2L3Residual_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/2017_UL/Summer19UL17_RunD_V5_DATA_L2Relative_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/2017_UL/Summer19UL17_RunD_V5_DATA_L3Absolute_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/2017_UL/Summer19UL17_RunD_V5_DATA_Uncertainty_AK4PFchs.junc.txt", - "src/BTVNanoCommissioning/data/JME/2017_UL/Summer19UL17_RunD_V5_DATA_UncertaintySources_AK4PFchs.junc.txt", - ], - "dataE": [ - "src/BTVNanoCommissioning/data/JME/2017_UL/Summer19UL17_RunE_V5_DATA_L1FastJet_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/2017_UL/Summer19UL17_RunE_V5_DATA_L2L3Residual_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/2017_UL/Summer19UL17_RunE_V5_DATA_L2Relative_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/2017_UL/Summer19UL17_RunE_V5_DATA_L3Absolute_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/2017_UL/Summer19UL17_RunE_V5_DATA_Uncertainty_AK4PFchs.junc.txt", - "src/BTVNanoCommissioning/data/JME/2017_UL/Summer19UL17_RunE_V5_DATA_UncertaintySources_AK4PFchs.junc.txt", - ], - "dataF": [ - "src/BTVNanoCommissioning/data/JME/2017_UL/Summer19UL17_RunF_V5_DATA_L1FastJet_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/2017_UL/Summer19UL17_RunF_V5_DATA_L2L3Residual_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/2017_UL/Summer19UL17_RunF_V5_DATA_L2Relative_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/2017_UL/Summer19UL17_RunF_V5_DATA_L3Absolute_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/2017_UL/Summer19UL17_RunF_V5_DATA_Uncertainty_AK4PFchs.junc.txt", - "src/BTVNanoCommissioning/data/JME/2017_UL/Summer19UL17_RunF_V5_DATA_UncertaintySources_AK4PFchs.junc.txt", - ], - }, - "2018_UL": { - "mc": [ - "src/BTVNanoCommissioning/data/JME/2018_UL/RegroupedV2_Summer19UL18_V5_MC_UncertaintySources_AK4PFchs.junc.txt", - "src/BTVNanoCommissioning/data/JME/2018_UL/Summer19UL18_JRV2_MC_PtResolution_AK4PFchs.jr.txt", - "src/BTVNanoCommissioning/data/JME/2018_UL/Summer19UL18_JRV2_MC_SF_AK4PFchs.jersf.txt", - "src/BTVNanoCommissioning/data/JME/2018_UL/Summer19UL18_V5_MC_L1FastJet_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/2018_UL/Summer19UL18_V5_MC_L2L3Residual_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/2018_UL/Summer19UL18_V5_MC_L2Relative_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/2018_UL/Summer19UL18_V5_MC_L3Absolute_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/2018_UL/Summer19UL18_V5_MC_Uncertainty_AK4PFchs.junc.txt", - ], - "dataA": [ - "src/BTVNanoCommissioning/data/JME/2018_UL/Summer19UL18_RunA_V5_DATA_L1FastJet_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/2018_UL/Summer19UL18_RunA_V5_DATA_L2L3Residual_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/2018_UL/Summer19UL18_RunA_V5_DATA_L2Relative_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/2018_UL/Summer19UL18_RunA_V5_DATA_L3Absolute_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/2018_UL/Summer19UL18_RunA_V5_DATA_Uncertainty_AK4PFchs.junc.txt", - "src/BTVNanoCommissioning/data/JME/2018_UL/Summer19UL18_RunA_V5_DATA_UncertaintySources_AK4PFchs.junc.txt", - ], - "dataB": [ - "src/BTVNanoCommissioning/data/JME/2018_UL/Summer19UL18_RunB_V5_DATA_L1FastJet_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/2018_UL/Summer19UL18_RunB_V5_DATA_L2L3Residual_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/2018_UL/Summer19UL18_RunB_V5_DATA_L2Relative_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/2018_UL/Summer19UL18_RunB_V5_DATA_L3Absolute_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/2018_UL/Summer19UL18_RunB_V5_DATA_Uncertainty_AK4PFchs.junc.txt", - "src/BTVNanoCommissioning/data/JME/2018_UL/Summer19UL18_RunB_V5_DATA_UncertaintySources_AK4PFchs.junc.txt", - ], - "dataC": [ - "src/BTVNanoCommissioning/data/JME/2018_UL/Summer19UL18_RunC_V5_DATA_L1FastJet_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/2018_UL/Summer19UL18_RunC_V5_DATA_L2L3Residual_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/2018_UL/Summer19UL18_RunC_V5_DATA_L2Relative_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/2018_UL/Summer19UL18_RunC_V5_DATA_L3Absolute_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/2018_UL/Summer19UL18_RunC_V5_DATA_Uncertainty_AK4PFchs.junc.txt", - "src/BTVNanoCommissioning/data/JME/2018_UL/Summer19UL18_RunC_V5_DATA_UncertaintySources_AK4PFchs.junc.txt", - ], - "dataD": [ - "src/BTVNanoCommissioning/data/JME/2018_UL/Summer19UL18_RunD_V5_DATA_L1FastJet_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/2018_UL/Summer19UL18_RunD_V5_DATA_L2L3Residual_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/2018_UL/Summer19UL18_RunD_V5_DATA_L2Relative_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/2018_UL/Summer19UL18_RunD_V5_DATA_L3Absolute_AK4PFchs.jec.txt", - "src/BTVNanoCommissioning/data/JME/2018_UL/Summer19UL18_RunD_V5_DATA_Uncertainty_AK4PFchs.junc.txt", - "src/BTVNanoCommissioning/data/JME/2018_UL/Summer19UL18_RunD_V5_DATA_UncertaintySources_AK4PFchs.junc.txt", - ], - }, - "Winter22Run3": { - "mc": [ - "src/BTVNanoCommissioning/data/JME/Winter22Run3/Winter22Run3_V1_MC_PtResolution_AK4PFPuppi.jr.txt", - "src/BTVNanoCommissioning/data/JME/Winter22Run3/Winter22Run3_V1_MC_SF_AK4PFPuppi.jersf.txt", - "src/BTVNanoCommissioning/data/JME/Winter22Run3/Winter22Run3_V2_MC_L1FastJet_AK4PFPuppi.jec.txt", - "src/BTVNanoCommissioning/data/JME/Winter22Run3/Winter22Run3_V2_MC_L2Relative_AK4PFPuppi.jec.txt", - "src/BTVNanoCommissioning/data/JME/Winter22Run3/Winter22Run3_V2_MC_L2Residual_AK4PFPuppi.jec.txt", - "src/BTVNanoCommissioning/data/JME/Winter22Run3/Winter22Run3_V2_MC_L3Absolute_AK4PFPuppi.jec.txt", - "src/BTVNanoCommissioning/data/JME/Winter22Run3/Winter22Run3_V2_MC_UncertaintySources_AK4PFPuppi.junc.txt", - "src/BTVNanoCommissioning/data/JME/Winter22Run3/Winter22Run3_V2_MC_Uncertainty_AK4PFPuppi.junc.txt", - ], - "dataC": [ - "src/BTVNanoCommissioning/data/JME/Winter22Run3/Winter22Run3_RunC_V2_DATA_L1FastJet_AK4PFPuppi.jec.txt", - "src/BTVNanoCommissioning/data/JME/Winter22Run3/Winter22Run3_RunC_V2_DATA_L2Relative_AK4PFPuppi.jec.txt", - "src/BTVNanoCommissioning/data/JME/Winter22Run3/Winter22Run3_RunC_V2_DATA_L3Absolute_AK4PFPuppi.jec.txt", - "src/BTVNanoCommissioning/data/JME/Winter22Run3/Winter22Run3_RunC_V2_DATA_L2L3Residual_AK4PFPuppi.jec.txt", - ], - "dataD": [ - "src/BTVNanoCommissioning/data/JME/Winter22Run3/Winter22Run3_RunD_V2_DATA_L1FastJet_AK4PFPuppi.jec.txt", - "src/BTVNanoCommissioning/data/JME/Winter22Run3/Winter22Run3_RunD_V2_DATA_L2Relative_AK4PFPuppi.jec.txt", - "src/BTVNanoCommissioning/data/JME/Winter22Run3/Winter22Run3_RunD_V2_DATA_L3Absolute_AK4PFPuppi.jec.txt", - "src/BTVNanoCommissioning/data/JME/Winter22Run3/Winter22Run3_RunD_V2_DATA_L2L3Residual_AK4PFPuppi.jec.txt", - ], - }, - "Summer22": { - "mc": [ - "src/BTVNanoCommissioning/data/JME/Summer22/Summer22_V1_MC_L1FastJet_AK4PFPuppi.jec.txt", - "src/BTVNanoCommissioning/data/JME/Summer22/Summer22_V1_MC_L2Relative_AK4PFPuppi.jec.txt", - "src/BTVNanoCommissioning/data/JME/Summer22/Summer22_V1_MC_L2Residual_AK4PFPuppi.jec.txt", - "src/BTVNanoCommissioning/data/JME/Summer22/Summer22_V1_MC_L3Absolute_AK4PFPuppi.jec.txt", - "src/BTVNanoCommissioning/data/JME/Summer22/Summer22_V1_MC_UncertaintySources_AK4PFPuppi.junc.txt", - "src/BTVNanoCommissioning/data/JME/Summer22/Summer22_V1_MC_Uncertainty_AK4PFPuppi.junc.txt", - "src/BTVNanoCommissioning/data/JME/Summer22/Summer22Run3_V1_MC_SF_AK4PFPuppi.jersf.txt", - "src/BTVNanoCommissioning/data/JME/Summer22/Summer22Run3_V1_MC_PtResolution_AK4PFPuppi.jr.txt", - ], - "dataC": [ - "src/BTVNanoCommissioning/data/JME/Summer22/Summer22_RunCD_V1_DATA_L1FastJet_AK4PFPuppi.jec.txt", - "src/BTVNanoCommissioning/data/JME/Summer22/Summer22_RunCD_V1_DATA_L2Relative_AK4PFPuppi.jec.txt", - "src/BTVNanoCommissioning/data/JME/Summer22/Summer22_RunCD_V1_DATA_L3Absolute_AK4PFPuppi.jec.txt", - "src/BTVNanoCommissioning/data/JME/Summer22/Summer22_RunCD_V1_DATA_L2L3Residual_AK4PFPuppi.jec.txt", - ], - "dataD": [ - "src/BTVNanoCommissioning/data/JME/Summer22/Summer22_RunCD_V1_DATA_L1FastJet_AK4PFPuppi.jec.txt", - "src/BTVNanoCommissioning/data/JME/Summer22/Summer22_RunCD_V1_DATA_L2Relative_AK4PFPuppi.jec.txt", - "src/BTVNanoCommissioning/data/JME/Summer22/Summer22_RunCD_V1_DATA_L3Absolute_AK4PFPuppi.jec.txt", - "src/BTVNanoCommissioning/data/JME/Summer22/Summer22_RunCD_V1_DATA_L2L3Residual_AK4PFPuppi.jec.txt", - ], - }, - "Summer22EE": { - "mc": [ - "src/BTVNanoCommissioning/data/JME/Summer22EE/Summer22EEPrompt22_JRV1_MC_SF_AK4PFPuppi.jersf.txt", - "src/BTVNanoCommissioning/data/JME/Summer22EE/Summer22EEPrompt22_JRV1_MC_PtResolution_AK4PFPuppi.jr.txt", - "src/BTVNanoCommissioning/data/JME/Summer22EE/Summer22EE_V1_MC_L1FastJet_AK4PFPuppi.jec.txt", - "src/BTVNanoCommissioning/data/JME/Summer22EE/Summer22EE_V1_MC_L2Relative_AK4PFPuppi.jec.txt", - "src/BTVNanoCommissioning/data/JME/Summer22EE/Summer22EE_V1_MC_L2Residual_AK4PFPuppi.jec.txt", - "src/BTVNanoCommissioning/data/JME/Summer22EE/Summer22EE_V1_MC_L3Absolute_AK4PFPuppi.jec.txt", - "src/BTVNanoCommissioning/data/JME/Summer22EE/Summer22EE_V1_MC_UncertaintySources_AK4PFPuppi.junc.txt", - "src/BTVNanoCommissioning/data/JME/Summer22EE/Summer22EE_V1_MC_Uncertainty_AK4PFPuppi.junc.txt", - ], - "dataE": [ - "src/BTVNanoCommissioning/data/JME/Summer22EE/Summer22EE_RunE_V1_DATA_L1FastJet_AK4PFPuppi.jec.txt", - "src/BTVNanoCommissioning/data/JME/Summer22EE/Summer22EE_RunE_V1_DATA_L2Relative_AK4PFPuppi.jec.txt", - "src/BTVNanoCommissioning/data/JME/Summer22EE/Summer22EE_RunE_V1_DATA_L3Absolute_AK4PFPuppi.jec.txt", - "src/BTVNanoCommissioning/data/JME/Summer22EE/Summer22EE_RunE_V1_DATA_L2L3Residual_AK4PFPuppi.jec.txt", - ], - "dataF": [ - "src/BTVNanoCommissioning/data/JME/Summer22EE/Summer22EE_RunF_V1_DATA_L1FastJet_AK4PFPuppi.jec.txt", - "src/BTVNanoCommissioning/data/JME/Summer22EE/Summer22EE_RunF_V1_DATA_L2Relative_AK4PFPuppi.jec.txt", - "src/BTVNanoCommissioning/data/JME/Summer22EE/Summer22EE_RunF_V1_DATA_L3Absolute_AK4PFPuppi.jec.txt", - "src/BTVNanoCommissioning/data/JME/Summer22EE/Summer22EE_RunF_V1_DATA_L2L3Residual_AK4PFPuppi.jec.txt", - ], - "dataG": [ - "src/BTVNanoCommissioning/data/JME/Summer22EE/Summer22EE_RunG_V1_DATA_L1FastJet_AK4PFPuppi.jec.txt", - "src/BTVNanoCommissioning/data/JME/Summer22EE/Summer22EE_RunG_V1_DATA_L2Relative_AK4PFPuppi.jec.txt", - "src/BTVNanoCommissioning/data/JME/Summer22EE/Summer22EE_RunG_V1_DATA_L3Absolute_AK4PFPuppi.jec.txt", - "src/BTVNanoCommissioning/data/JME/Summer22EE/Summer22EE_RunG_V1_DATA_L2L3Residual_AK4PFPuppi.jec.txt", - ], - }, - "Summer23": { - "mc": [ - "src/BTVNanoCommissioning/data/JME/Summer23/Summer23Prompt23_V1_MC_L1FastJet_AK4PFPuppi.jec.txt", - "src/BTVNanoCommissioning/data/JME/Summer23/Summer23Prompt23_V1_MC_L2Relative_AK4PFPuppi.jec.txt", - "src/BTVNanoCommissioning/data/JME/Summer23/Summer23Prompt23_V1_MC_L2Residual_AK4PFPuppi.jec.txt", - "src/BTVNanoCommissioning/data/JME/Summer23/Summer23Prompt23_V1_MC_L3Absolute_AK4PFPuppi.jec.txt", - "src/BTVNanoCommissioning/data/JME/Summer23/Summer23Prompt23_V1_MC_UncertaintySources_AK4PFPuppi.junc.txt", - "src/BTVNanoCommissioning/data/JME/Summer23/Summer23Prompt23_V1_MC_Uncertainty_AK4PFPuppi.junc.txt", - "src/BTVNanoCommissioning/data/JME/Summer23/Summer23Prompt23_JRV1_MC_SF_AK4PFPuppi.jersf.txt", - "src/BTVNanoCommissioning/data/JME/Summer23/Summer23Prompt23_JRV1_MC_PtResolution_AK4PFPuppi.jr.txt", - ], - "dataCv123": [ - "src/BTVNanoCommissioning/data/JME/Summer23/Summer23Prompt23_RunCv123_V1_DATA_L1FastJet_AK4PFPuppi.jec.txt", - "src/BTVNanoCommissioning/data/JME/Summer23/Summer23Prompt23_RunCv123_V1_DATA_L2Relative_AK4PFPuppi.jec.txt", - "src/BTVNanoCommissioning/data/JME/Summer23/Summer23Prompt23_RunCv123_V1_DATA_L3Absolute_AK4PFPuppi.jec.txt", - "src/BTVNanoCommissioning/data/JME/Summer23/Summer23Prompt23_RunCv123_V1_DATA_L2L3Residual_AK4PFPuppi.jec.txt", - ], - "dataCv4": [ - "src/BTVNanoCommissioning/data/JME/Summer23/Summer23Prompt23_RunCv4_V1_DATA_L1FastJet_AK4PFPuppi.jec.txt", - "src/BTVNanoCommissioning/data/JME/Summer23/Summer23Prompt23_RunCv4_V1_DATA_L2Relative_AK4PFPuppi.jec.txt", - "src/BTVNanoCommissioning/data/JME/Summer23/Summer23Prompt23_RunCv4_V1_DATA_L3Absolute_AK4PFPuppi.jec.txt", - "src/BTVNanoCommissioning/data/JME/Summer23/Summer23Prompt23_RunCv4_V1_DATA_L2L3Residual_AK4PFPuppi.jec.txt", - ], - }, - "Summer23BPix": { - "mc": [ - "src/BTVNanoCommissioning/data/JME/Summer23BPix/Summer23BPixPrompt23_V1_MC_L1FastJet_AK4PFPuppi.jec.txt", - "src/BTVNanoCommissioning/data/JME/Summer23BPix/Summer23BPixPrompt23_V1_MC_L2Relative_AK4PFPuppi.jec.txt", - "src/BTVNanoCommissioning/data/JME/Summer23BPix/Summer23BPixPrompt23_V1_MC_L2Residual_AK4PFPuppi.jec.txt", - "src/BTVNanoCommissioning/data/JME/Summer23BPix/Summer23BPixPrompt23_V1_MC_L3Absolute_AK4PFPuppi.jec.txt", - "src/BTVNanoCommissioning/data/JME/Summer23BPix/Summer23BPixPrompt23_V1_MC_UncertaintySources_AK4PFPuppi.junc.txt", - "src/BTVNanoCommissioning/data/JME/Summer23BPix/Summer23BPixPrompt23_V1_MC_Uncertainty_AK4PFPuppi.junc.txt", - "src/BTVNanoCommissioning/data/JME/Summer23BPix/Summer23BPixPrompt23_JRV1_MC_PtResolution_AK4PFPuppi.jr.txt", - "src/BTVNanoCommissioning/data/JME/Summer23BPix/Summer23BPixPrompt23_JRV1_MC_SF_AK4PFPuppi.jersf.txt", - ], - # "dataD":[ - # "src/BTVNanoCommissioning/data/JME/Summer23BPix/Summer23BPixPrompt23_RunD_V1_DATA_L1FastJet_AK4PFPuppi.jec.txt", - # "src/BTVNanoCommissioning/data/JME/Summer23BPix/Summer23BPixPrompt23_RunD_V1_DATA_L2Relative_AK4PFPuppi.jec.txt", - # "src/BTVNanoCommissioning/data/JME/Summer23BPix/Summer23BPixPrompt23_RunD_V1_DATA_L2Residual_AK4PFPuppi.jec.txt", - # "src/BTVNanoCommissioning/data/JME/Summer23BPix/Summer23BPixPrompt23_RunD_V1_DATA_L3Absolute_AK4PFPuppi.jec.txt", - # "src/BTVNanoCommissioning/data/JME/Summer23BPix/Summer23BPixPrompt23_RunD_V1_DATA_Uncertainty_AK4PFPuppi.junc.txt", - # "src/BTVNanoCommissioning/data/JME/Summer23BPix/Summer23BPixPrompt23_RunD_V1_DATA_UncertaintySources_AK4PFPuppi.junc.txt" - # ] - }, -} - - -def jet_factories(campaign): - factory_info = { - j: jet_factory_factory(files=jet_factory[campaign][j]) - for j in jet_factory[campaign].keys() - } - - return factory_info - - -if __name__ == "__main__": - import sys - import gzip - - # jme stuff not pickleable in coffea - import cloudpickle - - campaign = sys.argv[-2] - with gzip.open( - f"src/BTVNanoCommissioning/data/JME/{campaign}/{sys.argv[-1]}.pkl.gz", "wb" - ) as fout: - cloudpickle.dump( - { - "jet_factory": jet_factories(campaign), - "met_factory": CorrectedMETFactory(jec_name_map), - }, - fout, - ) diff --git a/src/BTVNanoCommissioning/utils/correction.py b/src/BTVNanoCommissioning/utils/correction.py index 0555e9dd..5c681544 100644 --- a/src/BTVNanoCommissioning/utils/correction.py +++ b/src/BTVNanoCommissioning/utils/correction.py @@ -1,29 +1,26 @@ import importlib.resources -import gzip -import pickle -import contextlib -import cloudpickle -import os -import re -import copy +import cloudpickle, gzip, contextlib +import copy, os, re + import numpy as np import awkward as ak import uproot from coffea.lookup_tools import extractor, txt_converters, rochester_lookup - from coffea.lumi_tools import LumiMask + +from coffea.jetmet_tools.CorrectedMETFactory import corrected_polar_met + +from coffea.analysis_tools import Weights + from coffea.btag_tools import BTagScaleFactor import correctionlib -from BTVNanoCommissioning.helpers.func import update +from BTVNanoCommissioning.helpers.func import update, _compile_jec_, _load_jmefactory from BTVNanoCommissioning.helpers.cTagSFReader import getSF -from coffea.analysis_tools import Weights from BTVNanoCommissioning.utils.AK4_parameters import correction_config as config -from BTVNanoCommissioning.utils.compile_jec import jec_name_map -from coffea.jetmet_tools.CorrectedMETFactory import corrected_polar_met -def load_SF(campaign, syst=False): +def load_SF(year, campaign, syst=False): correct_map = {"campaign": campaign} for SF in config[campaign].keys(): if SF == "lumiMask": @@ -32,10 +29,10 @@ def load_SF(campaign, syst=False): if SF == "PU": ## Check whether files in jsonpog-integration exist if os.path.exists( - f"/cvmfs/cms.cern.ch/rsync/cms-nanoAOD/jsonpog-integration/POG/LUM/{campaign}" + f"/cvmfs/cms.cern.ch/rsync/cms-nanoAOD/jsonpog-integration/POG/LUM/{year}_{campaign}" ): correct_map["PU"] = correctionlib.CorrectionSet.from_file( - f"/cvmfs/cms.cern.ch/rsync/cms-nanoAOD/jsonpog-integration/POG/LUM/{campaign}/puWeights.json.gz" + f"/cvmfs/cms.cern.ch/rsync/cms-nanoAOD/jsonpog-integration/POG/LUM/{year}_{campaign}/puWeights.json.gz" ) ## Otherwise custom files else: @@ -65,30 +62,31 @@ def load_SF(campaign, syst=False): ].endswith(".json.gz"): correct_map["btag"] = correctionlib.CorrectionSet.from_file( importlib.resources.path( - f"BTVNanoCommissioning.data.BTV.{campaign}", filename + f"BTVNanoCommissioning.data.BTV.{year}_{campaign}", filename ) ) if "ctag" in config[campaign]["BTV"].keys() and config[campaign]["BTV"][ - "btag" + "ctag" ].endswith(".json.gz"): correct_map["btag"] = correctionlib.CorrectionSet.from_file( importlib.resources.path( - f"BTVNanoCommissioning.data.BTV.{campaign}", filename + f"BTVNanoCommissioning.data.BTV.{year}_{campaign}", filename ) ) if os.path.exists( - f"/cvmfs/cms.cern.ch/rsync/cms-nanoAOD/jsonpog-integration/POG/BTV/{campaign}" + f"/cvmfs/cms.cern.ch/rsync/cms-nanoAOD/jsonpog-integration/POG/BTV/{year}_{campaign}" ): correct_map["btag"] = correctionlib.CorrectionSet.from_file( - f"/cvmfs/cms.cern.ch/rsync/cms-nanoAOD/jsonpog-integration/POG/BTV/{campaign}/btagging.json.gz" + f"/cvmfs/cms.cern.ch/rsync/cms-nanoAOD/jsonpog-integration/POG/BTV/{year}_{campaign}/btagging.json.gz" ) correct_map["ctag"] = correctionlib.CorrectionSet.from_file( - f"/cvmfs/cms.cern.ch/rsync/cms-nanoAOD/jsonpog-integration/POG/BTV/{campaign}/ctagging.json.gz" + f"/cvmfs/cms.cern.ch/rsync/cms-nanoAOD/jsonpog-integration/POG/BTV/{year}_{campaign}/ctagging.json.gz" ) else: correct_map["btag"] = {} correct_map["ctag"] = {} - _btag_path = f"BTVNanoCommissioning.data.BTV.{campaign}" + correct_map["btv_cfg"] = config[campaign]["BTV"] + _btag_path = f"BTVNanoCommissioning.data.BTV.{year}_{campaign}" for tagger in config[campaign]["BTV"]: with importlib.resources.path( _btag_path, config[campaign]["BTV"][tagger] @@ -115,6 +113,7 @@ def load_SF(campaign, syst=False): BTagScaleFactor.RESHAPE, methods="iterativefit,iterativefit,iterativefit", ) + ## lepton SFs elif SF == "LSF": correct_map["MUO_cfg"] = { @@ -129,30 +128,30 @@ def load_SF(campaign, syst=False): } ## Muon if os.path.exists( - f"/cvmfs/cms.cern.ch/rsync/cms-nanoAOD/jsonpog-integration/POG/MUO/{campaign}" + f"/cvmfs/cms.cern.ch/rsync/cms-nanoAOD/jsonpog-integration/POG/MUO/{year}_{campaign}" ): correct_map["MUO"] = correctionlib.CorrectionSet.from_file( - f"/cvmfs/cms.cern.ch/rsync/cms-nanoAOD/jsonpog-integration/POG/MUO/{campaign}/muon_Z.json.gz" + f"/cvmfs/cms.cern.ch/rsync/cms-nanoAOD/jsonpog-integration/POG/MUO/{year}_{campaign}/muon_Z.json.gz" ) if os.path.exists( - f"/cvmfs/cms.cern.ch/rsync/cms-nanoAOD/jsonpog-integration/POG/EGM/{campaign}" + f"/cvmfs/cms.cern.ch/rsync/cms-nanoAOD/jsonpog-integration/POG/EGM/{year}_{campaign}" ): correct_map["EGM"] = correctionlib.CorrectionSet.from_file( - f"/cvmfs/cms.cern.ch/rsync/cms-nanoAOD/jsonpog-integration/POG/EGM/{campaign}/electron.json.gz" + f"/cvmfs/cms.cern.ch/rsync/cms-nanoAOD/jsonpog-integration/POG/EGM/{year}_{campaign}/electron.json.gz" ) if any( np.char.find(np.array(list(config[campaign]["LSF"].keys())), "mu_json") != -1 ): correct_map["MUO"] = correctionlib.CorrectionSet.from_file( - f"src/BTVNanoCommissioning/data/LSF/{campaign}/{config[campaign]['LSF']['mu_json']}" + f"src/BTVNanoCommissioning/data/LSF/{year}_{campaign}/{config[campaign]['LSF']['mu_json']}" ) if any( np.char.find(np.array(list(config[campaign]["LSF"].keys())), "ele_json") != -1 ): correct_map["EGM"] = correctionlib.CorrectionSet.from_file( - f"src/BTVNanoCommissioning/data/LSF/{campaign}/{config[campaign]['LSF']['ele_json']}" + f"src/BTVNanoCommissioning/data/LSF/{year}_{campaign}/{config[campaign]['LSF']['ele_json']}" ) ### Check if any custom corrections needed @@ -255,15 +254,31 @@ def load_SF(campaign, syst=False): full_path, loaduncs=True ) correct_map["roccor"] = rochester_lookup.rochester_lookup(rochester_data) + + ## JME corrections elif SF == "JME": - year = int(re.search(r"\d+", campaign).group()) - if type(config[campaign]["JME"]) == str: - correct_map["JME"] = load_jmefactory(year, campaign) + if "name" in config[campaign]["JME"].keys(): + + if not os.path.exists( + f"src/BTVNanoCommissioning/data/JME/{year}_{campaign}/jec_compiled_{config[campaign]['JME']['name']}.pkl.gz" + ): + _compile_jec_( + year, + campaign, + config[campaign]["JME"], + f"jec_compiled_{config[campaign]['JME']['name']}", + ) + + correct_map["JME"] = _load_jmefactory( + year, + campaign, + f"jec_compiled_{config[campaign]['JME']['name']}.pkl.gz", + ) elif os.path.exists( - f"/cvmfs/cms.cern.ch/rsync/cms-nanoAOD/jsonpog-integration/POG/JME/20{year}_{campaign}/jet_jerc.json.gz" + f"/cvmfs/cms.cern.ch/rsync/cms-nanoAOD/jsonpog-integration/POG/JME/{year}_{campaign}/jet_jerc.json.gz" ): correct_map["JME"] = correctionlib.CorrectionSet.from_file( - f"/cvmfs/cms.cern.ch/rsync/cms-nanoAOD/jsonpog-integration/POG/JME/20{year}_{campaign}/jet_jerc.json.gz" + f"/cvmfs/cms.cern.ch/rsync/cms-nanoAOD/jsonpog-integration/POG/JME/{year}_{campaign}/jet_jerc.json.gz" ) correct_map["JME_cfg"] = config[campaign]["JME"] for dataset in correct_map["JME_cfg"].keys(): @@ -279,23 +294,22 @@ def load_SF(campaign, syst=False): raise ( f"{dataset} has no JEC map : {correct_map['JME_cfg'][dataset]} available" ) - elif SF == "JMAR": if os.path.exists( - f"/cvmfs/cms.cern.ch/rsync/cms-nanoAOD/jsonpog-integration/POG/JME/{campaign}/jmar.json.gz" + f"/cvmfs/cms.cern.ch/rsync/cms-nanoAOD/jsonpog-integration/POG/JME/{year}_{campaign}/jmar.json.gz" ): correct_map["JMAR_cfg"] = { j: f for j, f in config[campaign]["JMAR"].items() } correct_map["JMAR"] = correctionlib.CorrectionSet.from_file( - f"/cvmfs/cms.cern.ch/rsync/cms-nanoAOD/jsonpog-integration/POG/JME/{campaign}/jmar.json.gz" + f"/cvmfs/cms.cern.ch/rsync/cms-nanoAOD/jsonpog-integration/POG/JME/{year}_{campaign}/jmar.json.gz" ) elif SF == "jetveto": ext = extractor() with contextlib.ExitStack() as stack: ext.add_weight_sets( [ - f"{run} {stack.enter_context(importlib.resources.path(f'BTVNanoCommissioning.data.JME.{campaign}',file))}" + f"{run} {stack.enter_context(importlib.resources.path(f'BTVNanoCommissioning.data.JME.{year}_{campaign}',file))}" for run, file in config[campaign]["jetveto"].items() ] ) @@ -350,26 +364,8 @@ def common_shifts(self, events): return shifts -def jetveto(jets, correct_map): - return ak.where( - correct_map["jetveto"][list(correct_map["jetveto"].keys())[0]]( - jets.phi, jets.eta - ) - > 0, - ak.ones_like(jets.eta), - ak.zeros_like(jets.eta), - ) - - ##JEC # FIXME: would be nicer if we can move to correctionlib in the future together with factory and workable -def load_jmefactory(year, campaign): - _jet_path = f"BTVNanoCommissioning.data.JME.{year}_{campaign}" - with importlib.resources.path(_jet_path, config[campaign]["JME"]) as filename: - with gzip.open(filename) as fin: - jmestuff = cloudpickle.load(fin) - - return jmestuff def add_jec_variables(jets, event_rho): @@ -385,6 +381,18 @@ def add_jec_variables(jets, event_rho): return jets +## Jet Veto +def jetveto(jets, correct_map): + return ak.where( + correct_map["jetveto"][list(correct_map["jetveto"].keys())[0]]( + jets.phi, jets.eta + ) + > 0, + ak.ones_like(jets.eta), + ak.zeros_like(jets.eta), + ) + + ## JERC def JME_shifts( shifts, @@ -537,7 +545,7 @@ def JME_shifts( raise NameError jecname = "data" + jecname else: - jecname = "mc" + jecname = "MC" jets = correct_map["JME"]["jet_factory"][jecname].build( add_jec_variables(events.Jet, events.fixedGridRhoFastjetAll), @@ -720,8 +728,16 @@ def Roccor_shifts(shifts, correct_map, events, isRealData, systematic=False): return shifts -## PU weight def puwei(nPU, correct_map, weights, syst=False): + """ + Return pileup weight + Parameters + ---------- + nPU: ak.Array + correct_map : dict + weights : coffea.analysis_tool.weights + syst: "split", "weight_only" + """ if "correctionlib" in str(type(correct_map["PU"])): if syst: return weights.add( @@ -1733,9 +1749,9 @@ def weight_manager(pruned_ev, SF_map, isSyst): weights, syst_wei, ) - if "MUO" in SF_map.keys() and "Muon" in pruned_ev.fields: + if "MUO" in SF_map.keys() and "SelMuon" in pruned_ev.fields: muSFs(pruned_ev.Muon, SF_map, weights, syst_wei, False) - if "EGM" in SF_map.keys() and "Electron" in pruned_ev.fields: + if "EGM" in SF_map.keys() and "SelElectron" in pruned_ev.fields: eleSFs(pruned_ev.Electron, SF_map, weights, syst_wei, False) if "BTV" in SF_map.keys() and "SelJet" in pruned_ev.fields: btagSFs(pruned_ev.SelJet, SF_map, weights, "DeepJetC", syst_wei) diff --git a/src/BTVNanoCommissioning/workflows/BTA_producer.py b/src/BTVNanoCommissioning/workflows/BTA_producer.py index 886e6558..23e3c8dd 100644 --- a/src/BTVNanoCommissioning/workflows/BTA_producer.py +++ b/src/BTVNanoCommissioning/workflows/BTA_producer.py @@ -39,7 +39,7 @@ def __init__( self._campaign = campaign self.chunksize = chunksize - self.SF_map = load_SF(self._campaign) + self.SF_map = load_SF(self._year, self._campaign) # addPFMuons: if true, include the TrkInc and PFMuon collections, used by QCD based SF methods # addAllTracks: if true, include the Track collection used for JP calibration; # when running on data, requires events passing HLT_PFJet80 diff --git a/src/BTVNanoCommissioning/workflows/BTA_ttbar_producer.py b/src/BTVNanoCommissioning/workflows/BTA_ttbar_producer.py index a670e6cc..385f65f2 100644 --- a/src/BTVNanoCommissioning/workflows/BTA_ttbar_producer.py +++ b/src/BTVNanoCommissioning/workflows/BTA_ttbar_producer.py @@ -30,7 +30,7 @@ def __init__( self.chunksize = chunksize self.syst = isSyst self.name = name - self.SF_map = load_SF(self._campaign) + self.SF_map = load_SF(self._year, self._campaign) ### Custom initialzations for BTA_ttbar workflow ### diff --git a/src/BTVNanoCommissioning/workflows/QCD_soft_mu_validation.py b/src/BTVNanoCommissioning/workflows/QCD_soft_mu_validation.py index 7b18aef8..82e211f0 100644 --- a/src/BTVNanoCommissioning/workflows/QCD_soft_mu_validation.py +++ b/src/BTVNanoCommissioning/workflows/QCD_soft_mu_validation.py @@ -250,7 +250,6 @@ def process_shift(self, events, shift_name): ak.values_astype(pruned_ev.luminosityBlock, np.float32), ) weights.add("psweight", psweight) - genflavor = ak.zeros_like(sjets.pt, dtype=int) if "JetSVs" in events.fields: if len(lj_matched_JetSVs) > 0: lj_matched_JetSVs_genflav = ak.zeros_like( diff --git a/src/BTVNanoCommissioning/workflows/QCD_validation.py b/src/BTVNanoCommissioning/workflows/QCD_validation.py index 9e978716..df5b5fdc 100644 --- a/src/BTVNanoCommissioning/workflows/QCD_validation.py +++ b/src/BTVNanoCommissioning/workflows/QCD_validation.py @@ -38,7 +38,7 @@ def __init__( self.lumiMask = load_lumi(self._campaign) self.chunksize = chunksize ## Load corrections - self.SF_map = load_SF(self._campaign) + self.SF_map = load_SF(self._year, self._campaign) @property def accumulator(self): @@ -180,7 +180,6 @@ def process_shift(self, events, shift_name): ak.values_astype(pruned_ev.luminosityBlock, np.float32), ) weights.add("psweight", psweight) - genflavor = ak.zeros_like(sjets.pt, dtype=int) if "JetSVs" in events.fields: if len(lj_matched_JetSVs) > 0: lj_matched_JetSVs_genflav = ak.zeros_like( diff --git a/src/BTVNanoCommissioning/workflows/ctag_DY_valid_sf.py b/src/BTVNanoCommissioning/workflows/ctag_DY_valid_sf.py index 0b159dbb..ab2c71eb 100644 --- a/src/BTVNanoCommissioning/workflows/ctag_DY_valid_sf.py +++ b/src/BTVNanoCommissioning/workflows/ctag_DY_valid_sf.py @@ -46,7 +46,7 @@ def __init__( self.chunksize = chunksize self.selMod = selectionModifier ## Load corrections - self.SF_map = load_SF(self._campaign) + self.SF_map = load_SF(self._year, self._campaign) @property def accumulator(self): diff --git a/src/BTVNanoCommissioning/workflows/ctag_Wctt_valid_sf.py b/src/BTVNanoCommissioning/workflows/ctag_Wctt_valid_sf.py index 064c72ae..3fa9eab7 100644 --- a/src/BTVNanoCommissioning/workflows/ctag_Wctt_valid_sf.py +++ b/src/BTVNanoCommissioning/workflows/ctag_Wctt_valid_sf.py @@ -44,7 +44,7 @@ def __init__( self.lumiMask = load_lumi(self._campaign) self.chunksize = chunksize ## Load corrections - self.SF_map = load_SF(self._campaign) + self.SF_map = load_SF(self._year, self._campaign) self.selMod = selectionModifier @property diff --git a/src/BTVNanoCommissioning/workflows/ctag_dileptt_valid_sf.py b/src/BTVNanoCommissioning/workflows/ctag_dileptt_valid_sf.py index 82d63d9d..683006b0 100644 --- a/src/BTVNanoCommissioning/workflows/ctag_dileptt_valid_sf.py +++ b/src/BTVNanoCommissioning/workflows/ctag_dileptt_valid_sf.py @@ -46,7 +46,7 @@ def __init__( self.chunksize = chunksize self.selMod = selectionModifier ## Load corrections - self.SF_map = load_SF(self._campaign) + self.SF_map = load_SF(self._year, self._campaign) @property def accumulator(self): diff --git a/src/BTVNanoCommissioning/workflows/ctag_emdileptt_valid_sf.py b/src/BTVNanoCommissioning/workflows/ctag_emdileptt_valid_sf.py index d20cc1c3..66e73e77 100644 --- a/src/BTVNanoCommissioning/workflows/ctag_emdileptt_valid_sf.py +++ b/src/BTVNanoCommissioning/workflows/ctag_emdileptt_valid_sf.py @@ -42,7 +42,7 @@ def __init__( self.lumiMask = load_lumi(self._campaign) self.chunksize = chunksize ## Load corrections - self.SF_map = load_SF(self._campaign) + self.SF_map = load_SF(self._year, self._campaign) @property def accumulator(self): @@ -167,7 +167,7 @@ def process_shift(self, events, shift_name): False, axis=-1, ) - mu_jet = event_jet[jetsel] + mu_jet = event_jet[mujetsel] req_mujet = ak.count(mu_jet.pt, axis=1) >= 1 ## store jet index for PFCands, create mask on the jet index diff --git a/src/BTVNanoCommissioning/workflows/example.py b/src/BTVNanoCommissioning/workflows/example.py index dc0aee5d..755d86b2 100644 --- a/src/BTVNanoCommissioning/workflows/example.py +++ b/src/BTVNanoCommissioning/workflows/example.py @@ -52,7 +52,7 @@ def __init__( self.lumiMask = load_lumi(self._campaign) self.chunksize = chunksize ## Load corrections - self.SF_map = load_SF(self._campaign) + self.SF_map = load_SF(self._year, self._campaign) @property def accumulator(self): diff --git a/src/BTVNanoCommissioning/workflows/ttdilep_valid_sf.py b/src/BTVNanoCommissioning/workflows/ttdilep_valid_sf.py index a2446d87..6b636e06 100644 --- a/src/BTVNanoCommissioning/workflows/ttdilep_valid_sf.py +++ b/src/BTVNanoCommissioning/workflows/ttdilep_valid_sf.py @@ -48,7 +48,7 @@ def __init__( self.lumiMask = load_lumi(self._campaign) self.chunksize = chunksize ## Load corrections - self.SF_map = load_SF(self._campaign) + self.SF_map = load_SF(self._year, self._campaign) @property def accumulator(self): diff --git a/src/BTVNanoCommissioning/workflows/ttsemilep_valid_sf.py b/src/BTVNanoCommissioning/workflows/ttsemilep_valid_sf.py index b13f3d63..c2c6afdc 100644 --- a/src/BTVNanoCommissioning/workflows/ttsemilep_valid_sf.py +++ b/src/BTVNanoCommissioning/workflows/ttsemilep_valid_sf.py @@ -48,7 +48,7 @@ def __init__( ### Added selection for ttbar semileptonic self.ttaddsel = selectionModifier ## Load corrections - self.SF_map = load_SF(self._campaign) + self.SF_map = load_SF(self._year, self._campaign) @property def accumulator(self): diff --git a/src/BTVNanoCommissioning/workflows/validation.py b/src/BTVNanoCommissioning/workflows/validation.py index d648cf1c..568f7a5c 100644 --- a/src/BTVNanoCommissioning/workflows/validation.py +++ b/src/BTVNanoCommissioning/workflows/validation.py @@ -48,7 +48,7 @@ def __init__( self.lumiMask = load_lumi(self._campaign) self.chunksize = chunksize ## Load corrections - self.SF_map = load_SF(self._campaign) + self.SF_map = load_SF(self._year, self._campaign) @property def accumulator(self):