24 Creates a flag container (AthConfigFlags) appropriate for typical
25 Analysis athena applications.
28 from AthenaConfiguration
import AthConfigFlags
29 from AthenaConfiguration.AutoConfigFlags
import GetFileMD
30 from Campaigns.Utils
import Campaign
35 from AthenaConfiguration.Enums
import ProductionStep
37 acf.addFlag(
'Exec.OutputLevel',INFO)
38 acf.addFlag(
'Exec.MaxEvents',-1)
39 acf.addFlag(
'Exec.SkipEvents',0)
40 acf.addFlag(
'Exec.DebugStage',
'', help=argparse.SUPPRESS)
41 acf.addFlag(
'Exec.FPE',-2)
45 acf.addFlag(
'Exec.VerboseMessageComponents',[])
46 acf.addFlag(
'Exec.DebugMessageComponents',[])
47 acf.addFlag(
'Exec.InfoMessageComponents',[])
48 acf.addFlag(
'Exec.WarningMessageComponents',[])
49 acf.addFlag(
'Exec.ErrorMessageComponents',[])
51 acf.addFlag(
'Common.MsgSuppression',
True)
52 acf.addFlag(
'Common.MsgSourceLength',50)
53 acf.addFlag(
'Common.ProductionStep', ProductionStep.Default, type=ProductionStep, help=argparse.SUPPRESS)
54 acf.addFlag(
'Common.isOverlay',
False, help=argparse.SUPPRESS)
57 acf.addFlag(
'Input.Files', [
"_ATHENA_GENERIC_INPUTFILE_NAME_",])
58 acf.addFlag(
'Input.OverrideRunNumber',
False, help=argparse.SUPPRESS )
59 acf.addFlag(
'Input.SecondaryFiles', [], help=argparse.SUPPRESS)
60 acf.addFlag(
'Input.ProcessingTags',
lambda prevFlags :
GetFileMD(prevFlags.Input.Files).
get(
"processingTags", []), help=
"expert flag, do not override" )
61 acf.addFlag(
'Input.ProjectName',
lambda prevFlags :
GetFileMD(prevFlags.Input.Files).
get(
"project_name",
"data17_13TeV"), help=
"expert flag, do not override")
62 acf.addFlag(
'Input.MCCampaign',
lambda prevFlags : Campaign(
GetFileMD(prevFlags.Input.Files).
get(
"mc_campaign",
"")), type=Campaign, help=
"expert flag, do not override")
65 acf.addFlag(
'Concurrency.NumProcs', 0, help=
"0 = disables MP, otherwise is # of processes to use in MP mode")
66 acf.addFlag(
'Concurrency.NumThreads', 0, help=
"0 = disables MT, otherwise is # of threads to use in MT mode" )
67 acf.addFlag(
'Concurrency.NumConcurrentEvents',
lambda prevFlags : prevFlags.Concurrency.NumThreads)
68 acf.addFlag(
'Concurrency.DebugWorkers',
False )
71 acf.addFlag(
'Output.HISTOutputs', [],help=
"ROOT output files. Specify in form of 'STREAM:filename.root'")
72 acf.addFlag(
'Output.TreeAutoFlush', {}, help=
"{} = automatic for all streams, otherwise {'STREAM': 123}")
74 acf.addFlag(
"PoolSvc.MaxFilesOpen", 0, help=argparse.SUPPRESS)
77 acf.parser().add_argument(
'--accessMode',default=
"POOLAccess",choices={
"POOLAccess",
"ClassAccess"},help=
"Input file reading mode")
78 acf.parser().add_argument(
'--postExec',default=
None,help=
"Any postconfig execution required")
85 Creates a ComponentAccumulator appropriate for typical Analysis
91 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
92 from AthenaConfiguration.ComponentFactory
import CompFactory
96 if flags.args().accessMode ==
"POOLAccess":
97 from AthenaPoolCnvSvc.PoolReadConfig
import PoolReadCfg
100 from AthenaRootComps.xAODEventSelectorConfig
import xAODReadCfg,xAODAccessMode
101 ca.merge(
xAODReadCfg(flags, AccessMode = xAODAccessMode.CLASS_ACCESS))
103 outputs = [
"{} DATAFILE='{}' OPT='RECREATE'".
format(*file.split(
":",1))
for file
in flags.Output.HISTOutputs]
104 if len(outputs): ca.addService(CompFactory.THistSvc(Output = outputs))
106 ca.getService(
"MessageSvc").setWarning += [
"ClassIDSvc",
"PoolSvc",
"AthDictLoaderSvc",
"AthenaPoolAddressProviderSvc",
107 "ProxyProviderSvc",
"DBReplicaSvc",
"MetaDataSvc",
"MetaDataStore",
"AthenaPoolCnvSvc",
108 "TagMetaDataStore",
"EventSelector",
110 "CoreDumpSvc",
"AthMasterSeq",
"EventPersistencySvc",
"ActiveStoreSvc",
111 "AthenaEventLoopMgr",
"AthOutSeq",
"AthRegSeq"]
117 Launches the job (includes executing any postExec)
122 from AthenaConfiguration.Utils
import setupLoggingLevels
124 if flags.args().postExec: eval(flags.args().postExec)
125 if ca.run().isFailure():