Skip to content
Snippets Groups Projects

TileTBRec: Add new-style configuration for TileTBStat for Run 3

Merged Siarhei Harkusha requested to merge harkusha/athena:23.0-tile-tbstat-cfg-run3 into 23.0
All threads resolved!
2 files
+ 88
0
Compare changes
  • Side-by-side
  • Inline
Files
2
#
# Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
#
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
from AthenaConfiguration.ComponentFactory import CompFactory
'''
@file TileTBStatConfig.py
@brief Python configuration of TileTBStat algorithm for the Run III
'''
def TileTBStatCfg(flags, **kwargs):
''' Function to configure TileTBStat algorithm.'''
acc = ComponentAccumulator()
from TileConditions.TileCablingSvcConfig import TileCablingSvcCfg
acc.merge( TileCablingSvcCfg(flags) )
from TileRecUtils.TileDQstatusConfig import TileDQstatusAlgCfg
acc.merge( TileDQstatusAlgCfg(flags, TileBeamElemContainer='TileBeamElemCnt') )
acc.addService(CompFactory.ROBDataProviderSvc())
TileTBStat = CompFactory.TileTBStat
acc.addEventAlgo(TileTBStat(**kwargs), primary = True)
return acc
if __name__=='__main__':
# Set the Athena configuration flags
from AthenaConfiguration.AllConfigFlags import initConfigFlags
flags = initConfigFlags()
parser = flags.getArgumentParser()
parser.add_argument('--postExec', help='Code to execute after setup')
args, _ = parser.parse_known_args()
# Setup logs
from AthenaCommon.Logging import log
from AthenaCommon.Constants import INFO
log.setLevel(INFO)
from AthenaConfiguration.TestDefaults import defaultTestFiles
flags.Input.Files = defaultTestFiles.RAW_RUN2
flags.Exec.MaxEvents = 3
flags.fillFromArgs(parser=parser)
flags.lock()
flags.dump()
# Initialize configuration object, add accumulator, merge, and run.
from AthenaConfiguration.MainServicesConfig import MainServicesCfg
cfg = MainServicesCfg(flags)
from ByteStreamCnvSvc.ByteStreamConfig import ByteStreamReadCfg
tileTypeNames = ['TileDigitsContainer/TileDigitsCnt',
'TileRawChannelContainer/TileRawChannelCnt',
'TileLaserObject/TileLaserObj',
'TileBeamElemContainer/TileBeamElemCnt']
cfg.merge( ByteStreamReadCfg(flags, type_names=tileTypeNames) )
cfg.getService('ByteStreamCnvSvc').ROD2ROBmap = ["-1"]
cfg.merge( TileTBStatCfg(flags) )
# Any last things to do?
if args.postExec:
log.info('Executing postExec: %s', args.postExec)
exec(args.postExec)
cfg.printConfig(withDetails=True, summariseProps=True)
sc = cfg.run()
import sys
# Success should be 0
sys.exit(0 if sc.isSuccess() else 1)
Loading