16from GeneratorConfig.Sequences
import EvgenSequence, EvgenSequenceFactory
49 Add the necessary settings fir beams, energy, seed,
50 etc. It uses the h7c object which inherits from Hw7Config,
51 so several of the methods called below are defined in the parent class.
53 h7c.default_commands += h7c.beam_commands()
54 h7c.default_commands += h7c.energy_commands()
55 h7c.default_commands += h7c.random_seed_commands()
57 if not h7c.set_printout_commands:
58 h7c.default_commands += h7c.printout_commands()
59 if not h7c.set_physics_parameter_commands:
60 h7c.default_commands += h7c.physics_parameter_commands()
61 if not h7c.set_technical_parameter_commands:
62 h7c.default_commands += h7c.technical_parameter_commands()
64 h7c.enable_angularShowerScaleVariations(shower_var)
71 """This is the CA equivalent of Herwig7Config.py"""
73 commands = kwargs.pop(
"commands",
None)
74 shower_var = kwargs.pop(
"shower_var",
True)
75 cleanup_herwig_scratch = kwargs.pop(
"cleanup_herwig_scratch",
False)
76 local_pre_commands = kwargs.pop(
"local_pre_commands",
None)
77 local_post_commands = kwargs.pop(
"local_post_commands",
None)
78 me_pdf_order = kwargs.pop(
"me_pdf_order",
None)
79 me_pdf_name = kwargs.pop(
"me_pdf_name",
None)
80 mpi_pdf_name = kwargs.pop(
"mpi_pdf_name",
None)
81 shower_pdf_order = kwargs.pop(
"shower_pdf_order",
None)
82 shower_pdf_name = kwargs.pop(
"shower_pdf_name",
None)
87 kwargs.pop(
"tune",
None)
91 herwig7 = CompFactory.Herwig7(name, **kwargs)
95 local_pre_commands=local_pre_commands,
96 local_post_commands=local_post_commands
100 if me_pdf_name
is not None:
101 h7c.me_pdf_commands(order=me_pdf_order
or "NLO", name=me_pdf_name)
103 if mpi_pdf_name
is not None:
104 h7c.mpi_pdf_commands(name=mpi_pdf_name)
106 if shower_pdf_name
is not None:
107 h7c.shower_pdf_commands(order=shower_pdf_order
or "LO", name=shower_pdf_name)
110 h7c.add_commands(dedent(commands))
114 from Herwig7_i
import Herwig7Control
as hw7Control
116 run_settings = hw7Control.render_infile(h7c)
117 hw7Control.configure_algorithm(
119 hw7Control.get_runfile_name(h7c.run_name),
121 me_pdf_name=h7c.me_pdf_name,
122 mpi_pdf_name=h7c.mpi_pdf_name,
123 cleanup_herwig_scratch=cleanup_herwig_scratch,
124 run_settings=run_settings,
129 ca = ComponentAccumulator(EvgenSequenceFactory(EvgenSequence.Generator))
130 ca.addEventAlgo(herwig7)
132 from GeneratorConfig.GeneratorInfoSvcConfig
import GeneratorInfoSvcCfg
134 GeneratorInfoSvcCfg(flags,
135 Generators=[
"Herwig7"],
136 Tune=hw7Control.default_tune_name()