ATLAS Offline Software
TileTowerBuilderConfig.py
Go to the documentation of this file.
1 #
2 # Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 #
4 '''
5 @file TileTowerBuilderConfig.py
6 @brief Python configuration of Tile Tower builder algorithm for the Run III
7 '''
8 
9 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
10 from AthenaConfiguration.ComponentFactory import CompFactory
11 def TileTowerBuilderAlgCfg(flags, **kwargs):
12 
13  acc = ComponentAccumulator()
14 
15  kwargs.setdefault('name', 'TileTowerBldrAlg')
16  kwargs.setdefault('TowerContainerName', 'TileTower')
17  kwargs.setdefault('NumberOfPhiTowers', 64)
18  kwargs.setdefault('NumberOfEtaTowers', 34)
19  kwargs.setdefault('EtaMin', -1.7)
20  kwargs.setdefault('EtaMax', 1.7)
21  kwargs.setdefault('EnableChronoStat', flags.Concurrency.NumThreads == 0)
22 
23  from TileGeoModel.TileGMConfig import TileGMCfg
24  acc.merge(TileGMCfg(flags))
25 
26  from LArGeoAlgsNV.LArGMConfig import LArGMCfg
27  acc.merge(LArGMCfg(flags))
28 
29  TileTowerBuilderTool=CompFactory.TileTowerBuilderTool
30  tileCmbTwrBldr = TileTowerBuilderTool( name = 'TileCmbTwrBldr',
31  CellContainerName = 'AllCalo',
32  IncludedCalos = ['TILE'])
33 
34  kwargs['TowerBuilderTools'] = [ tileCmbTwrBldr ]
35 
36  CaloTowerAlgorithm=CompFactory.CaloTowerAlgorithm
37  acc.addEventAlgo(CaloTowerAlgorithm(**kwargs), primary = True)
38 
39  return acc
40 
41 
42 if __name__=='__main__':
43 
44  # Setup logs
45  from AthenaCommon.Logging import log
46  from AthenaCommon.Constants import INFO
47  log.setLevel(INFO)
48 
49  # Set the Athena configuration flags
50  from AthenaConfiguration.AllConfigFlags import initConfigFlags
51  from AthenaConfiguration.TestDefaults import defaultTestFiles
52  flags = initConfigFlags()
53  flags.Input.Files = defaultTestFiles.ESD
54  flags.Output.HISTFileName = 'TileTowerMonitorOutput.root'
55  flags.DQ.useTrigger = False
56  flags.DQ.enableLumiAccess = False
57  flags.Exec.MaxEvents = 3
58  flags.fillFromArgs()
59  flags.lock()
60 
61  # Initialize configuration object, add accumulator, merge, and run.
62  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
63  from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
64  cfg = MainServicesCfg(flags)
65  cfg.merge(PoolReadCfg(flags))
66 
67  cfg.merge( TileTowerBuilderAlgCfg(flags) )
68 
69  cfg.printConfig(withDetails = True, summariseProps = True)
70  flags.dump()
71 
72  cfg.store( open('TileTowerBuilder.pkl','wb') )
73 
74  sc = cfg.run()
75 
76  import sys
77  # Success should be 0
78  sys.exit(not sc.isSuccess())
TileTowerBuilderConfig.TileTowerBuilderAlgCfg
def TileTowerBuilderAlgCfg(flags, **kwargs)
Definition: TileTowerBuilderConfig.py:11
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:260
CaloTowerAlgorithm
Definition: CaloTowerAlgorithm.h:35
Constants
some useful constants -------------------------------------------------—
LArGMConfig.LArGMCfg
def LArGMCfg(flags)
Definition: LArGMConfig.py:8
Trk::open
@ open
Definition: BinningType.h:40
TileTowerBuilderTool
Concrete tool for CaloTower building in Tile.
Definition: TileTowerBuilderTool.h:21
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
python.PoolReadConfig.PoolReadCfg
def PoolReadCfg(flags)
Definition: PoolReadConfig.py:69
TileGMConfig.TileGMCfg
def TileGMCfg(flags)
Definition: TileGMConfig.py:7