def getGeant4SimSvc(name="ISF_Geant4SimSvc", **kwargs): from ISF_Config.ISF_jobProperties import ISF_Flags kwargs.setdefault('FullGeant4', False) kwargs.setdefault('SimulationTool', 'ISFG4TransportTool') kwargs.setdefault('Identifier', "Geant4") kwargs.setdefault('PrintTimingInfo', ISF_Flags.DoTimeMonitoring()) return getIGeant4(**kwargs).getSimSvc()
def getGeant4Tool(name="ISF_Geant4Tool", **kwargs): from G4AtlasApps.SimFlags import simFlags kwargs.setdefault('RandomNumberService', simFlags.RandomSvcMT()) kwargs.setdefault('InputConverter', 'ISF_InputConverter') kwargs.setdefault('UserActionSvc','G4UA::ISFUserActionSvc') if hasattr(simFlags, 'RecordFlux') and simFlags.RecordFlux.statusOn: kwargs.setdefault('RecordFlux',simFlags.RecordFlux()) # Multi-threading settinggs from AthenaCommon.ConcurrencyFlags import jobproperties as concurrencyProps if concurrencyProps.ConcurrencyFlags.NumThreads() > 0: is_hive = True else: is_hive = False kwargs.setdefault('MultiThreading', is_hive) # Set commands for the G4AtlasAlg kwargs.setdefault("G4Commands", simFlags.G4Commands.get_Value()) from ISF_Config.ISF_jobProperties import ISF_Flags kwargs.setdefault('PrintTimingInfo' , ISF_Flags.DoTimeMonitoring() ) kwargs.setdefault('SenDetMasterTool', 'SensitiveDetectorMasterTool') kwargs.setdefault('FastSimMasterTool', 'FastSimulationMasterTool') from AthenaCommon import CfgMgr # Workaround to keep other simulation flavours working while we migrate everything to be AthenaMT-compatible. if ISF_Flags.Simulator.get_Value() in ['FullG4', 'FullG4MT', 'PassBackG4', 'PassBackG4MT', 'G4FastCalo', 'G4FastCaloMT']: return CfgMgr.iGeant4__G4TransportTool(name, **kwargs) else: return CfgMgr.iGeant4__G4LegacyTransportTool(name, **kwargs)
def getKernel_GenericSimulator(name="ISF_Kernel_GenericSimulator", **kwargs): kwargs.setdefault("InputHardScatterCollection", "BeamTruthEvent") kwargs.setdefault("OutputHardScatterTruthCollection", "TruthEvent") kwargs.setdefault("InputConverter", "ISF_InputConverter") kwargs.setdefault("ParticleBroker", "ISF_ParticleBrokerSvc") from G4AtlasApps.SimFlags import simFlags kwargs.setdefault("TruthRecordService", simFlags.TruthStrategy.TruthServiceName()) kwargs.setdefault("SimHitService", "ISF_SimHitService") kwargs.setdefault("MemoryMonitoringTool", "ISF_MemoryMonitor") kwargs.setdefault("DoCPUMonitoring", ISF_Flags.DoTimeMonitoring()) kwargs.setdefault("DoMemoryMonitoring", ISF_Flags.DoMemoryMonitoring()) from ISF_Algorithms.ISF_AlgorithmsConf import ISF__SimKernel SimKernel = ISF__SimKernel(name, **kwargs) ##FIXME shouldn't really be doing this here from AthenaCommon.AlgSequence import AlgSequence topSequence = AlgSequence() topSequence += SimKernel return SimKernel