PYTHIA  8.312
ParticleData.h
1 // ParticleData.h is a part of the PYTHIA event generator.
2 // Copyright (C) 2024 Torbjorn Sjostrand.
3 // PYTHIA is licenced under the GNU GPL v2 or later, see COPYING for details.
4 // Please respect the MCnet Guidelines, see GUIDELINES for details.
5 
6 // Header file for the classes containing particle data.
7 // DecayChannel contains info on a single decay channel.
8 // ParticleDataEntry contains info on a single particle species.
9 // ParticleData collects info on all particles as a map.
10 
11 #ifndef Pythia8_ParticleData_H
12 #define Pythia8_ParticleData_H
13 
14 #include "Pythia8/Basics.h"
15 #include "Pythia8/Info.h"
16 #include "Pythia8/PythiaStdlib.h"
17 #include "Pythia8/Settings.h"
18 #include "Pythia8/StandardModel.h"
19 
20 namespace Pythia8 {
21 
22 //==========================================================================
23 
24 // Forward reference to some classes.
25 class ParticleData;
26 class ResonanceWidths;
27 class CoupSM;
28 class CoupSUSY;
29 class SUSYResonanceWidths;
30 
31 //==========================================================================
32 
33 // This class holds info on a single decay channel.
34 
35 class DecayChannel {
36 
37 public:
38 
39  // Constructor.
40  DecayChannel(int onModeIn = 0, double bRatioIn = 0., int meModeIn = 0,
41  int prod0 = 0, int prod1 = 0, int prod2 = 0, int prod3 = 0,
42  int prod4 = 0, int prod5 = 0, int prod6 = 0, int prod7 = 0)
43  : onModeSave(onModeIn), bRatioSave(bRatioIn), currentBRSave(0.),
44  onShellWidthSave(0.), openSecPos(1.), openSecNeg(1.),
45  meModeSave(meModeIn), nProd(0), prod(), hasChangedSave(true) {
46  prod[0] = prod0; prod[1] = prod1; prod[2] = prod2; prod[3] = prod3;
47  prod[4] = prod4; prod[5] = prod5; prod[6] = prod6; prod[7] = prod7;
48  for (int j = 0; j < 8; ++j) if (prod[j] != 0 && j == nProd) ++nProd; }
49 
50  // Copy constructor.
51  DecayChannel( const DecayChannel& oldDC) {
52  onModeSave = oldDC.onModeSave; bRatioSave = oldDC.bRatioSave;
53  currentBRSave = oldDC.currentBRSave;
54  onShellWidthSave = oldDC.onShellWidthSave; openSecPos = oldDC.openSecPos;
55  openSecNeg = oldDC.openSecNeg; meModeSave = oldDC.meModeSave;
56  nProd = oldDC.nProd; for (int j = 0; j < 8; ++j) prod[j] = oldDC.prod[j];
57  hasChangedSave = oldDC.hasChangedSave; }
58 
59  // Assignment operator.
60  DecayChannel& operator=( const DecayChannel& oldDC) { if (this != &oldDC) {
61  onModeSave = oldDC.onModeSave; bRatioSave = oldDC.bRatioSave;
62  currentBRSave = oldDC.currentBRSave;
63  onShellWidthSave = oldDC.onShellWidthSave; openSecPos = oldDC.openSecPos;
64  openSecNeg = oldDC.openSecNeg; meModeSave = oldDC.meModeSave;
65  nProd = oldDC.nProd; for (int j = 0; j < 8; ++j) prod[j] = oldDC.prod[j];
66  hasChangedSave = oldDC.hasChangedSave; } return *this; }
67 
68  // Member functions for input.
69  void onMode(int onModeIn) {onModeSave = onModeIn; hasChangedSave = true;}
70  void bRatio(double bRatioIn, bool countAsChanged = true) {
71  bRatioSave = bRatioIn; if (countAsChanged) hasChangedSave = true;}
72  void rescaleBR(double fac) {bRatioSave *= fac; hasChangedSave = true;}
73  void meMode(int meModeIn) {meModeSave = meModeIn; hasChangedSave = true;}
74  void multiplicity(int multIn) {nProd = multIn; hasChangedSave = true;}
75  void product(int i, int prodIn) {prod[i] = prodIn; nProd = 0;
76  for (int j = 0; j < 8; ++j) if (prod[j] != 0 && j == nProd) ++nProd;
77  hasChangedSave = true;}
78  void setHasChanged(bool hasChangedIn) {hasChangedSave = hasChangedIn;}
79 
80  // Member functions for output.
81  int onMode() const {return onModeSave;}
82  double bRatio() const {return bRatioSave;}
83  int meMode() const {return meModeSave;}
84  int multiplicity() const {return nProd;}
85  int product(int i) const {return (i >= 0 && i < nProd) ? prod[i] : 0;}
86  bool hasChanged() const { return hasChangedSave;}
87 
88  // Check for presence of particles anywhere in decay list.
89  bool contains(int id1) const;
90  bool contains(int id1, int id2) const;
91  bool contains(int id1, int id2, int id3) const;
92 
93  // Input/output for current selection of decay modes.
94  // Takes into account on/off switches and dynamic width for resonances.
95  void currentBR(double currentBRIn) {currentBRSave = currentBRIn;}
96  double currentBR() const {return currentBRSave;}
97 
98  // Input/output for nominal partial width; used by resonances.
99  void onShellWidth(double onShellWidthIn) {
100  onShellWidthSave = onShellWidthIn;}
101  double onShellWidth() const {return onShellWidthSave;}
102  void onShellWidthFactor(double factor) {onShellWidthSave *= factor;}
103 
104  // Input/output for fraction of secondary open widths; used by resonances.
105  void openSec(int idSgn, double openSecIn) {
106  if (idSgn > 0) openSecPos = openSecIn; else openSecNeg = openSecIn;}
107  double openSec(int idSgn) const {
108  return (idSgn > 0) ? openSecPos : openSecNeg;}
109 
110 private:
111 
112  // Decay channel info.
113  int onModeSave;
114  double bRatioSave, currentBRSave, onShellWidthSave, openSecPos,
115  openSecNeg;
116  int meModeSave, nProd, prod[8];
117  bool hasChangedSave;
118 
119 };
120 
121 //==========================================================================
122 
123 // This class holds info on a single particle species.
124 
126 
127 public:
128 
129  // Constructors: for antiparticle exists or not.
130  ParticleDataEntry(int idIn = 0, string nameIn = " ",
131  int spinTypeIn = 0, int chargeTypeIn = 0, int colTypeIn = 0,
132  double m0In = 0., double mWidthIn = 0., double mMinIn = 0.,
133  double mMaxIn = 0., double tau0In = 0., bool varWidthIn = false)
134  : idSave(abs(idIn)), nameSave(nameIn), antiNameSave("void"),
135  spinTypeSave(spinTypeIn), chargeTypeSave(chargeTypeIn),
136  colTypeSave(colTypeIn), m0Save(m0In), mWidthSave (mWidthIn),
137  mMinSave(mMinIn), mMaxSave(mMaxIn), tau0Save(tau0In),
138  constituentMassSave(), hasAntiSave(false), isResonanceSave(),
139  mayDecaySave(), tauCalcSave(true), varWidthSave(varWidthIn),
140  doExternalDecaySave(), isVisibleSave(), doForceWidthSave(),
141  hasChangedSave(true), hasChangedMMinSave(false),
142  hasChangedMMaxSave(false), modeBWnow(), modeTau0now(), atanLow(),
143  atanDif(), mThr(), currentBRSum(), resonancePtr(0), particleDataPtr() {
144  setDefaults();}
145  ParticleDataEntry(int idIn, string nameIn, string antiNameIn,
146  int spinTypeIn = 0, int chargeTypeIn = 0, int colTypeIn = 0,
147  double m0In = 0., double mWidthIn = 0., double mMinIn = 0.,
148  double mMaxIn = 0., double tau0In = 0., bool varWidthIn = false)
149  : idSave(abs(idIn)), nameSave(nameIn), antiNameSave(antiNameIn),
150  spinTypeSave(spinTypeIn), chargeTypeSave(chargeTypeIn),
151  colTypeSave(colTypeIn), m0Save(m0In), mWidthSave (mWidthIn),
152  mMinSave(mMinIn), mMaxSave(mMaxIn), tau0Save(tau0In),
153  constituentMassSave(), hasAntiSave(true), isResonanceSave(),
154  mayDecaySave(), tauCalcSave(true), varWidthSave(varWidthIn),
155  doExternalDecaySave(), isVisibleSave(), doForceWidthSave(),
156  hasChangedSave(true), hasChangedMMinSave(false),
157  hasChangedMMaxSave(false), modeBWnow(), modeTau0now(), atanLow(),
158  atanDif(), mThr(), currentBRSum(), resonancePtr(0), particleDataPtr() {
159  setDefaults(); if (toLower(antiNameIn) == "void") hasAntiSave = false;}
160 
161  // Copy constructor.
162  ParticleDataEntry( const ParticleDataEntry& oldPDE) {idSave = oldPDE.idSave;
163  nameSave = oldPDE.nameSave; antiNameSave = oldPDE.antiNameSave;
164  spinTypeSave = oldPDE.spinTypeSave; chargeTypeSave = oldPDE.chargeTypeSave;
165  colTypeSave = oldPDE.colTypeSave; m0Save = oldPDE.m0Save;
166  mWidthSave = oldPDE.mWidthSave; mMinSave = oldPDE.mMinSave;
167  mMaxSave = oldPDE.mMaxSave; tau0Save = oldPDE.tau0Save;
168  varWidthSave = oldPDE.varWidthSave;
169  constituentMassSave = oldPDE.constituentMassSave;
170  hasAntiSave = oldPDE.hasAntiSave; isResonanceSave = oldPDE.isResonanceSave;
171  mayDecaySave = oldPDE.mayDecaySave; tauCalcSave = oldPDE.tauCalcSave;
172  doExternalDecaySave = oldPDE.doExternalDecaySave; isVisibleSave
173  = oldPDE.isVisibleSave; doForceWidthSave = oldPDE.doForceWidthSave;
174  hasChangedSave = oldPDE.hasChangedSave; hasChangedMMinSave
175  = oldPDE.hasChangedMMinSave; hasChangedMMaxSave
176  = oldPDE.hasChangedMMaxSave; modeTau0now = oldPDE.modeTau0now; modeBWnow
177  = oldPDE.modeBWnow; atanLow = oldPDE.atanLow; atanDif = oldPDE.atanDif;
178  mThr = oldPDE.mThr;
179  for (int i = 0; i < int(oldPDE.channels.size()); ++i) {
180  DecayChannel oldDC = oldPDE.channels[i]; channels.push_back(oldDC); }
181  currentBRSum = oldPDE.currentBRSum; resonancePtr = oldPDE.resonancePtr;
182  particleDataPtr = oldPDE.particleDataPtr; }
183 
184  // Assignment operator.
186  if (this != &oldPDE) { idSave = oldPDE.idSave;
187  nameSave = oldPDE.nameSave; antiNameSave = oldPDE.antiNameSave;
188  spinTypeSave = oldPDE.spinTypeSave; chargeTypeSave = oldPDE.chargeTypeSave;
189  colTypeSave = oldPDE.colTypeSave; m0Save = oldPDE.m0Save;
190  mWidthSave = oldPDE.mWidthSave; mMinSave = oldPDE.mMinSave;
191  mMaxSave = oldPDE.mMaxSave; tau0Save = oldPDE.tau0Save;
192  varWidthSave = oldPDE.varWidthSave;
193  constituentMassSave = oldPDE.constituentMassSave;
194  hasAntiSave = oldPDE.hasAntiSave; isResonanceSave = oldPDE.isResonanceSave;
195  mayDecaySave = oldPDE.mayDecaySave; tauCalcSave = oldPDE.tauCalcSave;
196  doExternalDecaySave = oldPDE.doExternalDecaySave; isVisibleSave
197  = oldPDE.isVisibleSave; doForceWidthSave = oldPDE.doForceWidthSave;
198  hasChangedSave = oldPDE.hasChangedSave; hasChangedMMinSave
199  = oldPDE.hasChangedMMinSave; hasChangedMMaxSave
200  = oldPDE.hasChangedMMaxSave; modeBWnow = oldPDE.modeBWnow; atanLow
201  = oldPDE.atanLow; atanDif = oldPDE.atanDif; mThr = oldPDE.mThr;
202  for (int i = 0; i < int(oldPDE.channels.size()); ++i) {
203  DecayChannel oldDC = oldPDE.channels[i]; channels.push_back(oldDC); }
204  currentBRSum = oldPDE.currentBRSum; resonancePtr = 0;
205  particleDataPtr = 0; } return *this; }
206 
207  // Initialization of some particle flags.
208  void setDefaults();
209 
210  // Store pointer to whole particle data table/database.
211  void initPtr( ParticleData* particleDataPtrIn) {
212  particleDataPtr = particleDataPtrIn;}
213 
214  // Reset all the properties of an existing particle.
215  void setAll(string nameIn, string antiNameIn, int spinTypeIn = 0,
216  int chargeTypeIn = 0, int colTypeIn = 0, double m0In = 0.,
217  double mWidthIn = 0., double mMinIn = 0., double mMaxIn = 0.,
218  double tau0In = 0., bool varWidthIn = false)
219  {nameSave = nameIn; antiNameSave = antiNameIn; hasAntiSave = true;
220  if (toLower(antiNameIn) == "void") hasAntiSave = false;
221  spinTypeSave = spinTypeIn; chargeTypeSave = chargeTypeIn;
222  colTypeSave = colTypeIn; m0Save = m0In; mWidthSave = mWidthIn;
223  setMMin(mMinIn); setMMax(mMaxIn); tau0Save = tau0In;
224  varWidthSave = varWidthIn; setDefaults(); hasChangedSave = true;}
225 
226  // Change current values one at a time (or set if not set before).
227  // (Must use set here since else name+signature clash with get methods.)
228  void setName(string nameIn) {nameSave = nameIn; hasChangedSave = true;}
229  void setAntiName(string antiNameIn) {antiNameSave = antiNameIn;
230  hasAntiSave = (toLower(antiNameIn) != "void"); hasChangedSave = true;}
231  void setNames(string nameIn, string antiNameIn) {nameSave = nameIn;
232  antiNameSave = antiNameIn; hasAntiSave = (toLower(antiNameIn) != "void");
233  hasChangedSave = true;}
234  void setSpinType(int spinTypeIn) {spinTypeSave = spinTypeIn;
235  hasChangedSave = true;}
236  void setChargeType(int chargeTypeIn) {chargeTypeSave = chargeTypeIn;
237  hasChangedSave = true;}
238  void setColType(int colTypeIn) {colTypeSave = colTypeIn;
239  hasChangedSave = true;}
240  void setM0(double m0In) {m0Save = m0In; setConstituentMass();
241  hasChangedSave = true;}
242  void setMWidth(double mWidthIn, bool countAsChanged = true) {
243  mWidthSave = mWidthIn; if (countAsChanged) hasChangedSave = true;}
244  void setMMin(double mMinIn) {mMinSave = mMinIn; hasChangedSave = true;
245  hasChangedMMinSave=true;}
246  void setMMax(double mMaxIn) {mMaxSave = mMaxIn; hasChangedSave = true;
247  hasChangedMMaxSave=true;}
248  // Special options specifically when cutting wings of Breit-Wigners.
249  void setMMinNoChange(double mMinIn) {mMinSave = mMinIn;}
250  void setMMaxNoChange(double mMaxIn) {mMaxSave = mMaxIn;}
251  void setTau0(double tau0In, bool countAsChanged = true)
252  {tau0Save = tau0In; if (countAsChanged) hasChangedSave = true;}
253  void setVarWidth(bool varWidthIn) {varWidthSave = varWidthIn;}
254  void setIsResonance(bool isResonanceIn) {isResonanceSave = isResonanceIn;
255  hasChangedSave = true;}
256  void setMayDecay(bool mayDecayIn, bool countAsChanged = true) {
257  mayDecaySave = mayDecayIn; if (countAsChanged) hasChangedSave = true;}
258  void setTauCalc(bool tauCalcIn, bool countAsChanged = true) {
259  tauCalcSave = tauCalcIn; if (countAsChanged) hasChangedSave = true;}
260  void setDoExternalDecay(bool doExternalDecayIn)
261  {doExternalDecaySave = doExternalDecayIn; hasChangedSave = true;}
262  void setIsVisible(bool isVisibleIn) {isVisibleSave = isVisibleIn;
263  hasChangedSave = true;}
264  void setDoForceWidth(bool doForceWidthIn) {doForceWidthSave = doForceWidthIn;
265  hasChangedSave = true;}
266  void setHasChanged(bool hasChangedIn) {hasChangedSave = hasChangedIn;
267  for (int i = 0; i < int(channels.size()); ++i)
268  channels[i].setHasChanged(hasChangedIn);
269  if (!hasChangedIn) {hasChangedMMinSave=false; hasChangedMMaxSave=false;}}
270 
271  // Give back current values.
272  int id() const { return idSave; }
273  int antiId() const {
274  return hasAntiSave ? -idSave : idSave; }
275  bool hasAnti() const { return hasAntiSave; }
276  string name(int idIn = 1) const {
277  return (idIn > 0) ? nameSave : antiNameSave; }
278  int spinType() const {return spinTypeSave; }
279  int chargeType(int idIn = 1) const {
280  return (idIn > 0) ? chargeTypeSave : -chargeTypeSave; }
281  double charge(int idIn = 1) const {
282  return (idIn > 0) ? chargeTypeSave / 3. : -chargeTypeSave / 3.; }
283  int colType(int idIn = 1) const {
284  if (colTypeSave == 2) return colTypeSave;
285  return (idIn > 0) ? colTypeSave : -colTypeSave; }
286  double m0() const { return m0Save; }
287  double mWidth() const { return mWidthSave; }
288  double mMin() const { return mMinSave; }
289  double mMax() const { return mMaxSave; }
290  double m0Min() const {
291  return (modeBWnow == 0) ? m0Save : mMinSave; }
292  double m0Max() const {
293  return (modeBWnow == 0) ? m0Save : mMaxSave; }
294  double tau0() const { return tau0Save; }
295  bool isResonance() const { return isResonanceSave; }
296  bool varWidth() const { return varWidthSave; }
297  bool mayDecay() const { return mayDecaySave; }
298  bool tauCalc() const { return tauCalcSave; }
299  bool doExternalDecay() const { return doExternalDecaySave; }
300  bool isVisible() const { return isVisibleSave; }
301  bool doForceWidth() const { return doForceWidthSave; }
302  bool hasChanged() const { if (hasChangedSave) return true;
303  for (int i = 0; i < int(channels.size()); ++i)
304  if (channels[i].hasChanged()) return true;
305  return false;}
306  bool hasChangedMMin() const { return hasChangedMMinSave; }
307  bool hasChangedMMax() const { return hasChangedMMaxSave; }
308 
309  // Set and give back several mass-related quantities.
310  void initBWmass();
311  double constituentMass() const { return constituentMassSave; }
312  double mSel() const;
313  double mRun(double mH) const;
314 
315  // Give back other quantities.
316  bool useBreitWigner() const { return (modeBWnow > 0); }
317  bool canDecay() const { return (channels.size() > 0)
318  || varWidthSave; }
319  bool isLepton() const { return (idSave > 10 && idSave < 19);}
320  bool isQuark() const { return (idSave != 0 && idSave < 9);}
321  bool isGluon() const { return (idSave == 21);}
322  bool isDiquark() const { return (idSave > 1000 && idSave < 10000
323  && (idSave/10)%10 == 0);}
324  // Identify Hidden Valley partons as partons.
325  bool isParton() const { return ( idSave == 21
326  || (idSave != 0 && idSave < 6)
327  || (idSave > 1000 && idSave < 5510 && (idSave/10)%10 == 0)
328  || (idSave > 4900100 && idSave < 4900109)
329  || (idSave > 4901000 && idSave < 4909000 && (idSave/10)%10 == 0) );}
330  bool isHadron() const;
331  bool isMeson() const;
332  bool isBaryon() const;
333  bool isOnium() const;
334  bool isExotic() const;
335 
336  // Intermediate octet ccbar or bbar states in colour-octet model.
337  bool isOctetHadron() const {return idSave >= 9940000
338  && idSave < 9960000; }
339  int heaviestQuark(int idIn = 1) const;
340  int baryonNumberType(int idIn = 1) const;
341  int nQuarksInCode(int idQIn) const;
342 
343  // Reset to empty decay table.
344  void clearChannels() {channels.resize(0);}
345 
346  // Add a decay channel to the decay table.
347  void addChannel(int onMode = 0, double bRatio = 0., int meMode = 0,
348  int prod0 = 0, int prod1 = 0, int prod2 = 0, int prod3 = 0,
349  int prod4 = 0, int prod5 = 0, int prod6 = 0, int prod7 = 0) {
350  channels.push_back( DecayChannel( onMode, bRatio, meMode, prod0,
351  prod1, prod2, prod3, prod4, prod5, prod6, prod7) ); }
352 
353  // Decay table size.
354  int sizeChannels() const {return channels.size();}
355 
356  // Gain access to a channel in the decay table.
357  DecayChannel& channel(int i){return channels[i];}
358  const DecayChannel& channel(int i) const {return channels[i];}
359 
360  // Rescale sum of branching ratios to unity.
361  void rescaleBR(double newSumBR = 1.);
362 
363  // Random choice of decay channel according to branching ratios.
364  bool preparePick(int idSgn, double mHat = 0., int idInFlav = 0);
365  DecayChannel& pickChannel();
366 
367  // Access methods stored in ResonanceWidths.
368  void setResonancePtr(ResonanceWidthsPtr resonancePtrIn) {
369  resonancePtr = resonancePtrIn;}
370  ResonanceWidthsPtr getResonancePtr() {return resonancePtr;}
371  void resInit(Info* infoPtrIn);
372  double resWidth(int idSgn, double mHat, int idIn = 0,
373  bool openOnly = false, bool setBR = false);
374  double resWidthOpen(int idSgn, double mHat, int idIn = 0);
375  double resWidthStore(int idSgn, double mHat, int idIn = 0);
376  double resOpenFrac(int idSgn);
377  double resWidthRescaleFactor();
378  double resWidthChan(double mHat, int idAbs1 = 0, int idAbs2 = 0);
379 
380 private:
381 
382  // Constants: could only be changed in the code itself.
383  static const int INVISIBLENUMBER, INVISIBLETABLE[80], KNOWNNOWIDTH[3];
384  static const double MAXTAU0FORDECAY,MINMASSRESONANCE, NARROWMASS,
385  CONSTITUENTMASSTABLE[10];
386 
387  // Particle data.
388  int idSave;
389  string nameSave, antiNameSave;
390  int spinTypeSave, chargeTypeSave, colTypeSave;
391  double m0Save, mWidthSave, mMinSave, mMaxSave, tau0Save,
392  constituentMassSave;
393  bool hasAntiSave, isResonanceSave, mayDecaySave, tauCalcSave, varWidthSave,
394  doExternalDecaySave, isVisibleSave, doForceWidthSave, hasChangedSave,
395  hasChangedMMinSave, hasChangedMMaxSave;
396 
397  // Extra data for mass selection according to a Breit-Wigner and lifetime.
398  int modeBWnow, modeTau0now;
399  double atanLow, atanDif, mThr;
400 
401  // A vector containing all the decay channels of the particle.
402  vector<DecayChannel> channels;
403 
404  // Summed branching ratio of currently open channels.
405  double currentBRSum;
406 
407  // Pointer to ResonanceWidths object; only used for some particles.
408  ResonanceWidthsPtr resonancePtr;
409 
410  // Pointer to the full particle data table.
411  ParticleData* particleDataPtr;
412 
413  // Set constituent mass.
414  void setConstituentMass();
415 
416 };
417 
418 //==========================================================================
419 
420 // This class holds a map of all ParticleDataEntries.
421 
423 
424 public:
425 
426  // Constructor.
427  ParticleData() : setRapidDecayVertex(), modeBreitWigner(), maxEnhanceBW(),
428  mQRun(), Lambda5Run(), intermediateTau0(), infoPtr(nullptr),
429  settingsPtr(nullptr), rndmPtr(nullptr), coupSMPtr(nullptr),
430  particlePtr(nullptr), isInit(false), readingFailedSave(false) {}
431 
432  // Copy constructor.
433  ParticleData( const ParticleData& oldPD) {
434  modeBreitWigner = oldPD.modeBreitWigner; maxEnhanceBW = oldPD.maxEnhanceBW;
435  for (int i = 0; i < 7; ++i) mQRun[i] = oldPD.mQRun[i];
436  Lambda5Run = oldPD.Lambda5Run; infoPtr = nullptr; settingsPtr = nullptr;
437  rndmPtr = nullptr; coupSMPtr = nullptr;
438  for (auto pde = oldPD.pdt.begin(); pde != oldPD.pdt.end(); pde++) {
439  int idTmp = pde->first;
440  pdt[idTmp] = make_shared<ParticleDataEntry>(*pde->second);
441  pdt[idTmp]->initPtr(this); }
442  particlePtr = nullptr; isInit = oldPD.isInit;
443  readingFailedSave = oldPD.readingFailedSave; }
444 
445  // Assignment operator.
446  ParticleData& operator=( const ParticleData& oldPD) { if (this != &oldPD) {
447  modeBreitWigner = oldPD.modeBreitWigner; maxEnhanceBW = oldPD.maxEnhanceBW;
448  for (int i = 0; i < 7; ++i) mQRun[i] = oldPD.mQRun[i];
449  Lambda5Run = oldPD.Lambda5Run; infoPtr = nullptr; settingsPtr = nullptr;
450  rndmPtr = nullptr; coupSMPtr = nullptr;
451  for (auto pde = oldPD.pdt.begin(); pde != oldPD.pdt.end(); pde++) {
452  int idTmp = pde->first;
453  pdt[idTmp] = make_shared<ParticleDataEntry>(*pde->second);
454  pdt[idTmp]->initPtr(this); }
455  particlePtr = nullptr; isInit = oldPD.isInit;
456  readingFailedSave = oldPD.readingFailedSave; } return *this; }
457 
458  // Initialize pointers.
459  void initPtrs(Info* infoPtrIn) {infoPtr = infoPtrIn;
460  settingsPtr = infoPtr->settingsPtr; loggerPtr = infoPtr->loggerPtr;
461  rndmPtr = infoPtr->rndmPtr; coupSMPtr = infoPtr->coupSMPtr;}
462 
463  // Read in database from specific file.
464  bool init(string startFile = "../share/Pythia8/xmldoc/ParticleData.xml") {
465  initCommon(); return readXML(startFile);}
466 
467  // Read in database from saved file stored in memory.
468  bool init(const ParticleData& particleDataIn) {
469  initCommon(); return copyXML(particleDataIn);}
470 
471  // Read in database from an istream.
472  bool init(istream& is) { initCommon(); return readXML(is);}
473 
474  // Overwrite existing database by reading from specific file.
475  bool reInit(string startFile, bool xmlFormat = true) { initCommon();
476  return (xmlFormat) ? readXML(startFile) : readFF(startFile);}
477 
478  // Initialize pointers, normal Breit-Wigners and special resonances.
479  void initWidths(vector<ResonanceWidthsPtr> resonancePtrs);
480 
481  // Read and process or list whole (or part of) database from/to an XML file.
482  bool readXML(string inFile, bool reset = true) ;
483  void listXML(string outFile);
484  bool readXML(istream& is, bool reset=true);
485 
486  // Copy and process XML information from another particleData object.
487  bool copyXML(const ParticleData &particleDataIn);
488 
489  // Auxiliary functions to readXML() and copyXML().
490  bool loadXML(string inFile, bool reset = true) ;
491  bool loadXML(istream& is, bool reset=true);
492  bool processXML(bool reset = true) ;
493 
494  // Read or list whole (or part of) database from/to a free format file.
495  bool readFF(string inFile, bool reset = true) ;
496  bool readFF(istream& is, bool reset = true);
497  void listFF(string outFile);
498 
499  // Read in one update from a single line.
500  bool readString(string lineIn, bool warn = true) ;
501 
502  // Keep track whether any readings have failed, invalidating run setup.
503  bool readingFailed() {return readingFailedSave;}
504 
505  // Print out table of whole database, or of only part of it.
506  void listAll(ostream& stream) {list(stream, false, true);}
507  void listAll() {listAll(cout);}
508  void listChanged(bool changedRes = false) {list(true, changedRes);}
509  void list(ostream& stream, bool chargedOnly = false, bool changedRes = true);
510  void list(bool changedOnly = false, bool changedRes = true) {
511  list(cout, changedOnly, changedRes); }
512 
513  // Print out specified particles.
514  void list(int idList) {vector<int> idListTemp;
515  idListTemp.push_back(idList); list( idListTemp);}
516  void list(vector<int> idList);
517 
518  // Retrieve readString history (e.g., for inspection). Everything
519  // (subrun=-999), up to first subrun (=-1), or subrun-specific (>=0).
520  vector<string> getReadHistory(int subrun=-999) {
521  if (subrun == -999) return readStringHistory;
522  else if (readStringSubrun.find(subrun) != readStringSubrun.end())
523  return readStringSubrun[subrun];
524  else return vector<string>();
525  }
526 
527  // Check that table makes sense, especially for decays.
528  void checkTable(int verbosity = 1) ;
529 
530  // Add new entry.
531  void addParticle(int idIn, string nameIn = " ", int spinTypeIn = 0,
532  int chargeTypeIn = 0, int colTypeIn = 0, double m0In = 0.,
533  double mWidthIn = 0., double mMinIn = 0., double mMaxIn = 0.,
534  double tau0In = 0., bool varWidthIn = false) {
535  pdt[abs(idIn)] = make_shared<ParticleDataEntry>(idIn, nameIn, spinTypeIn,
536  chargeTypeIn, colTypeIn, m0In, mWidthIn, mMinIn, mMaxIn, tau0In,
537  varWidthIn);
538  pdt[abs(idIn)]->initPtr(this); }
539  void addParticle(int idIn, string nameIn, string antiNameIn,
540  int spinTypeIn = 0, int chargeTypeIn = 0, int colTypeIn = 0,
541  double m0In = 0., double mWidthIn = 0., double mMinIn = 0.,
542  double mMaxIn = 0., double tau0In = 0., bool varWidthIn = false) {
543  pdt[abs(idIn)] = make_shared<ParticleDataEntry>(idIn, nameIn, antiNameIn,
544  spinTypeIn, chargeTypeIn, colTypeIn, m0In, mWidthIn, mMinIn, mMaxIn,
545  tau0In, varWidthIn);
546  pdt[abs(idIn)]->initPtr(this); }
547 
548  // Reset all the properties of an entry in one go.
549  void setAll(int idIn, string nameIn, string antiNameIn,
550  int spinTypeIn = 0, int chargeTypeIn = 0, int colTypeIn = 0,
551  double m0In = 0., double mWidthIn = 0., double mMinIn = 0.,
552  double mMaxIn = 0.,double tau0In = 0.,bool varWidthIn = false) {
553  ParticleDataEntryPtr ptr = findParticle(idIn);
554  if ( ptr ) ptr->setAll( nameIn, antiNameIn, spinTypeIn, chargeTypeIn,
555  colTypeIn, m0In, mWidthIn, mMinIn, mMaxIn, tau0In, varWidthIn); }
556 
557  // Query existence of an entry.
558  bool isParticle(int idIn) const {
559  auto found = pdt.find( abs(idIn) );
560  if ( found == pdt.end() ) return false;
561  if ( idIn > 0 || found->second->hasAnti() ) return true;
562  return false;
563  }
564 
565  // Query existence of an entry and return an iterator.
566  ParticleDataEntryPtr findParticle(int idIn) {
567  auto found = pdt.find( abs(idIn) );
568  if( found == pdt.end() ) return nullptr;
569  if ( idIn > 0 || found->second->hasAnti() ) return found->second;
570  return nullptr;
571  }
572 
573  // Query existence of an entry and return a const iterator.
574  const ParticleDataEntryPtr findParticle(int idIn) const {
575  auto found = pdt.find( abs(idIn) );
576  if( found == pdt.end() ) return nullptr;
577  if ( idIn > 0 || found->second->hasAnti() ) return found->second;
578  return nullptr;
579  }
580 
581  // Return the id of the sequentially next particle stored in table.
582  int nextId(int idIn) const;
583 
584  // Define iterators over entries.
585  map<int, ParticleDataEntryPtr>::iterator begin() { return pdt.begin(); }
586  map<int, ParticleDataEntryPtr>::iterator end() { return pdt.end(); }
587 
588  // Change current values one at a time (or set if not set before).
589  void name(int idIn, string nameIn) {
590  ParticleDataEntryPtr ptr = findParticle(idIn);
591  if ( ptr ) ptr->setName(nameIn); }
592  void antiName(int idIn, string antiNameIn) {
593  ParticleDataEntryPtr ptr = findParticle(idIn);
594  if ( ptr ) ptr->setAntiName(antiNameIn); }
595  void names(int idIn, string nameIn, string antiNameIn) {
596  ParticleDataEntryPtr ptr = findParticle(idIn);
597  if ( ptr ) ptr->setNames(nameIn, antiNameIn); }
598  void spinType(int idIn, int spinTypeIn) {
599  ParticleDataEntryPtr ptr = findParticle(idIn);
600  if ( ptr ) ptr->setSpinType(spinTypeIn); }
601  void chargeType(int idIn, int chargeTypeIn) {
602  ParticleDataEntryPtr ptr = findParticle(idIn);
603  if ( ptr ) ptr->setChargeType(chargeTypeIn); }
604  void colType(int idIn, int colTypeIn) {
605  ParticleDataEntryPtr ptr = findParticle(idIn);
606  if ( ptr ) ptr->setColType(colTypeIn); }
607  void m0(int idIn, double m0In) {
608  ParticleDataEntryPtr ptr = findParticle(idIn);
609  if ( ptr ) ptr->setM0(m0In); }
610  void mWidth(int idIn, double mWidthIn) {
611  ParticleDataEntryPtr ptr = findParticle(idIn);
612  if ( ptr ) ptr->setMWidth(mWidthIn); }
613  void mMin(int idIn, double mMinIn) {
614  ParticleDataEntryPtr ptr = findParticle(idIn);
615  if ( ptr ) ptr->setMMin(mMinIn); }
616  void mMax(int idIn, double mMaxIn) {
617  ParticleDataEntryPtr ptr = findParticle(idIn);
618  if ( ptr ) ptr->setMMax(mMaxIn); }
619  void tau0(int idIn, double tau0In) {
620  ParticleDataEntryPtr ptr = findParticle(idIn);
621  if ( ptr ) ptr->setTau0(tau0In); }
622  void isResonance(int idIn, bool isResonanceIn) {
623  ParticleDataEntryPtr ptr = findParticle(idIn);
624  if ( ptr ) ptr->setIsResonance(isResonanceIn); }
625  void mayDecay(int idIn, bool mayDecayIn) {
626  ParticleDataEntryPtr ptr = findParticle(idIn);
627  if ( ptr ) ptr->setMayDecay(mayDecayIn); }
628  void tauCalc(int idIn, bool tauCalcIn) {
629  ParticleDataEntryPtr ptr = findParticle(idIn);
630  if ( ptr ) ptr->setTauCalc(tauCalcIn); }
631  void doExternalDecay(int idIn, bool doExternalDecayIn) {
632  ParticleDataEntryPtr ptr = findParticle(idIn);
633  if ( ptr ) ptr->setDoExternalDecay(doExternalDecayIn); }
634  void varWidth(int idIn, bool varWidthIn) {
635  ParticleDataEntryPtr ptr = findParticle(idIn);
636  if ( ptr ) ptr->setVarWidth(varWidthIn); }
637  void isVisible(int idIn, bool isVisibleIn) {
638  ParticleDataEntryPtr ptr = findParticle(idIn);
639  if ( ptr ) ptr->setIsVisible(isVisibleIn); }
640  void doForceWidth(int idIn, bool doForceWidthIn) {
641  ParticleDataEntryPtr ptr = findParticle(idIn);
642  if ( ptr ) ptr->setDoForceWidth(doForceWidthIn); }
643  void hasChanged(int idIn, bool hasChangedIn) {
644  ParticleDataEntryPtr ptr = findParticle(idIn);
645  if ( ptr ) ptr->setHasChanged(hasChangedIn); }
646 
647  // Give back current values.
648  bool hasAnti(int idIn) const {
649  const ParticleDataEntryPtr ptr = findParticle(idIn);
650  return ( ptr ) ? ptr->hasAnti() : false; }
651  int antiId(int idIn) const {
652  if (idIn < 0) return -idIn;
653  const ParticleDataEntryPtr ptr = findParticle(idIn);
654  return ( ptr ) ? ptr->antiId() : 0; }
655  string name(int idIn) const {
656  const ParticleDataEntryPtr ptr = findParticle(idIn);
657  return ( ptr ) ? ptr->name(idIn) : " "; }
658  int spinType(int idIn) const {
659  const ParticleDataEntryPtr ptr = findParticle(idIn);
660  return ( ptr ) ? ptr->spinType() : 0; }
661  int chargeType(int idIn) const {
662  const ParticleDataEntryPtr ptr = findParticle(idIn);
663  return ( ptr ) ? ptr->chargeType(idIn) : 0; }
664  double charge(int idIn) const {
665  const ParticleDataEntryPtr ptr = findParticle(idIn);
666  return ( ptr ) ? ptr->charge(idIn) : 0; }
667  int colType(int idIn) const {
668  const ParticleDataEntryPtr ptr = findParticle(idIn);
669  return ( ptr ) ? ptr->colType(idIn) : 0 ; }
670  double m0(int idIn) const {
671  const ParticleDataEntryPtr ptr = findParticle(idIn);
672  return ( ptr ) ? ptr->m0() : 0. ; }
673  double mWidth(int idIn) const {
674  const ParticleDataEntryPtr ptr = findParticle(idIn);
675  return ( ptr ) ? ptr->mWidth() : 0. ; }
676  double mMin(int idIn) const {
677  const ParticleDataEntryPtr ptr = findParticle(idIn);
678  return ( ptr ) ? ptr->mMin() : 0. ; }
679  double m0Min(int idIn) const {
680  const ParticleDataEntryPtr ptr = findParticle(idIn);
681  return ( ptr ) ? ptr->m0Min() : 0. ; }
682  double mMax(int idIn) const {
683  const ParticleDataEntryPtr ptr = findParticle(idIn);
684  return ( ptr ) ? ptr->mMax() : 0. ; }
685  double m0Max(int idIn) const {
686  const ParticleDataEntryPtr ptr = findParticle(idIn);
687  return ( ptr ) ? ptr->m0Max() : 0. ; }
688  double tau0(int idIn) const {
689  const ParticleDataEntryPtr ptr = findParticle(idIn);
690  return ( ptr ) ? ptr->tau0() : 0. ; }
691  bool isResonance(int idIn) const {
692  const ParticleDataEntryPtr ptr = findParticle(idIn);
693  return ( ptr ) ? ptr->isResonance() : false ; }
694  bool mayDecay(int idIn) const {
695  const ParticleDataEntryPtr ptr = findParticle(idIn);
696  return ( ptr ) ? ptr->mayDecay() : false ; }
697  bool tauCalc(int idIn) const {
698  const ParticleDataEntryPtr ptr = findParticle(idIn);
699  return ( ptr ) ? ptr->tauCalc() : false ; }
700  bool doExternalDecay(int idIn) const {
701  const ParticleDataEntryPtr ptr = findParticle(idIn);
702  return ( ptr ) ? ptr->doExternalDecay() : false ; }
703  bool isVisible(int idIn) const {
704  const ParticleDataEntryPtr ptr = findParticle(idIn);
705  return ( ptr ) ? ptr->isVisible() : false ; }
706  bool doForceWidth(int idIn) const {
707  const ParticleDataEntryPtr ptr = findParticle(idIn);
708  return ( ptr ) ? ptr->doForceWidth() : false ; }
709  bool hasChanged(int idIn) const {
710  const ParticleDataEntryPtr ptr = findParticle(idIn);
711  return ( ptr ) ? ptr->hasChanged() : false ; }
712  bool hasChangedMMin(int idIn) const {
713  const ParticleDataEntryPtr ptr = findParticle(idIn);
714  return ( ptr ) ? ptr->hasChangedMMin() : false ; }
715  bool hasChangedMMax(int idIn) const {
716  const ParticleDataEntryPtr ptr = findParticle(idIn);
717  return ( ptr ) ? ptr->hasChangedMMax() : false ; }
718 
719  // Give back special mass-related quantities.
720  bool useBreitWigner(int idIn) const {
721  const ParticleDataEntryPtr ptr = findParticle(idIn);
722  return ( ptr ) ? ptr->useBreitWigner() : false ; }
723  bool varWidth(int idIn) const {
724  const ParticleDataEntryPtr ptr = findParticle(idIn);
725  return ( ptr ) ? ptr->varWidth() : false; }
726  double constituentMass(int idIn) const {
727  const ParticleDataEntryPtr ptr = findParticle(idIn);
728  return ( ptr ) ? ptr->constituentMass() : 0. ; }
729  double mSel(int idIn) const {
730  const ParticleDataEntryPtr ptr = findParticle(idIn);
731  return ( ptr ) ? ptr->mSel() : 0. ; }
732  double mRun(int idIn, double mH) const {
733  const ParticleDataEntryPtr ptr = findParticle(idIn);
734  return ( ptr ) ? ptr->mRun(mH) : 0. ; }
735 
736  // Give back other quantities.
737  bool canDecay(int idIn) const {
738  const ParticleDataEntryPtr ptr = findParticle(idIn);
739  return ( ptr ) ? ptr->canDecay() : false ; }
740  bool isLepton(int idIn) const {
741  const ParticleDataEntryPtr ptr = findParticle(idIn);
742  return ( ptr ) ? ptr->isLepton() : false ; }
743  bool isQuark(int idIn) const {
744  const ParticleDataEntryPtr ptr = findParticle(idIn);
745  return ( ptr ) ? ptr->isQuark() : false ; }
746  bool isGluon(int idIn) const {
747  const ParticleDataEntryPtr ptr = findParticle(idIn);
748  return ( ptr ) ? ptr->isGluon() : false ; }
749  bool isDiquark(int idIn) const {
750  const ParticleDataEntryPtr ptr = findParticle(idIn);
751  return ( ptr ) ? ptr->isDiquark() : false ; }
752  bool isParton(int idIn) const {
753  const ParticleDataEntryPtr ptr = findParticle(idIn);
754  return ( ptr ) ? ptr->isParton() : false ; }
755  bool isHadron(int idIn) const {
756  const ParticleDataEntryPtr ptr = findParticle(idIn);
757  return ( ptr ) ? ptr->isHadron() : false ; }
758  bool isMeson(int idIn) const {
759  const ParticleDataEntryPtr ptr = findParticle(idIn);
760  return ( ptr ) ? ptr->isMeson() : false ; }
761  bool isBaryon(int idIn) const {
762  const ParticleDataEntryPtr ptr = findParticle(idIn);
763  return ( ptr ) ? ptr->isBaryon() : false ; }
764  bool isOnium(int idIn) const {
765  const ParticleDataEntryPtr ptr = findParticle(idIn);
766  return ( ptr ) ? ptr->isOnium() : false ; }
767  bool isExotic(int idIn) const {
768  const ParticleDataEntryPtr ptr = findParticle(idIn);
769  return ( ptr ) ? ptr->isExotic() : false ; }
770  bool isOctetHadron(int idIn) const {
771  const ParticleDataEntryPtr ptr = findParticle(idIn);
772  return ( ptr ) ? ptr->isOctetHadron() : false ; }
773  int heaviestQuark(int idIn) const {
774  const ParticleDataEntryPtr ptr = findParticle(idIn);
775  return ( ptr ) ? ptr->heaviestQuark(idIn) : 0 ; }
776  int baryonNumberType(int idIn) const {
777  const ParticleDataEntryPtr ptr = findParticle(idIn);
778  return ( ptr ) ? ptr->baryonNumberType(idIn) : 0 ; }
779  int nQuarksInCode(int idIn, int idQIn) const {
780  const ParticleDataEntryPtr ptr = findParticle(idIn);
781  return ( ptr ) ? ptr->nQuarksInCode(idQIn) : 0 ; }
782 
783  // Change branching ratios.
784  void rescaleBR(int idIn, double newSumBR = 1.) {
785  ParticleDataEntryPtr ptr = findParticle(idIn);
786  if ( ptr ) ptr->rescaleBR(newSumBR); }
787 
788  // Access methods stored in ResonanceWidths.
789  void setResonancePtr(int idIn, ResonanceWidthsPtr resonancePtrIn) {
790  ParticleDataEntryPtr ptr = findParticle(idIn);
791  if ( ptr ) ptr->setResonancePtr( resonancePtrIn);}
792  void resInit(int idIn) {
793  ParticleDataEntryPtr ptr = findParticle(idIn);
794  if ( ptr ) ptr->resInit(infoPtr);}
795  double resWidth(int idIn, double mHat, int idInFlav = 0,
796  bool openOnly = false, bool setBR = false) {
797  ParticleDataEntryPtr ptr = findParticle(idIn);
798  return ( ptr ) ? ptr->resWidth(idIn, mHat,
799  idInFlav, openOnly, setBR) : 0.;}
800  double resWidthOpen(int idIn, double mHat, int idInFlav = 0) {
801  ParticleDataEntryPtr ptr = findParticle(idIn);
802  return ( ptr ) ? ptr->resWidthOpen(idIn, mHat, idInFlav) : 0.;}
803  double resWidthStore(int idIn, double mHat, int idInFlav = 0) {
804  ParticleDataEntryPtr ptr = findParticle(idIn);
805  return ( ptr ) ? ptr->resWidthStore(idIn, mHat, idInFlav) : 0.;}
806  double resOpenFrac(int id1In, int id2In = 0, int id3In = 0);
807  double resWidthRescaleFactor(int idIn) {
808  ParticleDataEntryPtr ptr = findParticle(idIn);
809  return ( ptr ) ? ptr->resWidthRescaleFactor() : 0.;}
810  double resWidthChan(int idIn, double mHat, int idAbs1 = 0,
811  int idAbs2 = 0) {
812  ParticleDataEntryPtr ptr = findParticle(idIn);
813  return ( ptr ) ? ptr->resWidthChan( mHat, idAbs1, idAbs2) : 0.;}
814 
815  // Return pointer to entry.
816  ParticleDataEntryPtr particleDataEntryPtr(int idIn) {
817  ParticleDataEntryPtr ptr = findParticle(idIn);
818  return ( ptr ) ? ptr : pdt[0]; }
819 
820  // Check initialisation status.
821  bool getIsInit() {return isInit;}
822 
823 private:
824 
825  // Common data, accessible for the individual particles.
826  bool setRapidDecayVertex;
827  int modeBreitWigner;
828  double maxEnhanceBW, mQRun[7], Lambda5Run, intermediateTau0;
829 
830  // The individual particle need access to the full database.
831  friend class ParticleDataEntry;
832 
833  // Pointer to various information on the generation.
834  Info* infoPtr;
835 
836  // Pointer to the settings database.
837  Settings* settingsPtr;
838 
839  // Pointer to logger.
840  Logger* loggerPtr;
841 
842  // Pointer to the random number generator.
843  Rndm* rndmPtr;
844 
845  // Pointer to Standard Model couplings.
846  CoupSM* coupSMPtr;
847 
848  // All particle data stored in a map.
849  map<int, ParticleDataEntryPtr> pdt;
850 
851  // Pointer to current particle (e.g. when reading decay channels).
852  ParticleDataEntryPtr particlePtr;
853 
854  // Flag that initialization has been performed; whether any failures.
855  bool isInit, readingFailedSave;
856 
857  // Method for common setting of particle-specific info.
858  void initCommon();
859 
860  // Useful functions for string handling.
861  bool boolString(string tag) { string tagLow = toLower(tag);
862  return ( tagLow == "true" || tagLow == "1" || tagLow == "on"
863  || tagLow == "yes" || tagLow == "ok" ); }
864 
865  // Extract XML value following XML attribute.
866  string attributeValue(string line, string attribute);
867  bool boolAttributeValue(string line, string attribute);
868  int intAttributeValue(string line, string attribute);
869  double doubleAttributeValue(string line, string attribute);
870 
871  // Vector of strings containing the readable lines of the XML file.
872  vector<string> xmlFileSav;
873 
874  // Stored history of readString statements (common and by subrun).
875  vector<string> readStringHistory;
876  map<int, vector<string> > readStringSubrun;
877 
878 };
879 
880 //==========================================================================
881 
882 } // end namespace Pythia8
883 
884 #endif // Pythia8_ParticleData_H
void setResonancePtr(ResonanceWidthsPtr resonancePtrIn)
Access methods stored in ResonanceWidths.
Definition: ParticleData.h:368
void openSec(int idSgn, double openSecIn)
Input/output for fraction of secondary open widths; used by resonances.
Definition: ParticleData.h:105
This class holds info on a single particle species.
Definition: ParticleData.h:125
ParticleDataEntry & operator=(const ParticleDataEntry &oldPDE)
Assignment operator.
Definition: ParticleData.h:185
Definition: Info.h:45
void setAll(string nameIn, string antiNameIn, int spinTypeIn=0, int chargeTypeIn=0, int colTypeIn=0, double m0In=0., double mWidthIn=0., double mMinIn=0., double mMaxIn=0., double tau0In=0., bool varWidthIn=false)
Reset all the properties of an existing particle.
Definition: ParticleData.h:215
bool isParton() const
Identify Hidden Valley partons as partons.
Definition: ParticleData.h:325
bool canDecay(int idIn) const
Give back other quantities.
Definition: ParticleData.h:737
void onMode(int onModeIn)
Member functions for input.
Definition: ParticleData.h:69
bool isParticle(int idIn) const
Query existence of an entry.
Definition: ParticleData.h:558
ParticleData()
Constructor.
Definition: ParticleData.h:427
void clearChannels()
Reset to empty decay table.
Definition: ParticleData.h:344
void list(int idList)
Print out specified particles.
Definition: ParticleData.h:514
ParticleDataEntryPtr particleDataEntryPtr(int idIn)
Return pointer to entry.
Definition: ParticleData.h:816
void currentBR(double currentBRIn)
Definition: ParticleData.h:95
string toLower(const string &name, bool trim=true)
Definition: PythiaStdlib.cc:17
ParticleDataEntry(int idIn=0, string nameIn=" ", int spinTypeIn=0, int chargeTypeIn=0, int colTypeIn=0, double m0In=0., double mWidthIn=0., double mMinIn=0., double mMaxIn=0., double tau0In=0., bool varWidthIn=false)
Constructors: for antiparticle exists or not.
Definition: ParticleData.h:130
Definition: Logger.h:23
void setResonancePtr(int idIn, ResonanceWidthsPtr resonancePtrIn)
Access methods stored in ResonanceWidths.
Definition: ParticleData.h:789
DecayChannel(const DecayChannel &oldDC)
Copy constructor.
Definition: ParticleData.h:51
const ParticleDataEntryPtr findParticle(int idIn) const
Query existence of an entry and return a const iterator.
Definition: ParticleData.h:574
Definition: Basics.h:386
ParticleDataEntryPtr findParticle(int idIn)
Query existence of an entry and return an iterator.
Definition: ParticleData.h:566
This class holds info on a single decay channel.
Definition: ParticleData.h:35
bool contains(int id1) const
Check for presence of particles anywhere in decay list.
Definition: ParticleData.cc:29
bool reInit(string startFile, bool xmlFormat=true)
Overwrite existing database by reading from specific file.
Definition: ParticleData.h:475
ParticleDataEntry(const ParticleDataEntry &oldPDE)
Copy constructor.
Definition: ParticleData.h:162
void addParticle(int idIn, string nameIn=" ", int spinTypeIn=0, int chargeTypeIn=0, int colTypeIn=0, double m0In=0., double mWidthIn=0., double mMinIn=0., double mMaxIn=0., double tau0In=0., bool varWidthIn=false)
Add new entry.
Definition: ParticleData.h:531
bool hasAnti(int idIn) const
Give back current values.
Definition: ParticleData.h:648
bool init(string startFile="../share/Pythia8/xmldoc/ParticleData.xml")
Read in database from specific file.
Definition: ParticleData.h:464
bool readingFailed()
Keep track whether any readings have failed, invalidating run setup.
Definition: ParticleData.h:503
map< int, ParticleDataEntryPtr >::iterator begin()
Define iterators over entries.
Definition: ParticleData.h:585
ParticleData & operator=(const ParticleData &oldPD)
Assignment operator.
Definition: ParticleData.h:446
void setName(string nameIn)
Definition: ParticleData.h:228
DecayChannel(int onModeIn=0, double bRatioIn=0., int meModeIn=0, int prod0=0, int prod1=0, int prod2=0, int prod3=0, int prod4=0, int prod5=0, int prod6=0, int prod7=0)
Constructor.
Definition: ParticleData.h:40
bool init(const ParticleData &particleDataIn)
Read in database from saved file stored in memory.
Definition: ParticleData.h:468
void rescaleBR(int idIn, double newSumBR=1.)
Change branching ratios.
Definition: ParticleData.h:784
void addChannel(int onMode=0, double bRatio=0., int meMode=0, int prod0=0, int prod1=0, int prod2=0, int prod3=0, int prod4=0, int prod5=0, int prod6=0, int prod7=0)
Add a decay channel to the decay table.
Definition: ParticleData.h:347
Definition: StandardModel.h:135
vector< string > getReadHistory(int subrun=-999)
Definition: ParticleData.h:520
void onShellWidth(double onShellWidthIn)
Input/output for nominal partial width; used by resonances.
Definition: ParticleData.h:99
bool useBreitWigner(int idIn) const
Give back special mass-related quantities.
Definition: ParticleData.h:720
ParticleData(const ParticleData &oldPD)
Copy constructor.
Definition: ParticleData.h:433
bool useBreitWigner() const
Give back other quantities.
Definition: ParticleData.h:316
void initPtrs(Info *infoPtrIn)
Initialize pointers.
Definition: ParticleData.h:459
int id() const
Give back current values.
Definition: ParticleData.h:272
bool getIsInit()
Check initialisation status.
Definition: ParticleData.h:821
Header for classes to set beam momentum and interaction vertex spread.
Definition: Analysis.h:20
void listAll(ostream &stream)
Print out table of whole database, or of only part of it.
Definition: ParticleData.h:506
int sizeChannels() const
Decay table size.
Definition: ParticleData.h:354
void setMMinNoChange(double mMinIn)
Special options specifically when cutting wings of Breit-Wigners.
Definition: ParticleData.h:249
DecayChannel & operator=(const DecayChannel &oldDC)
Assignment operator.
Definition: ParticleData.h:60
This class holds a map of all ParticleDataEntries.
Definition: ParticleData.h:422
void setAll(int idIn, string nameIn, string antiNameIn, int spinTypeIn=0, int chargeTypeIn=0, int colTypeIn=0, double m0In=0., double mWidthIn=0., double mMinIn=0., double mMaxIn=0., double tau0In=0., bool varWidthIn=false)
Reset all the properties of an entry in one go.
Definition: ParticleData.h:549
Settings * settingsPtr
Pointer to the settings database.
Definition: Info.h:80
DecayChannel & channel(int i)
Gain access to a channel in the decay table.
Definition: ParticleData.h:357
bool init(istream &is)
Read in database from an istream.
Definition: ParticleData.h:472
void name(int idIn, string nameIn)
Change current values one at a time (or set if not set before).
Definition: ParticleData.h:589
int onMode() const
Member functions for output.
Definition: ParticleData.h:81
Definition: Settings.h:195
void initPtr(ParticleData *particleDataPtrIn)
Store pointer to whole particle data table/database.
Definition: ParticleData.h:211
bool isOctetHadron() const
Intermediate octet ccbar or bbar states in colour-octet model.
Definition: ParticleData.h:337