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