ATLAS Offline Software
Loading...
Searching...
No Matches
TileCisCalibAlgConfig.py
Go to the documentation of this file.
2# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3#
4
5from TileConfiguration.TileConfigFlags import TileRunType
6
7'''
8@file TileCisCalibAlgConfig.py
9@brief Python configuration of TileCisDefaultCalibTool tool for the Run III
10'''
11def TileCisDefaulCalibToolCfg(flags, **kwargs):
12
13 ''' Function to configure TileCisDefaultCalibTool tool'''
14
15 kwargs.setdefault('removePed', True)
16
17 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
18 acc = ComponentAccumulator()
19
20 from TileConditions.TileCablingSvcConfig import TileCablingSvcCfg
21 acc.merge( TileCablingSvcCfg(flags) )
22
23 from TileConditions.TileInfoLoaderConfig import TileInfoLoaderCfg
24 acc.merge( TileInfoLoaderCfg(flags) )
25
26 from TileGeoModel.TileGMConfig import TileGMCfg
27 acc.merge(TileGMCfg( flags ))
28
29 from TileRecUtils.TileDQstatusConfig import TileDQstatusAlgCfg
30 acc.merge( TileDQstatusAlgCfg(flags) )
31
32 from AthenaConfiguration.ComponentFactory import CompFactory
33 TileCisDefalutCalibTool = CompFactory.TileCisDefaultCalibTool
34
35 acc.setPrivateTools(TileCisDefalutCalibTool(**kwargs))
36
37 return acc
38
39
40'''
41@brief Python configuration of TileCisCalibAlg algorithm for the Run III
42'''
43def TileCisCalibAlgCfg(flags, **kwargs):
44
45 ''' Function to configure TileCisCalibAlg algorithm'''
46
47 kwargs.setdefault('name', 'TileCisCalibAlg')
48 kwargs.setdefault('RunType', TileRunType.CIS.getIntValue())
49 kwargs.setdefault('RunNumber', flags.Input.RunNumbers[0])
50
51 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
52 acc = ComponentAccumulator()
53
54 if 'TileCalibTools' not in kwargs:
55 cisCalibTool = acc.popToolsAndMerge( TileCisDefaulCalibToolCfg(flags) )
56 kwargs['TileCalibTools'] = [cisCalibTool]
57
58 from AthenaConfiguration.ComponentFactory import CompFactory
59 TileTopCalibAlg = CompFactory.TileTopCalibAlg
60
61 acc.addEventAlgo(TileTopCalibAlg(**kwargs), primary=True)
62
63 return acc
64
65if __name__=='__main__':
66
67 # Setup logs
68 from AthenaCommon.Logging import log
69 from AthenaCommon.Constants import INFO
70 log.setLevel(INFO)
71
72 # Set the Athena configuration flags
73 from AthenaConfiguration.AllConfigFlags import initConfigFlags
74 from AthenaConfiguration.TestDefaults import defaultConditionsTags, defaultGeometryTags, defaultTestFiles
75 flags = initConfigFlags()
76 flags.Input.Files = defaultTestFiles.RAW_RUN2
77 flags.GeoModel.AtlasVersion = defaultGeometryTags.RUN2
78 flags.IOVDb.GlobalTag = defaultConditionsTags.RUN2_DATA
79 flags.Tile.doFit = True
80 flags.Tile.RunType = TileRunType.CIS
81 flags.Exec.MaxEvents = 3
82 flags.fillFromArgs()
83 flags.lock()
84
85 # Initialize configuration object, add accumulator, merge, and run.
86 from AthenaConfiguration.MainServicesConfig import MainServicesCfg
87 cfg = MainServicesCfg(flags)
88
89 from TileByteStream.TileByteStreamConfig import TileRawDataReadingCfg
90 cfg.merge( TileRawDataReadingCfg(flags) )
91
92 from TileRecUtils.TileRawChannelMakerConfig import TileRawChannelMakerCfg
93 cfg.merge( TileRawChannelMakerCfg(flags) )
94
95 cfg.merge( TileCisCalibAlgCfg(flags) )
96
97 cfg.printConfig(withDetails = True, summariseProps = True)
98 flags.dump()
99
100 cfg.store( open('TileCisCalibAlg.pkl','wb') )
101
102 sc = cfg.run()
103
104 import sys
105 # Success should be 0
106 sys.exit(not sc.isSuccess())
TileCisDefaulCalibToolCfg(flags, **kwargs)
TileCisCalibAlgCfg(flags, **kwargs)