ATLAS Offline Software
Functions
G4AtlasAlgConfig Namespace Reference

Functions

def G4AtlasAlgCfg (flags, name="G4AtlasAlg", **kwargs)
 

Function Documentation

◆ G4AtlasAlgCfg()

def G4AtlasAlgConfig.G4AtlasAlgCfg (   flags,
  name = "G4AtlasAlg",
**  kwargs 
)
Return ComponentAccumulator configured for Atlas G4 simulation, without output

Definition at line 12 of file G4AtlasAlgConfig.py.

12 def G4AtlasAlgCfg(flags, name="G4AtlasAlg", **kwargs):
13  """Return ComponentAccumulator configured for Atlas G4 simulation, without output"""
14  # wihout output
15  result = ComponentAccumulator()
16  from SimulationConfig.SimEnums import LArParameterization
17  if flags.Sim.LArParameterization is LArParameterization.FastCaloSim:
18  # Add a dummy version of the SimKernel to the CA before adding the properly configured version
19  # Presently necessary for FastCaloSim to ensure the proper order of ISF_CollectionMerger
20  result.addEventAlgo(CompFactory.G4AtlasAlg(name, **kwargs))
21  kwargs.setdefault("UseShadowEvent", flags.Sim.UseShadowEvent)
22  if flags.Sim.UseShadowEvent and "TruthPreselectionTool" not in kwargs:
23  from ISF_HepMC_Tools.ISF_HepMC_ToolsConfig import TruthPreselectionToolCfg
24  kwargs.setdefault( "TruthPreselectionTool", result.popToolsAndMerge(TruthPreselectionToolCfg(flags)) )
25 
26  kwargs.setdefault("DetGeoSvc", result.getPrimaryAndMerge(DetectorGeometrySvcCfg(flags)).name)
27 
28  kwargs.setdefault("InputTruthCollection", "BeamTruthEvent") #tocheck -are these string inputs?
29  kwargs.setdefault("OutputTruthCollection", "TruthEvent")
30 
31 
32 
33  kwargs.setdefault("ReleaseGeoModel", flags.Sim.ReleaseGeoModel)
34  kwargs.setdefault("ExtraInputs", InputContainerListCfg(flags))
35  kwargs.setdefault("ExtraOutputs", SimHitContainerListCfg(flags))
36 
37  # Set the path to the simplified calorimeter geometry for particle transport if provided
38  if flags.Sim.LArParameterization is LArParameterization.FastCaloSim and flags.Sim.SimplifiedGeoPath:
39  kwargs.setdefault("SimplifiedGeoPath", flags.Sim.SimplifiedGeoPath)
40 
41 
42  kwargs.setdefault("RecordFlux", flags.Sim.RecordFlux)
43 
44  if flags.Sim.FlagAbortedEvents:
45 
46  kwargs.setdefault("FlagAbortedEvents", flags.Sim.FlagAbortedEvents)
47  if flags.Sim.FlagAbortedEvents and flags.Sim.KillAbortedEvents:
48  print("WARNING When G4AtlasAlg.FlagAbortedEvents is True G4AtlasAlg.KillAbortedEvents should be False. Setting G4AtlasAlg.KillAbortedEvents = False now.")
49  kwargs.setdefault("KillAbortedEvents", False)
50 
51 
52  kwargs.setdefault("KillAbortedEvents", flags.Sim.KillAbortedEvents)
53 
54  from RngComps.RngCompsConfig import AthRNGSvcCfg
55  kwargs.setdefault("AtRndmGenSvc",
56  result.getPrimaryAndMerge(AthRNGSvcCfg(flags)).name)
57 
58  kwargs.setdefault("RandomGenerator", "athena")
59 
60  # Multi-threading settinggs
61  is_hive = flags.Concurrency.NumThreads > 0
62  kwargs.setdefault("MultiThreading", is_hive)
63  if is_hive:
64  kwargs.setdefault('Cardinality', flags.Concurrency.NumThreads)
65 
66  kwargs.setdefault("TruthRecordService", result.getPrimaryAndMerge(TruthServiceCfg(flags)).name)
67  kwargs.setdefault("GeoIDSvc", result.getPrimaryAndMerge(GeoIDSvcCfg(flags)).name)
68 
69  #input converter
70  kwargs.setdefault("InputConverter", result.getPrimaryAndMerge(InputConverterCfg(flags)).name)
71  if flags.Sim.ISF.Simulator.isQuasiStable():
72  from BeamEffects.BeamEffectsAlgConfig import ZeroLifetimePositionerCfg
73  kwargs.setdefault("QuasiStablePatcher", result.getPrimaryAndMerge(ZeroLifetimePositionerCfg(flags)).name )
74 
75  #sensitive detector master tool
76  kwargs.setdefault("SenDetMasterTool", result.addPublicTool(result.popToolsAndMerge(SensitiveDetectorMasterToolCfg(flags))))
77 
78  #fast simulation master tool
79  kwargs.setdefault("FastSimMasterTool", result.addPublicTool(result.popToolsAndMerge(FastSimulationMasterToolCfg(flags))))
80 
81  #Write MetaData container and make it available to the job
82  result.merge(writeSimulationParametersMetadata(flags))
83  result.merge(readSimulationParameters(flags)) # for FileMetaData creation
84 
85  #User action services (Slow...)
86  kwargs.setdefault("UserActionSvc", result.getPrimaryAndMerge(UserActionSvcCfg(flags)).name)
87 
88  #PhysicsListSvc
89  kwargs.setdefault("PhysicsListSvc", result.getPrimaryAndMerge(PhysicsListSvcCfg(flags)).name)
90 
91 
95  verbosities=dict(foo="bar")
96  kwargs.setdefault("Verbosities", verbosities)
97  kwargs.setdefault("QuietMode", flags.Exec.QuietMode)
98 
99  # Set commands for the G4AtlasAlg
100  kwargs.setdefault("G4Commands", flags.Sim.G4Commands)
101  from SimulationConfig.SimEnums import CalibrationRun
102  if flags.Sim.CalibrationRun in [CalibrationRun.LAr, CalibrationRun.LArTile, CalibrationRun.LArTileZDC]:
103  # Needed to ensure that DeadMaterialCalibrationHitsMerger is scheduled correctly.
104  kwargs.setdefault("ExtraOutputs", [( 'CaloCalibrationHitContainer' , 'StoreGateSvc+LArCalibrationHitActive_DEAD' ), ( 'CaloCalibrationHitContainer' , 'StoreGateSvc+LArCalibrationHitDeadMaterial_DEAD' ), ( 'CaloCalibrationHitContainer' , 'StoreGateSvc+LArCalibrationHitInactive_DEAD' )])
105  result.addEventAlgo(CompFactory.G4AtlasAlg(name, **kwargs))
106 
107  return result
G4AtlasAlgConfig.G4AtlasAlgCfg
def G4AtlasAlgCfg(flags, name="G4AtlasAlg", **kwargs)
Definition: G4AtlasAlgConfig.py:12
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.SimulationMetadata.readSimulationParameters
def readSimulationParameters(flags)
Definition: SimulationMetadata.py:96
G4AtlasServicesConfig.DetectorGeometrySvcCfg
def DetectorGeometrySvcCfg(flags, name="DetectorGeometrySvc", **kwargs)
Definition: G4AtlasServicesConfig.py:14
G4AtlasToolsConfig.FastSimulationMasterToolCfg
def FastSimulationMasterToolCfg(flags, **kwargs)
Definition: G4AtlasToolsConfig.py:53
ISF_HepMC_ToolsConfig.TruthPreselectionToolCfg
def TruthPreselectionToolCfg(flags, name="TruthPreselectionTool", **kwargs)
Definition: ISF_HepMC_ToolsConfig.py:165
G4AtlasUserActionConfig.UserActionSvcCfg
def UserActionSvcCfg(flags, name="G4UA::UserActionSvc", **kwargs)
Definition: G4AtlasUserActionConfig.py:146
print
void print(char *figname, TCanvas *c1)
Definition: TRTCalib_StrawStatusPlots.cxx:25
ISF_ServicesConfig.TruthServiceCfg
def TruthServiceCfg(flags, **kwargs)
Definition: ISF_ServicesConfig.py:80
G4AtlasServicesConfig.PhysicsListSvcCfg
def PhysicsListSvcCfg(flags, name="PhysicsListSvc", **kwargs)
Definition: G4AtlasServicesConfig.py:22
G4AtlasToolsConfig.InputContainerListCfg
def InputContainerListCfg(flags)
Definition: G4AtlasToolsConfig.py:294
python.SimulationMetadata.writeSimulationParametersMetadata
def writeSimulationParametersMetadata(flags)
Definition: SimulationMetadata.py:76
ISF_ServicesConfig.InputConverterCfg
def InputConverterCfg(flags, name="ISF_InputConverter", **kwargs)
Definition: ISF_ServicesConfig.py:33
MuonG4SDConfig.SimHitContainerListCfg
def SimHitContainerListCfg(flags)
Definition: MuonG4SDConfig.py:48
ISF_ServicesCoreConfig.GeoIDSvcCfg
def GeoIDSvcCfg(flags, name="ISF_GeoIDSvc", **kwargs)
Definition: ISF_ServicesCoreConfig.py:22
BeamEffectsAlgConfig.ZeroLifetimePositionerCfg
def ZeroLifetimePositionerCfg(flags, name="ZeroLifetimePositioner", **kwargs)
Definition: BeamEffectsAlgConfig.py:169
G4AtlasToolsConfig.SensitiveDetectorMasterToolCfg
def SensitiveDetectorMasterToolCfg(flags, name="SensitiveDetectorMasterTool", **kwargs)
Definition: G4AtlasToolsConfig.py:372
RngCompsConfig.AthRNGSvcCfg
def AthRNGSvcCfg(flags, name="AthRNGSvc")
Definition: RngCompsConfig.py:51