ATLAS Offline Software
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 
8 from AthenaConfiguration.ComponentFactory import CompFactory
9 from 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 
59 if __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()
TileCondIdTransforms
Definition: TileCondIdTransforms.h:16
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
vtune_athena.format
format
Definition: vtune_athena.py:14
python.CaloEstimatedGainToolConfig.CaloEstimatedGainToolCfg
def CaloEstimatedGainToolCfg(flags)
Definition: CaloEstimatedGainToolConfig.py:12
LArCablingConfig.LArFebRodMappingCfg
def LArFebRodMappingCfg(configFlags)
Definition: LArCablingConfig.py:80
DerivationFramework::TriggerMatchingUtils::sorted
std::vector< typename T::value_type > sorted(T begin, T end)
Helper function to create a sorted vector from an unsorted one.
LArGMConfig.LArGMCfg
def LArGMCfg(flags)
Definition: LArGMConfig.py:8
TCS::join
std::string join(const std::vector< std::string > &v, const char c=',')
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/Root/StringUtils.cxx:10
python.CaloEstimatedGainToolConfig.sorted_repr
def sorted_repr(c)
Definition: CaloEstimatedGainToolConfig.py:72
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
str
Definition: BTagTrackIpAccessor.cxx:11
LArCablingConfig.LArCalibIdMappingCfg
def LArCalibIdMappingCfg(configFlags)
Definition: LArCablingConfig.py:83
TileGMConfig.TileGMCfg
def TileGMCfg(flags)
Definition: TileGMConfig.py:7