ATLAS Offline Software
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 
7 from AthenaCommon.Logging import logging
8 from AthenaConfiguration.ComponentFactory import CompFactory
9 from 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 
26 if __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")
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)
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:259
extractSporadic.printProperties
def printProperties(h, q, hLB)
Definition: extractSporadic.py:8
Trk::open
@ open
Definition: BinningType.h:40
python.ThinNegativeEnergyCaloClustersConfig.ThinNegativeEnergyCaloClustersCfg
def ThinNegativeEnergyCaloClustersCfg(flags, name="ThinNegativeEnergyCaloClustersAlg", **kwargs)
Definition: ThinNegativeEnergyCaloClustersConfig.py:12
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19