ATLAS Offline Software
FastCaloSimFactoryNew.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2 
3 from AthenaCommon.Logging import logging
4 from AthenaConfiguration.ComponentFactory import CompFactory
5 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
6 import TrkConfig.AtlasExtrapolatorToolsConfig as TC
7 
8 # EXTRAPOLATOR
9 def NITimedExtrapolatorCfg(flags, name="ISF_NITimedExtrapolator", **kwargs):
10  result = ComponentAccumulator()
11  mlog = logging.getLogger(name)
12  mlog.debug("Start configuration")
13 
14  # Configure MagneticField (resolve AtlasFieldCacheCondObj dependancy)
15  from MagFieldServices.MagFieldServicesConfig import AtlasFieldCacheCondAlgCfg
16  result.merge(AtlasFieldCacheCondAlgCfg(flags))
17  # add LAr calibration (resolve LAr dependancies)
18  from LArConfiguration.LArElecCalibDBConfig import LArElecCalibDBCfg
19  result.merge(LArElecCalibDBCfg(flags, ["fSampl"]))
20 
21  TimedPropagators = [] # PublicToolHandleArray
22  TimedUpdators = [] # PublicToolHandleArray
23 
24  # NAVIGATOR
25  kwargs.setdefault("Navigator", result.addPublicTool(result.popToolsAndMerge(TC.FastSimNavigatorCfg(flags))))
26 
27  # PROPAGATORS
28  from TrkConfig.TrkExRungeKuttaPropagatorConfig import RungeKuttaPropagatorCfg
29  AtlasRungeKuttaPropagator = result.popToolsAndMerge(RungeKuttaPropagatorCfg(flags))
30  TimedPropagators += [result.addPublicTool(AtlasRungeKuttaPropagator)]
31 
32  from TrkConfig.TrkExSTEP_PropagatorConfig import AtlasNoMatSTEP_PropagatorCfg
33  AtlasSTEP_Propagator = result.popToolsAndMerge(AtlasNoMatSTEP_PropagatorCfg(flags))
34  TimedPropagators += [result.addPublicTool(AtlasSTEP_Propagator)]
35  kwargs.setdefault("STEP_Propagator", result.getPublicTool(AtlasSTEP_Propagator.name)) # PublicToolHandle
36 
37  # UPDATORS
38  MaterialEffectsUpdator = result.popToolsAndMerge(TC.AtlasMaterialEffectsUpdatorCfg(flags))
39  result.addPublicTool(MaterialEffectsUpdator)
40 
41  NIMatEffUpdator = result.popToolsAndMerge(TC.NIMatEffUpdatorCfg(flags))
42  TimedUpdators += [result.addPublicTool(NIMatEffUpdator)]
43  # kwargs.setdefault("MaterialEffectsUpdators", [result.getPublicTool(NIMatEffUpdator.name)])
44  kwargs.setdefault("ApplyMaterialEffects", False)
45 
46  # CONFIGURE PROPAGATORS/UPDATORS ACCORDING TO GEOMETRY SIGNATURE
47 
48  TimedSubPropagators = [] # Array of names
49  TimedSubUpdators = [] # Array of names
50 
51  # -------------------- set it depending on the geometry ----------------------------------------------------
52  # default for Global is (Rk,Mat)
53  TimedSubPropagators += [ AtlasRungeKuttaPropagator.name ]
54  TimedSubUpdators += [ MaterialEffectsUpdator.name ]
55 
56  # default for ID is (Rk,Mat)
57  TimedSubPropagators += [ AtlasRungeKuttaPropagator.name ]
58  TimedSubUpdators += [ MaterialEffectsUpdator.name ]
59 
60  # default for BeamPipe is (Rk,Mat)
61  TimedSubPropagators += [ AtlasRungeKuttaPropagator.name ]
62  TimedSubUpdators += [ MaterialEffectsUpdator.name ]
63 
64  # default for Calo is (STEP,Mat)
65  TimedSubPropagators += [ AtlasSTEP_Propagator.name ]
66  TimedSubUpdators += [ NIMatEffUpdator.name ]
67 
68  # default for MS is (STEP,Mat)
69  TimedSubPropagators += [ AtlasSTEP_Propagator.name ]
70  TimedSubUpdators += [ MaterialEffectsUpdator.name ]
71 
72  # default for Cavern is (Rk,Mat)
73  TimedSubPropagators += [ AtlasRungeKuttaPropagator.name ]
74  TimedSubUpdators += [ MaterialEffectsUpdator.name ]
75 
76  # ----------------------------------------------------------------------------------------------------------
77 
78  kwargs.setdefault("MaterialEffectsUpdators", TimedUpdators) # PublicToolHandleArray
79  kwargs.setdefault("Propagators", TimedPropagators) # PublicToolHandleArray
80  kwargs.setdefault("SubPropagators", TimedSubPropagators) # vector of strings
81  kwargs.setdefault("SubMEUpdators", TimedSubUpdators) # vector of strings
82  from TrkConfig.AtlasExtrapolatorToolsConfig import AtlasEnergyLossUpdatorCfg
83  kwargs.setdefault("EnergyLossUpdater",
84  result.addPublicTool(result.popToolsAndMerge(AtlasEnergyLossUpdatorCfg(flags)))) # PublicToolHandle
85 
86  result.setPrivateTools(CompFactory.Trk.TimedExtrapolator(name, **kwargs))
87  return result
python.LArElecCalibDBConfig.LArElecCalibDBCfg
def LArElecCalibDBCfg(flags, condObjs)
Definition: LArElecCalibDBConfig.py:47
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.AtlasExtrapolatorToolsConfig.AtlasEnergyLossUpdatorCfg
def AtlasEnergyLossUpdatorCfg(flags, name='AtlasEnergyLossUpdator', **kwargs)
Definition: AtlasExtrapolatorToolsConfig.py:12
python.TrkExSTEP_PropagatorConfig.AtlasNoMatSTEP_PropagatorCfg
def AtlasNoMatSTEP_PropagatorCfg(flags, name='NoMatSTEP_Propagator', **kwargs)
Definition: TrkExSTEP_PropagatorConfig.py:28
python.TrkExRungeKuttaPropagatorConfig.RungeKuttaPropagatorCfg
def RungeKuttaPropagatorCfg(flags, name='AtlasRungeKuttaPropagator', **kwargs)
Definition: TrkExRungeKuttaPropagatorConfig.py:9
FastCaloSimFactoryNew.NITimedExtrapolatorCfg
def NITimedExtrapolatorCfg(flags, name="ISF_NITimedExtrapolator", **kwargs)
Definition: FastCaloSimFactoryNew.py:9
python.MagFieldServicesConfig.AtlasFieldCacheCondAlgCfg
def AtlasFieldCacheCondAlgCfg(flags, **kwargs)
Definition: MagFieldServicesConfig.py:8