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

Functions

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

Variables

 jetcaliblog = Logging.logging.getLogger('JetCalibToolsConfig')
list all = ['getJetCalibTool']
dict calibdic

Function Documentation

◆ defineJetCalibTool()

JetCalibToolsCfg.defineJetCalibTool ( jetdef,
modspec )

Definition at line 17 of file JetCalibToolsCfg.py.

17def defineJetCalibTool(jetdef, modspec):
18 from JetCalibTools.JetCalibStepsConfig import calibToolFromConfigFile
19
20 jetcollection = jetdef.basename
21 cfg = calibdic[f"{jetdef.basename}:{modspec}"]
22 path_configFile = PathResolver.FindCalibFile(cfg)
23 toolname = "jetcalib_new_{0}_{1}".format(jetcollection,modspec)
24 jct = calibToolFromConfigFile(jetdef._cflags, path_configFile, toolname)
25
26 return jct
27
28# This method extends the basic config getter to specify the requisite jet
29# moments or other inputs
static std::string FindCalibFile(const std::string &logical_file_name)

◆ getJetCalibToolPrereqs()

JetCalibToolsCfg.getJetCalibToolPrereqs ( jetdef,
modspec )

Definition at line 30 of file JetCalibToolsCfg.py.

30def getJetCalibToolPrereqs(jetdef, modspec):
31 from JetCalibTools.JetCalibStepsConfig import load_yaml_cfg
32
33 cfg = calibdic[f"{jetdef.basename}:{modspec}"]
34 configDic = load_yaml_cfg(cfg)
35
36 prereqs = ["mod:ConstitFourMom"]
37 pvname = "PrimaryVertices" # this can be set dinamically in future
38
39 for step, step_config in configDic.items():
40 # JetArea
41 if step_config.get("DoJetArea", False):
42 if modspec.startswith("Trig"):
43 prereqs.append("input:HLT_EventDensity")
44 elif pvname == "PrimaryVertices_initial":
45 prereqs.append("input:EventDensityCustomVtxGNN")
46 elif pvname != "PrimaryVertices":
47 prereqs.append("input:EventDensityCustomVtx")
48 else:
49 prereqs.append(inputsFromContext("EventDensity")(jetdef))
50
51 # read prereqs from context or default config block
52 prereq_block = step_config.get("prereqs", {})
53 step_prereqs = prereq_block.get(modspec, prereq_block.get("default", []))
54 prereqs.extend(step_prereqs)
55
56 # remove duplication and keep order
57 seen = set()
58 prereqs_unique = []
59 for p in prereqs:
60 if p not in seen:
61 prereqs_unique.append(p)
62 seen.add(p)
63
64 return prereqs_unique
65
STL class.

Variable Documentation

◆ all

list JetCalibToolsCfg.all = ['getJetCalibTool']

Definition at line 9 of file JetCalibToolsCfg.py.

◆ calibdic

dict JetCalibToolsCfg.calibdic
Initial value:
1= {
2 "AntiKt4EMPFlow:T0" : "JetCalibTools/calibConfigExample.yaml",
3 "AntiKt4EMPFlow:TrigRun2" : "JetCalibTools/calibConfigExample.yaml", # this is for testing
4}

Definition at line 11 of file JetCalibToolsCfg.py.

◆ jetcaliblog

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

Definition at line 7 of file JetCalibToolsCfg.py.