5from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
6from AthenaConfiguration.Enums
import BeamType
9@file TileRawChannelToNtupleConfig.py
10@brief Python configuration of Tile raw channels to ntuple algorithm for the Run III
13from AthenaConfiguration.ComponentFactory
import CompFactory
17 ''' Function to configure Tile digits to h70 ntuple algorithm.'''
19 acc = ComponentAccumulator()
21 from TileGeoModel.TileGMConfig
import TileGMCfg
22 acc.merge(TileGMCfg(flags))
24 from TileConditions.TileCablingSvcConfig
import TileCablingSvcCfg
25 acc.merge( TileCablingSvcCfg(flags) )
28 prefix =
'tiletb' if flags.Beam.Type
is BeamType.TestBeam
else 'tile'
29 outputFile = f
'{prefix}.ntup.root'
31 ntupleSvc = CompFactory.NTupleSvc()
32 ntupleSvc.Output = [
"NTUP DATAFILE='%s' OPT='NEW'" % outputFile]
33 acc.addService(ntupleSvc)
35 kwargs.setdefault(
'TileRawChannelContainer',
'TileRawChannelCnt')
36 kwargs.setdefault(
'NTupleLoc',
'/NTUP')
38 TileRawChannelToNtuple = CompFactory.TileRawChannelToNtuple
41 acc.setAppProperty(
'HistogramPersistency',
'ROOT')
46if __name__ ==
'__main__':
49 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
50 flags = initConfigFlags()
53 from AthenaCommon.Logging
import log
57 from AthenaConfiguration.TestDefaults
import defaultTestFiles
58 flags.Input.Files = defaultTestFiles.RDO_RUN3
59 flags.Exec.MaxEvents = 3
62 log.info(
'Final configuration flags follow:')
68 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
69 cfg = MainServicesCfg(flags)
71 from AthenaPoolCnvSvc.PoolReadConfig
import PoolReadCfg
72 cfg.merge(PoolReadCfg(flags))
76 cfg.printConfig(withDetails=
True, summariseProps=
True)
78 with open(
'TileRawChannelToNtupleConfig.pkl',
'wb')
as f:
85 sys.exit(0
if sc.isSuccess()
else 1)
TileRawChannelToNtupleCfg(flags, outputFile=None, **kwargs)