ATLAS Offline Software
RegSelCondAlg_TileConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
2 
3 """Define methods to construct configured RegSelCondAlg_Tile conditions algorithm"""
4 
5 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
6 from AthenaConfiguration.ComponentFactory import CompFactory
7 
8 def RegSelCondAlg_TileCfg(flags, **kwargs):
9  """Return component accumulator with configured RegSelCondAlg_Tile conditions algorithm"""
10 
11  kwargs.setdefault('name', 'RegSelCondAlg_Tile')
12 
13  acc = ComponentAccumulator()
14 
15  from TileGeoModel.TileGMConfig import TileGMCfg
16  acc.merge( TileGMCfg(flags) )
17 
18  from TileByteStream.TileHid2RESrcIDConfig import TileHid2RESrcIDCondAlgCfg
19  acc.merge( TileHid2RESrcIDCondAlgCfg(flags, ForHLT=True) )
20 
21  RegSelCondAlg_Tile = CompFactory.RegSelCondAlg_Tile
22  acc.addCondAlgo( RegSelCondAlg_Tile(**kwargs) )
23 
24  return acc
25 
26 
27 
28 if __name__ == "__main__":
29 
30  from AthenaConfiguration.AllConfigFlags import initConfigFlags
31  from AthenaConfiguration.TestDefaults import defaultGeometryTags, defaultTestFiles
32  from AthenaCommon.Logging import log
33  from AthenaCommon.Constants import INFO
34 
35  # Test setup
36  log.setLevel(INFO)
37 
38  flags = initConfigFlags()
39  flags.Input.Files = defaultTestFiles.RAW_RUN2
40  flags.GeoModel.AtlasVersion = defaultGeometryTags.RUN2
41  flags.lock()
42 
43  # Initialize configuration object, add accumulator, merge, and run.
44  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
45  cfg = MainServicesCfg(flags)
46 
47  from ByteStreamCnvSvc.ByteStreamConfig import ByteStreamReadCfg
48  cfg.merge( ByteStreamReadCfg(flags) )
49 
50  cfg.merge( RegSelCondAlg_TileCfg(flags) )
51 
52  cfg.printConfig(withDetails = True, summariseProps = True)
53  cfg.store( open('RegSelCondAlg_Tile.pkl','wb') )
54 
55  sc = cfg.run(3)
56 
57  import sys
58  # Success should be 0
59  sys.exit(not sc.isSuccess())
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.ByteStreamConfig.ByteStreamReadCfg
def ByteStreamReadCfg(flags, type_names=None)
Definition: Event/ByteStreamCnvSvc/python/ByteStreamConfig.py:25
RegSelCondAlg_TileConfig.RegSelCondAlg_TileCfg
def RegSelCondAlg_TileCfg(flags, **kwargs)
Definition: RegSelCondAlg_TileConfig.py:8
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:260
Constants
some useful constants -------------------------------------------------—
RegSelCondAlg_Tile
Definition: RegSelCondAlg_Tile.h:30
TileHid2RESrcIDConfig.TileHid2RESrcIDCondAlgCfg
def TileHid2RESrcIDCondAlgCfg(flags, source='COOL', **kwargs)
Definition: TileHid2RESrcIDConfig.py:24
Trk::open
@ open
Definition: BinningType.h:40
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
TileGMConfig.TileGMCfg
def TileGMCfg(flags)
Definition: TileGMConfig.py:7