ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
Algorithms
JetAnalysisAlgorithms
python
JetCalibAlgConfig.py
Go to the documentation of this file.
1
# Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2
3
"""
4
JetCalibAlgConfig
5
6
This module is currently demonstrates a ConfigBlock for a single JetCalibAlg using the new Jet calibration tools.
7
It is loosely inspired from
8
9
"""
10
# AnaAlgorithm import(s):
11
from
AnalysisAlgorithmsConfig.ConfigBlock
import
ConfigBlock
12
from
AnaAlgorithm.DualUseConfig
import
isAthena
13
14
# Jet config imports
15
from
JetCalibTools.JetCalibStepsConfig
import
calibToolFromConfigFile
16
17
class
JetCalibAlgConfig
(ConfigBlock):
18
19
def
__init__
(self):
20
super(JetCalibAlgConfig, self).
__init__
()
21
22
self.addOption(
'inputJets'
,
''
, type=str)
23
self.addOption(
'calibratedJets'
,
''
, type=str)
24
25
26
self.addOption(
'CalibFile'
,
''
, type=str)
27
28
def
makeAlgs
(self, config):
29
30
config.setSourceName (self.
calibratedJets
, self.
inputJets
, originalName = self.
inputJets
)
31
32
# Perform a shallow copy of the input :
33
if
config.wantCopy (self.
calibratedJets
) :
34
alg = config.createAlgorithm(
'CP::AsgShallowCopyAlg'
,
'JetShallowCopyAlg'
)
35
alg.input = config.readName (self.
calibratedJets
)
36
alg.output = config.copyName (self.
calibratedJets
)
37
38
alg = config.createAlgorithm(
'CP::JetCalibAlg'
,
'JetCalibAlg'
)
39
alg.jets = config.readName(self.
calibratedJets
)
40
alg.OutputLevel = 3
41
42
# Call calibToolFromConfigFile
43
calibtool = calibToolFromConfigFile(config.flags, self.CalibFile, name=self.
inputJets
+
"Calib"
)
44
calibtool.OutputLevel=3
45
46
if
isAthena:
47
# In this case calibtool is a regular configurable and the usual syntax works:
48
alg.calibrationTool = calibtool
49
else
:
50
# AnalysisBase : use the special JetAnalysisCommon syntax to propagate the config of this tool:
51
calibtool.toToolInAnaAlg(alg,
"calibrationTool"
)
52
53
54
55
56
57
python.JetCalibAlgConfig.JetCalibAlgConfig
Definition
JetCalibAlgConfig.py:17
python.JetCalibAlgConfig.JetCalibAlgConfig.__init__
__init__(self)
Definition
JetCalibAlgConfig.py:19
python.JetCalibAlgConfig.JetCalibAlgConfig.makeAlgs
makeAlgs(self, config)
Definition
JetCalibAlgConfig.py:28
python.JetCalibAlgConfig.JetCalibAlgConfig.inputJets
inputJets
Definition
JetCalibAlgConfig.py:30
python.JetCalibAlgConfig.JetCalibAlgConfig.calibratedJets
calibratedJets
Definition
JetCalibAlgConfig.py:30
Generated on
for ATLAS Offline Software by
1.17.0