ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
egamma
egammaConfig
python
egammaSteeringConfig.py
Go to the documentation of this file.
1
# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2
3
""" Instantiate the things needed upstream the main egamma Reconstruction,
4
EGamma Reconstruction,
5
Output Item Lists,
6
xAOD related Thinning
7
"""
8
9
from
AthenaCommon.Logging
import
logging
10
from
AthenaConfiguration.ComponentAccumulator
import
ComponentAccumulator
11
12
13
def
EGammaSteeringCfg
(flags,
14
name="EGammaSteering"):
15
16
mlog = logging.getLogger(name)
17
mlog.info(
'Starting EGamma Steering'
)
18
19
acc = ComponentAccumulator()
20
21
# e/gamma main Reconstruction
22
from
egammaConfig.egammaReconstructionConfig
import
(
23
egammaReconstructionCfg)
24
acc.merge(egammaReconstructionCfg(flags))
25
26
# Add e/gamma related containers to the output stream
27
if
flags.Output.doWriteESD
or
flags.Output.doWriteAOD:
28
from
egammaConfig.egammaOutputConfig
import
(
29
egammaOutputCfg)
30
acc.merge(egammaOutputCfg(flags))
31
32
# LRT Reconstruction
33
if
flags.Tracking.doLargeD0:
34
from
egammaConfig.egammaLRTReconstructionConfig
import
(
35
egammaLRTReconstructionCfg)
36
acc.merge(egammaLRTReconstructionCfg(flags))
37
38
# LRT output
39
if
flags.Output.doWriteESD
or
flags.Output.doWriteAOD:
40
from
egammaConfig.egammaLRTOutputConfig
import
(
41
egammaLRTOutputCfg)
42
acc.merge(egammaLRTOutputCfg(flags))
43
44
# Add e/gamma xAOD thinning
45
if
flags.Output.doWriteAOD:
46
from
egammaConfig.egammaxAODThinningConfig
import
(
47
egammaxAODThinningCfg)
48
acc.merge(egammaxAODThinningCfg(flags))
49
50
mlog.info(
"EGamma Steering done"
)
51
return
acc
52
53
# Run with python -m egammaConfig.egammaSteeringConfig
54
def
egammaSteeringConfigTest
(flags=None):
55
56
if
flags
is
None
:
57
from
AthenaConfiguration.AllConfigFlags
import
initConfigFlags
58
flags = initConfigFlags()
59
flags.addFlag(
'egamma.configOnly'
,
False
, help=
'custom option for egammaSteeringConfig to not run, only output config file'
)
60
61
from
AthenaConfiguration.TestDefaults
import
defaultTestFiles, defaultConditionsTags
62
flags.Input.Files = defaultTestFiles.RDO_RUN3
63
flags.IOVDb.GlobalTag = defaultConditionsTags.RUN3_MC
64
flags.Exec.MaxEvents = 1
65
66
flags.Output.doWriteESD =
True
# To test the ESD parts
67
flags.Output.doWriteAOD =
True
# To test the AOD parts
68
flags.Output.ESDFileName =
"myESD.pool.root"
69
flags.Output.AODFileName =
"myAOD.pool.root"
70
71
from
egammaConfig.ConfigurationHelpers
import
egammaOnlyFromRaw
72
egammaOnlyFromRaw(flags)
73
flags.fillFromArgs()
74
75
flags.lock()
76
77
from
RecJobTransforms.RecoSteering
import
RecoSteering
78
acc = RecoSteering(flags)
79
80
# Special message service configuration
81
from
DigitizationConfig.DigitizationSteering
import
DigitizationMessageSvcCfg
82
acc.merge(DigitizationMessageSvcCfg(flags))
83
84
from
AthenaConfiguration.Utils
import
setupLoggingLevels
85
setupLoggingLevels(flags, acc)
86
87
# Print reco domain status
88
from
RecJobTransforms.RecoConfigFlags
import
printRecoFlags
89
printRecoFlags(flags)
90
91
with
open(
"egammasteeringconfig.pkl"
,
"wb"
)
as
f:
92
acc.store(f)
93
94
if
flags.hasCategory(
'egamma'
)
and
flags.egamma.configOnly:
95
return
None
# returns statusCode of None
96
else
:
97
statusCode = acc.run()
98
return
statusCode
99
100
if
__name__ ==
"__main__"
:
101
egammaSteeringConfigTest
()
python.egammaSteeringConfig.EGammaSteeringCfg
EGammaSteeringCfg(flags, name="EGammaSteering")
Definition
egammaSteeringConfig.py:14
python.egammaSteeringConfig.egammaSteeringConfigTest
egammaSteeringConfigTest(flags=None)
Definition
egammaSteeringConfig.py:54
Generated on
for ATLAS Offline Software by
1.17.0