3 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
4 from AthenaConfiguration.ComponentFactory
import CompFactory
5 from GeneratorConfig.Sequences
import EvgenSequence, EvgenSequenceFactory
9 from AthenaCommon.Logging
import logging
10 log = 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
78 CompFactory.Pythia8_i(
"Pythia8_i", **kwargs)
86 Fragment for setting up EvtGen on top of Pythia 8
89 auxfiles = [
"inclusiveP8DsDPlus.pdt"]
91 whiteList = [-5334, 5334]
94 from EvtGen_i.EvtGenConfig
import EvtGenCfg
97 whiteList = whiteList,
106 Fragment for setting up A2 MSTW2008LO tune
109 cmds = kwargs.get(
"Commands", [])
114 "MultipartonInteractions:bProfile = 4",
115 "MultipartonInteractions:a1 = 0.03",
116 "MultipartonInteractions:pT0Ref = 1.90",
117 "MultipartonInteractions:ecmPow = 0.30",
118 "SpaceShower:rapidityOrder = 0",
119 "PDF:pSet = LHAPDF6:MSTW2008lo68cl",
120 "ColourReconnection:range = 2.28"
127 kwargs[
"Commands"] =
list(dict.fromkeys(cmds))
138 Config for Py8 tune A2 with MSTW2008LO tune
139 The default version of this includes EvtGen for standardised b fragmentation
140 This tune is generally only used for pile up samples at the start of run 2
141 for high pT physics at the start of run 2 the A14 tune is more appropriate.
142 There are also more recent soft QCD tunes, such as Monash,
143 but A2 was a conservative choice for initial 13 TeV pile up
157 A function that ensures rapidity ordering is set
160 if any(
"SpaceShower:rapidityOrderMPI" in c
for c
in cmds):
165 if "SpaceShower:rapidityOrder" in c
and "MPI" not in c:
166 val = c.split(
"=", 1)[-1].strip()
167 cmds.append(f
"SpaceShower:rapidityOrderMPI = {val}")