egammaLargeClusterMakerConfig.py 1.63 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
11
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
egammaLargeClusterMaker = CompFactory.egammaLargeClusterMaker

12

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

    acc = ComponentAccumulator()
16
17

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

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

    return acc

25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49

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()
    mlog = logging.getLogger("egammaLargeClusterMakerTest")
    mlog.info("Configuring  egammaLargeClusterMaker: ")
    printProperties(mlog, cfg.popToolsAndMerge(
        egammaLargeClusterMakerCfg(ConfigFlags)),
        nestLevel=1,
        printDefaults=True)

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