ATLAS Offline Software
TileTBStatConfig.py
Go to the documentation of this file.
1 #
2 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 #
4 
5 
6 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
7 from 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 
16 def 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 
38 if __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)
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
TileTBStatConfig.TileTBStatCfg
def TileTBStatCfg(flags, **kwargs)
Definition: TileTBStatConfig.py:16
TileDQstatusConfig.TileDQstatusAlgCfg
def TileDQstatusAlgCfg(flags, **kwargs)
Definition: TileDQstatusConfig.py:31
TileTBStat
Class to produce run statistics. Used to fill commissioning database.
Definition: TileTBStat.h:76
LArG4FSStartPointFilter.exec
exec
Definition: LArG4FSStartPointFilter.py:103
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:260
Constants
some useful constants -------------------------------------------------—
TileHid2RESrcIDConfig.TileHid2RESrcIDCondAlgCfg
def TileHid2RESrcIDCondAlgCfg(flags, source='COOL', **kwargs)
Definition: TileHid2RESrcIDConfig.py:24
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
TileByteStreamConfig.TileRawDataReadingCfg
def TileRawDataReadingCfg(flags, readDigits=True, readRawChannel=True, readMuRcv=None, readMuRcvDigits=False, readMuRcvRawCh=False, readBeamElem=None, readLaserObj=None, readDigitsFlx=False, readL2=False, stateless=False, **kwargs)
Definition: TileByteStreamConfig.py:87
python.TileCablingSvcConfig.TileCablingSvcCfg
def TileCablingSvcCfg(flags)
Definition: TileCablingSvcConfig.py:11