From 9267b79a6982b723a50d3e4c4faf531ff20b8ff5 Mon Sep 17 00:00:00 2001 From: John Derek Chapman <chapman@hep.phy.cam.ac.uk> Date: Thu, 28 Jul 2016 10:04:54 +0200 Subject: [PATCH] python/ISF_ServicesConfig.py (getSimHitService): add missing import of ISF_Flags. ATLASSIM-3004, ATLASSIM-2679. Tagging ISF_Services-01-00-04 (ISF_Services-01-00-04) * python/ISF_ServicesConfig.py (getSimHitService): add missing import of ISF_Flags. ATLASSIM-3004, ATLASSIM-2679 * ISF_Services-01-00-04 2016-07-12 John Chapman <John.Chapman@cern.ch> * python/ISF_ServicesConfigDb.py - remove unneeded imports. Register CfgGetter method for ISF_ParticleKillerSvc. ATLASSIM-2352 * python/ISF_ServicesConfig.py - add getParticleKillerSvc CfgGetter method. ATLASSIM-2352. General tidying of syntax. * ISF_Services-01-00-03 * src/SimHitSvc.cxx - check empty hit collections Former-commit-id: 4ce560c72fb36771dfb3d1ff96fe6d6de7222451 --- .../ISF_Services/python/ISF_ServicesConfig.py | 33 +++++++------------ .../python/ISF_ServicesConfigDb.py | 10 ++---- 2 files changed, 14 insertions(+), 29 deletions(-) diff --git a/Simulation/ISF/ISF_Core/ISF_Services/python/ISF_ServicesConfig.py b/Simulation/ISF/ISF_Core/ISF_Services/python/ISF_ServicesConfig.py index 762637beb58..61d8e07ce6b 100644 --- a/Simulation/ISF/ISF_Core/ISF_Services/python/ISF_ServicesConfig.py +++ b/Simulation/ISF/ISF_Core/ISF_Services/python/ISF_ServicesConfig.py @@ -5,28 +5,22 @@ Tools configurations for ISF KG Tan, 17/06/2012 """ -from AthenaCommon.CfgGetter import getPrivateTool,getPrivateToolClone,getPublicTool,getPublicToolClone,\ - getService,getServiceClone,getAlgorithm,getAlgorithmClone +from AthenaCommon import CfgMgr from AthenaCommon.Constants import * # FATAL,ERROR etc. from AthenaCommon.SystemOfUnits import * -from AthenaCommon.DetFlags import DetFlags - -from ISF_Config.ISF_jobProperties import ISF_Flags # IMPORTANT: Flags must be set before tools are retrieved - def getParticleBrokerSvcNoOrdering(name="ISF_ParticleBrokerSvcNoOrdering", **kwargs): kwargs.setdefault('StackFiller' , 'ISF_StackFiller' ) kwargs.setdefault('EntryLayerTool' , 'ISF_EntryLayerTool' ) kwargs.setdefault('GeoIDSvc' , 'ISF_GeoIDSvc' ) kwargs.setdefault('AlwaysUseGeoIDSvc' , False ) + from ISF_Config.ISF_jobProperties import ISF_Flags kwargs.setdefault('ValidateGeoIDs' , ISF_Flags.ValidationMode() ) kwargs.setdefault('ValidationOutput' , ISF_Flags.ValidationMode() ) kwargs.setdefault('ValidationStreamName' , "ParticleBroker" ) kwargs.setdefault('BarcodeService' , ISF_Flags.BarcodeService() ) - - from ISF_Services.ISF_ServicesConf import ISF__ParticleBrokerDynamicOnReadIn - return ISF__ParticleBrokerDynamicOnReadIn(name, **kwargs) + return CfgMgr.ISF__ParticleBrokerDynamicOnReadIn(name, **kwargs) def getParticleBrokerSvc(name="ISF_ParticleBrokerSvc", **kwargs): #kwargs.setdefault('ParticleOrderingTool' , 'ISF_InToOutSubDetOrderingTool' ) @@ -42,10 +36,9 @@ def getAFIIParticleBrokerSvc(name="ISF_AFIIParticleBrokerSvc", **kwargs): return getParticleBrokerSvc(name, **kwargs) def getSimHitService(name="ISF_SimHitService", **kwargs): + from ISF_Config.ISF_jobProperties import ISF_Flags kwargs.setdefault('ValidationOutput' , ISF_Flags.ValidationMode() ) - - from ISF_Services.ISF_ServicesConf import ISF__SimHitSvc - return ISF__SimHitSvc(name, **kwargs) + return CfgMgr.ISF__SimHitSvc(name, **kwargs) def getNoG4SimHitService(name="ISF_NoG4SimHitService", **kwargs): kwargs.setdefault("SensitiveDetectorMasterTool","EmptySensitiveDetectorMasterTool") @@ -59,28 +52,26 @@ def getPileupSimHitService(name="ISF_PileupSimHitService", **kwargs): def getISFEnvelopeDefSvc(name="ISF_ISFEnvelopeDefSvc", **kwargs): # ATLAS common envlope definitions kwargs.setdefault("ATLASEnvelopeDefSvc" , "AtlasGeometry_EnvelopeDefSvc") - - from ISF_Services.ISF_ServicesConf import ISF__ISFEnvelopeDefSvc - return ISF__ISFEnvelopeDefSvc(name, **kwargs) + return CfgMgr.ISF__ISFEnvelopeDefSvc(name, **kwargs) def getAFIIEnvelopeDefSvc(name="ISF_AFIIEnvelopeDefSvc", **kwargs): from AthenaCommon.SystemOfUnits import mm # ATLAS common envlope definitions kwargs.setdefault("ISFEnvelopeDefSvc" , "ISF_ISFEnvelopeDefSvc" ) kwargs.setdefault("InDetMaxExtentZ" , 3549.5*mm ) - - from ISF_Services.ISF_ServicesConf import ISF__AFIIEnvelopeDefSvc - return ISF__AFIIEnvelopeDefSvc(name, **kwargs) + return CfgMgr.ISF__AFIIEnvelopeDefSvc(name, **kwargs) def getGeoIDSvc(name="ISF_GeoIDSvc", **kwargs): # with ISF volume definitions kwargs.setdefault("EnvelopeDefSvc" , "ISF_ISFEnvelopeDefSvc" ) - - from ISF_Services.ISF_ServicesConf import ISF__GeoIDSvc - return ISF__GeoIDSvc(name, **kwargs) + return CfgMgr.ISF__GeoIDSvc(name, **kwargs) def getAFIIGeoIDSvc(name="ISF_AFIIGeoIDSvc", **kwargs): kwargs.setdefault("EnvelopeDefSvc" , "ISF_AFIIEnvelopeDefSvc" ) return getGeoIDSvc(name, **kwargs) + +def getParticleKillerSvc(name="ISF_ParticleKillerSvc", **kwargs): + kwargs.setdefault('Identifier', "ParticleKiller") + return CfgMgr.ISF__ParticleKillerSimSvc(name, **kwargs) diff --git a/Simulation/ISF/ISF_Core/ISF_Services/python/ISF_ServicesConfigDb.py b/Simulation/ISF/ISF_Core/ISF_Services/python/ISF_ServicesConfigDb.py index 1c395388bc2..7e1a333128b 100644 --- a/Simulation/ISF/ISF_Core/ISF_Services/python/ISF_ServicesConfigDb.py +++ b/Simulation/ISF/ISF_Core/ISF_Services/python/ISF_ServicesConfigDb.py @@ -5,14 +5,7 @@ Configuration database for ISF_Services Elmar Ritsch, 16/12/2014 """ -from AthenaCommon.CfgGetter import addTool, addToolClone, addService, addAlgorithm, \ - addTypesToExcludeIfDefaultValue, addNamesToExcludeIfDefaultValue, addFullNamesToExcludeIfDefaultValue, \ - addPropertiesToExcludeIfDefault, \ - addTypesToSkipIfNotAvailable, addNamesToSkipIfNotAvailable, addFullNamesToSkipIfNotAvailable, \ - addTypesOnlyToSkip - -from AthenaCommon.Constants import * # FATAL,ERROR etc. -import AthenaCommon.SystemOfUnits as Units +from AthenaCommon.CfgGetter import addService # Common tools, services and algorithms used by jobs addService("ISF_Services.ISF_ServicesConfig.getISFEnvelopeDefSvc" , "ISF_ISFEnvelopeDefSvc" ) @@ -26,3 +19,4 @@ addService("ISF_Services.ISF_ServicesConfig.getAFIIParticleBrokerSvc" , "I addService("ISF_Services.ISF_ServicesConfig.getSimHitService" , "ISF_SimHitService" ) addService("ISF_Services.ISF_ServicesConfig.getNoG4SimHitService" , "ISF_NoG4SimHitService" ) addService("ISF_Services.ISF_ServicesConfig.getPileupSimHitService" , "ISF_PileupSimHitService" ) +addService("ISF_Services.ISF_ServicesConfig.getParticleKillerSvc" , "ISF_ParticleKillerSvc" ) -- GitLab