52def generatorRunArgsToFlags(runArgs, flags):
53 """Fill generator configuration flags from run arguments."""
54
55 from AthenaCommon.SystemOfUnits import GeV
56
57 if hasattr(runArgs, "ecmEnergy"):
58 flags.Beam.Energy = runArgs.ecmEnergy/2 * GeV
59 else:
60 raise RuntimeError("No center of mass energy provided.")
61
62 if hasattr(runArgs, "ignoreBlackList"):
63 flags.Generator.ignoreBlackList = runArgs.ignoreBlackList
64
65 if hasattr(runArgs, "inputGeneratorFile"):
66 flags.Generator.inputGeneratorFile = runArgs.inputGeneratorFile
67
68 if hasattr(runArgs, "jobConfig"):
69 flags.Generator.jobConfig = runArgs.jobConfig
70
71 if hasattr(runArgs, "firstEvent"):
72 flags.Generator.firstEvent = runArgs.firstEvent
73
74 if hasattr(runArgs, "printEvts"):
75 flags.Generator.printEvts = runArgs.printEvts
76
77 if hasattr(runArgs, "outputYODAFile"):
78 flags.Generator.outputYODAFile = runArgs.outputYODAFile
79
80 if hasattr(runArgs, "rivetAnas"):
81 flags.Generator.rivetAnalyses = runArgs.rivetAnas
82
83 if hasattr(runArgs, "avoidExtracting"):
84 flags.Generator.avoidExtracting = runArgs.avoidExtracting