ATLAS Offline Software
Loading...
Searching...
No Matches
JetCalibToolsCfg Namespace Reference

Functions

 defineJetCalibTool (jetdef, modspec)
 getJetCalibToolPrereqs (jetdef, modspec)
 getJetCalibToolSettings (jetdef, modspec)

Variables

 jetcaliblog = Logging.logging.getLogger('JetCalibToolsConfig')
list all = ['getJetCalibTool']
str commonPath = '/eos/atlas/atlascerngroupdisk/perf-jets/JSV/JetCalibToolsMigration/configFiles/'
dict calibdic_T0
dict calibdic_analysis_Run2
dict calibdic_analysis_Run3
dict calibdic

Function Documentation

◆ defineJetCalibTool()

JetCalibToolsCfg.defineJetCalibTool ( jetdef,
modspec )

Definition at line 41 of file JetCalibToolsCfg.py.

41def defineJetCalibTool(jetdef, modspec):
42 from JetCalibTools.JetCalibStepsConfig import calibToolFromConfigFile
43
44 # Get the yaml file and calibration sequence
45 cfg, calibSeq, forceCalibSeq = getJetCalibToolSettings(jetdef, modspec)
46 path_configFile = PathResolver.FindCalibFile(cfg)
47 toolname = "jetcalib_new_{0}_{1}".format(jetdef.basename,modspec)
48 jct = calibToolFromConfigFile(jetdef._cflags, path_configFile, toolname, forceCalibSeq, calibSeq)
49
50 return jct
51
52# This method extends the basic config getter to specify the requisite jet
53# moments or other inputs
static std::string FindCalibFile(const std::string &logical_file_name)

◆ getJetCalibToolPrereqs()

JetCalibToolsCfg.getJetCalibToolPrereqs ( jetdef,
modspec )

Definition at line 54 of file JetCalibToolsCfg.py.

54def getJetCalibToolPrereqs(jetdef, modspec):
55 from JetCalibTools.JetCalibStepsConfig import load_yaml_cfg
56
57 cfg = calibdic_T0[jetdef.basename]
58 configDic = load_yaml_cfg(cfg)
59
60 prereqs = ["mod:ConstitFourMom"]
61 pvname = "PrimaryVertices" # this can be set dinamically in future
62
63 for step, step_config in configDic.items():
64 # JetArea
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")
72 else:
73 prereqs.append(inputsFromContext("EventDensity")(jetdef))
74
75 # read prereqs from context or default config block
76 prereq_block = step_config.get("prereqs", {})
77 step_prereqs = prereq_block.get(modspec, prereq_block.get("default", []))
78 prereqs.extend(step_prereqs)
79
80 # remove duplication and keep order
81 seen = set()
82 prereqs_unique = []
83 for p in prereqs:
84 if p not in seen:
85 prereqs_unique.append(p)
86 seen.add(p)
87
88 return prereqs_unique
89
90# Get specific settings for JetCalibTools
STL class.

◆ getJetCalibToolSettings()

JetCalibToolsCfg.getJetCalibToolSettings ( jetdef,
modspec )

Definition at line 91 of file JetCalibToolsCfg.py.

91def getJetCalibToolSettings(jetdef, modspec):
92
93 calibspecs = modspec.split(':')
94 context = calibspecs[0]
95
96
99
100 # For some specific jet collections, e.g. lepton-free PFlow jets,
101 # we want to apply the calibrations of the default jet PFlow jets
102
103 jetcollection = jetdef.basename
104
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","")
113
114
117
118 # Per default, the calibration sequence is determined from the yaml file
119 calibSeq = ""
120 forceCalibSeq = False
121 # Check if specified in configuration (e.g. for low / no pT jet collections)
122 if len(calibspecs) > 2:
123 forceCalibSeq = True
124 calibSeq = calibspecs[2]
125 # Check if T0 configuration, if yes, want to apply only certain calibrations
126 elif context == "T0":
127 forceCalibSeq = True
128 calibSeq = "JetArea_Residual_EtaJES"
129 if jetcollection == "AntiKt10UFOCSSKSoftDropBeta100Zcut10":
130 calibSeq = "EtaJES_JMS"
131
132
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]
142 else:
143 cfg = calibdic[context][jetcollection]
144
145 return cfg, calibSeq, forceCalibSeq

