ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
egamma
egammaTools
python
EMShowerBuilderConfig.py
Go to the documentation of this file.
1
# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2
3
""" Configuration for EMShowerBuilder """
4
5
from
AthenaConfiguration.ComponentAccumulator
import
ComponentAccumulator
6
from
AthenaConfiguration.ComponentFactory
import
CompFactory
7
8
from
AthenaCommon.Logging
import
logging
9
from
CaloIdentifier
import
SUBCALO
10
11
12
def
EMShowerBuilderCfg
(flags, name='EMShowerBuilder', **kwargs):
13
14
mlog = logging.getLogger(name)
15
mlog.debug(
'Start configuration'
)
16
17
acc = ComponentAccumulator()
18
egammaIso, egammaShowerShape = CompFactory.getComps(
19
"egammaIso"
,
"egammaShowerShape"
,)
20
kwargs.setdefault(
"CellsName"
, flags.Egamma.Keys.Input.CaloCells)
21
kwargs.setdefault(
22
"CaloNums"
, [SUBCALO.LAREM, SUBCALO.LARHEC, SUBCALO.TILE])
23
kwargs.setdefault(
"ShowerShapeTool"
,
egammaShowerShape
())
24
kwargs.setdefault(
"HadronicLeakageTool"
,
egammaIso
())
25
26
tool = CompFactory.EMShowerBuilder(name, **kwargs)
27
28
acc.setPrivateTools(tool)
29
return
acc
30
31
32
if
__name__ ==
"__main__"
:
33
34
from
AthenaConfiguration.AllConfigFlags
import
initConfigFlags
35
from
AthenaConfiguration.ComponentAccumulator
import
printProperties
36
from
AthenaConfiguration.TestDefaults
import
defaultTestFiles
37
flags = initConfigFlags()
38
flags.Input.Files = defaultTestFiles.RDO_RUN2
39
flags.fillFromArgs()
40
flags.lock()
41
flags.dump()
42
43
cfg = ComponentAccumulator()
44
mlog = logging.getLogger(
"EMShowerBuilderConfigTest"
)
45
mlog.info(
"Configuring EMShowerBuilder: "
)
46
printProperties(mlog, cfg.popToolsAndMerge(
47
EMShowerBuilderCfg
(flags)),
48
nestLevel=1,
49
printDefaults=
True
)
50
51
f = open(
"emshowerbuilder.pkl"
,
"wb"
)
52
cfg.store(f)
53
f.close()
egammaIso
{Tool to estimate the hadronic energy behind the electromagnetic cluster, the
Definition
egammaIso.h:16
egammaShowerShape
@
Definition
egammaShowerShape.h:35
EMShowerBuilderConfig.EMShowerBuilderCfg
EMShowerBuilderCfg(flags, name='EMShowerBuilder', **kwargs)
Definition
EMShowerBuilderConfig.py:12
Generated on
for ATLAS Offline Software by
1.17.0