5 from AthenaConfiguration.AthConfigFlags
import AthConfigFlags
10 flags: AthConfigFlags, config_name: str, log: logging.Logger) -> AthConfigFlags:
12 """Get the flags for the named config, ensure that they are set to be active
16 flags : AthConfigFlags
17 The instance of the flags to check
19 The name of the desired tracking config
21 Logger to print related messages
25 Either the current flags instance if all the ActiveConfig is correct or a new
26 version with cloned flags
28 the flags correspond to InDet/ITk format
31 if flags.hasFlag(
"Tracking.ActiveConfig.input_name"):
32 if flags.Tracking.ActiveConfig.input_name == config_name:
34 "flags.Tracking.ActiveConfig is for %s",
35 flags.Tracking.ActiveConfig.input_name,
40 "flags.Tracking.ActiveConfig is not for %s but %s",
42 flags.Tracking.ActiveConfig.input_name,
47 "Menu code invoked ID config without flags.Tracking.ActiveConfig for %s",
55 flags: AthConfigFlags, config_name: str, log: logging.Logger) -> AthConfigFlags:
58 InDet/ITk specific clone and replace of ActiveConfig without checking flags vs config_name
60 this function should be used only high up in the menu creation where a context of tracking flags
61 does not exist yet and is created for the first time in generateChainConfigs function
62 or there are multiple contexts for ActiveConfig like in LRT
64 in other cases getFlagsForActiveConfig should be used instead
68 log.info(f
"Cloning tracking config for {config_name} to flags.Tracking.ActiveConfig")
73 prefix =
"Trigger.InDetTracking."
74 if flags.Detector.GeometryITk:
75 prefix =
"Trigger.ITkTracking."
76 if flags.Trigger.useActsTracking:
77 prefix =
"Trigger.ActsTracking."
79 return flags.cloneAndReplace(
80 "Tracking.ActiveConfig",