3from JetRecConfig.StandardJetConstits
import inputsFromContext
4from PathResolver
import PathResolver
6from AthenaCommon
import Logging
7jetcaliblog = Logging.logging.getLogger(
'JetCalibToolsConfig')
9from AthenaConfiguration.Enums
import LHCPeriod
11all = [
'getJetCalibTool']
13commonPath =
'/eos/atlas/atlascerngroupdisk/perf-jets/JSV/JetCalibToolsMigration/configFiles/'
16 "AntiKt4EMPFlow": commonPath+
"T0/EMPFlow/JES_MC15cRecommendation_PFlow_Aug2016_rel21.yaml",
17 "AntiKt4EMTopo": commonPath+
"T0/EMTopo/JES_MC15cRecommendation_May2016_rel21.yaml",
18 "AntiKt4LCTopo": commonPath+
"T0/LCTopo/JES_MC15cRecommendation_May2016_rel21.yaml",
19 "AntiKt10UFOCSSKSoftDropBeta100Zcut10": commonPath+
"LatestRecommendations/largeR_Run23/JES_MC20PreRecommendation_R10_UFO_CSSK_SoftDrop_JMS_R21Insitu_26Nov2024.yaml",
22calibdic_analysis_Run2 = {
23 "AntiKt4EMPFlow": commonPath+
"LatestRecommendations/smallR_mc20_Run2/PreRec_R22_PFlow_ResPU_EtaJES_GSC_February23_230215.yaml",
24 "AntiKt4EMTopo": commonPath+
"LatestRecommendations/EMTopo/PreRec_R22_EMTopo_ResPU_EtaJES_October23_231024.yaml",
25 "AntiKt10UFOCSSKSoftDropBeta100Zcut10": commonPath+
"LatestRecommendations/largeR_Run23/JES_MC20PreRecommendation_R10_UFO_CSSK_SoftDrop_JMS_R21Insitu_26Nov2024.yaml",
28calibdic_analysis_Run3 = {
29 "AntiKt4EMPFlow": commonPath+
"LatestRecommendations/smallR_mc23_Run3/AntiKt4EMPFlow_MC23a_PreRecR22_Phase2_CalibConfig_ResPU_EtaJES_GSC_241208_InSitu.yaml",
30 "AntiKt4EMTopo": commonPath+
"LatestRecommendations/EMTopo/PreRec_R22_EMTopo_ResPU_EtaJES_October23_231024.yaml",
31 "AntiKt10UFOCSSKSoftDropBeta100Zcut10": commonPath+
"LatestRecommendations/largeR_Run23/JES_MC20PreRecommendation_R10_UFO_CSSK_SoftDrop_JMS_R21Insitu_26Nov2024.yaml",
36 "Run2": calibdic_analysis_Run2,
37 "Run3": calibdic_analysis_Run3,
42 from JetCalibTools.JetCalibStepsConfig
import calibToolFromConfigFile
47 toolname =
"jetcalib_new_{0}_{1}".format(jetdef.basename,modspec)
48 jct = calibToolFromConfigFile(jetdef._cflags, path_configFile, toolname, forceCalibSeq, calibSeq)
55 from JetCalibTools.JetCalibStepsConfig
import load_yaml_cfg
57 cfg = calibdic_T0[jetdef.basename]
58 configDic = load_yaml_cfg(cfg)
60 prereqs = [
"mod:ConstitFourMom"]
61 pvname =
"PrimaryVertices"
63 for step, step_config
in configDic.items():
65 if step_config.get(
"DoJetArea",
False):
66 if modspec.startswith(
"Trig"):
67 prereqs.append(
"input:HLT_EventDensity")
68 elif pvname ==
"PrimaryVertices_initial":
69 prereqs.append(
"input:EventDensityCustomVtxGNN")
70 elif pvname !=
"PrimaryVertices":
71 prereqs.append(
"input:EventDensityCustomVtx")
73 prereqs.append(inputsFromContext(
"EventDensity")(jetdef))
76 prereq_block = step_config.get(
"prereqs", {})
77 step_prereqs = prereq_block.get(modspec, prereq_block.get(
"default", []))
78 prereqs.extend(step_prereqs)
85 prereqs_unique.append(p)
93 calibspecs = modspec.split(
':')
94 context = calibspecs[0]
103 jetcollection = jetdef.basename
105 if "_noElectrons" in jetcollection:
106 jetcollection = jetcollection.replace(
"_noElectrons",
"")
107 if "_noMuons" in jetcollection:
108 jetcollection = jetcollection.replace(
"_noMuons",
"")
109 if "_noLeptons" in jetcollection :
110 jetcollection = jetcollection.replace(
"_noLeptons",
"")
111 if "_tauSeedEleRM" in jetcollection :
112 jetcollection = jetcollection.replace(
"_tauSeedEleRM",
"")
120 forceCalibSeq =
False
122 if len(calibspecs) > 2:
124 calibSeq = calibspecs[2]
126 elif context ==
"T0":
128 calibSeq =
"JetArea_Residual_EtaJES"
129 if jetcollection ==
"AntiKt10UFOCSSKSoftDropBeta100Zcut10":
130 calibSeq =
"EtaJES_JMS"
135 if context ==
"AnalysisLatest":
136 if jetdef._cflags.GeoModel.Run == LHCPeriod.Run2:
137 cfg = calibdic[
"Run2"][jetcollection]
138 elif jetdef._cflags.GeoModel.Run == LHCPeriod.Run3:
139 cfg = calibdic[
"Run3"][jetcollection]
140 elif jetdef._cflags.GeoModel.Run >= LHCPeriod.Run4:
141 cfg = calibdic[
"HLLHC"][jetcollection]
143 cfg = calibdic[context][jetcollection]
145 return cfg, calibSeq, forceCalibSeq
static std::string FindCalibFile(const std::string &logical_file_name)