Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions mkShapesRDF/processor/framework/Steps_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -1354,7 +1354,7 @@
# "JES_modules_MC_18UL",
# "JERsMCUL",
# # "FatJERsMCUL",
"btagPerJet_DeepCSV_2018UL",
# "btagPerJet_DeepCSV_2018UL",
"btagPerJet_DeepJet_2018UL",
# "JetPUID_SF_UL",
# "rochesterMC",
Expand Down Expand Up @@ -1707,7 +1707,7 @@
"do4MC": True,
"do4Data": False,
"import": "mkShapesRDF.processor.modules.btagSFProducerLatinos",
"declare": 'btagPerJet_DeepCSV_2018UL = lambda : btagSFProducerLatinos(2018, "deepCSV", ["shape"], "shape", "RPLME_FW/processor/data/jsonpog-integration/POG/BTV/2018_UL/btagging.json.gz", ["jes","jesAbsolute","jesAbsolute_2018","jesBBEC1","jesBBEC1_2018","jesEC2","jesEC2_2018","jesFlavorQCD","jesHF","jesHF_2018","jesRelativeBal","jesRelativeSample_2018"])',
"declare": 'btagPerJet_DeepCSV_2018UL = lambda : btagSFProducerLatinos("2018", "deepCSV", ["shape"], "shape", "RPLME_FW/processor/data/jsonpog-integration/POG/BTV/2018_UL/btagging.json.gz", ["jes","jesAbsolute","jesAbsolute_2018","jesBBEC1","jesBBEC1_2018","jesEC2","jesEC2_2018","jesFlavorQCD","jesHF","jesHF_2018","jesRelativeBal","jesRelativeSample_2018"])',
"module": "btagPerJet_DeepCSV_2018UL()",
},

Expand All @@ -1716,7 +1716,7 @@
"do4MC": True,
"do4Data": False,
"import": "mkShapesRDF.processor.modules.btagSFProducerLatinos",
"declare": 'btagPerJet_DeepJet_2018UL = lambda : btagSFProducerLatinos(2018, "deepJet", ["shape"], "shape", "RPLME_FW/processor/data/jsonpog-integration/POG/BTV/2018_UL/btagging.json.gz", ["jes","jesAbsolute","jesAbsolute_2018","jesBBEC1","jesBBEC1_2018","jesEC2","jesEC2_2018","jesFlavorQCD","jesHF","jesHF_2018","jesRelativeBal","jesRelativeSample_2018"])',
"declare": 'btagPerJet_DeepJet_2018UL = lambda : btagSFProducerLatinos("2018", "deepJet", ["shape"], "shape", "RPLME_FW/processor/data/jsonpog-integration/POG/BTV/2018_UL/btagging.json.gz", ["jes","jesAbsolute","jesAbsolute_2018","jesBBEC1","jesBBEC1_2018","jesEC2","jesEC2_2018","jesFlavorQCD","jesHF","jesHF_2018","jesRelativeBal","jesRelativeSample_2018"])',
"module": "btagPerJet_DeepJet_2018UL()",
},
######## btagging SF
Expand Down
20 changes: 16 additions & 4 deletions mkShapesRDF/processor/modules/btagSFProducerLatinos.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,30 @@ def __init__(
self.max_abs_eta = """2.49999"""
self.min_pt = """20.0001"""

if "2022" or "2023" in era:
if ("2022" in era) or ("2023" in era):
print ("here era =", era)
self.prodTime = "Summer"
else:
print("btagSFProducerLatinos")
print("-------------------")
print("Warning: Production season unknown for " + era)
print("Please check!!")
self.prodTime = ""

print ("self.prodTime = ", self.prodTime)

# NB: "era" must be a string
print ("era = ", era)
year = re.findall(r'\d+', era)[0]
key = era.split("Full20")[1].split("v")[0]

if framework_path:
if "Full20" in era:
key = era.split("Full20")[1].split("v")[0]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is key defined only here? I.e. Can it be used in line 57?

Does this if handle also the 2016 case, where if I remember correctly, we split into 2016HIPM and 2016noHIPM (without Full)?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have not tested yet on 2016, but I will need to do it soon and let you know.
The "key" was there in the code before ... not sure why/where it was introduced

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. Then, I would wait for the 2016 test before merging.

else:
key = ""

if "btagging.json.gz" in framework_path:
# in this case in the configuration file I have defined exactly the json file and no need for magic
pathToJson = framework_path
elif framework_path:
pathToJson = framework_path.split("framework")[0] + "/processor/data/jsonpog-integration/POG/BTV/" + year + "_" + self.prodTime + key + "/btagging.json.gz"
else:
pathToJson = os.path.dirname(os.path.dirname(__file__)).split("processor")[0] + "/processor/data/jsonpog-integration/POG/BTV/" + year + "_" + self.prodTime + key + "/btagging.json.gz"
Expand Down