ATLAS Offline Software
Functions | Variables
python.Pythia8Config Namespace Reference

Functions

def Pythia8BaseCfg (flags, name="Pythia8_i", **kwargs)
 
def Pythia8EvtGenBaseCfg (flags, **kwargs)
 
def Pythia8_A2_MSTW2008LO_Common_Cfg (flags, **kwargs)
 
def Pythia8_A2_MSTW2008LO_EvtGen_Common_Cfg (flags, **kwargs)
 
def ensureRapidityOrderMPI (cmds)
 

Variables

 log = logging.getLogger("Pythia8Config")
 

Function Documentation

◆ ensureRapidityOrderMPI()

def python.Pythia8Config.ensureRapidityOrderMPI (   cmds)
A function that ensures rapidity ordering is set

Definition at line 155 of file Pythia8Config.py.

155 def ensureRapidityOrderMPI(cmds):
156  """
157  A function that ensures rapidity ordering is set
158  """
159  # if MPI‐ordering already explicitly set, do nothing
160  if any("SpaceShower:rapidityOrderMPI" in c for c in cmds):
161  return cmds
162 
163  # find the first rapidityOrder value
164  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}")
168  break
169  return cmds

◆ Pythia8_A2_MSTW2008LO_Common_Cfg()

def python.Pythia8Config.Pythia8_A2_MSTW2008LO_Common_Cfg (   flags,
**  kwargs 
)
Fragment for setting up A2 MSTW2008LO tune

Definition at line 104 of file Pythia8Config.py.

104 def Pythia8_A2_MSTW2008LO_Common_Cfg(flags, **kwargs):
105  """
106  Fragment for setting up A2 MSTW2008LO tune
107  """
108  # Defaults
109  cmds = kwargs.get("Commands", [])
110 
111  # Tune parameters
112  cmds.extend([
113  "Tune:pp = 5",
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"
121  ])
122 
123  # Now call rapidity ordering
124  cmds = ensureRapidityOrderMPI(cmds)
125 
126  # Update kwargs
127  kwargs["Commands"] = list(dict.fromkeys(cmds))
128 
129  # Broadcast tune to service
130  #tune = "A2 MSTW2008LO"
131 
132  # Call the base config
133  return Pythia8BaseCfg(flags, **kwargs)
134 
135 

◆ Pythia8_A2_MSTW2008LO_EvtGen_Common_Cfg()

def python.Pythia8Config.Pythia8_A2_MSTW2008LO_EvtGen_Common_Cfg (   flags,
**  kwargs 
)
Config for Py8 tune A2 with MSTW2008LO tune
The default version of this includes EvtGen for standardised b fragmentation
This tune is generally only used for pile up samples at the start of run 2 
for high pT physics at the start of run 2 the A14 tune is more appropriate.  
There are also more recent soft QCD tunes, such as Monash, 
but A2 was a conservative choice for initial 13 TeV pile up

Definition at line 136 of file Pythia8Config.py.

136 def Pythia8_A2_MSTW2008LO_EvtGen_Common_Cfg(flags, **kwargs):
137  """
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
144  """
145 
146  # Add Pythia 8 to CA with correct tune settings
147  ca = Pythia8_A2_MSTW2008LO_Common_Cfg(flags, **kwargs)
148 
149  # Add EvtGen
150  ca.merge(Pythia8EvtGenBaseCfg(flags, **kwargs))
151 
152  return ca
153 
154 

◆ Pythia8BaseCfg()

def python.Pythia8Config.Pythia8BaseCfg (   flags,
  name = "Pythia8_i",
**  kwargs 
)
The main Pythia8 configuration fragment that sets up the Pythia8_i algorithm
and returns a CA instance

Definition at line 13 of file Pythia8Config.py.

