3from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
4from AthenaConfiguration.ComponentFactory
import CompFactory
5from GeneratorConfig.Sequences
import EvgenSequence, EvgenSequenceFactory
6from AthenaCommon.SystemOfUnits
import GeV
9from AthenaCommon.Logging
import logging
10log = logging.getLogger(
"Pythia8Config")
15 The main Pythia8 configuration fragment that sets up the Pythia8_i algorithm
16 and returns a CA instance
19 commands = kwargs.get(
"Commands", [])
23 "Main:timesAllowErrors = 500",
24 "ParticleDecays:limitTau0 = on",
25 "ParticleDecays:tau0Max = 10.0"
27 commands.extend(base_cmds)
30 if "CollisionEnergy" not in kwargs:
31 kwargs[
"CollisionEnergy"] = flags.Beam.Energy * 2 / GeV
34 if flags.Generator.PDGparams:
36 from EvgenProdTools.offline_dict
import parameters
39 particle_params = parameters.get(
"particles")
41 for pdg_str, vals
in particle_params.items():
45 commands.append(f
"{pdg}:m0 = {vals['mass']}")
46 commands.append(f
"{pdg}:mWidth = {vals['width']}")
48 log.warning(
"Could not retrieve standard ATLAS particle parameters")
51 ew_params = parameters.get(
"EW_parameters")
54 for key, val
in ew_params.items():
55 if key[1]
in (
'sin2thetaW',
'sin2thetaWbar'):
56 commands.append(f
"StandardModel:{key[1]} = {val}")
58 log.warning(
"Could not retrieve standard ATLAS EW parameters")
67 "StandardModel:sin2thetaW = 0.23113",
68 "StandardModel:sin2thetaWbar = 0.23146",
72 commands = list(dict.fromkeys(commands))
73 kwargs[
"Commands"] = commands
76 ca = ComponentAccumulator(EvgenSequenceFactory(EvgenSequence.Generator))
78 CompFactory.Pythia8_i(
"Pythia8_i", **kwargs)
82 from GeneratorConfig.GeneratorInfoSvcConfig
import GeneratorInfoSvcCfg
83 ca.merge(GeneratorInfoSvcCfg(flags, Generators=[
"Pythia8"]), sequenceName=EvgenSequence.Generator.value)
90 Fragment for setting up EvtGen on top of Pythia 8
93 auxfiles = [
"inclusiveP8DsDPlus.pdt"]
95 whiteList = [-5334, 5334]
98 from EvtGen_i.EvtGenConfig
import EvtGenCfg
101 whiteList = whiteList,
110 Fragment for setting up A2 MSTW2008LO tune
113 cmds = kwargs.get(
"Commands", [])
118 "MultipartonInteractions:bProfile = 4",
119 "MultipartonInteractions:a1 = 0.03",
120 "MultipartonInteractions:pT0Ref = 1.90",
121 "MultipartonInteractions:ecmPow = 0.30",
122 "SpaceShower:rapidityOrder = 0",
123 "PDF:pSet = LHAPDF6:MSTW2008lo68cl",
124 "ColourReconnection:range = 2.28"
131 kwargs[
"Commands"] = list(dict.fromkeys(cmds))
137 from GeneratorConfig.GeneratorInfoSvcConfig
import GeneratorInfoSvcCfg
138 ca.merge(GeneratorInfoSvcCfg(flags, Tune=
"A2 MSTW2008LO"), sequenceName=EvgenSequence.Generator.value)
146 Fragment for setting up A14 tune with NNPDF23LO PDF
149 cmds = kwargs.get(
"Commands", [])
155 "SpaceShower:rapidityOrder = on",
156 "SigmaProcess:alphaSvalue = 0.140",
157 "SpaceShower:pT0Ref = 1.56",
158 "SpaceShower:pTmaxFudge = 0.91",
159 "SpaceShower:pTdampFudge = 1.05",
160 "SpaceShower:alphaSvalue = 0.127",
161 "TimeShower:alphaSvalue = 0.127",
162 "BeamRemnants:primordialKThard = 1.88",
163 "MultipartonInteractions:pT0Ref = 2.09",
164 "MultipartonInteractions:alphaSvalue = 0.126",
165 "PDF:pSet=LHAPDF6:NNPDF23_lo_as_0130_qed",
166 "ColourReconnection:range = 1.71"
173 kwargs[
"Commands"] = list(dict.fromkeys(cmds))
179 from GeneratorConfig.GeneratorInfoSvcConfig
import GeneratorInfoSvcCfg
180 ca.merge(GeneratorInfoSvcCfg(flags, Tune=
"A14 NNPDF23LO"), sequenceName=EvgenSequence.Generator.value)
188 Config for Py8 tune A2 with MSTW2008LO tune
189 The default version of this includes EvtGen for standardised b fragmentation
190 This tune is generally only used for pile up samples at the start of run 2
191 for high pT physics at the start of run 2 the A14 tune is more appropriate.
192 There are also more recent soft QCD tunes, such as Monash,
193 but A2 was a conservative choice for initial 13 TeV pile up
207 Config for setting up Py8 with A14 tune
222 A function that ensures rapidity ordering is set
225 if any(
"SpaceShower:rapidityOrderMPI" in c
for c
in cmds):
230 if "SpaceShower:rapidityOrder" in c
and "MPI" not in c:
231 val = c.split(
"=", 1)[-1].
strip()
232 cmds.append(f
"SpaceShower:rapidityOrderMPI = {val}")
239 Modular fragment for MadGraph LHE input in Pythia8.
240 The Pythia8_i algorithm is configured through ShowerCfg (defaults to
241 Pythia8BaseCfg) so tune/EvtGen fragments can be injected without
242 instantiating Pythia8_i twice.
245 kwargs.setdefault(
"LHEFile",
"events.lhe")
248 ca = ShowerCfg(flags, **kwargs)
251 from GeneratorConfig.GeneratorInfoSvcConfig
import GeneratorInfoSvcCfg
252 ca.merge(GeneratorInfoSvcCfg(flags, Generators=[
"MadGraph"]), sequenceName=EvgenSequence.Generator.value)
Pythia8_A2_MSTW2008LO_EvtGen_Common_Cfg(flags, **kwargs)
Pythia8_MadGraph_Cfg(flags, ShowerCfg=Pythia8BaseCfg, **kwargs)
Pythia8_A14_NNPDF23LO_Common_Cfg(flags, **kwargs)
Pythia8_A14_NNPDF23LO_EvtGen_Common_Cfg(flags, **kwargs)
Pythia8BaseCfg(flags, name="Pythia8_i", **kwargs)
Pythia8EvtGenBaseCfg(flags, **kwargs)
Pythia8_A2_MSTW2008LO_Common_Cfg(flags, **kwargs)
ensureRapidityOrderMPI(cmds)