60def build_sherpa3_base_fragment(flags):
61 """Build the Sherpa 3 BaseFragment YAML string."""
62 particle_data = _default_particle_data()
63
64 base_fragment = write_pretty_fragment(
65 f"""
66 BEAMS: 2212
67 BEAM_ENERGIES: {flags.Beam.Energy / GeV}
68
69 MAX_PROPER_LIFETIME: 10.0
70 HEPMC_TREE_LIKE: 1
71 PRETTY_PRINT: Off
72 EXTERNAL_RNG: Atlas_RNG
73
74 OVERWEIGHT_THRESHOLD: 10
75 MC@NLO:
76 HPSMODE: 0
77
78 SCALE_VARIATIONS:
79 - 4.0*
80
81 PARTICLE_DATA:
82 """
83 )
84
85
86 for pdg_id in sorted(particle_data, key=int):
87 values = particle_data[pdg_id]
88 base_fragment += (
89 f" {pdg_id}:\n"
90 f" Mass: {values['mass']}\n"
91 f" Width: {values['width']}\n"
92 )
93
94
95
96 base_fragment += write_pretty_fragment(
97 """
98 EW_SCHEME: Gmu
99 GF: 1.166397e-5
100
101 HARD_DECAYS:
102 Enabled: true
103 Channels:
104 "6 -> 24 5": { Width: 1.32 }
105 "-6 -> -24 -5": { Width: 1.32 }
106 "25 -> 5 -5": { Width: 2.35e-3 }
107 "25 -> 15 -15": { Width: 2.57e-4 }
108 "25 -> 13 -13": { Width: 8.91e-7 }
109 "25 -> 4 -4": { Width: 1.18e-4 }
110 "25 -> 3 -3": { Width: 1.00e-6 }
111 "25 -> 21 21": { Width: 3.49e-4 }
112 "25 -> 22 22": { Width: 9.28e-6 }
113 "24 -> 2 -1": { Width: 0.7041 }
114 "24 -> 4 -3": { Width: 0.7041 }
115 "24 -> 12 -11": { Width: 0.2256 }
116 "24 -> 14 -13": { Width: 0.2256 }
117 "24 -> 16 -15": { Width: 0.2256 }
118 "-24 -> -2 1": { Width: 0.7041 }
119 "-24 -> -4 3": { Width: 0.7041 }
120 "-24 -> -12 11": { Width: 0.2256 }
121 "-24 -> -14 13": { Width: 0.2256 }
122 "-24 -> -16 15": { Width: 0.2256 }
123 "23 -> 1 -1": { Width: 0.3828 }
124 "23 -> 2 -2": { Width: 0.2980 }
125 "23 -> 3 -3": { Width: 0.3828 }
126 "23 -> 4 -4": { Width: 0.2980 }
127 "23 -> 5 -5": { Width: 0.3828 }
128 "23 -> 11 -11": { Width: 0.0840 }
129 "23 -> 12 -12": { Width: 0.1663 }
130 "23 -> 13 -13": { Width: 0.0840 }
131 "23 -> 14 -14": { Width: 0.1663 }
132 "23 -> 15 -15": { Width: 0.0840 }
133 "23 -> 16 -16": { Width: 0.1663 }
134 OL_PARAMETERS:
135 preset: 2
136 write_parameters: 1
137 """
138 )
139
140
141 from os import environ
142 openloops_path = environ.get("OPENLOOPSPATH")
143 if openloops_path:
144 base_fragment += f"OL_PREFIX: {openloops_path}\n"
145 else:
146 log.warning("OPENLOOPSPATH not set")
147
148 return base_fragment