Skip to content
Snippets Groups Projects
Commit 329fb60a authored by John Derek Chapman's avatar John Derek Chapman Committed by Graeme Stewart
Browse files

actually add python/FlagSetters.py and share/AllDet_detDescr.py....

actually add python/FlagSetters.py and share/AllDet_detDescr.py. ATLASSIM-2148. Tagging ISF_Config-00-01-24 (ISF_Config-00-01-24)

	* actually add python/FlagSetters.py and
	share/AllDet_detDescr.py. ATLASSIM-2148
	* tagging ISF_Config-00-01-24

2015-08-06  John Chapman  <John.Chapman@cern.ch>

	* add python/FlagSetters.py - module containing methods to set
	DetFlags and in the future other jobproperties in a
	simulator-specific way. ATLASSIM-2148
	* add python/AllDet_detDescr.py - replace the RecExCond version of
	this file with one that only does the minimum required for ISF.
	* share/ISF_ConfigJobInclude.py - remove all setting of
	DetFlags. This will now be done via the methods in
	FlagSetters.py. Include ISF_Config/AllDet_detDescr.py rather than
	RecExCond version. Use new ISF_Flags.Simulator.KernelName()
	method.
	* tagging ISF_Config-00-01-23

2015-07-31  John Chapman  <John.Chapman@cern.ch>
...
(Long ChangeLog diff - truncated)
parent 14599106
No related merge requests found
......@@ -6,7 +6,6 @@ manager Wolfgang Lukas <Wolfgang.Lukas@cern.ch>
private
use AtlasPolicy AtlasPolicy-*
use AtlasReconstructionRunTime AtlasReconstructionRunTime-*
private
use TestPolicy TestPolicy-*
......
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
## Base method
def configureFlagsBase():
from AthenaCommon.DetFlags import DetFlags
if not DetFlags.any_on():
# If you configure some of the DetFlags then you're
# responsible for configuring all of them.
DetFlags.all_setOn()
DetFlags.Truth_setOn() # FIXME redundant?
DetFlags.LVL1_setOff() # LVL1 is not part of G4 sim
DetFlags.Forward_setOff() # Forward dets are off by default
## Configure tasks
DetFlags.digitize.all_setOff()
DetFlags.makeRIO.all_setOff()
#DetFlags.overlay.all_setOff() # will soon be needed
DetFlags.pileup.all_setOff()
DetFlags.readRDOBS.all_setOff()
DetFlags.readRDOPool.all_setOff()
DetFlags.readRIOBS.all_setOff()
DetFlags.readRIOPool.all_setOff()
DetFlags.simulateLVL1.all_setOff()
DetFlags.writeBS.all_setOff()
DetFlags.writeRDOPool.all_setOff()
DetFlags.writeRIOPool.all_setOff()
return
## methods for Geant4 only simulators
def configureFlagsFullG4():
from G4AtlasApps.SimFlags import simFlags
simFlags.SimulationFlavour = "FullG4"
return
def configureFlagsPassBackG4():
configureFlagsFullG4()
from G4AtlasApps.SimFlags import simFlags
simFlags.SimulationFlavour = "PassBackG4"
return
def configureFlagsMC12G4():
configureFlagsFullG4()
from G4AtlasApps.SimFlags import simFlags
simFlags.SimulationFlavour = "MC12G4"
return
def configureFlagsMC12G4_longLived():
configureFlagsMC12G4()
from G4AtlasApps.SimFlags import simFlags
simFlags.SimulationFlavour = "MC12G4_longLived"
return
def configureFlagsCosmicsG4():
configureFlagsMC12G4()
return
def configureFlagsMC12G4_IDOnly():
configureFlagsFullG4()
from G4AtlasApps.SimFlags import simFlags
simFlags.SimulationFlavour = "MC12G4_IDOnly"
return
def configureFlagsMC12G4_IDCalo():
configureFlagsFullG4()
from G4AtlasApps.SimFlags import simFlags
simFlags.SimulationFlavour = "MC12G4_IDCalo"
return
## methods for simulators which use G4 + FastCaloSim
def configureFlagsATLFASTII():
from G4AtlasApps.SimFlags import simFlags
simFlags.SimulationFlavour = "AtlfastII" # TODO: can we rename this to "ATLFASTII" ?
return
## methods for simulators which use Fatras + FastCaloSim
def configureFlagsATLFASTIIF():
from AthenaCommon.DetFlags import DetFlags
# BCM simulation not supported in FATRAS. Currently it is the
# geometry task which is used to determine whether a detector has
# been simulated (see ISF_Example/python/ISF_Output.py)
DetFlags.geometry.BCM_setOff()
from G4AtlasApps.SimFlags import simFlags
simFlags.SimulationFlavour = "ATLFASTIIF"
return
def configureFlagsFatras_newExtrapolation():
configureFlagsATLFASTIIF()
from G4AtlasApps.SimFlags import simFlags
simFlags.SimulationFlavour = "Fatras_newExtrapolation"
return
def configureFlagsFatras_newExtrapolation_IDOnly():
configureFlagsATLFASTIIF()
from G4AtlasApps.SimFlags import simFlags
simFlags.SimulationFlavour = "Fatras_newExtrapolation_IDOnly"
return
def configureFlagsATLFASTIIF_PileUp():
configureFlagsATLFASTIIF()
from G4AtlasApps.SimFlags import simFlags
simFlags.SimulationFlavour = "ATLFASTIIF_PileUp"
return
def configureFlagsATLFASTIIF_IDOnly():
configureFlagsATLFASTIIF()
from G4AtlasApps.SimFlags import simFlags
simFlags.SimulationFlavour = "ATLFASTIIF_IDOnly"
return
def configureFlagsATLFASTIIF_IDCalo():
configureFlagsATLFASTIIF()
from G4AtlasApps.SimFlags import simFlags
simFlags.SimulationFlavour = "ATLFASTIIF_IDCalo"
return
def configureFlagsFastOnly():
configureFlagsATLFASTIIF()
return
## methods for simulators which combine Geant4, Fatras and FastCaloSim
def configureFlagsMultiSimTest():
return
def configureFlagsG4GammaCones():
return
def configureFlagsG4GammaCones_FastCalo():
return
def configureFlagsFatrasGammaCones_FastCalo():
return
def configureFlagsG4BHadronsOnly_FastCalo():
return
def configureFlagsG4BHadrons_FatrasID_FastCalo():
return
def configureFlagsG4TauProductsOnly():
return
def configureFlagsG4HiggsLeptonsConeOnly():
return
def configureFlagsG4HiggsLeptons():
return
def configureFlagsG4WLeptonsCone_FatrasID_FastCalo ():
return
def configureFlagsG4JPsiLeptonsCone_FatrasID_FastCalo ():
return
def configureFlagsG4ZLeptonsCone_FatrasID_FastCalo ():
return
def configureFlagsG4ZLeptonsConeSticky_FatrasID_FastCalo ():
return
def configureFlagsG4ZDecayProducts_FatrasID_FastCalo ():
return
This diff is collapsed.
......@@ -76,12 +76,6 @@ class VertexPositionFromFile(JobProperty):
allowedTypes = ['bool']
StoredValue = False
class UseNewG4Config(JobProperty):
"""Steering of ISF: use new G4 config"""
statusOn = True
allowedTypes = ['bool']
StoredValue = False
class DoMemoryMonitoring(JobProperty):
"""Steering of ISF: do memory monitoring"""
statusOn = True
......@@ -105,6 +99,12 @@ class Simulator(JobProperty):
statusOn = True
allowedTypes = ['str']
StoredValue = 'ATLFASTII'
def KernelName(self):
if self.statusOn:
return 'ISF_Kernel_' + self.StoredValue
def configFlagsMethodName(self):
if self.statusOn:
return 'configureFlags' + self.StoredValue
## TODO Setting this should automatically update dependent jobproperties.
class TruthStrategy(JobProperty):
......@@ -206,7 +206,6 @@ jobproperties.ISF_jobProperties.add_JobProperty(DumpStoreGate)
jobproperties.ISF_jobProperties.add_JobProperty(RunValgrind)
jobproperties.ISF_jobProperties.add_JobProperty(ValidationMode)
jobproperties.ISF_jobProperties.add_JobProperty(VertexPositionFromFile)
jobproperties.ISF_jobProperties.add_JobProperty(UseNewG4Config)
jobproperties.ISF_jobProperties.add_JobProperty(DoMemoryMonitoring)
jobproperties.ISF_jobProperties.add_JobProperty(DoTimeMonitoring)
jobproperties.ISF_jobProperties.add_JobProperty(Input)
......
# include so that alldet_detdescr can be used directly from somewhere else
# (there is an include.block so that it is only loaded once)
include.block("ISF_Config/AllDet_detDescr.py")
# also block alternatives
include.block("RecExCond/AllDet_detDescr.py")
include.block("RecExCommon/AllDet_detDescr.py")
from AthenaCommon.Resilience import protectedInclude
if DetFlags.detdescr.any_on():
from AtlasGeoModel import SetGeometryVersion
from AtlasGeoModel import GeoModelInit
from AtlasGeoModel import SetupRecoGeometry
# Beam Spot service job options - just defines conditions data access
if DetFlags.detdescr.ID_on():
protectedInclude("InDetBeamSpotService/BeamCondSvc.py" )
if DetFlags.detdescr.LAr_on():
include( "LArDetDescr/LArDetDescr_joboptions.py" )
if DetFlags.detdescr.Tile_on():
protectedInclude( "TileConditions/TileConditions_jobOptions.py" )
if DetFlags.detdescr.Muon_on():
protectedInclude ("AmdcAth/AmdcAth_jobOptions.py")
# MagneticField Service
if DetFlags.detdescr.BField_on():
import MagFieldServices.SetupField
......@@ -53,31 +53,20 @@ if globalflags.DetDescrVersion() not in simFlags.SimLayout.get_Value():
simFlags.load_atlas_flags()
simFlags.EventFilter.set_Off()
# set the detectors on/off and steer the fast simulation flags
if 'DetFlags' not in dir():
## If you configure one det flag, you're responsible for configuring them all!
from AthenaCommon.DetFlags import DetFlags
DetFlags.all_setOn()
DetFlags.LVL1_setOff() # LVL1 is not part of G4 sim
DetFlags.Truth_setOn()
DetFlags.Forward_setOff() # Forward dets are off by default
#--------------------------------------------------------------
# Job setup
#--------------------------------------------------------------
theApp.EvtMax = athenaCommonFlags.EvtMax()
# all det description
include('RecExCond/AllDet_detDescr.py')
include('ISF_Config/AllDet_detDescr.py')
DetFlags.Print()
if len(globalflags.ConditionsTag()):
from IOVDbSvc.CondDB import conddb
conddb.setGlobalTag(globalflags.ConditionsTag())
#include("ISF_Example/CommonISFJobOptions.py")
#--------------------------------------------------------------
# Setup the ISF Services
#--------------------------------------------------------------
......@@ -115,8 +104,9 @@ elif jobproperties.Beam.beamType.get_Value() == 'cosmics':
else:
getAlgorithm('EvgenCosmicGenerator')
# non of the above
elif hasattr(ServiceMgr, 'EventSelector'):
print "ISF Input Configuration: EventSelector already defined, likely running with a particle gun preInclude"
elif not athenaCommonFlags.PoolEvgenInput.statusOn:
print "ISF Input Configuration: PoolEvgenInput off, likely running with a particle gun preInclude"
# non of the above -> input via ISF_Flags
else :
if ISF_Flags.OverrideInputFiles():
......@@ -133,7 +123,7 @@ from ISF_Example.ISF_Input import ISF_Input
#from ISF_Geant4Tools.ISF_Geant4ToolsConf import iGeant4__SDActivateUserAction
#ToolSvc += iGeant4__SDActivateUserAction("ISFSDActivateUserAction",
# OutputLevel=INFO)
SimKernel = getAlgorithm('ISF_Kernel_' + ISF_Flags.Simulator())
SimKernel = getAlgorithm(ISF_Flags.Simulator.KernelName())
#--------------------------------------------------------------
......
......@@ -38,7 +38,6 @@ from ISF_Config.ISF_jobProperties import ISF_Flags
#ISF_Flags.RunValgrind = True # default: False
ISF_Flags.ValidationMode = ValidationMode # default: False
#ISF_Flags.VertexPositionFromFile = True # default: False
#ISF_Flags.UseNewG4Config = True # default: False
ISF_Flags.DoMemoryMonitoring = True # default: False
ISF_Flags.DoTimeMonitoring = True # default: False
ISF_Flags.Input = Input # default: 'ttbar'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment