ATLAS Offline Software
Loading...
Searching...
No Matches
TileTBStatConfig.py
Go to the documentation of this file.
2# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3#
4
5
6from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
7from AthenaConfiguration.ComponentFactory import CompFactory
8
9
10'''
11@file TileTBStatConfig.py
12@brief Python configuration of TileTBStat algorithm for the Run III
13'''
14
15
16def TileTBStatCfg(flags, **kwargs):
17 ''' Function to configure TileTBStat algorithm.'''
18
19 acc = ComponentAccumulator()
20
21 from TileConditions.TileCablingSvcConfig import TileCablingSvcCfg
22 acc.merge( TileCablingSvcCfg(flags) )
23
24 from TileRecUtils.TileDQstatusConfig import TileDQstatusAlgCfg
25 acc.merge( TileDQstatusAlgCfg(flags, TileBeamElemContainer='TileBeamElemCnt') )
26
27 from TileByteStream.TileHid2RESrcIDConfig import TileHid2RESrcIDCondAlgCfg
28 acc.merge( TileHid2RESrcIDCondAlgCfg(flags, ROD2ROBmap=['-1']) )
29
30 acc.addService(CompFactory.ROBDataProviderSvc())
31
32 TileTBStat = CompFactory.TileTBStat
33 acc.addEventAlgo(TileTBStat(**kwargs), primary = True)
34
35 return acc
36
37
38if __name__=='__main__':
39
40 # Set the Athena configuration flags
41 from AthenaConfiguration.AllConfigFlags import initConfigFlags
42 flags = initConfigFlags()
43 parser = flags.getArgumentParser()
44 parser.add_argument('--postExec', help='Code to execute after setup')
45 args, _ = parser.parse_known_args()
46
47 # Setup logs
48 from AthenaCommon.Logging import log
49 from AthenaCommon.Constants import INFO
50 log.setLevel(INFO)
51
52 from AthenaConfiguration.TestDefaults import defaultConditionsTags, defaultGeometryTags, defaultTestFiles
53 flags.Input.Files = defaultTestFiles.RAW_RUN2
54 flags.GeoModel.AtlasVersion = defaultGeometryTags.RUN2
55 flags.IOVDb.GlobalTag = defaultConditionsTags.RUN2_DATA
56 flags.Exec.MaxEvents = 3
57 flags.fillFromArgs(parser=parser)
58
59 flags.lock()
60
61 flags.dump()
62
63 # Initialize configuration object, add accumulator, merge, and run.
64 from AthenaConfiguration.MainServicesConfig import MainServicesCfg
65 cfg = MainServicesCfg(flags)
66
67 from TileByteStream.TileByteStreamConfig import TileRawDataReadingCfg
68 cfg.merge( TileRawDataReadingCfg(flags, readMuRcv=False, readBeamElem=True) )
69
70 cfg.merge( TileTBStatCfg(flags) )
71
72 # Any last things to do?
73 if args.postExec:
74 log.info('Executing postExec: %s', args.postExec)
75 exec(args.postExec)
76
77 cfg.printConfig(withDetails=True, summariseProps=True)
78
79 sc = cfg.run()
80
81 import sys
82 # Success should be 0
83 sys.exit(0 if sc.isSuccess() else 1)
Class to produce run statistics.
Definition TileTBStat.h:76
TileTBStatCfg(flags, **kwargs)