ATLAS Offline Software
FastCaloSimFactory.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
2 
3 def FastCaloSimFactory(name="FastCaloSimFactory", **kwargs):
4 
5  from AthenaCommon.Logging import logging
6  mlog = logging.getLogger('FastCaloSimFactory::configure:')
7 
8  from AthenaCommon.AppMgr import ToolSvc
9 
10  mlog.info("now configure the non-interacting propagator...")
11  from TrkExSTEP_Propagator.TrkExSTEP_PropagatorConf import Trk__STEP_Propagator
12  niPropagator = Trk__STEP_Propagator()
13  niPropagator.MaterialEffects = False
14  ToolSvc += niPropagator
15  mlog.info("configure nono-interacting propagator finished")
16 
17  from AthenaCommon.AlgSequence import AthSequencer
18  condSeq = AthSequencer("AthCondSeq")
19 
20  # use NI navigator method checks for
21  # ISF_Flags.UseTrackingGeometryCond
22  from TrkExTools.TimedExtrapolator import getNINavigator
23  navigator = getNINavigator (name="FCSNavigator")
24  ToolSvc += navigator
25 
26  mlog.info("now configure the TimedExtrapolator...")
27  from TrkExTools.TimedExtrapolator import TimedExtrapolator
28  timedExtrapolator = TimedExtrapolator()
29  timedExtrapolator.STEP_Propagator = niPropagator
30  timedExtrapolator.Navigator = navigator
31  timedExtrapolator.ApplyMaterialEffects = False
32  ToolSvc += timedExtrapolator
33  mlog.info("configure TimedExtrapolator finished")
34 
35  if not hasattr(condSeq, 'CellInfoContainerCondAlg'):
36  from FastCaloSim.FastCaloSimConf import CellInfoContainerCondAlg
37  condSeq += CellInfoContainerCondAlg("CellInfoContainerCondAlg")
38 
39  from TrkDetDescrSvc.TrkDetDescrJobProperties import TrkDetFlags
40 
41  kwargs.setdefault("CaloEntrance", TrkDetFlags.InDetContainerName())
42  kwargs.setdefault("Extrapolator", timedExtrapolator)
43 
44  from FastCaloSim.FastCaloSimConf import FastShowerCellBuilderTool
45  theFastShowerCellBuilderTool = FastShowerCellBuilderTool(name, **kwargs)
46 
47  try:
48  ParticleParametrizationFileName = theFastShowerCellBuilderTool.ParticleParametrizationFileName
49  except Exception:
50  ParticleParametrizationFileName = ""
51 
52  if ParticleParametrizationFileName == "" and len(theFastShowerCellBuilderTool.AdditionalParticleParametrizationFileNames) == 0:
53  ParticleParametrizationFileName = "FastCaloSim/v1/ParticleEnergyParametrization.root"
54 
55  theFastShowerCellBuilderTool.ParticleParametrizationFileName = ParticleParametrizationFileName
56  mlog.info("ParticleParametrizationFile=%s",
57  ParticleParametrizationFileName)
58 
59  mlog.info("all values:")
60  mlog.info(theFastShowerCellBuilderTool)
61 
62  return theFastShowerCellBuilderTool
AthSequencer
ClassName: AthSequencer.
Definition: AthSequencer.h:40
FastCaloSimFactory.FastCaloSimFactory
def FastCaloSimFactory(name="FastCaloSimFactory", **kwargs)
Definition: FastCaloSimFactory.py:3