13 def Pythia8BaseCfg(flags, name="Pythia8_i", **kwargs):
14  """
15  The main Pythia8 configuration fragment that sets up the Pythia8_i algorithm
16  and returns a CA instance
17  """
18  # Default commands
19  commands = kwargs.get("Commands", [])
20 
21  # Baseline P8 settings
22  base_cmds = [
23  "Main:timesAllowErrors = 500",
24  "ParticleDecays:limitTau0 = on",
25  "ParticleDecays:tau0Max = 10.0"
26  ]
27  commands.extend(base_cmds)
28 
29  # Collision energy
30  if "CollisionEnergy" not in kwargs:
31  kwargs["CollisionEnergy"] = flags.Beam.Energy * 2 / GeV
32 
33  # Extended settings
34  if flags.Generator.PDGparams:
35 
36  from EvgenProdTools.offline_dict import parameters
37 
38 
39  particle_params = parameters.get("particles")
40  if particle_params:
41  for pdg_str, vals in particle_params.items():
42 
43  pdg = int(pdg_str)
44  if 6 <= pdg < 26:
45  commands.append(f"{pdg}:m0 = {vals['mass']}")
46  commands.append(f"{pdg}:mWidth = {vals['width']}")
47  else:
48  log.warning("Could not retrieve standard ATLAS particle parameters")
49 
50 
51  ew_params = parameters.get("EW_parameters")
52  if ew_params:
53 
54  for key, val in ew_params.items():
55  if key[1] in ('sin2thetaW', 'sin2thetaWbar'):
56  commands.append(f"StandardModel:{key[1]} = {val}")
57  else:
58  log.warning("Could not retrieve standard ATLAS EW parameters")
59  else:
60 
61  commands.extend([
62  "6:m0 = 172.5",
63  "23:m0 = 91.1876",
64  "23:mWidth = 2.4952",
65  "24:m0 = 80.399",
66  "24:mWidth = 2.085",
67  "StandardModel:sin2thetaW = 0.23113",
68  "StandardModel:sin2thetaWbar = 0.23146",
69  ])
70 
71  # Remove duplicate commands and update kwargs
72  commands = list(dict.fromkeys(commands))
73  kwargs["Commands"] = commands
74 
75  # Create CA object
76  ca = ComponentAccumulator(EvgenSequenceFactory(EvgenSequence.Generator))
77  ca.addEventAlgo(
78  CompFactory.Pythia8_i("Pythia8_i", **kwargs)
79  )
80 
81  return ca
82 
83 

◆ Pythia8EvtGenBaseCfg()

def python.Pythia8Config.Pythia8EvtGenBaseCfg (   flags,
**  kwargs 
)
Fragment for setting up EvtGen on top of Pythia 8

Definition at line 84 of file Pythia8Config.py.

84 def Pythia8EvtGenBaseCfg(flags, **kwargs):
85  """
86  Fragment for setting up EvtGen on top of Pythia 8
87  """
88  # Custom settings
89  auxfiles = ["inclusiveP8DsDPlus.pdt"]
90  # FHerwig has problems with omega b* (5334), so not present in the base EvtGen fragment.
91  whiteList = [-5334, 5334]
92 
93  # Add custom EvtGenCfg
94  from EvtGen_i.EvtGenConfig import EvtGenCfg
95  ca = EvtGenCfg(
96  flags,
97  whiteList = whiteList,
98  auxfiles = auxfiles
99  )
100 
101  return ca
102 
103 

Variable Documentation

◆ log

python.Pythia8Config.log = logging.getLogger("Pythia8Config")

Definition at line 10 of file Pythia8Config.py.

python.Sequences.EvgenSequenceFactory
def EvgenSequenceFactory(sequence)
Definition: Sequences.py:18
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.Pythia8Config.Pythia8_A2_MSTW2008LO_Common_Cfg
def Pythia8_A2_MSTW2008LO_Common_Cfg(flags, **kwargs)
Definition: Pythia8Config.py:104
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
python.Pythia8Config.Pythia8_A2_MSTW2008LO_EvtGen_Common_Cfg
def Pythia8_A2_MSTW2008LO_EvtGen_Common_Cfg(flags, **kwargs)
Definition: Pythia8Config.py:136
python.EvtGenConfig.EvtGenCfg
def EvtGenCfg(flags, decayFile=None, whiteList=None, allowAllKnownDecays=False, auxfiles=None)
Definition: EvtGenConfig.py:13
python.CaloAddPedShiftConfig.int
int
Definition: CaloAddPedShiftConfig.py:45
python.Pythia8Config.ensureRapidityOrderMPI
def ensureRapidityOrderMPI(cmds)
Definition: Pythia8Config.py:155
python.Pythia8Config.Pythia8EvtGenBaseCfg
def Pythia8EvtGenBaseCfg(flags, **kwargs)
Definition: Pythia8Config.py:84
python.Pythia8Config.Pythia8BaseCfg
def Pythia8BaseCfg(flags, name="Pythia8_i", **kwargs)
Definition: Pythia8Config.py:13