ATLAS Offline Software
Loading...
Searching...
No Matches
MBTSTimeDiffEventInfoAlgConfig.py
Go to the documentation of this file.
1# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2
3"""Define method to construct configured MBTS time difference algorithm"""
4
5from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
6from AthenaConfiguration.ComponentFactory import CompFactory
7from TileConfiguration.TileConfigFlags import TileRunType
8
9def MBTSTimeDiffEventInfoAlgCfg(flags, **kwargs):
10 """Return component accumulator with configured MBTS time difference algorithm
11
12 Arguments:
13 flags -- Athena configuration flags
14 """
15
16 acc = ComponentAccumulator()
17
18 from TileConditions.TileCablingSvcConfig import TileCablingSvcCfg
19 acc.merge( TileCablingSvcCfg(flags) )
20
21 from TileGeoModel.TileGMConfig import TileGMCfg
22 acc.merge(TileGMCfg(flags))
23
24 from LArGeoAlgsNV.LArGMConfig import LArGMCfg
25 acc.merge(LArGMCfg(flags))
26
27 MBTSTimeDiffEventInfoAlg=CompFactory.MBTSTimeDiffEventInfoAlg
28 acc.addEventAlgo(MBTSTimeDiffEventInfoAlg(**kwargs), primary = True)
29
30 return acc
31
32
33
34if __name__ == "__main__":
35
36 from AthenaConfiguration.AllConfigFlags import initConfigFlags
37 from AthenaConfiguration.TestDefaults import defaultTestFiles
38 from AthenaCommon.Logging import log
39 from AthenaCommon.Constants import DEBUG
40
41 # Test setup
42 log.setLevel(DEBUG)
43
44 flags = initConfigFlags()
45 flags.Input.Files = defaultTestFiles.AOD_RUN2_DATA
46 flags.Tile.RunType = TileRunType.PHY
47 flags.lock()
48
49 from AthenaConfiguration.MainServicesConfig import MainServicesCfg
50 acc = MainServicesCfg(flags)
51
52 from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
53 acc.merge(PoolReadCfg(flags))
54
55 acc.merge( MBTSTimeDiffEventInfoAlgCfg(flags) )
56
57 flags.dump()
58 acc.printConfig(withDetails = True, summariseProps = True)
59 acc.store( open('MBTSTimeDiffEventInfoAlg.pkl','wb') )
60
61 sc = acc.run(maxEvents = 3)
62
63 import sys
64 # Success should be 0
65 sys.exit(not sc.isSuccess())
66