ATLAS Offline Software
Loading...
Searching...
No Matches
ThinNegativeEnergyCaloClustersConfig.py
Go to the documentation of this file.
1# Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
2
3__doc__ = """
4 Instantiate the Negative Calo Cluster Thinning
5 """
6
7from AthenaCommon.Logging import logging
8from AthenaConfiguration.ComponentFactory import CompFactory
9from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
10
11
13 name="ThinNegativeEnergyCaloClustersAlg",
14 **kwargs):
15
16 acc = ComponentAccumulator()
17 kwargs.setdefault("StreamName", "StreamAOD")
18 kwargs.setdefault("ThinNegativeEnergyCaloClusters", True)
19 kwargs.setdefault("CaloClustersKey", "CaloCalTopoClusters")
20 acc.addEventAlgo(
21 CompFactory.ThinNegativeEnergyCaloClustersAlg(name, **kwargs)
22 )
23 return acc
24
25
26if __name__ == "__main__":
27 from AthenaConfiguration.AllConfigFlags import initConfigFlags
28 from AthenaConfiguration.TestDefaults import defaultTestFiles
29 from AthenaConfiguration.ComponentAccumulator import printProperties
30 from AthenaConfiguration.MainServicesConfig import MainServicesCfg
31 flags = initConfigFlags()
32 flags.Input.Files = defaultTestFiles.RDO_RUN2
33 flags.Output.doWriteAOD = True # To test the AOD parts
34 flags.lock()
35 acc = MainServicesCfg(flags)
36 acc.merge(ThinNegativeEnergyCaloClustersCfg(flags))
37 mlog = logging.getLogger("ThinNegativeEnergyCaloClustersConfigTest")
38 printProperties(
39 mlog,
40 acc.getEventAlgo("ThinNegativeEnergyCaloClustersAlg"),
41 nestLevel=1,
42 printDefaults=True,
43 )
44
45 with open("thinnegativeenergycaloclusterscfg.pkl", "wb") as f:
46 acc.store(f)
ThinNegativeEnergyCaloClustersCfg(flags, name="ThinNegativeEnergyCaloClustersAlg", **kwargs)