egammaLargeClusterMakerConfig.py 1.59 KB
Newer Older
1
# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
2

3
4
__doc__ = """ Configure egammaLargeClusterMaker,
               which chooses cells to store in the AOD"""
5
6
__author__ = "Jovan Mitrevski"

7
from AthenaCommon.Logging import logging
8
from AthenaConfiguration.ComponentFactory import CompFactory
9
10
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator

11

12
13
14
def egammaLargeClusterMakerCfg(flags, name="egammaLCMakerTool",  **kwargs):

    acc = ComponentAccumulator()
15
16

    kwargs.setdefault("CellsName", flags.Egamma.Keys.Input.CaloCells)
17
18
    kwargs.setdefault("InputClusterCollection",
                      flags.Egamma.Keys.Output.CaloClusters)
19

20
    acc.setPrivateTools(CompFactory.egammaLargeClusterMaker(name, **kwargs))
21
22
23

    return acc

24
25
26
27
28
29
30
31
32
33
34
35
36
37
38

if __name__ == "__main__":

    from AthenaConfiguration.AllConfigFlags import ConfigFlags
    from AthenaConfiguration.ComponentAccumulator import printProperties
    from AthenaCommon.Configurable import Configurable
    from AthenaConfiguration.TestDefaults import defaultTestFiles
    Configurable.configurableRun3Behavior = True

    ConfigFlags.Input.Files = defaultTestFiles.RDO
    ConfigFlags.fillFromArgs()
    ConfigFlags.lock()
    ConfigFlags.dump()

    cfg = ComponentAccumulator()
39
    mlog = logging.getLogger("egammaLargeClusterMakerConfigTest")
40
41
42
43
44
45
46
47
48
    mlog.info("Configuring  egammaLargeClusterMaker: ")
    printProperties(mlog, cfg.popToolsAndMerge(
        egammaLargeClusterMakerCfg(ConfigFlags)),
        nestLevel=1,
        printDefaults=True)

    f = open("egammalargeclustermaker.pkl", "wb")
    cfg.store(f)
    f.close()