Skip to content
Snippets Groups Projects
Commit 8c94abb0 authored by Frank Winklmeier's avatar Frank Winklmeier
Browse files

RecExCommon: Setup and lock ConfigFlags

Since we start having multiple CA-based configurations included in
RecExCommon, setup the ConfigFlags via `OldFlags2NewFlags` in
`RecExCommon_topOptions.py` so they can be used downstream.

Also lock the flags (except for DPD making).
parent a6efbe1b
No related branches found
No related tags found
5 merge requests!69091Fix correlated smearing bug in JER in JetUncertainties in 22.0,!58791DataQualityConfigurations: Modify L1Calo config for web display,!51674Fixing hotSpotInHIST for Run3 HIST,!50012RecExConfig: Adjust log message levels from GetRunNumber and GetLBNumber,!47186AthConfigFlags: do not allow hashing of unlocked container
......@@ -139,11 +139,9 @@ if rec.readESD():
rec.doBTagging=False
if (jetOK or rec.readESD()) and rec.doBTagging() and DetFlags.ID_on() and DetFlags.Muon_on():
try:
from AthenaConfiguration.AllConfigFlags import ConfigFlags
from AthenaCommon.Configurable import Configurable
Configurable.configurableRun3Behavior=1
from AthenaConfiguration.OldFlags2NewFlags import getNewConfigFlags
# Translate all needed flags from old jobProperties to a new AthConfigFlag Container
ConfigFlags = getNewConfigFlags()
Configurable.configurableRun3Behavior=1 # TODO: remove once ATLASRECTS-6635 is fixed
# Configure BTagging algorithm
from BTagging.BTagRun3Config import BTagRecoSplitCfg
CAtoGlobalWrapper(BTagRecoSplitCfg, ConfigFlags)
......
......@@ -521,9 +521,21 @@ if recAlgs.doAtlfast():
protectedInclude ("AtlfastAlgs/Atlfast_RecExCommon_Fragment.py")
AODFix_postAtlfast()
# functionality : FTK truth-based FastSim
if rec.doTruth() and DetFlags.detdescr.FTK_on():
protectedInclude("TrigFTKFastSimTruth/TrigFTKFastSimTruth_jobOptions.py")
#################################################################################
# Initialize ConfigFlags for use by CA-based code below
from AthenaConfiguration.OldFlags2NewFlags import getNewConfigFlags
ConfigFlags = getNewConfigFlags()
# Apply additional changes to the ConfigFlags:
if rec.doTrigger and globalflags.DataSource() == 'data' and globalflags.InputFormat == 'bytestream':
ConfigFlags.Trigger.readBS = True
# Lock the flags
if not rec.doDPD(): # except for derivations: ATLASRECTS-6636
logRecExCommon_topOptions.info("Locking ConfigFlags")
ConfigFlags.lock()
#################################################################################
pdr.flag_domain('trig')
......@@ -540,7 +552,6 @@ if not globalflags.InputFormat.is_bytestream():
cfgKeyStore.addManyTypesInputFile(convert_itemList(layout='#join'))
# Check for Run-1, Run-2 or Run-3 Trigger content in the input file
from TrigDecisionTool.TrigDecisionToolConfig import getRun3NavigationContainerFromInput
from AthenaConfiguration.AllConfigFlags import ConfigFlags
if not cfgKeyStore.isInInputFile("HLT::HLTResult", "HLTResult_EF") \
and not cfgKeyStore.isInInputFile("xAOD::TrigNavigation", "TrigNavigation") \
and not cfgKeyStore.isInInputFile("xAOD::TrigCompositeContainer", getRun3NavigationContainerFromInput(ConfigFlags) ):
......@@ -550,19 +561,11 @@ if not globalflags.InputFormat.is_bytestream():
logRecExCommon_topOptions.warning('Failed to check input file for Trigger content, leaving rec.doTrigger value unchanged (%s)', rec.doTrigger)
if rec.doTrigger:
if globalflags.DataSource() == 'data' and globalflags.InputFormat == 'bytestream':
ConfigFlags.Trigger.readBS = True
from TriggerJobOpts.TriggerRecoGetter import TriggerRecoGetter
triggerGetter = TriggerRecoGetter()
# ESDtoAOD Run-3 Trigger Outputs: Don't run any trigger - only pass the HLT contents from ESD to AOD
if rec.readESD() and rec.doAOD():
from AthenaConfiguration.AllConfigFlags import ConfigFlags
# The simplest protection in case ConfigFlags.Input.Files is not set, doesn't cover all cases:
if ConfigFlags.Input.Files == ['_ATHENA_GENERIC_INPUTFILE_NAME_'] and athenaCommonFlags.FilesInput():
ConfigFlags.Input.Files = athenaCommonFlags.FilesInput()
if ConfigFlags.Trigger.EDMVersion == 3:
# Add HLT output
from TriggerJobOpts.HLTTriggerResultGetter import HLTTriggerResultGetter
......
......@@ -35,16 +35,9 @@ if DetFlags.detdescr.ID_on():
protectedInclude( "InDetRecExample/InDetRec_jobOptions.py" )
AODFix_postInDetRec()
if jobproperties.InDetJobProperties.useNewConfig():
print('Wrapping new configuration')
from AthenaConfiguration.ComponentAccumulator import CAtoGlobalWrapper
from AthenaConfiguration.AllConfigFlags import ConfigFlags
from InDetConfig.TrackRecoConfig import TrackRecoCfg
from AthenaConfiguration.OldFlags2NewFlags import getNewConfigFlags
# Translate all needed flags from old jobProperties to a new AthConfigFlag Container
ConfigFlags = getNewConfigFlags()
# TODO Keep here for the moment, since we still have debugging to do.
from AthenaCommon.Logging import logging
log = logging.getLogger( "Py:conf2toConfigurable" )
log.setLevel(DEBUG)
CAtoGlobalWrapper(TrackRecoCfg,ConfigFlags)
......
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