ATLAS Offline Software
Loading...
Searching...
No Matches
CaloEstimatedGainToolConfig.py
Go to the documentation of this file.
1# Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2#
3# File: CaloTools/python/CaloEstimatedGainToolConfig.py
4# Created: Aug 2019, sss
5# Purpose: Configure CaloEstimatedGainTool.
6#
7
8from AthenaConfiguration.ComponentFactory import CompFactory
9from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
10
11
13 result = ComponentAccumulator()
14
15 from AtlasGeoModel.GeoModelConfig import GeoModelCfg
16 result.merge (GeoModelCfg (flags))
17
18 from LArGeoAlgsNV.LArGMConfig import LArGMCfg
19 from TileGeoModel.TileGMConfig import TileGMCfg
20
21 result.merge(LArGMCfg(flags))
22 result.merge(TileGMCfg(flags))
23
24 from LArCabling.LArCablingConfig import LArFebRodMappingCfg, LArCalibIdMappingCfg
25 result.merge(LArFebRodMappingCfg(flags))
26 result.merge(LArCalibIdMappingCfg(flags))
27
28 from TileConditions.TileInfoLoaderConfig import TileInfoLoaderCfg
29 result.merge (TileInfoLoaderCfg (flags))
30
31 from TileConditions.TileEMScaleConfig import TileCondToolEmscaleCfg
32 acc = TileCondToolEmscaleCfg (flags)
33 emscaleTool = acc.popPrivateTools()
34 result.merge (acc)
35
36 from TileConditions.TileSampleNoiseConfig import TileCondToolNoiseSampleCfg
37 acc = TileCondToolNoiseSampleCfg (flags)
38 noiseSampleTool = acc.popPrivateTools()
39 result.merge (acc)
40
41 from LArRecUtils.LArADC2MeVCondAlgConfig import LArADC2MeVCondAlgCfg
42 result.merge (LArADC2MeVCondAlgCfg (flags))
43 adc2mev = result.getCondAlgo ('LArADC2MeVCondAlg')
44
45 TileCondIdTransforms=CompFactory.TileCondIdTransforms
46
47 CaloEstimatedGainTool=CompFactory.CaloEstimatedGainTool
48 tool = CaloEstimatedGainTool ('CaloEstimatedGainTool',
49 ADC2MeVKey = adc2mev.LArADC2MeVKey,
50 TileCondIdTransforms = TileCondIdTransforms(),
51 TileCondToolEmscale = emscaleTool,
52 TileCondToolNoiseSample = noiseSampleTool)
53
54 result.setPrivateTools (tool)
55
56 return result
57
58
59if __name__ == "__main__":
60 from AthenaConfiguration.AllConfigFlags import initConfigFlags
61 from AthenaConfiguration.TestDefaults import defaultTestFiles
62
63 flags1 = initConfigFlags()
64 flags1.Input.Files = defaultTestFiles.RDO_RUN2
65 flags1.lock()
66 acc1 = CaloEstimatedGainToolCfg (flags1)
67 only = ['CaloEstimatedGainTool']
68 acc1.printCondAlgs(summariseProps=True, onlyComponents = only)
69
70 # Print a configurable with properties in sorted order.
71 Configurable = CompFactory.CaloEstimatedGainTool.__bases__[0]
72 def sorted_repr (c):
73 if not isinstance(c, Configurable): return str(c)
74 args = [c.name] + ['{}={!r}'.format(item[0], sorted_repr(item[1])) for item in sorted(c._properties.items())]
75 return '{}({})'.format(type(c).__name__, ', '.join(args))
76
77 print ('ComponentAccumulator:', sorted_repr (acc1.popPrivateTools()))
78 acc1.wasMerged()