Skip to content
Snippets Groups Projects
Commit f8e3ec93 authored by Walter Lampl's avatar Walter Lampl
Browse files

Merge branch 'OverlayMetaData_master' into 'master'

Manual sweep of !14376 from '21.0' to 'master': Run-dependent MC Overlay and for the IOVMetaDataContainers written out to the RDO file

See merge request atlas/athena!14551

Former-commit-id: b84a5cb8
parents b851cd3e bfe10740
No related branches found
No related tags found
No related merge requests found
......@@ -69,32 +69,6 @@ rec.projectName = 'IS_SIMULATION'
DataInputCollections=runArgs.inputRDO_BKGFile
athenaCommonFlags.PoolRDOInput=runArgs.inputRDO_BKGFile
import MagFieldServices.SetupField
from IOVDbSvc.CondDB import conddb
if hasattr(runArgs, 'conditionsTag') and runArgs.conditionsTag!='NONE' and runArgs.conditionsTag!='':
globalflags.ConditionsTag=runArgs.conditionsTag
if len(globalflags.ConditionsTag())!=0:
conddb.setGlobalTag(globalflags.ConditionsTag())
# LVL1 Trigger Menu
if hasattr(runArgs, "triggerConfig") and runArgs.triggerConfig!="NONE":
# LVL1 Trigger Menu
# PJB 9/2/2009 Setup the new triggerConfig flags here
from TriggerJobOpts.TriggerFlags import TriggerFlags
triggerArg = runArgs.triggerConfig
#if not prefixed with LVL1: add it here
Args = triggerArg.split(":")
if Args[0] != "LVL1":
TriggerFlags.triggerConfig ="LVL1:"+triggerArg
else:
TriggerFlags.triggerConfig =triggerArg
overlaylog.info( 'triggerConfig argument is: %s ', TriggerFlags.triggerConfig.get_Value() )
from TriggerJobOpts.TriggerConfigGetter import TriggerConfigGetter
cfg = TriggerConfigGetter("HIT2RDO")
print "================ DetFlags ================ "
if 'DetFlags' in dir():
overlaylog.warning("DetFlags already defined! This means DetFlags should have been fully configured already..")
......@@ -120,6 +94,40 @@ DetFlags.Print()
globalflags.DataSource.set_Value_and_Lock('geant4')
#--------------------------------------------------------------
# Read Simulation MetaData (unless override flag set to True)
#--------------------------------------------------------------
if 'ALL' in digitizationFlags.overrideMetadata.get_Value():
overlaylog.info("Skipping input file MetaData check.")
else :
from EventOverlayJobTransforms.OverlayPoolReadMetaData import readInputFileMetadata
readInputFileMetadata()
import MagFieldServices.SetupField
from IOVDbSvc.CondDB import conddb
if hasattr(runArgs, 'conditionsTag') and runArgs.conditionsTag!='NONE' and runArgs.conditionsTag!='':
globalflags.ConditionsTag=runArgs.conditionsTag
if len(globalflags.ConditionsTag())!=0:
conddb.setGlobalTag(globalflags.ConditionsTag())
# LVL1 Trigger Menu
if hasattr(runArgs, "triggerConfig") and runArgs.triggerConfig!="NONE":
# LVL1 Trigger Menu
# PJB 9/2/2009 Setup the new triggerConfig flags here
from TriggerJobOpts.TriggerFlags import TriggerFlags
triggerArg = runArgs.triggerConfig
#if not prefixed with LVL1: add it here
Args = triggerArg.split(":")
if Args[0] != "LVL1":
TriggerFlags.triggerConfig ="LVL1:"+triggerArg
else:
TriggerFlags.triggerConfig =triggerArg
overlaylog.info( 'triggerConfig argument is: %s ', TriggerFlags.triggerConfig.get_Value() )
from TriggerJobOpts.TriggerConfigGetter import TriggerConfigGetter
cfg = TriggerConfigGetter("HIT2RDO")
print "================ Start ================= "
from AthenaCommon.AlgSequence import AlgSequence
......@@ -144,6 +152,8 @@ if hasattr( runArgs, 'maxEvents'):
include ( "EventOverlayJobTransforms/ConfiguredOverlay_jobOptions.py" )
include("Digitization/RunNumberOverride.py")
if DetFlags.overlay.Truth_on():
include ( "EventOverlayJobTransforms/TruthOverlay_jobOptions.py" )
......@@ -196,5 +206,15 @@ if hasattr(runArgs, "postExec") and runArgs.postExec != 'NONE':
for cmd in runArgs.postExec:
exec(cmd)
from AthenaCommon.AppMgr import ServiceMgr
#Patch /TagInfo metadata container
from OverlayCommonAlgs.OverlayFlags import overlayFlags
for key in overlayFlags.extraTagInfoPairs.get_Value().keys():
ServiceMgr.TagInfoMgr.ExtraTagValuePairs += [str(key), str(overlayFlags.extraTagInfoPairs.get_Value()[key])]
if hasattr(runArgs, 'AMITag'):
if runArgs.AMITag != "NONE":
ServiceMgr.TagInfoMgr.ExtraTagValuePairs += ["AMITag", runArgs.AMITag]
#print "OverlayPool_tf.py: at the end. job=\n", job
print "\nOverlayPool_tf.py: at the end. ServiceMgr=\n", ServiceMgr
......@@ -57,6 +57,13 @@ class outputStore(JobProperty):
allowedTypes=['str']
StoredValue = 'StoreGateSvc'
class extraTagInfoPairs(JobProperty):
""" workaround to correctly populate the /TagInfo metadata container
"""
statusOn=False
allowedTypes=['dict']
StoredValue=dict()
## Definition and registration of the simulation flag container
class Overlay_Flags(JobPropertyContainer):
......
......@@ -7,7 +7,7 @@ from AthenaCommon.AppMgr import ServiceMgr
if digitizationFlags.dataRunNumber.get_Value():
if digitizationFlags.dataRunNumber.get_Value() < 0:
raise SystemExit("Given a negative Run Number - please use a real run number from data.")
logDigitization_flags.info( 'Overriding run number to be: %s ', digitizationFlags.dataRunNumber.get_Value() )
print 'Overriding run number to be: %s ', digitizationFlags.dataRunNumber.get_Value()
myRunNumber = digitizationFlags.dataRunNumber.get_Value()
myFirstLB = 1
myInitialTimeStamp = 1
......
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