Variable Documentation

◆ all

list JetCalibToolsCfg.all = ['getJetCalibTool']

Definition at line 11 of file JetCalibToolsCfg.py.

◆ calibdic

dict JetCalibToolsCfg.calibdic
Initial value:
1= {
2 "T0": calibdic_T0,
3 "Run2": calibdic_analysis_Run2,
4 "Run3": calibdic_analysis_Run3,
5}

Definition at line 34 of file JetCalibToolsCfg.py.

◆ calibdic_analysis_Run2

dict JetCalibToolsCfg.calibdic_analysis_Run2
Initial value:
1= {
2 "AntiKt4EMPFlow": commonPath+"LatestRecommendations/smallR_mc20_Run2/PreRec_R22_PFlow_ResPU_EtaJES_GSC_February23_230215.yaml",
3 "AntiKt4EMTopo": commonPath+"LatestRecommendations/EMTopo/PreRec_R22_EMTopo_ResPU_EtaJES_October23_231024.yaml",
4 "AntiKt10UFOCSSKSoftDropBeta100Zcut10": commonPath+"LatestRecommendations/largeR_Run23/JES_MC20PreRecommendation_R10_UFO_CSSK_SoftDrop_JMS_R21Insitu_26Nov2024.yaml",
5}

Definition at line 22 of file JetCalibToolsCfg.py.

◆ calibdic_analysis_Run3

dict JetCalibToolsCfg.calibdic_analysis_Run3
Initial value:
1= {
2 "AntiKt4EMPFlow": commonPath+"LatestRecommendations/smallR_mc23_Run3/AntiKt4EMPFlow_MC23a_PreRecR22_Phase2_CalibConfig_ResPU_EtaJES_GSC_241208_InSitu.yaml",
3 "AntiKt4EMTopo": commonPath+"LatestRecommendations/EMTopo/PreRec_R22_EMTopo_ResPU_EtaJES_October23_231024.yaml",
4 "AntiKt10UFOCSSKSoftDropBeta100Zcut10": commonPath+"LatestRecommendations/largeR_Run23/JES_MC20PreRecommendation_R10_UFO_CSSK_SoftDrop_JMS_R21Insitu_26Nov2024.yaml",
5}

Definition at line 28 of file JetCalibToolsCfg.py.

◆ calibdic_T0

dict JetCalibToolsCfg.calibdic_T0
Initial value:
1= {
2 "AntiKt4EMPFlow": commonPath+"T0/EMPFlow/JES_MC15cRecommendation_PFlow_Aug2016_rel21.yaml",
3 "AntiKt4EMTopo": commonPath+"T0/EMTopo/JES_MC15cRecommendation_May2016_rel21.yaml",
4 "AntiKt4LCTopo": commonPath+"T0/LCTopo/JES_MC15cRecommendation_May2016_rel21.yaml",
5 "AntiKt10UFOCSSKSoftDropBeta100Zcut10": commonPath+"LatestRecommendations/largeR_Run23/JES_MC20PreRecommendation_R10_UFO_CSSK_SoftDrop_JMS_R21Insitu_26Nov2024.yaml",
6}

Definition at line 15 of file JetCalibToolsCfg.py.

◆ commonPath

str JetCalibToolsCfg.commonPath = '/eos/atlas/atlascerngroupdisk/perf-jets/JSV/JetCalibToolsMigration/configFiles/'

Definition at line 13 of file JetCalibToolsCfg.py.

◆ jetcaliblog

JetCalibToolsCfg.jetcaliblog = Logging.logging.getLogger('JetCalibToolsConfig')

Definition at line 7 of file JetCalibToolsCfg.py.