Skip to content
Snippets Groups Projects
Verified Commit ec0a65d7 authored by Tadej Novak's avatar Tadej Novak
Browse files

Cleanup overlay test flags

parent 71c0426c
No related branches found
No related tags found
No related merge requests found
Showing
with 60 additions and 64 deletions
......@@ -25,7 +25,7 @@ class defaultTestFiles:
RDO_RUN2 = [f"{d}/WorkflowReferences/master/q443/v1/myRDO.pool.root"]
RDO_BKG_RUN2 = [f"{d}/OverlayTests/PresampledPileUp/22.0/Run2/large/mc20_13TeV.900149.PG_single_nu_Pt50.digit.RDO.e8307_s3482_s3136_d1715/RDO.26811908._031801.pool.root.1"]
RDO_BKG_RUN3 = [f"{d}/CampaignInputs/mc21/RDO_BKG/mc21_13p6TeV.900149.PG_single_nu_Pt50.digit.RDO.e8453_e8455_s3864_d1761/50events.RDO.pool.root"]
RDO_BKG_RUN4 = [f"{d}/PhaseIIUpgrade/RDO_BKG/ATLAS-P2-RUN4-01-00-00/50events.RDO.pool.root"]
RDO_BKG_RUN4 = [f"{d}/PhaseIIUpgrade/RDO_BKG/ATLAS-P2-RUN4-01-00-00/mu200.50events.RDO.pool.root"]
ESD = [f"{d}/RecExRecoTest/mc16_13TeV.361022.Pythia8EvtGen_A14NNPDF23LO_jetjet_JZ2W.recon.ESD.e3668_s3170_r10572_homeMade.pool.root"]
AOD = [f"{d}/CommonInputs/data16_13TeV.00311321.physics_Main.recon.AOD.r9264/AOD.11038520._000001.pool.root.1"]
AOD_MC = [f"{d}/CommonInputs/mc16_13TeV.410501.PowhegPythia8EvtGen_A14_ttbar_hdamp258p75_nonallhad.merge.AOD.e5458_s3126_r9364_r9315/AOD.11182705._000001.pool.root.1"]
......@@ -10,7 +10,7 @@ from AthenaConfiguration.MainServicesConfig import MainServicesCfg
from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
from HGTD_Overlay.HGTD_OverlayConfig import HGTD_OverlayCfg
from OverlayConfiguration.OverlayTestHelpers import \
CommonTestArgumentParser, defaultTestFlags, postprocessAndLockFlags, printAndRun
CommonTestArgumentParser, overlayTestFlags, postprocessAndLockFlags, printAndRun
from OverlayCopyAlgs.OverlayCopyAlgsConfig import CopyMcEventCollectionCfg
from xAODEventInfoCnv.xAODEventInfoCnvConfig import EventInfoOverlayCfg
......@@ -19,7 +19,7 @@ parser = CommonTestArgumentParser("HGTD_OverlayConfig_test.py")
args = parser.parse_args()
# Configure
defaultTestFlags(ConfigFlags, args)
overlayTestFlags(ConfigFlags, args)
postprocessAndLockFlags(ConfigFlags, args)
# Construct our accumulator to run
......
......@@ -10,7 +10,7 @@ from AthenaConfiguration.MainServicesConfig import MainServicesCfg
from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
from InDetOverlay.BCMOverlayConfig import BCMOverlayCfg
from OverlayConfiguration.OverlayTestHelpers import \
CommonTestArgumentParser, defaultTestFlags, postprocessAndLockFlags, printAndRun
CommonTestArgumentParser, overlayTestFlags, postprocessAndLockFlags, printAndRun
from OverlayCopyAlgs.OverlayCopyAlgsConfig import CopyMcEventCollectionCfg
from xAODEventInfoCnv.xAODEventInfoCnvConfig import EventInfoOverlayCfg
......@@ -19,7 +19,7 @@ parser = CommonTestArgumentParser("BCMOverlayConfig_test.py")
args = parser.parse_args()
# Configure
defaultTestFlags(ConfigFlags, args)
overlayTestFlags(ConfigFlags, args)
ConfigFlags.Output.RDOFileName = 'mcOverlayRDO_BCM.pool.root'
postprocessAndLockFlags(ConfigFlags, args)
......
......@@ -10,7 +10,7 @@ from AthenaConfiguration.MainServicesConfig import MainServicesCfg
from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
from InDetOverlay.PixelOverlayConfig import PixelOverlayCfg
from OverlayConfiguration.OverlayTestHelpers import \
CommonTestArgumentParser, defaultTestFlags, postprocessAndLockFlags, printAndRun
CommonTestArgumentParser, overlayTestFlags, postprocessAndLockFlags, printAndRun
from OverlayCopyAlgs.OverlayCopyAlgsConfig import CopyMcEventCollectionCfg
from xAODEventInfoCnv.xAODEventInfoCnvConfig import EventInfoOverlayCfg
......@@ -19,7 +19,7 @@ parser = CommonTestArgumentParser("PixelOverlayConfig_test.py")
args = parser.parse_args()
# Configure
defaultTestFlags(ConfigFlags, args)
overlayTestFlags(ConfigFlags, args)
ConfigFlags.Output.RDOFileName = 'mcOverlayRDO_Pixel.pool.root'
postprocessAndLockFlags(ConfigFlags, args)
......
......@@ -10,7 +10,7 @@ from AthenaConfiguration.MainServicesConfig import MainServicesCfg
from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
from InDetOverlay.SCTOverlayConfig import SCTOverlayCfg
from OverlayConfiguration.OverlayTestHelpers import \
CommonTestArgumentParser, defaultTestFlags, postprocessAndLockFlags, printAndRun
CommonTestArgumentParser, overlayTestFlags, postprocessAndLockFlags, printAndRun
from OverlayCopyAlgs.OverlayCopyAlgsConfig import CopyMcEventCollectionCfg
from xAODEventInfoCnv.xAODEventInfoCnvConfig import EventInfoOverlayCfg
......@@ -19,7 +19,7 @@ parser = CommonTestArgumentParser("SCTOverlayConfig_test.py")
args = parser.parse_args()
# Configure
defaultTestFlags(ConfigFlags, args)
overlayTestFlags(ConfigFlags, args)
ConfigFlags.Output.RDOFileName = 'mcOverlayRDO_SCT.pool.root'
postprocessAndLockFlags(ConfigFlags, args)
......
......@@ -10,7 +10,7 @@ from AthenaConfiguration.MainServicesConfig import MainServicesCfg
from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
from InDetOverlay.TRTOverlayConfig import TRTOverlayCfg
from OverlayConfiguration.OverlayTestHelpers import \
CommonTestArgumentParser, defaultTestFlags, postprocessAndLockFlags, printAndRun
CommonTestArgumentParser, overlayTestFlags, postprocessAndLockFlags, printAndRun
from OverlayCopyAlgs.OverlayCopyAlgsConfig import CopyMcEventCollectionCfg
from xAODEventInfoCnv.xAODEventInfoCnvConfig import EventInfoOverlayCfg
......@@ -19,7 +19,7 @@ parser = CommonTestArgumentParser("TRTOverlayConfig_test.py")
args = parser.parse_args()
# Configure
defaultTestFlags(ConfigFlags, args)
overlayTestFlags(ConfigFlags, args)
ConfigFlags.Output.RDOFileName = 'mcOverlayRDO_TRT.pool.root'
postprocessAndLockFlags(ConfigFlags, args)
......
......@@ -45,61 +45,57 @@ def CommonTestArgumentParser(prog):
return parser
def defaultTestFlags(configFlags, args):
def overlayTestFlags(flags, args):
"""Fill default overlay flags for testing"""
configFlags.GeoModel.Align.Dynamic = False
configFlags.Digitization.DoCaloNoise = False
configFlags.Digitization.DoInnerDetectorNoise = False
configFlags.Digitization.EnableCaloHSTruthRecoInputs = False
if args.disableTruth:
configFlags.Digitization.EnableTruth = False
configFlags.LAr.OFCShapeFolder = "4samples1phase"
configFlags.LAr.ROD.DoOFCPileupOptimization = True
configFlags.LAr.ROD.nSamples = 4
configFlags.LAr.ROD.NumberOfCollisions = 20
configFlags.LAr.ROD.UseHighestGainAutoCorr = True
configFlags.Tile.BestPhaseFromCOOL = False
configFlags.Tile.correctTime = False
configFlags.Tile.zeroAmplitudeWithoutDigits = False
flags.Digitization.EnableTruth = False
from AthenaConfiguration.TestDefaults import defaultTestFiles
from AthenaConfiguration.Enums import ProductionStep
configFlags.Common.ProductionStep = ProductionStep.Overlay
flags.Common.ProductionStep = ProductionStep.Overlay
if args.data:
configFlags.Input.isMC = False # TODO: this one should be autodetected
configFlags.Input.Files = defaultTestFiles.HITS_DATA_OVERLAY
configFlags.Input.SecondaryFiles = defaultTestFiles.RAW_BKG
configFlags.Output.RDOFileName = "dataOverlayRDO.pool.root"
configFlags.IOVDb.GlobalTag = "CONDBR2-BLKPA-2016-12-01"
configFlags.IOVDb.DatabaseInstance = "CONDBR2"
configFlags.Overlay.DataOverlay = True
flags.Input.isMC = False
flags.Input.Files = defaultTestFiles.HITS_DATA_OVERLAY
flags.Input.SecondaryFiles = defaultTestFiles.RAW_BKG
flags.Output.RDOFileName = "dataOverlayRDO.pool.root"
flags.IOVDb.GlobalTag = "CONDBR2-BLKPA-2016-12-01"
flags.IOVDb.DatabaseInstance = "CONDBR2"
flags.Overlay.DataOverlay = True
from Campaigns import DataOverlayPPTest
DataOverlayPPTest(flags)
else:
configFlags.Input.MCChannelNumber = GetFileMD(configFlags.Input.SecondaryFiles).get("mc_channel_number", 0)
flags.Input.MCChannelNumber = GetFileMD(flags.Input.SecondaryFiles).get("mc_channel_number", 0)
if args.run is LHCPeriod.Run2:
configFlags.Input.Files = defaultTestFiles.RDO_BKG_RUN2
configFlags.Input.SecondaryFiles = defaultTestFiles.HITS_RUN2
configFlags.IOVDb.GlobalTag = "OFLCOND-MC16-SDR-RUN2-09"
flags.Input.Files = defaultTestFiles.RDO_BKG_RUN2
flags.Input.SecondaryFiles = defaultTestFiles.HITS_RUN2
flags.IOVDb.GlobalTag = "OFLCOND-MC16-SDR-RUN2-09"
from Campaigns import MC20e
MC20e(flags)
elif args.run is LHCPeriod.Run3:
configFlags.Input.Files = defaultTestFiles.RDO_BKG_RUN3
configFlags.Input.SecondaryFiles = defaultTestFiles.HITS_RUN3
configFlags.IOVDb.GlobalTag = "OFLCOND-MC21-SDR-RUN3-07"
flags.Input.Files = defaultTestFiles.RDO_BKG_RUN3
flags.Input.SecondaryFiles = defaultTestFiles.HITS_RUN3
flags.IOVDb.GlobalTag = "OFLCOND-MC21-SDR-RUN3-07"
from Campaigns import MC21a
MC21a(flags)
elif args.run is LHCPeriod.Run4:
configFlags.Input.Files = defaultTestFiles.RDO_BKG_RUN4
configFlags.Input.SecondaryFiles = defaultTestFiles.HITS_RUN4
configFlags.IOVDb.GlobalTag = "OFLCOND-MC15c-SDR-14-05"
flags.Input.Files = defaultTestFiles.RDO_BKG_RUN4
flags.Input.SecondaryFiles = defaultTestFiles.HITS_RUN4
flags.IOVDb.GlobalTag = "OFLCOND-MC15c-SDR-14-05"
from Campaigns import PhaseIIPileUp200
PhaseIIPileUp200(flags)
else:
raise ValueError("Run not supported")
configFlags.Output.RDOFileName = "mcOverlayRDO.pool.root"
configFlags.Overlay.DataOverlay = False
flags.Output.RDOFileName = "mcOverlayRDO.pool.root"
flags.Overlay.DataOverlay = False
if args.output:
if args.output == 'None':
configFlags.Output.RDOFileName = ''
flags.Output.RDOFileName = ''
else:
configFlags.Output.RDOFileName = args.output
flags.Output.RDOFileName = args.output
if args.outputSig:
configFlags.Output.RDO_SGNLFileName = args.outputSig
flags.Output.RDO_SGNLFileName = args.outputSig
if 'detectors' in args and args.detectors:
detectors = args.detectors
......@@ -107,30 +103,30 @@ def defaultTestFlags(configFlags, args):
detectors = None
from AthenaConfiguration.DetectorConfigFlags import setupDetectorFlags
setupDetectorFlags(configFlags, detectors, toggle_geometry=True, use_metadata=True)
setupDetectorFlags(flags, detectors, toggle_geometry=True, use_metadata=True)
def postprocessAndLockFlags(configFlags, args):
def postprocessAndLockFlags(flags, args):
"""Postprocess and lock config flags for overlay"""
# Flags relating to multithreaded execution
configFlags.Concurrency.NumThreads = args.threads
flags.Concurrency.NumThreads = args.threads
if args.threads > 0:
configFlags.Scheduler.ShowDataDeps = True
configFlags.Scheduler.ShowDataFlow = True
configFlags.Scheduler.ShowControlFlow = True
configFlags.Concurrency.NumConcurrentEvents = args.concurrent if args.concurrent > 0 else args.threads
flags.Scheduler.ShowDataDeps = True
flags.Scheduler.ShowDataFlow = True
flags.Scheduler.ShowControlFlow = True
flags.Concurrency.NumConcurrentEvents = args.concurrent if args.concurrent > 0 else args.threads
configFlags.lock()
flags.lock()
def printAndRun(accessor, configFlags, args):
def printAndRun(accessor, flags, args):
"""Common debugging and execution for overlay tests"""
# Dump config
accessor.printConfig(withDetails=args.verboseAccumulators)
if args.verboseStoreGate:
accessor.getService("StoreGateSvc").Dump = True
configFlags.dump()
flags.dump()
if args.debug:
accessor.setDebugStage (args.debug)
......
......@@ -12,14 +12,14 @@ from xAODEventInfoCnv.xAODEventInfoCnvConfig import EventInfoOverlayCfg
from Digitization.DigitizationParametersConfig import writeDigitizationParameters
from OverlayConfiguration.OverlayMetadata import overlayMetadataCheck
from OverlayConfiguration.OverlayTestHelpers import defaultTestFlags, postprocessAndLockFlags, printAndRun, CommonTestArgumentParser
from OverlayConfiguration.OverlayTestHelpers import overlayTestFlags, postprocessAndLockFlags, printAndRun, CommonTestArgumentParser
# Argument parsing
parser = CommonTestArgumentParser("OverlayMetadataConfig_test.py")
args = parser.parse_args()
# Configure
defaultTestFlags(ConfigFlags, args)
overlayTestFlags(ConfigFlags, args)
overlayMetadataCheck(ConfigFlags)
postprocessAndLockFlags(ConfigFlags, args)
ConfigFlags.initAll()
......
......@@ -11,7 +11,7 @@ from Digitization.DigitizationSteering import DigitizationMessageSvcCfg
from OverlayConfiguration.OverlaySteering import OverlayMainCfg
from OverlayConfiguration.OverlayTestHelpers import \
CommonTestArgumentParser, OverlayJobOptsDumperCfg, \
defaultTestFlags, postprocessAndLockFlags, printAndRun
overlayTestFlags, postprocessAndLockFlags, printAndRun
# Argument parsing
parser = CommonTestArgumentParser("OverlayTest.py")
......@@ -46,7 +46,7 @@ if args.dependencies:
print()
# Configure
defaultTestFlags(ConfigFlags, args)
overlayTestFlags(ConfigFlags, args)
postprocessAndLockFlags(ConfigFlags, args)
# Construct our accumulator to run
......
......@@ -9,7 +9,7 @@ from AthenaConfiguration.AllConfigFlags import ConfigFlags
from AthenaConfiguration.MainServicesConfig import MainServicesCfg
from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
from OverlayConfiguration.OverlayTestHelpers import \
CommonTestArgumentParser, defaultTestFlags, postprocessAndLockFlags, printAndRun
CommonTestArgumentParser, overlayTestFlags, postprocessAndLockFlags, printAndRun
from OverlayCopyAlgs.OverlayCopyAlgsConfig import \
CopyCaloCalibrationHitContainersCfg, CopyJetTruthInfoCfg, CopyMcEventCollectionCfg, \
CopyTrackRecordCollectionsCfg
......@@ -20,7 +20,7 @@ parser = CommonTestArgumentParser("OverlayCopyAlgs_test.py")
args = parser.parse_args()
# Configure
defaultTestFlags(ConfigFlags, args)
overlayTestFlags(ConfigFlags, args)
postprocessAndLockFlags(ConfigFlags, args)
# Construct our accumulator to run
......
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