Verified Commit ee12e59e authored by Tadej Novak's avatar Tadej Novak
Browse files

Ensure G4 jobs convert legacy xAOD::EventInfo early enough

parent cff050b2
Pipeline #3838826 passed with stage
in 0 seconds
......@@ -82,6 +82,9 @@ print (topSeq.ParticleGun)
# This should only be used when evgen is run in the simulation step
include('G4AtlasApps/fragment.SimCopyWeights.py')
# Create xAOD::EventInfo from EventInfo
topSeq += CfgMgr.xAODMaker__EventInfoCnvAlg()
include("G4AtlasApps/G4Atlas.flat.configuration.py")
#from TruthExamples.TruthExamplesConf import DumpMC
......@@ -90,10 +93,6 @@ include("G4AtlasApps/G4Atlas.flat.configuration.py")
from AthenaCommon.CfgGetter import getAlgorithm
topSeq += getAlgorithm("BeamEffectsAlg", tryDefaultConfigurable=True)
# Create xAOD::EventInfo from EventInfo
topSeq += CfgMgr.xAODMaker__EventInfoCnvAlg()
## Add the G4 sim to the alg sequence after the generator
from AthenaCommon.CfgGetter import getAlgorithm
topSeq += getAlgorithm("G4AtlasAlg",tryDefaultConfigurable=True)
......
......@@ -72,11 +72,18 @@ simFlags.ReleaseGeoModel = False
# Debug outputs of user actions
#CfgGetter.getPublicTool('G4UA::AthenaTrackingActionTool').OutputLevel = DEBUG
include("G4AtlasApps/G4Atlas.flat.configuration.py")
# Setup the algorithm and output sequences
# Setup the algorithm sequence
from AthenaCommon.AlgSequence import AlgSequence
topSeq = AlgSequence()
from G4AtlasApps.G4Atlas_Metadata import checkForContainerInInput
if not checkForContainerInInput("xAOD::EventInfo"):
# If xAOD::EventInfo is not present in the input file then it should be created
topSeq += CfgMgr.xAODMaker__EventInfoCnvAlg()
include("G4AtlasApps/G4Atlas.flat.configuration.py")
# Setup the output sequence
from AthenaCommon.AppMgr import theApp
StreamHITS = theApp.getOutputStream( "StreamHITS" )
......@@ -87,11 +94,6 @@ CfgMgr.SGInputLoader().Load += [('McEventCollection', 'StoreGateSvc+GEN_EVENT')]
from AthenaCommon.CfgGetter import getAlgorithm
topSeq += getAlgorithm("BeamEffectsAlg", tryDefaultConfigurable=True)
from G4AtlasApps.G4Atlas_Metadata import checkForContainerInInput
if not checkForContainerInInput("xAOD::EventInfo"):
# If xAOD::EventInfo is not present in the input file then it should be created
topSeq += CfgMgr.xAODMaker__EventInfoCnvAlg()
# Add the (python) G4 simulation service.
# This will kickstart a lot of simulation setup.
topSeq += getAlgorithm("G4AtlasAlg", tryDefaultConfigurable=True)
......
......@@ -62,16 +62,16 @@ simFlags.EventFilter.set_On()
#callbacks.use_simplerunge_stepper()
#callbacks.use_verbose_tracking()
include("G4AtlasApps/G4Atlas.flat.configuration.py")
from AthenaCommon.CfgGetter import getAlgorithm
topSeq += getAlgorithm("BeamEffectsAlg", tryDefaultConfigurable=True)
from G4AtlasApps.G4Atlas_Metadata import checkForContainerInInput
if not checkForContainerInInput("xAOD::EventInfo"):
# If xAOD::EventInfo is not present in the input file then it should be created
topSeq += CfgMgr.xAODMaker__EventInfoCnvAlg()
include("G4AtlasApps/G4Atlas.flat.configuration.py")
from AthenaCommon.CfgGetter import getAlgorithm
topSeq += getAlgorithm("BeamEffectsAlg", tryDefaultConfigurable=True)
## Add the G4 sim to the alg sequence
from AthenaCommon.CfgGetter import getAlgorithm
topSeq += getAlgorithm("G4AtlasAlg",tryDefaultConfigurable=True)
......@@ -111,7 +111,7 @@ class TestAtlasG4(unittest.TestCase):
# need to evaluate to obtain actual Python object
ignore_Algs = ['EventInfoTagBuilder/EventInfoTagBuilder']
ath_alg_sequence_list = [ alg for alg in eval(ath_alg_sequence_as_str) if alg not in ignore_Algs ]
actual_last_ath_alg_sequence_entry = ath_alg_sequence_list[1] #Position 0 should be the timer alg
actual_last_ath_alg_sequence_entry = ath_alg_sequence_list[2] #Position 0 and 1 should be the EventInfo conversion and timer alg
expected_last_ath_alg_sequence_entry = "Simulation::BeamEffectsAlg/BeamEffectsAlg"
self.assertEqual(expected_last_ath_alg_sequence_entry,
actual_last_ath_alg_sequence_entry)
......
......@@ -226,6 +226,11 @@ if jobproperties.Beam.beamType.get_Value() != 'cosmics':
else:
simFlags.EventFilter.set_On()
from G4AtlasApps.G4Atlas_Metadata import checkForContainerInInput
if not checkForContainerInInput("xAOD::EventInfo"):
# If xAOD::EventInfo is not present in the input file then it should be created
topSeq += CfgMgr.xAODMaker__EventInfoCnvAlg()
include("G4AtlasApps/G4Atlas.flat.configuration.py")
## The looper killer is on by default. Disable it if this is requested.
......@@ -252,11 +257,6 @@ else:
from AthenaCommon.CfgGetter import getAlgorithm
topSeq += getAlgorithm("BeamEffectsAlg", tryDefaultConfigurable=True)
from G4AtlasApps.G4Atlas_Metadata import checkForContainerInInput
if not checkForContainerInInput("xAOD::EventInfo"):
# If xAOD::EventInfo is not present in the input file then it should be created
topSeq += CfgMgr.xAODMaker__EventInfoCnvAlg()
from AthenaCommon.CfgGetter import getAlgorithm
topSeq += getAlgorithm("G4AtlasAlg",tryDefaultConfigurable=True)
......
Supports Markdown
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