ATLAS Offline Software
Loading...
Searching...
No Matches
TileInfoLoaderConfig.py
Go to the documentation of this file.
1# Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2
3"""Define method to construct configured Tile info loader service"""
4
5
6from AthenaConfiguration.ComponentFactory import CompFactory
7from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
8from AthenaConfiguration.AccumulatorCache import AccumulatorCache
9
10@AccumulatorCache
11def TileInfoLoaderCfg(flags, **kwargs):
12 """Return component accumulator with configured Tile info loader service
13
14 Arguments:
15 flags -- Athena configuration flags
16 """
17
18 from AthenaCommon.Logging import logging
19 msg = logging.getLogger('TileInfoLoaderCfg')
20
21 from TileConditions.TileCablingSvcConfig import TileCablingSvcCfg
22 acc = ComponentAccumulator()
23 acc.merge (TileCablingSvcCfg(flags))
24
25 kwargs.setdefault('LoadWienerFilterWeights', flags.Tile.doWiener)
26
27 if 'NoiseScaleIndex' not in kwargs:
28 if flags.Tile.doOpt2 and not flags.Tile.doOptATLAS:
29 msg.info("Adjusting TileInfo to return cell noise for Opt.Filter with iterations")
30 kwargs['NoiseScaleIndex'] = 2 # Noise for Optimal Filter with iterations
31 else:
32 msg.info("Adjusting TileInfo to return cell noise for Opt.Filter without iterations")
33 kwargs['NoiseScaleIndex'] = 1 # Noise for Optimal Filter without iterations
34
35 kwargs.setdefault('TileNoise', flags.Digitization.DoCaloNoise)
36 if kwargs['TileNoise']:
37 msg.info("Switching ON noise in Tile Digitization" )
38 else:
39 msg.info("Switching OFF noise in Tile Digitization" )
40
41
42 TileInfoLoader=CompFactory.TileInfoLoader
43 acc.addService(TileInfoLoader(**kwargs), primary = True, create=True)
44
45 return acc
46
47
48if __name__ == "__main__":
49
50 from AthenaConfiguration.AllConfigFlags import initConfigFlags
51 from AthenaConfiguration.TestDefaults import defaultTestFiles
52 from AthenaCommon.Logging import log
53 from AthenaCommon.Constants import DEBUG
54
55 # Test setup
56 log.setLevel(DEBUG)
57
58 flags = initConfigFlags()
59 flags.Input.Files = defaultTestFiles.RAW_RUN2
60 flags.lock()
61
62 acc = ComponentAccumulator()
63 acc.merge( TileInfoLoaderCfg(flags) )
64
65 acc.printConfig(withDetails = True, summariseProps = True)
66 print(acc.getService('TileInfoLoader'))
67 acc.store( open('TileInfoLoader.pkl','wb') )
68
69 print('All OK')
void print(char *figname, TCanvas *c1)