PYTHIA  8.316
ParticleData.h
1 // ParticleData.h is a part of the PYTHIA event generator.
2 // Copyright (C) 2025 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 mSelInRange( double mMinNow, double mMaxNow);
314  double mRun(double mH) const;
315 
316  // Give back other quantities.
317  bool useBreitWigner() const { return (modeBWnow > 0); }
318  bool canDecay() const { return (channels.size() > 0)
319  || varWidthSave; }
320  bool isLepton() const { return (idSave > 10 && idSave < 19);}
321  bool isQuark() const { return (idSave != 0 && idSave < 9);}
322  bool isGluon() const { return (idSave == 21);}
323  bool isDiquark() const { return (idSave > 1000 && idSave < 10000
324  && (idSave/10)%10 == 0);}
325  // Identify Hidden Valley partons as partons.
326  bool isParton() const { return ( idSave == 21
327  || (idSave != 0 && idSave < 6)
328  || (idSave > 1000 && idSave < 5510 && (idSave/10)%10 == 0)
329  || (idSave > 4900100 && idSave < 4900109)
330  || (idSave > 4901000 && idSave < 4909000 && (idSave/10)%10 == 0) );}
331  bool isHadron() const;
332  bool isMeson() const;
333  bool isBaryon() const;
334  bool isOnium() const;
335  bool isExotic() const;
336 
337  // Intermediate octet ccbar or bbar states in colour-octet model.
338  bool isOctetHadron() const {return idSave >= 9940000
339  && idSave < 9960000; }
340  int heaviestQuark(int idIn = 1) const;
341  int baryonNumberType(int idIn = 1) const;
342  int nQuarksInCode(int idQIn) const;
343 
344  // Reset to empty decay table.
345  void clearChannels() {channels.resize(0);}
346 
347  // Add a decay channel to the decay table.
348  void addChannel(int onMode = 0, double bRatio = 0., int meMode = 0,
349  int prod0 = 0, int prod1 = 0, int prod2 = 0, int prod3 = 0,
350  int prod4 = 0, int prod5 = 0, int prod6 = 0, int prod7 = 0) {
351  channels.push_back( DecayChannel( onMode, bRatio, meMode, prod0,
352  prod1, prod2, prod3, prod4, prod5, prod6, prod7) ); }
353 
354  // Decay table size.
355  int sizeChannels() const {return channels.size();}
356 
357  // Gain access to a channel in the decay table.
358  DecayChannel& channel(int i){return channels[i];}
359  const DecayChannel& channel(int i) const {return channels[i];}
360 
361  // Rescale sum of branching ratios to unity.
362  void rescaleBR(double newSumBR = 1.);
363 
364  // Random choice of decay channel according to branching ratios.
365  bool preparePick(int idSgn, double mHat = 0., int idInFlav = 0);
366  DecayChannel& pickChannel();
367 
368  // Access methods stored in ResonanceWidths.
369  void setResonancePtr(ResonanceWidthsPtr resonancePtrIn) {
370  resonancePtr = resonancePtrIn;}
371  ResonanceWidthsPtr getResonancePtr() {return resonancePtr;}
372  void resInit(Info* infoPtrIn);
373  double resWidth(int idSgn, double mHat, int idIn = 0,
374  bool openOnly = false, bool setBR = false);
375  double resWidthOpen(int idSgn, double mHat, int idIn = 0);
376  double resWidthStore(int idSgn, double mHat, int idIn = 0);
377  double resOpenFrac(int idSgn);
378  double resWidthRescaleFactor();
379  double resWidthChan(double mHat, int idAbs1 = 0, int idAbs2 = 0);
380 
381 private:
382 
383  // Constants: could only be changed in the code itself.
384  static const int INVISIBLENUMBER, INVISIBLETABLE[80], KNOWNNOWIDTH[3];
385  static const double MAXTAU0FORDECAY,MINMASSRESONANCE, NARROWMASS,
386  CONSTITUENTMASSTABLE[10];
387 
388  // Particle data.
389  int idSave;
390  string nameSave, antiNameSave;
391  int spinTypeSave, chargeTypeSave, colTypeSave;
392  double m0Save, mWidthSave, mMinSave, mMaxSave, tau0Save,
393  constituentMassSave;
394  bool hasAntiSave, isResonanceSave, mayDecaySave, tauCalcSave, varWidthSave,
395  doExternalDecaySave, isVisibleSave, doForceWidthSave, hasChangedSave,
396  hasChangedMMinSave, hasChangedMMaxSave;
397 
398  // Extra data for mass selection according to a Breit-Wigner and lifetime.
399  int modeBWnow, modeTau0now;
400  double atanLow, atanDif, mThr;
401 
402  // A vector containing all the decay channels of the particle.
403  vector<DecayChannel> channels;
404 
405  // Summed branching ratio of currently open channels.
406  double currentBRSum;
407 
408  // Pointer to ResonanceWidths object; only used for some particles.
409  ResonanceWidthsPtr resonancePtr;
410 
411  // Pointer to the full particle data table.
412  ParticleData* particleDataPtr;
413 
414  // Set constituent mass.
415  void setConstituentMass();
416 
417 };
418 
419 //==========================================================================
420 
421 // This class holds a map of all ParticleDataEntries.
422 
424 
425 public:
426 
427  // Constructor.
428  ParticleData() : setRapidDecayVertex(), modeBreitWigner(), maxEnhanceBW(),
429  mQRun(), Lambda5Run(), intermediateTau0(), infoPtr(nullptr),
430  settingsPtr(nullptr), rndmPtr(nullptr), coupSMPtr(nullptr),
431  particlePtr(nullptr), isInit(false), readingFailedSave(false) {}
432 
433  // Copy constructor.
434  ParticleData( const ParticleData& oldPD) {
435  modeBreitWigner = oldPD.modeBreitWigner; maxEnhanceBW = oldPD.maxEnhanceBW;
436  for (int i = 0; i < 7; ++i) mQRun[i] = oldPD.mQRun[i];
437  Lambda5Run = oldPD.Lambda5Run; infoPtr = nullptr; settingsPtr = nullptr;
438  rndmPtr = nullptr; coupSMPtr = nullptr;
439  for (auto pde = oldPD.pdt.begin(); pde != oldPD.pdt.end(); pde++) {
440  int idTmp = pde->first;
441  pdt[idTmp] = make_shared<ParticleDataEntry>(*pde->second);
442  pdt[idTmp]->initPtr(this); }
443  particlePtr = nullptr; isInit = oldPD.isInit;
444  readingFailedSave = oldPD.readingFailedSave; }
445 
446  // Assignment operator.
447  ParticleData& operator=( const ParticleData& oldPD) { if (this != &oldPD) {
448  modeBreitWigner = oldPD.modeBreitWigner; maxEnhanceBW = oldPD.maxEnhanceBW;
449  for (int i = 0; i < 7; ++i) mQRun[i] = oldPD.mQRun[i];
450  Lambda5Run = oldPD.Lambda5Run; infoPtr = nullptr; settingsPtr = nullptr;
451  rndmPtr = nullptr; coupSMPtr = nullptr;
452  for (auto pde = oldPD.pdt.begin(); pde != oldPD.pdt.end(); pde++) {
453  int idTmp = pde->first;
454  pdt[idTmp] = make_shared<ParticleDataEntry>(*pde->second);
455  pdt[idTmp]->initPtr(this); }
456  particlePtr = nullptr; isInit = oldPD.isInit;
457  readingFailedSave = oldPD.readingFailedSave; } return *this; }
458 
459  // Initialize pointers.
460  void initPtrs(Info* infoPtrIn) {infoPtr = infoPtrIn;
461  settingsPtr = infoPtr->settingsPtr; loggerPtr = infoPtr->loggerPtr;
462  rndmPtr = infoPtr->rndmPtr; coupSMPtr = infoPtr->coupSMPtr;}
463 
464  // Read in database from specific file.
465  bool init(string startFile = "../share/Pythia8/xmldoc/ParticleData.xml") {
466  initCommon(); return readXML(startFile);}
467 
468  // Read in database from saved file stored in memory.
469  bool init(const ParticleData& particleDataIn) {
470  initCommon(); return copyXML(particleDataIn);}
471 
472  // Read in database from an istream.
473  bool init(istream& is) { initCommon(); return readXML(is);}
474 
475  // Overwrite existing database by reading from specific file.
476  bool reInit(string startFile, bool xmlFormat = true) { initCommon();
477  return (xmlFormat) ? readXML(startFile) : readFF(startFile);}
478 
479  // Initialize pointers, normal Breit-Wigners and special resonances.
480  void initWidths(vector<ResonanceWidthsPtr> resonancePtrs);
481 
482  // Read and process or list whole (or part of) database from/to an XML file.
483  bool readXML(string inFile, bool reset = true) ;
484  void listXML(string outFile);
485  bool readXML(istream& is, bool reset=true);
486 
487  // Copy and process XML information from another particleData object.
488  bool copyXML(const ParticleData &particleDataIn);
489 
490  // Auxiliary functions to readXML() and copyXML().
491  bool loadXML(string inFile, bool reset = true) ;
492  bool loadXML(istream& is, bool reset=true);
493  bool processXML(bool reset = true) ;
494 
495  // Read or list whole (or part of) database from/to a free format file.
496  bool readFF(string inFile, bool reset = true) ;
497  bool readFF(istream& is, bool reset = true);
498  void listFF(string outFile);
499 
500  // Read in one update from a single line.
501  bool readString(string lineIn, bool warn = true) ;
502 
503  // Keep track whether any readings have failed, invalidating run setup.
504  bool readingFailed() {return readingFailedSave;}
505 
506  // Print out table of whole database, or of only part of it.
507  void listAll(ostream& stream) {list(stream, false, true);}
508  void listAll() {listAll(cout);}
509  void listChanged(bool changedRes = false) {list(true, changedRes);}
510  void list(ostream& stream, bool chargedOnly = false, bool changedRes = true);
511  void list(bool changedOnly = false, bool changedRes = true) {
512  list(cout, changedOnly, changedRes); }
513 
514  // Print out specified particles.
515  void list(int idList) {vector<int> idListTemp;
516  idListTemp.push_back(idList); list( idListTemp);}
517  void list(vector<int> idList);
518 
519  // Retrieve readString history (e.g., for inspection). Everything
520  // (subrun=-999), up to first subrun (=-1), or subrun-specific (>=0).
521  vector<string> getReadHistory(int subrun=-999) {
522  if (subrun == -999) return readStringHistory;
523  else if (readStringSubrun.find(subrun) != readStringSubrun.end())
524  return readStringSubrun[subrun];
525  else return vector<string>();
526  }
527 
528  // Check that table makes sense, especially for decays.
529  void checkTable(int verbosity = 1) ;
530 
531  // Add new entry.
532  void addParticle(int idIn, string nameIn = " ", int spinTypeIn = 0,
533  int chargeTypeIn = 0, int colTypeIn = 0, double m0In = 0.,
534  double mWidthIn = 0., double mMinIn = 0., double mMaxIn = 0.,
535  double tau0In = 0., bool varWidthIn = false) {
536  pdt[abs(idIn)] = make_shared<ParticleDataEntry>(idIn, nameIn, spinTypeIn,
537  chargeTypeIn, colTypeIn, m0In, mWidthIn, mMinIn, mMaxIn, tau0In,
538  varWidthIn);
539  pdt[abs(idIn)]->initPtr(this); }
540  void addParticle(int idIn, string nameIn, string antiNameIn,
541  int spinTypeIn = 0, int chargeTypeIn = 0, int colTypeIn = 0,
542  double m0In = 0., double mWidthIn = 0., double mMinIn = 0.,
543  double mMaxIn = 0., double tau0In = 0., bool varWidthIn = false) {
544  pdt[abs(idIn)] = make_shared<ParticleDataEntry>(idIn, nameIn, antiNameIn,
545  spinTypeIn, chargeTypeIn, colTypeIn, m0In, mWidthIn, mMinIn, mMaxIn,
546  tau0In, varWidthIn);
547  pdt[abs(idIn)]->initPtr(this); }
548 
549  // Reset all the properties of an entry in one go.
550  void setAll(int idIn, string nameIn, string antiNameIn,
551  int spinTypeIn = 0, int chargeTypeIn = 0, int colTypeIn = 0,
552  double m0In = 0., double mWidthIn = 0., double mMinIn = 0.,
553  double mMaxIn = 0.,double tau0In = 0.,bool varWidthIn = false) {
554  ParticleDataEntryPtr ptr = findParticle(idIn);
555  if ( ptr ) ptr->setAll( nameIn, antiNameIn, spinTypeIn, chargeTypeIn,
556  colTypeIn, m0In, mWidthIn, mMinIn, mMaxIn, tau0In, varWidthIn); }
557 
558  // Query existence of an entry.
559  bool isParticle(int idIn) const {
560  auto found = pdt.find( abs(idIn) );
561  if ( found == pdt.end() ) return false;
562  if ( idIn > 0 || found->second->hasAnti() ) return true;
563  return false;
564  }
565 
566  // Query existence of an entry and return an iterator.
567  ParticleDataEntryPtr findParticle(int idIn) {
568  auto found = pdt.find( abs(idIn) );
569  if( found == pdt.end() ) return nullptr;
570  if ( idIn > 0 || found->second->hasAnti() ) return found->second;
571  return nullptr;
572  }
573 
574  // Query existence of an entry and return a const iterator.
575  const ParticleDataEntryPtr findParticle(int idIn) const {
576  auto found = pdt.find( abs(idIn) );
577  if( found == pdt.end() ) return nullptr;
578  if ( idIn > 0 || found->second->hasAnti() ) return found->second;
579  return nullptr;
580  }
581 
582  // Return the id of the sequentially next particle stored in table.
583  int nextId(int idIn) const;
584 
585  // Define iterators over entries.
586  map<int, ParticleDataEntryPtr>::iterator begin() { return pdt.begin(); }
587  map<int, ParticleDataEntryPtr>::iterator end() { return pdt.end(); }
588 
589  // Change current values one at a time (or set if not set before).
590  void name(int idIn, string nameIn) {
591  ParticleDataEntryPtr ptr = findParticle(idIn);
592  if ( ptr ) ptr->setName(nameIn); }
593  void antiName(int idIn, string antiNameIn) {
594  ParticleDataEntryPtr ptr = findParticle(idIn);
595  if ( ptr ) ptr->setAntiName(antiNameIn); }
596  void names(int idIn, string nameIn, string antiNameIn) {
597  ParticleDataEntryPtr ptr = findParticle(idIn);
598  if ( ptr ) ptr->setNames(nameIn, antiNameIn); }
599  void spinType(int idIn, int spinTypeIn) {
600  ParticleDataEntryPtr ptr = findParticle(idIn);
601  if ( ptr ) ptr->setSpinType(spinTypeIn); }
602  void chargeType(int idIn, int chargeTypeIn) {
603  ParticleDataEntryPtr ptr = findParticle(idIn);
604  if ( ptr ) ptr->setChargeType(chargeTypeIn); }
605  void colType(int idIn, int colTypeIn) {
606  ParticleDataEntryPtr ptr = findParticle(idIn);
607  if ( ptr ) ptr->setColType(colTypeIn); }
608  void m0(int idIn, double m0In) {
609  ParticleDataEntryPtr ptr = findParticle(idIn);
610  if ( ptr ) ptr->setM0(m0In); }
611  void mWidth(int idIn, double mWidthIn) {
612  ParticleDataEntryPtr ptr = findParticle(idIn);
613  if ( ptr ) ptr->setMWidth(mWidthIn); }
614  void mMin(int idIn, double mMinIn) {
615  ParticleDataEntryPtr ptr = findParticle(idIn);
616  if ( ptr ) ptr->setMMin(mMinIn); }
617  void mMax(int idIn, double mMaxIn) {
618  ParticleDataEntryPtr ptr = findParticle(idIn);
619  if ( ptr ) ptr->setMMax(mMaxIn); }
620  void tau0(int idIn, double tau0In) {
621  ParticleDataEntryPtr ptr = findParticle(idIn);
622  if ( ptr ) ptr->setTau0(tau0In); }
623  void isResonance(int idIn, bool isResonanceIn) {
624  ParticleDataEntryPtr ptr = findParticle(idIn);
625  if ( ptr ) ptr->setIsResonance(isResonanceIn); }
626  void mayDecay(int idIn, bool mayDecayIn) {
627  ParticleDataEntryPtr ptr = findParticle(idIn);
628  if ( ptr ) ptr->setMayDecay(mayDecayIn); }
629  void tauCalc(int idIn, bool tauCalcIn) {
630  ParticleDataEntryPtr ptr = findParticle(idIn);
631  if ( ptr ) ptr->setTauCalc(tauCalcIn); }
632  void doExternalDecay(int idIn, bool doExternalDecayIn) {
633  ParticleDataEntryPtr ptr = findParticle(idIn);
634  if ( ptr ) ptr->setDoExternalDecay(doExternalDecayIn); }
635  void varWidth(int idIn, bool varWidthIn) {
636  ParticleDataEntryPtr ptr = findParticle(idIn);
637  if ( ptr ) ptr->setVarWidth(varWidthIn); }
638  void isVisible(int idIn, bool isVisibleIn) {
639  ParticleDataEntryPtr ptr = findParticle(idIn);
640  if ( ptr ) ptr->setIsVisible(isVisibleIn); }
641  void doForceWidth(int idIn, bool doForceWidthIn) {
642  ParticleDataEntryPtr ptr = findParticle(idIn);
643  if ( ptr ) ptr->setDoForceWidth(doForceWidthIn); }
644  void hasChanged(int idIn, bool hasChangedIn) {
645  ParticleDataEntryPtr ptr = findParticle(idIn);
646  if ( ptr ) ptr->setHasChanged(hasChangedIn); }
647 
648  // Give back current values.
649  bool hasAnti(int idIn) const {
650  const ParticleDataEntryPtr ptr = findParticle(idIn);
651  return ( ptr ) ? ptr->hasAnti() : false; }
652  int antiId(int idIn) const {
653  if (idIn < 0) return -idIn;
654  const ParticleDataEntryPtr ptr = findParticle(idIn);
655  return ( ptr ) ? ptr->antiId() : 0; }
656  string name(int idIn) const {
657  const ParticleDataEntryPtr ptr = findParticle(idIn);
658  return ( ptr ) ? ptr->name(idIn) : " "; }
659  int spinType(int idIn) const {
660  const ParticleDataEntryPtr ptr = findParticle(idIn);
661  return ( ptr ) ? ptr->spinType() : 0; }
662  int chargeType(int idIn) const {
663  const ParticleDataEntryPtr ptr = findParticle(idIn);
664  return ( ptr ) ? ptr->chargeType(idIn) : 0; }
665  double charge(int idIn) const {
666  const ParticleDataEntryPtr ptr = findParticle(idIn);
667  return ( ptr ) ? ptr->charge(idIn) : 0; }
668  int colType(int idIn) const {
669  const ParticleDataEntryPtr ptr = findParticle(idIn);
670  return ( ptr ) ? ptr->colType(idIn) : 0 ; }
671  double m0(int idIn) const {
672  const ParticleDataEntryPtr ptr = findParticle(idIn);
673  return ( ptr ) ? ptr->m0() : 0. ; }
674  double mWidth(int idIn) const {
675  const ParticleDataEntryPtr ptr = findParticle(idIn);
676  return ( ptr ) ? ptr->mWidth() : 0. ; }
677  double mMin(int idIn) const {
678  const ParticleDataEntryPtr ptr = findParticle(idIn);
679  return ( ptr ) ? ptr->mMin() : 0. ; }
680  double m0Min(int idIn) const {
681  const ParticleDataEntryPtr ptr = findParticle(idIn);
682  return ( ptr ) ? ptr->m0Min() : 0. ; }
683  double mMax(int idIn) const {
684  const ParticleDataEntryPtr ptr = findParticle(idIn);
685  return ( ptr ) ? ptr->mMax() : 0. ; }
686  double m0Max(int idIn) const {
687  const ParticleDataEntryPtr ptr = findParticle(idIn);
688  return ( ptr ) ? ptr->m0Max() : 0. ; }
689  double tau0(int idIn) const {
690  const ParticleDataEntryPtr ptr = findParticle(idIn);
691  return ( ptr ) ? ptr->tau0() : 0. ; }
692  bool isResonance(int idIn) const {
693  const ParticleDataEntryPtr ptr = findParticle(idIn);
694  return ( ptr ) ? ptr->isResonance() : false ; }
695  bool mayDecay(int idIn) const {
696  const ParticleDataEntryPtr ptr = findParticle(idIn);
697  return ( ptr ) ? ptr->mayDecay() : false ; }
698  bool tauCalc(int idIn) const {
699  const ParticleDataEntryPtr ptr = findParticle(idIn);
700  return ( ptr ) ? ptr->tauCalc() : false ; }
701  bool doExternalDecay(int idIn) const {
702  const ParticleDataEntryPtr ptr = findParticle(idIn);
703  return ( ptr ) ? ptr->doExternalDecay() : false ; }
704  bool isVisible(int idIn) const {
705  const ParticleDataEntryPtr ptr = findParticle(idIn);
706  return ( ptr ) ? ptr->isVisible() : false ; }
707  bool doForceWidth(int idIn) const {
708  const ParticleDataEntryPtr ptr = findParticle(idIn);
709  return ( ptr ) ? ptr->doForceWidth() : false ; }
710  bool hasChanged(int idIn) const {
711  const ParticleDataEntryPtr ptr = findParticle(idIn);
712  return ( ptr ) ? ptr->hasChanged() : false ; }
713  bool hasChangedMMin(int idIn) const {
714  const ParticleDataEntryPtr ptr = findParticle(idIn);
715  return ( ptr ) ? ptr->hasChangedMMin() : false ; }
716  bool hasChangedMMax(int idIn) const {
717  const ParticleDataEntryPtr ptr = findParticle(idIn);
718  return ( ptr ) ? ptr->hasChangedMMax() : false ; }
719 
720  // Give back special mass-related quantities.
721  bool useBreitWigner(int idIn) const {
722  const ParticleDataEntryPtr ptr = findParticle(idIn);
723  return ( ptr ) ? ptr->useBreitWigner() : false ; }
724  bool varWidth(int idIn) const {
725  const ParticleDataEntryPtr ptr = findParticle(idIn);
726  return ( ptr ) ? ptr->varWidth() : false; }
727  double constituentMass(int idIn) const {
728  const ParticleDataEntryPtr ptr = findParticle(idIn);
729  return ( ptr ) ? ptr->constituentMass() : 0. ; }
730  double mSel(int idIn) const {
731  const ParticleDataEntryPtr ptr = findParticle(idIn);
732  return ( ptr ) ? ptr->mSel() : 0. ; }
733  double mSelInRange(int idIn, double mMinNow, double mMaxNow) const {
734  const ParticleDataEntryPtr ptr = findParticle(idIn);
735  return ( ptr ) ? ptr->mSelInRange( mMinNow, mMaxNow) : 0. ; }
736  double mRun(int idIn, double mH) const {
737  const ParticleDataEntryPtr ptr = findParticle(idIn);
738  return ( ptr ) ? ptr->mRun(mH) : 0. ; }
739 
740  // Give back other quantities.
741  bool canDecay(int idIn) const {
742  const ParticleDataEntryPtr ptr = findParticle(idIn);
743  return ( ptr ) ? ptr->canDecay() : false ; }
744  bool isLepton(int idIn) const {
745  const ParticleDataEntryPtr ptr = findParticle(idIn);
746  return ( ptr ) ? ptr->isLepton() : false ; }
747  bool isQuark(int idIn) const {
748  const ParticleDataEntryPtr ptr = findParticle(idIn);
749  return ( ptr ) ? ptr->isQuark() : false ; }
750  bool isGluon(int idIn) const {
751  const ParticleDataEntryPtr ptr = findParticle(idIn);
752  return ( ptr ) ? ptr->isGluon() : false ; }
753  bool isDiquark(int idIn) const {
754  const ParticleDataEntryPtr ptr = findParticle(idIn);
755  return ( ptr ) ? ptr->isDiquark() : false ; }
756  bool isParton(int idIn) const {
757  const ParticleDataEntryPtr ptr = findParticle(idIn);
758  return ( ptr ) ? ptr->isParton() : false ; }
759  bool isHadron(int idIn) const {
760  const ParticleDataEntryPtr ptr = findParticle(idIn);
761  return ( ptr ) ? ptr->isHadron() : false ; }
762  bool isMeson(int idIn) const {
763  const ParticleDataEntryPtr ptr = findParticle(idIn);
764  return ( ptr ) ? ptr->isMeson() : false ; }
765  bool isBaryon(int idIn) const {
766  const ParticleDataEntryPtr ptr = findParticle(idIn);
767  return ( ptr ) ? ptr->isBaryon() : false ; }
768  bool isOnium(int idIn) const {
769  const ParticleDataEntryPtr ptr = findParticle(idIn);
770  return ( ptr ) ? ptr->isOnium() : false ; }
771  bool isExotic(int idIn) const {
772  const ParticleDataEntryPtr ptr = findParticle(idIn);
773  return ( ptr ) ? ptr->isExotic() : false ; }
774  bool isOctetHadron(int idIn) const {
775  const ParticleDataEntryPtr ptr = findParticle(idIn);
776  return ( ptr ) ? ptr->isOctetHadron() : false ; }
777  int heaviestQuark(int idIn) const {
778  const ParticleDataEntryPtr ptr = findParticle(idIn);
779  return ( ptr ) ? ptr->heaviestQuark(idIn) : 0 ; }
780  int baryonNumberType(int idIn) const {
781  const ParticleDataEntryPtr ptr = findParticle(idIn);
782  return ( ptr ) ? ptr->baryonNumberType(idIn) : 0 ; }
783  int nQuarksInCode(int idIn, int idQIn) const {
784  const ParticleDataEntryPtr ptr = findParticle(idIn);
785  return ( ptr ) ? ptr->nQuarksInCode(idQIn) : 0 ; }
786 
787  // Change branching ratios.
788  void rescaleBR(int idIn, double newSumBR = 1.) {
789  ParticleDataEntryPtr ptr = findParticle(idIn);
790  if ( ptr ) ptr->rescaleBR(newSumBR); }
791 
792  // Access methods stored in ResonanceWidths.
793  void setResonancePtr(int idIn, ResonanceWidthsPtr resonancePtrIn) {
794  ParticleDataEntryPtr ptr = findParticle(idIn);
795  if ( ptr ) ptr->setResonancePtr( resonancePtrIn);}
796  void resInit(int idIn) {
797  ParticleDataEntryPtr ptr = findParticle(idIn);
798  if ( ptr ) ptr->resInit(infoPtr);}
799  double resWidth(int idIn, double mHat, int idInFlav = 0,
800  bool openOnly = false, bool setBR = false) {
801  ParticleDataEntryPtr ptr = findParticle(idIn);
802  return ( ptr ) ? ptr->resWidth(idIn, mHat,
803  idInFlav, openOnly, setBR) : 0.;}
804  double resWidthOpen(int idIn, double mHat, int idInFlav = 0) {
805  ParticleDataEntryPtr ptr = findParticle(idIn);
806  return ( ptr ) ? ptr->resWidthOpen(idIn, mHat, idInFlav) : 0.;}
807  double resWidthStore(int idIn, double mHat, int idInFlav = 0) {
808  ParticleDataEntryPtr ptr = findParticle(idIn);
809  return ( ptr ) ? ptr->resWidthStore(idIn, mHat, idInFlav) : 0.;}
810  double resOpenFrac(int id1In, int id2In = 0, int id3In = 0);
811  double resWidthRescaleFactor(int idIn) {
812  ParticleDataEntryPtr ptr = findParticle(idIn);
813  return ( ptr ) ? ptr->resWidthRescaleFactor() : 0.;}
814  double resWidthChan(int idIn, double mHat, int idAbs1 = 0,
815  int idAbs2 = 0) {
816  ParticleDataEntryPtr ptr = findParticle(idIn);
817  return ( ptr ) ? ptr->resWidthChan( mHat, idAbs1, idAbs2) : 0.;}
818 
819  // Return pointer to entry.
820  ParticleDataEntryPtr particleDataEntryPtr(int idIn) {
821  ParticleDataEntryPtr ptr = findParticle(idIn);
822  return ( ptr ) ? ptr : pdt[0]; }
823 
824  // Check initialisation status.
825  bool getIsInit() {return isInit;}
826 
827 private:
828 
829  // Common data, accessible for the individual particles.
830  bool setRapidDecayVertex;
831  int modeBreitWigner;
832  double maxEnhanceBW, mQRun[7], Lambda5Run, intermediateTau0;
833 
834  // The individual particle need access to the full database.
835  friend class ParticleDataEntry;
836 
837  // Pointer to various information on the generation.
838  Info* infoPtr;
839 
840  // Pointer to the settings database.
841  Settings* settingsPtr;
842 
843  // Pointer to logger.
844  Logger* loggerPtr;
845 
846  // Pointer to the random number generator.
847  Rndm* rndmPtr;
848 
849  // Pointer to Standard Model couplings.
850  CoupSM* coupSMPtr;
851 
852  // All particle data stored in a map.
853  map<int, ParticleDataEntryPtr> pdt;
854 
855  // Pointer to current particle (e.g. when reading decay channels).
856  ParticleDataEntryPtr particlePtr;
857 
858  // Flag that initialization has been performed; whether any failures.
859  bool isInit, readingFailedSave;
860 
861  // Method for common setting of particle-specific info.
862  void initCommon();
863 
864  // Useful functions for string handling.
865  bool boolString(string tag) { string tagLow = toLower(tag);
866  return ( tagLow == "true" || tagLow == "1" || tagLow == "on"
867  || tagLow == "yes" || tagLow == "ok" ); }
868 
869  // Extract XML value following XML attribute.
870  string attributeValue(string line, string attribute);
871  bool boolAttributeValue(string line, string attribute);
872  int intAttributeValue(string line, string attribute);
873  double doubleAttributeValue(string line, string attribute);
874 
875  // Vector of strings containing the readable lines of the XML file.
876  vector<string> xmlFileSav;
877 
878  // Stored history of readString statements (common and by subrun).
879  vector<string> readStringHistory;
880  map<int, vector<string> > readStringSubrun;
881 
882 };
883 
884 //==========================================================================
885 
886 } // end namespace Pythia8
887 
888 #endif // Pythia8_ParticleData_H
void setResonancePtr(ResonanceWidthsPtr resonancePtrIn)
Access methods stored in ResonanceWidths.
Definition: ParticleData.h:369
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:326
bool canDecay(int idIn) const
Give back other quantities.
Definition: ParticleData.h:741
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:559
ParticleData()
Constructor.
Definition: ParticleData.h:428
void clearChannels()
Reset to empty decay table.
Definition: ParticleData.h:345
void list(int idList)
Print out specified particles.
Definition: ParticleData.h:515
ParticleDataEntryPtr particleDataEntryPtr(int idIn)
Return pointer to entry.
Definition: ParticleData.h:820
void currentBR(double currentBRIn)
Definition: ParticleData.h:95
string toLower(const string &name, bool trim=true)
Definition: PythiaStdlib.cc:20
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:793
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:575
Definition: Basics.h:388
ParticleDataEntryPtr findParticle(int idIn)
Query existence of an entry and return an iterator.
Definition: ParticleData.h:567
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:476
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:532
bool hasAnti(int idIn) const
Give back current values.
Definition: ParticleData.h:649
bool init(string startFile="../share/Pythia8/xmldoc/ParticleData.xml")
Read in database from specific file.
Definition: ParticleData.h:465
bool readingFailed()
Keep track whether any readings have failed, invalidating run setup.
Definition: ParticleData.h:504
map< int, ParticleDataEntryPtr >::iterator begin()
Define iterators over entries.
Definition: ParticleData.h:586
ParticleData & operator=(const ParticleData &oldPD)
Assignment operator.
Definition: ParticleData.h:447
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:469
void rescaleBR(int idIn, double newSumBR=1.)
Change branching ratios.
Definition: ParticleData.h:788
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:348
Definition: StandardModel.h:142
vector< string > getReadHistory(int subrun=-999)
Definition: ParticleData.h:521
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:721
ParticleData(const ParticleData &oldPD)
Copy constructor.
Definition: ParticleData.h:434
bool useBreitWigner() const
Give back other quantities.
Definition: ParticleData.h:317
void initPtrs(Info *infoPtrIn)
Initialize pointers.
Definition: ParticleData.h:460
int id() const
Give back current values.
Definition: ParticleData.h:272
bool getIsInit()
Check initialisation status.
Definition: ParticleData.h:825
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:507
int sizeChannels() const
Decay table size.
Definition: ParticleData.h:355
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:423
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:550
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:358
bool init(istream &is)
Read in database from an istream.
Definition: ParticleData.h:473
void name(int idIn, string nameIn)
Change current values one at a time (or set if not set before).
Definition: ParticleData.h:590
int onMode() const
Member functions for output.
Definition: ParticleData.h:81
Definition: Settings.h:196
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:338