Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-18 09:23:49

0001 // ParticleData.h is a part of the PYTHIA event generator.
0002 // Copyright (C) 2025 Torbjorn Sjostrand.
0003 // PYTHIA is licenced under the GNU GPL v2 or later, see COPYING for details.
0004 // Please respect the MCnet Guidelines, see GUIDELINES for details.
0005 
0006 // Header file for the classes containing particle data.
0007 // DecayChannel contains info on a single decay channel.
0008 // ParticleDataEntry contains info on a single particle species.
0009 // ParticleData collects info on all particles as a map.
0010 
0011 #ifndef Pythia8_ParticleData_H
0012 #define Pythia8_ParticleData_H
0013 
0014 #include "Pythia8/Basics.h"
0015 #include "Pythia8/Info.h"
0016 #include "Pythia8/PythiaStdlib.h"
0017 #include "Pythia8/Settings.h"
0018 #include "Pythia8/StandardModel.h"
0019 
0020 namespace Pythia8 {
0021 
0022 //==========================================================================
0023 
0024 // Forward reference to some classes.
0025 class ParticleData;
0026 class ResonanceWidths;
0027 class CoupSM;
0028 class CoupSUSY;
0029 class SUSYResonanceWidths;
0030 
0031 //==========================================================================
0032 
0033 // This class holds info on a single decay channel.
0034 
0035 class DecayChannel {
0036 
0037 public:
0038 
0039   // Constructor.
0040   DecayChannel(int onModeIn = 0, double bRatioIn = 0., int meModeIn = 0,
0041     int prod0 = 0, int prod1 = 0, int prod2 = 0, int prod3 = 0,
0042     int prod4 = 0, int prod5 = 0, int prod6 = 0, int prod7 = 0)
0043     : onModeSave(onModeIn), bRatioSave(bRatioIn), currentBRSave(0.),
0044     onShellWidthSave(0.), openSecPos(1.), openSecNeg(1.),
0045     meModeSave(meModeIn), nProd(0), prod(), hasChangedSave(true) {
0046     prod[0] = prod0; prod[1] = prod1; prod[2] = prod2; prod[3] = prod3;
0047     prod[4] = prod4; prod[5] = prod5; prod[6] = prod6; prod[7] = prod7;
0048     for (int j = 0; j < 8; ++j) if (prod[j] != 0 && j == nProd) ++nProd; }
0049 
0050   // Copy constructor.
0051   DecayChannel( const DecayChannel& oldDC) {
0052     onModeSave = oldDC.onModeSave; bRatioSave = oldDC.bRatioSave;
0053     currentBRSave = oldDC.currentBRSave;
0054     onShellWidthSave = oldDC.onShellWidthSave; openSecPos = oldDC.openSecPos;
0055     openSecNeg = oldDC.openSecNeg; meModeSave = oldDC.meModeSave;
0056     nProd = oldDC.nProd; for (int j = 0; j < 8; ++j) prod[j] = oldDC.prod[j];
0057     hasChangedSave = oldDC.hasChangedSave; }
0058 
0059   // Assignment operator.
0060   DecayChannel& operator=( const DecayChannel& oldDC) { if (this != &oldDC) {
0061     onModeSave = oldDC.onModeSave; bRatioSave = oldDC.bRatioSave;
0062     currentBRSave = oldDC.currentBRSave;
0063     onShellWidthSave = oldDC.onShellWidthSave; openSecPos = oldDC.openSecPos;
0064     openSecNeg = oldDC.openSecNeg; meModeSave = oldDC.meModeSave;
0065     nProd = oldDC.nProd; for (int j = 0; j < 8; ++j) prod[j] = oldDC.prod[j];
0066     hasChangedSave = oldDC.hasChangedSave; } return *this; }
0067 
0068   // Member functions for input.
0069   void onMode(int onModeIn) {onModeSave = onModeIn; hasChangedSave = true;}
0070   void bRatio(double bRatioIn, bool countAsChanged = true) {
0071     bRatioSave = bRatioIn; if (countAsChanged) hasChangedSave = true;}
0072   void rescaleBR(double fac) {bRatioSave *= fac; hasChangedSave = true;}
0073   void meMode(int meModeIn) {meModeSave = meModeIn; hasChangedSave = true;}
0074   void multiplicity(int multIn)  {nProd = multIn; hasChangedSave = true;}
0075   void product(int i, int prodIn) {prod[i] = prodIn; nProd = 0;
0076     for (int j = 0; j < 8; ++j) if (prod[j] != 0 && j == nProd) ++nProd;
0077     hasChangedSave = true;}
0078   void setHasChanged(bool hasChangedIn) {hasChangedSave = hasChangedIn;}
0079 
0080   // Member functions for output.
0081   int    onMode()       const {return onModeSave;}
0082   double bRatio()       const {return bRatioSave;}
0083   int    meMode()       const {return meModeSave;}
0084   int    multiplicity() const {return nProd;}
0085   int    product(int i) const {return (i >= 0 && i < nProd) ? prod[i] : 0;}
0086   bool   hasChanged()   const { return hasChangedSave;}
0087 
0088   // Check for presence of particles anywhere in decay list.
0089   bool   contains(int id1) const;
0090   bool   contains(int id1, int id2) const;
0091   bool   contains(int id1, int id2, int id3) const;
0092 
0093   // Input/output for current selection of decay modes.
0094   // Takes into account on/off switches and dynamic width for resonances.
0095   void   currentBR(double currentBRIn) {currentBRSave = currentBRIn;}
0096   double currentBR() const {return currentBRSave;}
0097 
0098   // Input/output for nominal partial width; used by resonances.
0099   void   onShellWidth(double onShellWidthIn) {
0100          onShellWidthSave = onShellWidthIn;}
0101   double onShellWidth() const {return onShellWidthSave;}
0102   void   onShellWidthFactor(double factor) {onShellWidthSave *= factor;}
0103 
0104   // Input/output for fraction of secondary open widths; used by resonances.
0105   void   openSec(int idSgn, double openSecIn) {
0106     if (idSgn > 0) openSecPos = openSecIn; else openSecNeg = openSecIn;}
0107   double openSec(int idSgn) const {
0108     return (idSgn > 0) ? openSecPos : openSecNeg;}
0109 
0110 private:
0111 
0112   // Decay channel info.
0113   int    onModeSave;
0114   double bRatioSave, currentBRSave, onShellWidthSave, openSecPos,
0115          openSecNeg;
0116   int    meModeSave, nProd, prod[8];
0117   bool   hasChangedSave;
0118 
0119 };
0120 
0121 //==========================================================================
0122 
0123 // This class holds info on a single particle species.
0124 
0125 class ParticleDataEntry {
0126 
0127 public:
0128 
0129   // Constructors: for antiparticle exists or not.
0130   ParticleDataEntry(int idIn = 0, string nameIn = " ",
0131     int spinTypeIn = 0, int chargeTypeIn = 0, int colTypeIn = 0,
0132     double m0In = 0., double mWidthIn = 0., double mMinIn = 0.,
0133     double mMaxIn = 0., double tau0In = 0., bool varWidthIn = false)
0134     : idSave(abs(idIn)), nameSave(nameIn), antiNameSave("void"),
0135     spinTypeSave(spinTypeIn), chargeTypeSave(chargeTypeIn),
0136     colTypeSave(colTypeIn), m0Save(m0In),  mWidthSave (mWidthIn),
0137     mMinSave(mMinIn), mMaxSave(mMaxIn), tau0Save(tau0In),
0138     constituentMassSave(), hasAntiSave(false), isResonanceSave(),
0139     mayDecaySave(), tauCalcSave(true), varWidthSave(varWidthIn),
0140     doExternalDecaySave(), isVisibleSave(), doForceWidthSave(),
0141     hasChangedSave(true), hasChangedMMinSave(false),
0142     hasChangedMMaxSave(false), modeBWnow(), modeTau0now(), atanLow(),
0143     atanDif(), mThr(), currentBRSum(), resonancePtr(0), particleDataPtr() {
0144       setDefaults();}
0145   ParticleDataEntry(int idIn, string nameIn, string antiNameIn,
0146     int spinTypeIn = 0, int chargeTypeIn = 0, int colTypeIn = 0,
0147     double m0In = 0., double mWidthIn = 0., double mMinIn = 0.,
0148     double mMaxIn = 0., double tau0In = 0., bool varWidthIn = false)
0149     : idSave(abs(idIn)), nameSave(nameIn), antiNameSave(antiNameIn),
0150     spinTypeSave(spinTypeIn), chargeTypeSave(chargeTypeIn),
0151     colTypeSave(colTypeIn), m0Save(m0In), mWidthSave (mWidthIn),
0152     mMinSave(mMinIn), mMaxSave(mMaxIn), tau0Save(tau0In),
0153     constituentMassSave(), hasAntiSave(true), isResonanceSave(),
0154     mayDecaySave(), tauCalcSave(true), varWidthSave(varWidthIn),
0155     doExternalDecaySave(), isVisibleSave(), doForceWidthSave(),
0156     hasChangedSave(true), hasChangedMMinSave(false),
0157     hasChangedMMaxSave(false), modeBWnow(), modeTau0now(), atanLow(),
0158     atanDif(), mThr(), currentBRSum(), resonancePtr(0), particleDataPtr() {
0159       setDefaults(); if (toLower(antiNameIn) == "void") hasAntiSave = false;}
0160 
0161   // Copy constructor.
0162   ParticleDataEntry( const ParticleDataEntry& oldPDE) {idSave = oldPDE.idSave;
0163     nameSave = oldPDE.nameSave; antiNameSave = oldPDE.antiNameSave;
0164     spinTypeSave = oldPDE.spinTypeSave; chargeTypeSave = oldPDE.chargeTypeSave;
0165     colTypeSave = oldPDE.colTypeSave; m0Save = oldPDE.m0Save;
0166     mWidthSave = oldPDE.mWidthSave;  mMinSave = oldPDE.mMinSave;
0167     mMaxSave = oldPDE.mMaxSave;  tau0Save = oldPDE.tau0Save;
0168     varWidthSave = oldPDE.varWidthSave;
0169     constituentMassSave = oldPDE.constituentMassSave;
0170     hasAntiSave = oldPDE.hasAntiSave; isResonanceSave = oldPDE.isResonanceSave;
0171     mayDecaySave = oldPDE.mayDecaySave; tauCalcSave = oldPDE.tauCalcSave;
0172     doExternalDecaySave = oldPDE.doExternalDecaySave; isVisibleSave
0173     = oldPDE.isVisibleSave; doForceWidthSave = oldPDE.doForceWidthSave;
0174     hasChangedSave = oldPDE.hasChangedSave; hasChangedMMinSave
0175     = oldPDE.hasChangedMMinSave; hasChangedMMaxSave
0176     = oldPDE.hasChangedMMaxSave; modeTau0now = oldPDE.modeTau0now; modeBWnow
0177     = oldPDE.modeBWnow; atanLow = oldPDE.atanLow; atanDif = oldPDE.atanDif;
0178     mThr = oldPDE.mThr;
0179     for (int i = 0; i < int(oldPDE.channels.size()); ++i) {
0180       DecayChannel oldDC = oldPDE.channels[i]; channels.push_back(oldDC); }
0181     currentBRSum = oldPDE.currentBRSum; resonancePtr = oldPDE.resonancePtr;
0182     particleDataPtr = oldPDE.particleDataPtr; }
0183 
0184   // Assignment operator.
0185   ParticleDataEntry& operator=( const ParticleDataEntry& oldPDE) {
0186     if (this != &oldPDE) { idSave = oldPDE.idSave;
0187     nameSave = oldPDE.nameSave; antiNameSave = oldPDE.antiNameSave;
0188     spinTypeSave = oldPDE.spinTypeSave; chargeTypeSave = oldPDE.chargeTypeSave;
0189     colTypeSave = oldPDE.colTypeSave; m0Save = oldPDE.m0Save;
0190     mWidthSave = oldPDE.mWidthSave;  mMinSave = oldPDE.mMinSave;
0191     mMaxSave = oldPDE.mMaxSave;  tau0Save = oldPDE.tau0Save;
0192     varWidthSave = oldPDE.varWidthSave;
0193     constituentMassSave = oldPDE.constituentMassSave;
0194     hasAntiSave = oldPDE.hasAntiSave; isResonanceSave = oldPDE.isResonanceSave;
0195     mayDecaySave = oldPDE.mayDecaySave; tauCalcSave = oldPDE.tauCalcSave;
0196     doExternalDecaySave = oldPDE.doExternalDecaySave; isVisibleSave
0197     = oldPDE.isVisibleSave; doForceWidthSave = oldPDE.doForceWidthSave;
0198     hasChangedSave = oldPDE.hasChangedSave; hasChangedMMinSave
0199     = oldPDE.hasChangedMMinSave; hasChangedMMaxSave
0200     = oldPDE.hasChangedMMaxSave; modeBWnow = oldPDE.modeBWnow; atanLow
0201     = oldPDE.atanLow; atanDif = oldPDE.atanDif; mThr = oldPDE.mThr;
0202     for (int i = 0; i < int(oldPDE.channels.size()); ++i) {
0203       DecayChannel oldDC = oldPDE.channels[i]; channels.push_back(oldDC); }
0204     currentBRSum = oldPDE.currentBRSum; resonancePtr = 0;
0205     particleDataPtr = 0; } return *this; }
0206 
0207   // Initialization of some particle flags.
0208   void setDefaults();
0209 
0210   // Store pointer to whole particle data table/database.
0211   void initPtr( ParticleData* particleDataPtrIn) {
0212     particleDataPtr = particleDataPtrIn;}
0213 
0214   // Reset all the properties of an existing particle.
0215   void setAll(string nameIn, string antiNameIn, int spinTypeIn = 0,
0216     int chargeTypeIn = 0, int colTypeIn = 0, double m0In = 0.,
0217     double mWidthIn = 0., double mMinIn = 0., double mMaxIn = 0.,
0218     double tau0In = 0., bool varWidthIn = false)
0219     {nameSave = nameIn; antiNameSave = antiNameIn; hasAntiSave = true;
0220     if (toLower(antiNameIn) == "void") hasAntiSave = false;
0221     spinTypeSave = spinTypeIn; chargeTypeSave = chargeTypeIn;
0222     colTypeSave = colTypeIn; m0Save = m0In; mWidthSave = mWidthIn;
0223     setMMin(mMinIn); setMMax(mMaxIn); tau0Save = tau0In;
0224     varWidthSave = varWidthIn; setDefaults(); hasChangedSave = true;}
0225 
0226   // Change current values one at a time (or set if not set before).
0227   // (Must use set here since else name+signature clash with get methods.)
0228   void setName(string nameIn) {nameSave = nameIn; hasChangedSave = true;}
0229   void setAntiName(string antiNameIn) {antiNameSave = antiNameIn;
0230     hasAntiSave = (toLower(antiNameIn) != "void"); hasChangedSave = true;}
0231   void setNames(string nameIn, string antiNameIn) {nameSave = nameIn;
0232     antiNameSave = antiNameIn; hasAntiSave = (toLower(antiNameIn) != "void");
0233     hasChangedSave = true;}
0234   void setSpinType(int spinTypeIn) {spinTypeSave = spinTypeIn;
0235     hasChangedSave = true;}
0236   void setChargeType(int chargeTypeIn) {chargeTypeSave = chargeTypeIn;
0237     hasChangedSave = true;}
0238   void setColType(int colTypeIn) {colTypeSave = colTypeIn;
0239     hasChangedSave = true;}
0240   void setM0(double m0In) {m0Save = m0In; setConstituentMass();
0241     hasChangedSave = true;}
0242   void setMWidth(double mWidthIn, bool countAsChanged = true) {
0243     mWidthSave = mWidthIn; if (countAsChanged) hasChangedSave = true;}
0244   void setMMin(double mMinIn) {mMinSave = mMinIn; hasChangedSave = true;
0245     hasChangedMMinSave=true;}
0246   void setMMax(double mMaxIn) {mMaxSave = mMaxIn; hasChangedSave = true;
0247     hasChangedMMaxSave=true;}
0248   // Special options specifically when cutting wings of Breit-Wigners.
0249   void setMMinNoChange(double mMinIn) {mMinSave = mMinIn;}
0250   void setMMaxNoChange(double mMaxIn) {mMaxSave = mMaxIn;}
0251   void setTau0(double tau0In, bool countAsChanged = true)
0252     {tau0Save = tau0In; if (countAsChanged) hasChangedSave = true;}
0253   void setVarWidth(bool varWidthIn) {varWidthSave = varWidthIn;}
0254   void setIsResonance(bool isResonanceIn) {isResonanceSave = isResonanceIn;
0255     hasChangedSave = true;}
0256   void setMayDecay(bool mayDecayIn, bool countAsChanged = true) {
0257     mayDecaySave = mayDecayIn; if (countAsChanged) hasChangedSave = true;}
0258   void setTauCalc(bool tauCalcIn, bool countAsChanged = true) {
0259     tauCalcSave = tauCalcIn; if (countAsChanged) hasChangedSave = true;}
0260   void setDoExternalDecay(bool doExternalDecayIn)
0261     {doExternalDecaySave = doExternalDecayIn; hasChangedSave = true;}
0262   void setIsVisible(bool isVisibleIn) {isVisibleSave = isVisibleIn;
0263     hasChangedSave = true;}
0264   void setDoForceWidth(bool doForceWidthIn) {doForceWidthSave = doForceWidthIn;
0265     hasChangedSave = true;}
0266   void setHasChanged(bool hasChangedIn) {hasChangedSave = hasChangedIn;
0267     for (int i = 0; i < int(channels.size()); ++i)
0268       channels[i].setHasChanged(hasChangedIn);
0269     if (!hasChangedIn) {hasChangedMMinSave=false; hasChangedMMaxSave=false;}}
0270 
0271   // Give back current values.
0272   int    id()                     const { return idSave; }
0273   int    antiId()                 const {
0274          return hasAntiSave ? -idSave : idSave; }
0275   bool   hasAnti()                const { return hasAntiSave; }
0276   string name(int idIn = 1)       const {
0277          return (idIn > 0) ? nameSave : antiNameSave; }
0278   int    spinType()               const {return spinTypeSave; }
0279   int    chargeType(int idIn = 1) const {
0280          return (idIn > 0) ? chargeTypeSave : -chargeTypeSave; }
0281   double charge(int idIn = 1)     const {
0282          return (idIn > 0) ? chargeTypeSave / 3. : -chargeTypeSave / 3.; }
0283   int    colType(int idIn = 1)    const {
0284          if (colTypeSave == 2) return colTypeSave;
0285          return (idIn > 0) ? colTypeSave : -colTypeSave; }
0286   double m0()                     const { return m0Save; }
0287   double mWidth()                 const { return mWidthSave; }
0288   double mMin()                   const { return mMinSave; }
0289   double mMax()                   const { return mMaxSave; }
0290   double m0Min()                  const {
0291          return (modeBWnow == 0) ? m0Save : mMinSave; }
0292   double m0Max()                  const {
0293          return (modeBWnow == 0) ? m0Save : mMaxSave; }
0294   double tau0()                   const { return tau0Save; }
0295   bool   isResonance()            const { return isResonanceSave; }
0296   bool   varWidth()               const { return varWidthSave; }
0297   bool   mayDecay()               const { return mayDecaySave; }
0298   bool   tauCalc()                const { return tauCalcSave; }
0299   bool   doExternalDecay()        const { return doExternalDecaySave; }
0300   bool   isVisible()              const { return isVisibleSave; }
0301   bool   doForceWidth()           const { return doForceWidthSave; }
0302   bool   hasChanged()     const { if (hasChangedSave) return true;
0303          for (int i = 0; i < int(channels.size()); ++i)
0304            if (channels[i].hasChanged()) return true;
0305          return false;}
0306   bool   hasChangedMMin()         const { return hasChangedMMinSave; }
0307   bool   hasChangedMMax()         const { return hasChangedMMaxSave; }
0308 
0309   // Set and give back several mass-related quantities.
0310   void   initBWmass();
0311   double constituentMass()        const { return constituentMassSave; }
0312   double mSel()                   const;
0313   double mSelInRange( double mMinNow, double mMaxNow);
0314   double mRun(double mH)          const;
0315 
0316   // Give back other quantities.
0317   bool   useBreitWigner() const { return (modeBWnow > 0); }
0318   bool   canDecay()       const { return (channels.size() > 0)
0319                                        || varWidthSave; }
0320   bool   isLepton()       const { return (idSave > 10 && idSave < 19);}
0321   bool   isQuark()        const { return (idSave != 0 && idSave < 9);}
0322   bool   isGluon()        const { return (idSave == 21);}
0323   bool   isDiquark()      const { return (idSave > 1000 && idSave < 10000
0324          && (idSave/10)%10 == 0);}
0325   // Identify Hidden Valley partons as partons.
0326   bool   isParton()       const { return ( idSave == 21
0327     || (idSave != 0 && idSave < 6)
0328     || (idSave > 1000 && idSave < 5510 && (idSave/10)%10 == 0)
0329     || (idSave > 4900100 && idSave < 4900109)
0330     || (idSave > 4901000 && idSave < 4909000 && (idSave/10)%10 == 0) );}
0331   bool   isHadron()       const;
0332   bool   isMeson()        const;
0333   bool   isBaryon()       const;
0334   bool   isOnium()        const;
0335   bool   isExotic()       const;
0336 
0337   // Intermediate octet ccbar or bbar states in colour-octet model.
0338   bool   isOctetHadron()  const {return idSave >= 9940000
0339       && idSave < 9960000; }
0340   int    heaviestQuark(int idIn = 1)    const;
0341   int    baryonNumberType(int idIn = 1) const;
0342   int    nQuarksInCode(int idQIn)       const;
0343 
0344   // Reset to empty decay table.
0345   void clearChannels() {channels.resize(0);}
0346 
0347   // Add a decay channel to the decay table.
0348   void addChannel(int onMode = 0, double bRatio = 0., int meMode = 0,
0349     int prod0 = 0, int prod1 = 0, int prod2 = 0, int prod3 = 0,
0350     int prod4 = 0, int prod5 = 0, int prod6 = 0, int prod7 = 0) {
0351     channels.push_back( DecayChannel( onMode, bRatio, meMode, prod0,
0352     prod1, prod2, prod3, prod4, prod5, prod6, prod7) ); }
0353 
0354   // Decay table size.
0355   int sizeChannels() const {return channels.size();}
0356 
0357   // Gain access to a channel in the decay table.
0358   DecayChannel& channel(int i){return channels[i];}
0359   const DecayChannel& channel(int i) const {return channels[i];}
0360 
0361   // Rescale sum of branching ratios to unity.
0362   void rescaleBR(double newSumBR = 1.);
0363 
0364   // Random choice of decay channel according to branching ratios.
0365   bool preparePick(int idSgn, double mHat = 0., int idInFlav = 0);
0366   DecayChannel& pickChannel();
0367 
0368   // Access methods stored in ResonanceWidths.
0369   void   setResonancePtr(ResonanceWidthsPtr resonancePtrIn) {
0370     resonancePtr = resonancePtrIn;}
0371   ResonanceWidthsPtr getResonancePtr() {return resonancePtr;}
0372   void   resInit(Info* infoPtrIn);
0373   double resWidth(int idSgn, double mHat, int idIn = 0,
0374     bool openOnly = false, bool setBR = false);
0375   double resWidthOpen(int idSgn, double mHat, int idIn = 0);
0376   double resWidthStore(int idSgn, double mHat, int idIn = 0);
0377   double resOpenFrac(int idSgn);
0378   double resWidthRescaleFactor();
0379   double resWidthChan(double mHat, int idAbs1 = 0, int idAbs2 = 0);
0380 
0381 private:
0382 
0383   // Constants: could only be changed in the code itself.
0384   static const int    INVISIBLENUMBER, INVISIBLETABLE[80], KNOWNNOWIDTH[3];
0385   static const double MAXTAU0FORDECAY,MINMASSRESONANCE, NARROWMASS,
0386                       CONSTITUENTMASSTABLE[10];
0387 
0388   // Particle data.
0389   int    idSave;
0390   string nameSave, antiNameSave;
0391   int    spinTypeSave, chargeTypeSave, colTypeSave;
0392   double m0Save, mWidthSave, mMinSave, mMaxSave, tau0Save,
0393          constituentMassSave;
0394   bool   hasAntiSave, isResonanceSave, mayDecaySave, tauCalcSave, varWidthSave,
0395          doExternalDecaySave, isVisibleSave, doForceWidthSave, hasChangedSave,
0396          hasChangedMMinSave, hasChangedMMaxSave;
0397 
0398   // Extra data for mass selection according to a Breit-Wigner and lifetime.
0399   int    modeBWnow, modeTau0now;
0400   double atanLow, atanDif, mThr;
0401 
0402   // A vector containing all the decay channels of the particle.
0403   vector<DecayChannel> channels;
0404 
0405   // Summed branching ratio of currently open channels.
0406   double currentBRSum;
0407 
0408   // Pointer to ResonanceWidths object; only used for some particles.
0409   ResonanceWidthsPtr resonancePtr;
0410 
0411   // Pointer to the full particle data table.
0412   ParticleData* particleDataPtr;
0413 
0414   // Set constituent mass.
0415   void setConstituentMass();
0416 
0417 };
0418 
0419 //==========================================================================
0420 
0421 // This class holds a map of all ParticleDataEntries.
0422 
0423 class ParticleData {
0424 
0425 public:
0426 
0427   // Constructor.
0428   ParticleData() : setRapidDecayVertex(), modeBreitWigner(), maxEnhanceBW(),
0429     mQRun(), Lambda5Run(), intermediateTau0(), infoPtr(nullptr),
0430     settingsPtr(nullptr), rndmPtr(nullptr), coupSMPtr(nullptr),
0431     particlePtr(nullptr), isInit(false), readingFailedSave(false) {}
0432 
0433   // Copy constructor.
0434   ParticleData( const ParticleData& oldPD) {
0435     modeBreitWigner = oldPD.modeBreitWigner; maxEnhanceBW = oldPD.maxEnhanceBW;
0436     for (int i = 0; i < 7; ++i) mQRun[i] = oldPD.mQRun[i];
0437     Lambda5Run = oldPD.Lambda5Run; infoPtr = nullptr; settingsPtr = nullptr;
0438     rndmPtr = nullptr; coupSMPtr = nullptr;
0439     for (auto pde = oldPD.pdt.begin(); pde != oldPD.pdt.end(); pde++) {
0440       int idTmp = pde->first;
0441       pdt[idTmp] = make_shared<ParticleDataEntry>(*pde->second);
0442       pdt[idTmp]->initPtr(this); }
0443     particlePtr = nullptr; isInit = oldPD.isInit;
0444     readingFailedSave = oldPD.readingFailedSave; }
0445 
0446   // Assignment operator.
0447   ParticleData& operator=( const ParticleData& oldPD) { if (this != &oldPD) {
0448     modeBreitWigner = oldPD.modeBreitWigner; maxEnhanceBW = oldPD.maxEnhanceBW;
0449     for (int i = 0; i < 7; ++i) mQRun[i] = oldPD.mQRun[i];
0450     Lambda5Run = oldPD.Lambda5Run; infoPtr = nullptr; settingsPtr = nullptr;
0451     rndmPtr = nullptr; coupSMPtr = nullptr;
0452     for (auto pde = oldPD.pdt.begin(); pde != oldPD.pdt.end(); pde++) {
0453       int idTmp = pde->first;
0454       pdt[idTmp] = make_shared<ParticleDataEntry>(*pde->second);
0455       pdt[idTmp]->initPtr(this); }
0456     particlePtr = nullptr; isInit = oldPD.isInit;
0457     readingFailedSave = oldPD.readingFailedSave; } return *this; }
0458 
0459   // Initialize pointers.
0460   void initPtrs(Info* infoPtrIn) {infoPtr = infoPtrIn;
0461     settingsPtr = infoPtr->settingsPtr; loggerPtr = infoPtr->loggerPtr;
0462     rndmPtr = infoPtr->rndmPtr; coupSMPtr = infoPtr->coupSMPtr;}
0463 
0464   // Read in database from specific file.
0465   bool init(string startFile = "../share/Pythia8/xmldoc/ParticleData.xml") {
0466     initCommon(); return readXML(startFile);}
0467 
0468   // Read in database from saved file stored in memory.
0469   bool init(const ParticleData& particleDataIn) {
0470     initCommon(); return copyXML(particleDataIn);}
0471 
0472   // Read in database from an istream.
0473   bool init(istream& is) { initCommon(); return readXML(is);}
0474 
0475   // Overwrite existing database by reading from specific file.
0476   bool reInit(string startFile, bool xmlFormat = true) { initCommon();
0477     return (xmlFormat) ? readXML(startFile) : readFF(startFile);}
0478 
0479   // Initialize pointers, normal Breit-Wigners and special resonances.
0480   void initWidths(vector<ResonanceWidthsPtr> resonancePtrs);
0481 
0482   // Read and process or list whole (or part of) database from/to an XML file.
0483   bool readXML(string inFile, bool reset = true) ;
0484   void listXML(string outFile);
0485   bool readXML(istream& is, bool reset=true);
0486 
0487   // Copy and process XML information from another particleData object.
0488   bool copyXML(const ParticleData &particleDataIn);
0489 
0490   // Auxiliary functions to readXML() and copyXML().
0491   bool loadXML(string inFile, bool reset = true) ;
0492   bool loadXML(istream& is, bool reset=true);
0493   bool processXML(bool reset = true) ;
0494 
0495   // Read or list whole (or part of) database from/to a free format file.
0496   bool readFF(string inFile, bool reset = true) ;
0497   bool readFF(istream& is, bool reset = true);
0498   void listFF(string outFile);
0499 
0500   // Read in one update from a single line.
0501   bool readString(string lineIn, bool warn = true) ;
0502 
0503   // Keep track whether any readings have failed, invalidating run setup.
0504   bool readingFailed() {return readingFailedSave;}
0505 
0506   // Print out table of whole database, or of only part of it.
0507   void listAll(ostream& stream) {list(stream, false, true);}
0508   void listAll() {listAll(cout);}
0509   void listChanged(bool changedRes = false) {list(true, changedRes);}
0510   void list(ostream& stream, bool chargedOnly = false, bool changedRes = true);
0511   void list(bool changedOnly = false, bool changedRes = true) {
0512     list(cout, changedOnly, changedRes); }
0513 
0514   // Print out specified particles.
0515   void list(int idList) {vector<int> idListTemp;
0516     idListTemp.push_back(idList); list( idListTemp);}
0517   void list(vector<int> idList);
0518 
0519   // Retrieve readString history (e.g., for inspection). Everything
0520   // (subrun=-999), up to first subrun (=-1), or subrun-specific (>=0).
0521   vector<string> getReadHistory(int subrun=-999) {
0522     if (subrun == -999) return readStringHistory;
0523     else if (readStringSubrun.find(subrun) != readStringSubrun.end())
0524       return readStringSubrun[subrun];
0525     else return vector<string>();
0526   }
0527 
0528   // Check that table makes sense, especially for decays.
0529   void checkTable(int verbosity = 1) ;
0530 
0531   // Add new entry.
0532   void addParticle(int idIn, string nameIn = " ", int spinTypeIn = 0,
0533     int chargeTypeIn = 0, int colTypeIn = 0, double m0In = 0.,
0534     double mWidthIn = 0., double mMinIn = 0., double mMaxIn = 0.,
0535     double tau0In = 0., bool varWidthIn = false) {
0536     pdt[abs(idIn)] = make_shared<ParticleDataEntry>(idIn, nameIn, spinTypeIn,
0537       chargeTypeIn, colTypeIn, m0In, mWidthIn, mMinIn, mMaxIn, tau0In,
0538       varWidthIn);
0539     pdt[abs(idIn)]->initPtr(this); }
0540   void addParticle(int idIn, string nameIn, string antiNameIn,
0541     int spinTypeIn = 0, int chargeTypeIn = 0, int colTypeIn = 0,
0542     double m0In = 0., double mWidthIn = 0., double mMinIn = 0.,
0543     double mMaxIn = 0., double tau0In = 0., bool varWidthIn = false) {
0544     pdt[abs(idIn)] = make_shared<ParticleDataEntry>(idIn, nameIn, antiNameIn,
0545       spinTypeIn, chargeTypeIn, colTypeIn, m0In, mWidthIn, mMinIn, mMaxIn,
0546       tau0In, varWidthIn);
0547     pdt[abs(idIn)]->initPtr(this); }
0548 
0549   // Reset all the properties of an entry in one go.
0550   void setAll(int idIn, string nameIn, string antiNameIn,
0551     int spinTypeIn = 0, int chargeTypeIn = 0, int colTypeIn = 0,
0552     double m0In = 0., double mWidthIn = 0., double mMinIn = 0.,
0553     double mMaxIn = 0.,double tau0In = 0.,bool varWidthIn = false) {
0554     ParticleDataEntryPtr ptr = findParticle(idIn);
0555     if ( ptr ) ptr->setAll( nameIn, antiNameIn, spinTypeIn, chargeTypeIn,
0556     colTypeIn, m0In, mWidthIn, mMinIn, mMaxIn, tau0In, varWidthIn); }
0557 
0558   // Query existence of an entry.
0559   bool isParticle(int idIn) const {
0560     auto found = pdt.find( abs(idIn) );
0561     if ( found == pdt.end() ) return false;
0562     if ( idIn > 0 || found->second->hasAnti() ) return true;
0563     return false;
0564   }
0565 
0566   // Query existence of an entry and return an iterator.
0567   ParticleDataEntryPtr findParticle(int idIn) {
0568     auto found = pdt.find( abs(idIn) );
0569     if( found == pdt.end() ) return nullptr;
0570     if ( idIn > 0 || found->second->hasAnti() ) return found->second;
0571     return nullptr;
0572   }
0573 
0574   // Query existence of an entry and return a const iterator.
0575   const ParticleDataEntryPtr findParticle(int idIn) const {
0576     auto found = pdt.find( abs(idIn) );
0577     if( found == pdt.end() ) return nullptr;
0578     if ( idIn > 0 || found->second->hasAnti() ) return found->second;
0579     return nullptr;
0580   }
0581 
0582   // Return the id of the sequentially next particle stored in table.
0583   int nextId(int idIn) const;
0584 
0585   // Define iterators over entries.
0586   map<int, ParticleDataEntryPtr>::iterator begin() { return pdt.begin(); }
0587   map<int, ParticleDataEntryPtr>::iterator end()   { return pdt.end();   }
0588 
0589   // Change current values one at a time (or set if not set before).
0590   void name(int idIn, string nameIn) {
0591     ParticleDataEntryPtr ptr = findParticle(idIn);
0592     if ( ptr ) ptr->setName(nameIn); }
0593   void antiName(int idIn, string antiNameIn) {
0594     ParticleDataEntryPtr ptr = findParticle(idIn);
0595     if ( ptr ) ptr->setAntiName(antiNameIn); }
0596   void names(int idIn, string nameIn, string antiNameIn) {
0597     ParticleDataEntryPtr ptr = findParticle(idIn);
0598     if ( ptr ) ptr->setNames(nameIn, antiNameIn); }
0599   void spinType(int idIn, int spinTypeIn) {
0600     ParticleDataEntryPtr ptr = findParticle(idIn);
0601     if ( ptr ) ptr->setSpinType(spinTypeIn); }
0602   void chargeType(int idIn, int chargeTypeIn) {
0603     ParticleDataEntryPtr ptr = findParticle(idIn);
0604     if ( ptr ) ptr->setChargeType(chargeTypeIn); }
0605   void colType(int idIn, int colTypeIn) {
0606     ParticleDataEntryPtr ptr = findParticle(idIn);
0607     if ( ptr ) ptr->setColType(colTypeIn); }
0608   void m0(int idIn, double m0In) {
0609     ParticleDataEntryPtr ptr = findParticle(idIn);
0610     if ( ptr ) ptr->setM0(m0In); }
0611   void mWidth(int idIn, double mWidthIn) {
0612     ParticleDataEntryPtr ptr = findParticle(idIn);
0613     if ( ptr ) ptr->setMWidth(mWidthIn); }
0614   void mMin(int idIn, double mMinIn) {
0615     ParticleDataEntryPtr ptr = findParticle(idIn);
0616     if ( ptr ) ptr->setMMin(mMinIn); }
0617   void mMax(int idIn, double mMaxIn) {
0618     ParticleDataEntryPtr ptr = findParticle(idIn);
0619     if ( ptr ) ptr->setMMax(mMaxIn); }
0620   void tau0(int idIn, double tau0In) {
0621     ParticleDataEntryPtr ptr = findParticle(idIn);
0622     if ( ptr ) ptr->setTau0(tau0In); }
0623   void isResonance(int idIn, bool isResonanceIn) {
0624     ParticleDataEntryPtr ptr = findParticle(idIn);
0625     if ( ptr ) ptr->setIsResonance(isResonanceIn); }
0626   void mayDecay(int idIn, bool mayDecayIn) {
0627     ParticleDataEntryPtr ptr = findParticle(idIn);
0628     if ( ptr ) ptr->setMayDecay(mayDecayIn); }
0629   void tauCalc(int idIn, bool tauCalcIn) {
0630     ParticleDataEntryPtr ptr = findParticle(idIn);
0631     if ( ptr ) ptr->setTauCalc(tauCalcIn); }
0632   void doExternalDecay(int idIn, bool doExternalDecayIn) {
0633     ParticleDataEntryPtr ptr = findParticle(idIn);
0634     if ( ptr ) ptr->setDoExternalDecay(doExternalDecayIn); }
0635   void varWidth(int idIn, bool varWidthIn) {
0636     ParticleDataEntryPtr ptr = findParticle(idIn);
0637     if ( ptr ) ptr->setVarWidth(varWidthIn); }
0638   void isVisible(int idIn, bool isVisibleIn) {
0639     ParticleDataEntryPtr ptr = findParticle(idIn);
0640     if ( ptr ) ptr->setIsVisible(isVisibleIn); }
0641   void doForceWidth(int idIn, bool doForceWidthIn) {
0642     ParticleDataEntryPtr ptr = findParticle(idIn);
0643     if ( ptr ) ptr->setDoForceWidth(doForceWidthIn); }
0644   void hasChanged(int idIn, bool hasChangedIn) {
0645     ParticleDataEntryPtr ptr = findParticle(idIn);
0646     if ( ptr ) ptr->setHasChanged(hasChangedIn); }
0647 
0648   // Give back current values.
0649   bool hasAnti(int idIn) const {
0650     const ParticleDataEntryPtr ptr = findParticle(idIn);
0651     return ( ptr ) ? ptr->hasAnti() : false; }
0652   int antiId(int idIn) const {
0653     if (idIn < 0) return -idIn;
0654     const ParticleDataEntryPtr ptr = findParticle(idIn);
0655     return ( ptr ) ? ptr->antiId() : 0; }
0656   string name(int idIn) const {
0657     const ParticleDataEntryPtr ptr = findParticle(idIn);
0658     return ( ptr ) ? ptr->name(idIn) : " "; }
0659   int spinType(int idIn) const {
0660     const ParticleDataEntryPtr ptr = findParticle(idIn);
0661     return ( ptr ) ? ptr->spinType() : 0; }
0662   int chargeType(int idIn) const {
0663     const ParticleDataEntryPtr ptr = findParticle(idIn);
0664     return ( ptr ) ? ptr->chargeType(idIn) : 0; }
0665   double charge(int idIn) const {
0666     const ParticleDataEntryPtr ptr = findParticle(idIn);
0667     return ( ptr ) ? ptr->charge(idIn) : 0; }
0668   int colType(int idIn) const {
0669     const ParticleDataEntryPtr ptr = findParticle(idIn);
0670     return ( ptr ) ? ptr->colType(idIn) : 0 ; }
0671   double m0(int idIn) const {
0672     const ParticleDataEntryPtr ptr = findParticle(idIn);
0673     return ( ptr ) ? ptr->m0() : 0. ; }
0674   double mWidth(int idIn) const {
0675     const ParticleDataEntryPtr ptr = findParticle(idIn);
0676     return ( ptr ) ? ptr->mWidth() : 0. ; }
0677   double mMin(int idIn) const {
0678     const ParticleDataEntryPtr ptr = findParticle(idIn);
0679     return ( ptr ) ? ptr->mMin() : 0. ; }
0680   double m0Min(int idIn) const {
0681     const ParticleDataEntryPtr ptr = findParticle(idIn);
0682     return ( ptr ) ? ptr->m0Min() : 0. ; }
0683   double mMax(int idIn) const {
0684     const ParticleDataEntryPtr ptr = findParticle(idIn);
0685     return ( ptr ) ? ptr->mMax() : 0. ; }
0686   double m0Max(int idIn) const {
0687     const ParticleDataEntryPtr ptr = findParticle(idIn);
0688     return ( ptr ) ? ptr->m0Max() : 0. ; }
0689   double tau0(int idIn) const {
0690     const ParticleDataEntryPtr ptr = findParticle(idIn);
0691     return ( ptr ) ? ptr->tau0() : 0. ; }
0692   bool isResonance(int idIn) const {
0693     const ParticleDataEntryPtr ptr = findParticle(idIn);
0694     return ( ptr ) ? ptr->isResonance() : false ; }
0695   bool mayDecay(int idIn) const {
0696     const ParticleDataEntryPtr ptr = findParticle(idIn);
0697     return ( ptr ) ? ptr->mayDecay() : false ; }
0698   bool tauCalc(int idIn) const {
0699     const ParticleDataEntryPtr ptr = findParticle(idIn);
0700     return ( ptr ) ? ptr->tauCalc() : false ; }
0701   bool doExternalDecay(int idIn) const {
0702     const ParticleDataEntryPtr ptr = findParticle(idIn);
0703     return ( ptr ) ? ptr->doExternalDecay() : false ; }
0704   bool isVisible(int idIn) const {
0705     const ParticleDataEntryPtr ptr = findParticle(idIn);
0706     return ( ptr ) ? ptr->isVisible() : false ; }
0707   bool doForceWidth(int idIn) const {
0708     const ParticleDataEntryPtr ptr = findParticle(idIn);
0709     return ( ptr ) ? ptr->doForceWidth() : false ; }
0710   bool hasChanged(int idIn) const {
0711     const ParticleDataEntryPtr ptr = findParticle(idIn);
0712     return ( ptr ) ? ptr->hasChanged() : false ; }
0713   bool hasChangedMMin(int idIn) const {
0714     const ParticleDataEntryPtr ptr = findParticle(idIn);
0715     return ( ptr ) ? ptr->hasChangedMMin() : false ; }
0716   bool hasChangedMMax(int idIn) const {
0717     const ParticleDataEntryPtr ptr = findParticle(idIn);
0718     return ( ptr ) ? ptr->hasChangedMMax() : false ; }
0719 
0720   // Give back special mass-related quantities.
0721   bool useBreitWigner(int idIn) const {
0722     const ParticleDataEntryPtr ptr = findParticle(idIn);
0723     return ( ptr ) ? ptr->useBreitWigner() : false ; }
0724   bool varWidth(int idIn) const {
0725     const ParticleDataEntryPtr ptr = findParticle(idIn);
0726     return ( ptr ) ? ptr->varWidth() : false; }
0727   double constituentMass(int idIn) const {
0728     const ParticleDataEntryPtr ptr = findParticle(idIn);
0729     return ( ptr ) ? ptr->constituentMass() : 0. ; }
0730   double mSel(int idIn) const {
0731     const ParticleDataEntryPtr ptr = findParticle(idIn);
0732     return ( ptr ) ? ptr->mSel() : 0. ; }
0733   double mSelInRange(int idIn, double mMinNow, double mMaxNow) const {
0734     const ParticleDataEntryPtr ptr = findParticle(idIn);
0735     return ( ptr ) ? ptr->mSelInRange( mMinNow, mMaxNow) : 0. ; }
0736   double mRun(int idIn, double mH) const {
0737     const ParticleDataEntryPtr ptr = findParticle(idIn);
0738     return ( ptr ) ? ptr->mRun(mH) : 0. ; }
0739 
0740   // Give back other quantities.
0741   bool canDecay(int idIn) const {
0742     const ParticleDataEntryPtr ptr = findParticle(idIn);
0743     return ( ptr ) ? ptr->canDecay() : false ; }
0744   bool isLepton(int idIn) const {
0745     const ParticleDataEntryPtr ptr = findParticle(idIn);
0746     return ( ptr ) ? ptr->isLepton() : false ; }
0747   bool isQuark(int idIn) const {
0748     const ParticleDataEntryPtr ptr = findParticle(idIn);
0749     return ( ptr ) ? ptr->isQuark() : false ; }
0750   bool isGluon(int idIn) const {
0751     const ParticleDataEntryPtr ptr = findParticle(idIn);
0752     return ( ptr ) ? ptr->isGluon() : false ; }
0753   bool isDiquark(int idIn) const {
0754     const ParticleDataEntryPtr ptr = findParticle(idIn);
0755     return ( ptr ) ? ptr->isDiquark() : false ; }
0756   bool isParton(int idIn) const {
0757     const ParticleDataEntryPtr ptr = findParticle(idIn);
0758     return ( ptr ) ? ptr->isParton() : false ; }
0759   bool isHadron(int idIn) const {
0760     const ParticleDataEntryPtr ptr = findParticle(idIn);
0761     return ( ptr ) ? ptr->isHadron() : false ; }
0762   bool isMeson(int idIn) const {
0763     const ParticleDataEntryPtr ptr = findParticle(idIn);
0764     return ( ptr ) ? ptr->isMeson() : false ; }
0765   bool isBaryon(int idIn) const {
0766     const ParticleDataEntryPtr ptr = findParticle(idIn);
0767     return ( ptr ) ? ptr->isBaryon() : false ; }
0768   bool isOnium(int idIn) const {
0769     const ParticleDataEntryPtr ptr = findParticle(idIn);
0770     return ( ptr ) ? ptr->isOnium() : false ; }
0771   bool isExotic(int idIn) const {
0772     const ParticleDataEntryPtr ptr = findParticle(idIn);
0773     return ( ptr ) ? ptr->isExotic() : false ; }
0774   bool isOctetHadron(int idIn) const {
0775     const ParticleDataEntryPtr ptr = findParticle(idIn);
0776     return ( ptr ) ? ptr->isOctetHadron() : false ; }
0777   int heaviestQuark(int idIn) const {
0778     const ParticleDataEntryPtr ptr = findParticle(idIn);
0779     return ( ptr ) ? ptr->heaviestQuark(idIn) : 0 ; }
0780   int baryonNumberType(int idIn) const {
0781     const ParticleDataEntryPtr ptr = findParticle(idIn);
0782     return ( ptr ) ? ptr->baryonNumberType(idIn) : 0 ; }
0783   int nQuarksInCode(int idIn, int idQIn) const {
0784     const ParticleDataEntryPtr ptr = findParticle(idIn);
0785     return ( ptr ) ? ptr->nQuarksInCode(idQIn) : 0 ; }
0786 
0787   // Change branching ratios.
0788   void rescaleBR(int idIn, double newSumBR = 1.) {
0789     ParticleDataEntryPtr ptr = findParticle(idIn);
0790     if ( ptr ) ptr->rescaleBR(newSumBR); }
0791 
0792   // Access methods stored in ResonanceWidths.
0793   void setResonancePtr(int idIn, ResonanceWidthsPtr resonancePtrIn) {
0794     ParticleDataEntryPtr ptr = findParticle(idIn);
0795     if ( ptr ) ptr->setResonancePtr( resonancePtrIn);}
0796   void resInit(int idIn) {
0797     ParticleDataEntryPtr ptr = findParticle(idIn);
0798     if ( ptr ) ptr->resInit(infoPtr);}
0799   double resWidth(int idIn, double mHat, int idInFlav = 0,
0800     bool openOnly = false, bool setBR = false) {
0801     ParticleDataEntryPtr ptr = findParticle(idIn);
0802     return ( ptr ) ? ptr->resWidth(idIn, mHat,
0803     idInFlav, openOnly, setBR) : 0.;}
0804   double resWidthOpen(int idIn, double mHat, int idInFlav = 0) {
0805     ParticleDataEntryPtr ptr = findParticle(idIn);
0806     return ( ptr ) ? ptr->resWidthOpen(idIn, mHat, idInFlav) : 0.;}
0807   double resWidthStore(int idIn, double mHat, int idInFlav = 0) {
0808     ParticleDataEntryPtr ptr = findParticle(idIn);
0809     return ( ptr ) ? ptr->resWidthStore(idIn, mHat, idInFlav) : 0.;}
0810   double resOpenFrac(int id1In, int id2In = 0, int id3In = 0);
0811   double resWidthRescaleFactor(int idIn) {
0812     ParticleDataEntryPtr ptr = findParticle(idIn);
0813     return ( ptr ) ? ptr->resWidthRescaleFactor() : 0.;}
0814   double resWidthChan(int idIn, double mHat, int idAbs1 = 0,
0815     int idAbs2 = 0) {
0816     ParticleDataEntryPtr ptr = findParticle(idIn);
0817     return ( ptr ) ? ptr->resWidthChan( mHat, idAbs1, idAbs2) : 0.;}
0818 
0819   // Return pointer to entry.
0820   ParticleDataEntryPtr particleDataEntryPtr(int idIn) {
0821     ParticleDataEntryPtr ptr = findParticle(idIn);
0822     return ( ptr ) ? ptr : pdt[0]; }
0823 
0824   // Check initialisation status.
0825   bool getIsInit() {return isInit;}
0826 
0827 private:
0828 
0829   // Common data, accessible for the individual particles.
0830   bool   setRapidDecayVertex;
0831   int    modeBreitWigner;
0832   double maxEnhanceBW, mQRun[7], Lambda5Run, intermediateTau0;
0833 
0834   // The individual particle need access to the full database.
0835   friend class ParticleDataEntry;
0836 
0837   // Pointer to various information on the generation.
0838   Info*     infoPtr;
0839 
0840   // Pointer to the settings database.
0841   Settings* settingsPtr;
0842 
0843   // Pointer to logger.
0844   Logger*   loggerPtr;
0845 
0846   // Pointer to the random number generator.
0847   Rndm*     rndmPtr;
0848 
0849   // Pointer to Standard Model couplings.
0850   CoupSM* coupSMPtr;
0851 
0852   // All particle data stored in a map.
0853   map<int, ParticleDataEntryPtr> pdt;
0854 
0855   // Pointer to current particle (e.g. when reading decay channels).
0856   ParticleDataEntryPtr particlePtr;
0857 
0858   // Flag that initialization has been performed; whether any failures.
0859   bool   isInit, readingFailedSave;
0860 
0861   // Method for common setting of particle-specific info.
0862   void   initCommon();
0863 
0864   // Useful functions for string handling.
0865   bool   boolString(string tag) { string tagLow = toLower(tag);
0866     return ( tagLow == "true" || tagLow == "1" || tagLow == "on"
0867     || tagLow == "yes" || tagLow == "ok" ); }
0868 
0869   // Extract XML value following XML attribute.
0870   string attributeValue(string line, string attribute);
0871   bool   boolAttributeValue(string line, string attribute);
0872   int    intAttributeValue(string line, string attribute);
0873   double doubleAttributeValue(string line, string attribute);
0874 
0875   // Vector of strings containing the readable lines of the XML file.
0876   vector<string> xmlFileSav;
0877 
0878   // Stored history of readString statements (common and by subrun).
0879   vector<string> readStringHistory;
0880   map<int, vector<string> > readStringSubrun;
0881 
0882 };
0883 
0884 //==========================================================================
0885 
0886 } // end namespace Pythia8
0887 
0888 #endif // Pythia8_ParticleData_H