ATLAS Offline Software
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 
5 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
6 from AthenaConfiguration.ComponentFactory import CompFactory
7 from TileConfiguration.TileConfigFlags import TileRunType
8 
9 def 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 
34 if __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 
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:260
Constants
some useful constants -------------------------------------------------—
LArGMConfig.LArGMCfg
def LArGMCfg(flags)
Definition: LArGMConfig.py:8
MBTSTimeDiffEventInfoAlg
Definition: MBTSTimeDiffEventInfoAlg.h:20
Trk::open
@ open
Definition: BinningType.h:40
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
MBTSTimeDiffEventInfoAlgConfig.MBTSTimeDiffEventInfoAlgCfg
def MBTSTimeDiffEventInfoAlgCfg(flags, **kwargs)
Definition: MBTSTimeDiffEventInfoAlgConfig.py:9
python.PoolReadConfig.PoolReadCfg
def PoolReadCfg(flags)
Definition: PoolReadConfig.py:69
python.TileCablingSvcConfig.TileCablingSvcCfg
def TileCablingSvcCfg(flags)
Definition: TileCablingSvcConfig.py:11
TileGMConfig.TileGMCfg
def TileGMCfg(flags)
Definition: TileGMConfig.py:7