Commit bd8e5556 authored by John Derek Chapman's avatar John Derek Chapman Committed by Graeme Stewart
Browse files

python/ISF_iGeant4Config.py - use ISF_Flags.TruthService to specify the...

python/ISF_iGeant4Config.py - use ISF_Flags.TruthService to specify the TruthService name. Requires ISF_Config-00-01-00 or later. ATLASSIM-1603. Tag ISF_Geant4Config-00-01-17 (ISF_Geant4Config-00-01-17)

	* python/ISF_iGeant4Config.py - use ISF_Flags.TruthService to
	specify the TruthService name. Requires ISF_Config-00-01-00 or
	later. ATLASSIM-1603.
	* tag ISF_Geant4Config-00-01-17

2014-10-01  Zach Marshall <ZLMarshall@lbl.gov>
	* python/iGeant4.py: Adding a catch for truth levels
	* tag ISF_Geant4Config-00-01-16

2014-09-08  Elmar Ritsch  <elmar.ritsch@cern.ch>

	* ISF_iGeant4Config.py: use of kwargs from ConfGetter to allow passing
	multiple arguments to getIGeant4(..) method
	* python/iGeant4.py: add GeoIDSvc to list of __init__(..) arguments
	* both needed for ATLASSIM-1556
	* tag ISF_Geant4Config-00-01-15
parent b9cff779
......@@ -21,11 +21,15 @@ def usingGeant4():
global cache
return bool(cache)
def getIGeant4(FullGeant4 = False):
def getIGeant4(**kwargs):
global cache
FullGeant4 = kwargs['FullGeant4']
if 'iGeant4' in cache:
i = cache['iGeant4']
# if FullGeant4 specified, make sure returning cached version with FullGeant4 already in use
if FullGeant4:
if (i.FullGeant4 == False) :
......@@ -34,16 +38,13 @@ def getIGeant4(FullGeant4 = False):
else:
if FullGeant4:
ParticleServiceName ="ISF_ParticleBrokerSvcNoOrdering"
else:
ParticleServiceName ="ISF_ParticleBrokerSvc"
from ISF_Config.ISF_jobProperties import ISF_Flags
from iGeant4 import iGeant4
i = iGeant4(ParticleService = getService(ParticleServiceName),
TruthService = getService('ISF_TruthService'),
SimHitService = getService('ISF_SimHitService'),
i = iGeant4(ParticleService = kwargs['ParticleService'],
TruthService = kwargs['TruthService'],
SimHitService = kwargs['SimHitService'],
GeoIDSvc = kwargs["GeoIDSvc"],
UseNewConfiguration = ISF_Flags.UseNewG4Config(),
PrintTimingInfo = ISF_Flags.DoTimeMonitoring(),
FullGeant4 = FullGeant4)
......@@ -51,7 +52,15 @@ def getIGeant4(FullGeant4 = False):
return i
def getGeant4SimSvc(name="ISF_Geant4SimSvc", **kwargs):
return getIGeant4().getSimSvc()
kwargs.setdefault('FullGeant4' , False )
kwargs.setdefault('ParticleService' , getService('ISF_ParticleBrokerSvc') )
kwargs.setdefault('TruthService' , ISF_Flags.TruthService.get_Value() )
kwargs.setdefault('SimHitService' , getService('ISF_SimHitService') )
kwargs.setdefault('GeoIDSvc' , getService('ISF_GeoIDSvc') )
return getIGeant4(**kwargs).getSimSvc()
def getFullGeant4SimSvc(name="ISF_Geant4SimSvc", **kwargs):
return getIGeant4(True).getSimSvc()
kwargs.setdefault('FullGeant4' , True )
kwargs.setdefault('ParticleService' , getService('ISF_ParticleBrokerSvcNoOrdering') )
return getGeant4SimSvc(name, **kwargs)
......@@ -11,7 +11,7 @@ from AthenaCommon.CfgGetter import getPrivateTool,getPrivateToolClone,getPublicT
G4Eng = None
class iGeant4:
def __init__(self, ParticleService, TruthService, SimHitService, UseNewConfiguration, PrintTimingInfo, FullGeant4 ):
def __init__(self, ParticleService, TruthService, SimHitService, GeoIDSvc, UseNewConfiguration, PrintTimingInfo, FullGeant4 ):
from G4AtlasApps.SimFlags import simFlags
from AthenaCommon.AppMgr import ToolSvc
from AthenaCommon.AppMgr import ServiceMgr as svcMgr
......@@ -44,10 +44,14 @@ class iGeant4:
from ISF_Geant4Tools.ISF_Geant4ToolsConf import iGeant4__TrackProcessorUserAction,iGeant4__SDActivateUserAction
G4TrackProcessorUserAction = iGeant4__TrackProcessorUserAction('ISFG4TrackProcessorUserAction')
G4TrackProcessorUserAction.ParticleBroker = ParticleService
G4TrackProcessorUserAction.GeoIDSvc = getService('ISF_GeoIDSvc')
G4TrackProcessorUserAction.GeoIDSvc = GeoIDSvc
G4TrackProcessorUserAction.Geant4OnlyMode = FullGeant4
if jobproperties.Beam.beamType() == 'cosmics' or \
(simFlags.CavernBG.statusOn and not 'Signal' in simFlags.CavernBG.get_Value() ):
G4TrackProcessorUserAction.TruthVolumeLevel = 2
ToolSvc += G4TrackProcessorUserAction
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment