ATLAS Offline Software
Loading...
Searching...
No Matches
python.PowhegConfig Namespace Reference

Classes

class  _RunArgs
class  _RunOpts

Functions

 _make_run_args (flags)
 PowhegCfg (flags, process, settings=None, **generate_kwargs)

Function Documentation

◆ _make_run_args()

_make_run_args ( flags)
protected
Create the legacy runArgs interface from CA flags.

Definition at line 18 of file PowhegConfig.py.

18def _make_run_args(flags):
19 """Create the legacy runArgs interface from CA flags."""
20 run_args = _RunArgs()
21 run_args.ecmEnergy = flags.Beam.Energy * 2 / GeV
22 run_args.maxEvents = (
23 flags.Exec.MaxEvents
24 if flags.Exec.MaxEvents > 0
25 else flags.Generator.nEventsPerJob
26 )
27 run_args.randomSeed = flags.Random.SeedOffset
28
29 if flags.Output.EVNTFileName:
30 run_args.outputEVNTFile = flags.Output.EVNTFileName
31 if flags.Generator.outputYODAFile:
32 run_args.outputYODAFile = flags.Generator.outputYODAFile
33 if flags.Output.TXTFileName:
34 run_args.outputTXTFile = flags.Output.TXTFileName
35
36 return run_args
37
38

◆ PowhegCfg()

PowhegCfg ( flags,
process,
settings = None,
** generate_kwargs )
Configure and run a legacy PowhegControl process.
'settings' contains assignments to public PowhegControl parameters.
Additional keyword arguments are forwarded to 'generate()'.

Definition at line 39 of file PowhegConfig.py.

39def PowhegCfg(flags, process, settings=None, **generate_kwargs):
40 """
41 Configure and run a legacy PowhegControl process.
42 'settings' contains assignments to public PowhegControl parameters.
43 Additional keyword arguments are forwarded to 'generate()'.
44 """
45 from PowhegControl.powheg_control import PowhegControl
46
47 run_args = _make_run_args(flags)
48
49 control = PowhegControl(
50 process_name=process,
51 run_args=run_args,
52 run_opts=_RunOpts(),
53 )
54
55 for setting, value in (settings or {}).items():
56 setattr(control, setting, value)
57
58 control.generate(**generate_kwargs)
59
60 lhe_file = run_args.inputGeneratorFile
61
62 ca = ComponentAccumulator(EvgenSequenceFactory(EvgenSequence.Generator))
63
64 from GeneratorConfig.GeneratorInfoSvcConfig import GeneratorInfoSvcCfg
65
66 ca.merge(GeneratorInfoSvcCfg(flags, Generators=["Powheg"]), sequenceName=EvgenSequence.Generator.value)
67
68 return ca, lhe_file