ATLAS Offline Software
Loading...
Searching...
No Matches
python.JetCalibAlgConfig.JetCalibAlgConfig Class Reference
Inheritance diagram for python.JetCalibAlgConfig.JetCalibAlgConfig:
Collaboration diagram for python.JetCalibAlgConfig.JetCalibAlgConfig:

Public Member Functions

 __init__ (self)
 instanceName (self)
 makeAlgs (self, config)

Public Attributes

 calibratedJets
 inputJets
 CalibFile

Detailed Description

Definition at line 15 of file JetCalibAlgConfig.py.

Constructor & Destructor Documentation

◆ __init__()

python.JetCalibAlgConfig.JetCalibAlgConfig.__init__ ( self)

Definition at line 17 of file JetCalibAlgConfig.py.

17 def __init__(self):
18 super().__init__()
19
20 self.addOption('inputJets', '', type=str,
21 info="the name of the input jet container, also used to look up the "
22 "calibration configuration (unless `CalibFile` is set).")
23 self.addOption('calibratedJets', '', type=str, meta={'role':'container'},
24 info="the name of the output (calibrated) jet container.")
25 self.addOption('context', 'AnalysisLatest', type=str,
26 info="the calibration context used to look up the calibration "
27 "configuration file (ignored if `CalibFile` is set).")
28 self.addOption('CalibFile', '', type=str,
29 info="expert override: path to the calibration configuration file, "
30 "skipping the lookup based on `context` and `inputJets`.")
31

Member Function Documentation

◆ instanceName()

python.JetCalibAlgConfig.JetCalibAlgConfig.instanceName ( self)
Return the instance name for this block

Definition at line 32 of file JetCalibAlgConfig.py.

32 def instanceName (self) :
33 """Return the instance name for this block"""
34 return self.calibratedJets
35

◆ makeAlgs()

python.JetCalibAlgConfig.JetCalibAlgConfig.makeAlgs ( self,
config )

Definition at line 36 of file JetCalibAlgConfig.py.

36 def makeAlgs(self, config):
37
38 config.setSourceName (self.calibratedJets, self.inputJets, originalName = self.inputJets)
39
40 if config.wantCopy (self.calibratedJets) :
41 alg = config.createAlgorithm( 'CP::AsgShallowCopyAlg', 'JetShallowCopyAlg' )
42 alg.input = config.readName (self.calibratedJets)
43 alg.output = config.copyName (self.calibratedJets)
44
45 alg = config.createAlgorithm('CP::JetCalibAlg', 'JetCalibAlg')
46 alg.jets = config.readName(self.calibratedJets)
47
48 if self.CalibFile:
49 calibFile = self.CalibFile
50 else:
51 from JetCalibTools.JetCalibToolsCfg import get_calib_cfg_path, get_jet_collection_name
52 jetcollection = self.inputJets
53 if jetcollection.endswith('Jets'):
54 jetcollection = jetcollection[:-4]
55 jetcollection = get_jet_collection_name(jetcollection)
56 calibFile = get_calib_cfg_path(self.context, jetcollection)
57
58 calibtool = calibToolFromConfigFile(config.flags, calibFile, name=self.inputJets+"Calib")
59
60 if isAthena:
61 # In this case calibtool is a regular configurable and the usual syntax works:
62 alg.calibrationTool = calibtool
63 else:
64 # AnalysisBase : use the special JetAnalysisCommon syntax to propagate the config of this tool:
65 calibtool.toToolInAnaAlg(alg, "calibrationTool")

Member Data Documentation

◆ CalibFile

python.JetCalibAlgConfig.JetCalibAlgConfig.CalibFile

Definition at line 48 of file JetCalibAlgConfig.py.

◆ calibratedJets

python.JetCalibAlgConfig.JetCalibAlgConfig.calibratedJets

Definition at line 38 of file JetCalibAlgConfig.py.

◆ inputJets

python.JetCalibAlgConfig.JetCalibAlgConfig.inputJets

Definition at line 38 of file JetCalibAlgConfig.py.


The documentation for this class was generated from the following file: