3 """Define method to construct configured Tile info loader service"""
6 from __future__
import print_function
7 from AthenaConfiguration.ComponentFactory
import CompFactory
8 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
9 from AthenaConfiguration.AccumulatorCache
import AccumulatorCache
13 """Return component accumulator with configured Tile info loader service
16 flags -- Athena configuration flags
19 from AthenaCommon.Logging
import logging
20 msg = logging.getLogger(
'TileInfoLoaderCfg')
22 from TileConditions.TileCablingSvcConfig
import TileCablingSvcCfg
26 kwargs.setdefault(
'LoadWienerFilterWeights', flags.Tile.doWiener)
28 if 'NoiseScaleIndex' not in kwargs:
29 if flags.Tile.doOpt2
and not flags.Tile.doOptATLAS:
30 msg.info(
"Adjusting TileInfo to return cell noise for Opt.Filter with iterations")
31 kwargs[
'NoiseScaleIndex'] = 2
33 msg.info(
"Adjusting TileInfo to return cell noise for Opt.Filter without iterations")
34 kwargs[
'NoiseScaleIndex'] = 1
36 kwargs.setdefault(
'TileNoise', flags.Digitization.DoCaloNoise)
37 if kwargs[
'TileNoise']:
38 msg.info(
"Switching ON noise in Tile Digitization" )
40 msg.info(
"Switching OFF noise in Tile Digitization" )
43 TileInfoLoader=CompFactory.TileInfoLoader
44 acc.addService(
TileInfoLoader(**kwargs), primary =
True, create=
True)
49 if __name__ ==
"__main__":
51 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
52 from AthenaConfiguration.TestDefaults
import defaultTestFiles
53 from AthenaCommon.Logging
import log
60 flags.Input.Files = defaultTestFiles.RAW_RUN2
66 acc.printConfig(withDetails =
True, summariseProps =
True)
67 print(acc.getService(
'TileInfoLoader'))
68 acc.store(
open(
'TileInfoLoader.pkl',
'wb') )