Skip to content
Snippets Groups Projects
Commit 03155fad authored by Duc Ta's avatar Duc Ta
Browse files

Merge branch 'fix-ATLASVPONE-659' into '24.0'

VP1: Add support for loading config files (missing since CA move)

See merge request !69144
parents 1054dc54 e8528fc6
No related branches found
No related tags found
2 merge requests!692142024-02-24: merge of 24.0 into main,!69144VP1: Add support for loading config files (missing since CA move)
......@@ -70,7 +70,6 @@ def VP1AlgCfg(flags, name="VP1AlgCA", **kwargs):
result = ComponentAccumulator()
kwargs.setdefault("AtlasRelease", getATLASVersion())
the_alg = CompFactory.VP1Alg(name="VP1EventDisplayAlg", **kwargs)
result.addEventAlgo(the_alg, primary=True)
return result
......@@ -109,9 +108,15 @@ def SetupVP1():
group = parser.add_argument_group("VP1 specific")
group.add_argument(
"Filename",
nargs='?',
help="Input file to pass to VP1 (i.e. vp1 myESD.pool.root as an alternative to vp1 --filesInput=[])",
metavar="File name",
)
group.add_argument(
"--config",
nargs="*",
help="Config file to use for VP1. If not specified, the default configuration will be used.",
)
group.add_argument(
"--verboseAthena",
action="store_true",
......@@ -179,7 +184,6 @@ def SetupVP1():
if "help" in args:
# No point doing more here, since we just want to print the help.
import sys
sys.exit()
# Support the positional version of passing file name e.g. vp1 myESD.pool.root
......@@ -189,15 +193,6 @@ def SetupVP1():
):
flags.Input.Files = [args.Filename]
# Set the online flag if we are running at P1
if args.online:
flags.Common.isOnline = args.online
elif "HLTP" in flags.IOVDb.GlobalTag:
print(
"HLTP detected in the global tag, but --online mode is not enabled. Enabling it now."
)
flags.Common.isOnline = True
_logger.verbose("+ About to set flags related to the input")
# Empty input is not normal for Athena, so we will need to check
......@@ -237,8 +232,17 @@ def SetupVP1():
if not path.exists(flags.Input.Files[0]):
_logger.warning("Input file", file, "does not exist")
import sys
sys.exit(1)
# Set the online flag if we are running at P1
if args.online:
flags.Common.isOnline = args.online
elif "HLTP" in flags.IOVDb.GlobalTag:
print(
"HLTP detected in the global tag, but --online mode is not enabled. Enabling it now."
)
flags.Common.isOnline = True
_logger.verbose("+ ... Input flags done")
_logger.verbose("+ About to set the detector flags")
......@@ -284,11 +288,15 @@ def SetupVP1():
# Check if running on legacy inputs
if "EventInfo" not in flags.Input.Collections:
from xAODEventInfoCnv.xAODEventInfoCnvConfig import EventInfoCnvAlgCfg
cfg.merge(EventInfoCnvAlgCfg(flags))
from TrkConfig.TrackCollectionReadConfig import TrackCollectionReadCfg
from TrkConfig.TrackCollectionReadConfig import TrackCollectionReadCfg
cfg.merge(TrackCollectionReadCfg(flags, "Tracks"))
from TrkConfig.AtlasExtrapolationEngineConfig import AtlasExtrapolationEngineCfg
AtlasExtrapolationEngine = cfg.getPrimaryAndMerge(AtlasExtrapolationEngineCfg(flags))
cfg.addPublicTool(AtlasExtrapolationEngine)
if flags.Input.isMC:
# AOD2xAOD Truth conversion
from xAODTruthCnv.xAODTruthCnvConfig import GEN_AOD2xAODCfg
......@@ -311,7 +319,11 @@ def SetupVP1():
if args.cruise:
vp1config.setdefault("InitialCruiseMode", "EVENT")
vp1config.setdefault("vp1Alg.InitialCruiseModePeriod", args.cruise)
vp1config.setdefault("InitialCruiseModePeriod", args.cruise)
if args.config:
print("Using config file", args.config)
vp1config.setdefault("InitialInputVP1Files", args.config)
# Batch mode
if args.batch:
......@@ -325,7 +337,7 @@ def SetupVP1():
setup_live_mode(args, vp1config)
# configure VP1
cfg.merge(VP1AlgCfg(flags, vp1config))
cfg.merge(VP1AlgCfg(flags, **vp1config))
cfg.run()
......
......@@ -19,8 +19,10 @@ Launching VP1 - the ATLAS 3D event display
******************************************
*IMPORTANT*: VP1 has now been migrated to use ComponentAccumulator. At the same time, we have tried to simplify the configuration of VP1.
If you have any problems, or if you needed some of the removed configuration options, please contact us on the JIRA ticket:
*IMPORTANT*: VP1 has now been migrated to use ComponentAccumulator.
At the same time, we have tried to simplify the configuration of VP1.
If you have any problems, or if you needed some of the removed configuration options,
please contact us on the JIRA ticket:
https://its.cern.ch/jira/browse/ATLASRECTS-7853
******************************************
......
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