PYTHIA  8.311
Public Member Functions | Friends | List of all members
ParticleData Class Reference

This class holds a map of all ParticleDataEntries. More...

#include <ParticleData.h>

Public Member Functions

 ParticleData ()
 Constructor.
 
 ParticleData (const ParticleData &oldPD)
 Copy constructor.
 
ParticleDataoperator= (const ParticleData &oldPD)
 Assignment operator.
 
void initPtrs (Info *infoPtrIn)
 Initialize pointers.
 
bool init (string startFile="../share/Pythia8/xmldoc/ParticleData.xml")
 Read in database from specific file.
 
bool init (const ParticleData &particleDataIn)
 Read in database from saved file stored in memory.
 
bool init (istream &is)
 Read in database from an istream.
 
bool reInit (string startFile, bool xmlFormat=true)
 Overwrite existing database by reading from specific file.
 
void initWidths (vector< ResonanceWidthsPtr > resonancePtrs)
 Initialize pointers, normal Breit-Wigners and special resonances. More...
 
bool readXML (string inFile, bool reset=true)
 Read and process or list whole (or part of) database from/to an XML file. More...
 
void listXML (string outFile)
 Print out complete database in numerical order as an XML file. More...
 
bool readXML (istream &is, bool reset=true)
 Read in database from specific XML stream (which may refer to others). More...
 
bool copyXML (const ParticleData &particleDataIn)
 Copy and process XML information from another particleData object. More...
 
bool loadXML (string inFile, bool reset=true)
 Auxiliary functions to readXML() and copyXML(). More...
 
bool loadXML (istream &is, bool reset=true)
 Load a specific XML file into memory (which may refer to others). More...
 
bool processXML (bool reset=true)
 Process XML contents stored in memory. More...
 
bool readFF (string inFile, bool reset=true)
 Read or list whole (or part of) database from/to a free format file. More...
 
bool readFF (istream &is, bool reset=true)
 Read in database from specific free format file. More...
 
void listFF (string outFile)
 Print out complete database in numerical order as a free format file. More...
 
bool readString (string lineIn, bool warn=true)
 Read in one update from a single line. More...
 
bool readingFailed ()
 Keep track whether any readings have failed, invalidating run setup.
 
void listAll (ostream &stream)
 Print out table of whole database, or of only part of it.
 
void listAll ()
 
void listChanged (bool changedRes=false)
 
void list (ostream &stream, bool chargedOnly=false, bool changedRes=true)
 Print out complete or changed table of database in numerical order. More...
 
void list (bool changedOnly=false, bool changedRes=true)
 
void list (int idList)
 Print out specified particles.
 
void list (vector< int > idList)
 Print out partial table of database in input order. More...
 
vector< string > getReadHistory (int subrun=-999)
 
void checkTable (int verbosity=1)
 Check that table makes sense, especially for decays. More...
 
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.
 
void addParticle (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)
 
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.
 
bool isParticle (int idIn) const
 Query existence of an entry.
 
ParticleDataEntryPtr findParticle (int idIn)
 Query existence of an entry and return an iterator.
 
const ParticleDataEntryPtr findParticle (int idIn) const
 Query existence of an entry and return a const iterator.
 
int nextId (int idIn) const
 Return the id of the sequentially next particle stored in table. More...
 
map< int, ParticleDataEntryPtr >::iterator begin ()
 Define iterators over entries.
 
map< int, ParticleDataEntryPtr >::iterator end ()
 
void name (int idIn, string nameIn)
 Change current values one at a time (or set if not set before).
 
void antiName (int idIn, string antiNameIn)
 
void names (int idIn, string nameIn, string antiNameIn)
 
void spinType (int idIn, int spinTypeIn)
 
void chargeType (int idIn, int chargeTypeIn)
 
void colType (int idIn, int colTypeIn)
 
void m0 (int idIn, double m0In)
 
void mWidth (int idIn, double mWidthIn)
 
void mMin (int idIn, double mMinIn)
 
void mMax (int idIn, double mMaxIn)
 
void tau0 (int idIn, double tau0In)
 
void isResonance (int idIn, bool isResonanceIn)
 
void mayDecay (int idIn, bool mayDecayIn)
 
void tauCalc (int idIn, bool tauCalcIn)
 
void doExternalDecay (int idIn, bool doExternalDecayIn)
 
void varWidth (int idIn, bool varWidthIn)
 
void isVisible (int idIn, bool isVisibleIn)
 
void doForceWidth (int idIn, bool doForceWidthIn)
 
void hasChanged (int idIn, bool hasChangedIn)
 
bool hasAnti (int idIn) const
 Give back current values.
 
int antiId (int idIn) const
 
string name (int idIn) const
 
int spinType (int idIn) const
 
int chargeType (int idIn) const
 
double charge (int idIn) const
 
int colType (int idIn) const
 
double m0 (int idIn) const
 
double mWidth (int idIn) const
 
double mMin (int idIn) const
 
double m0Min (int idIn) const
 
double mMax (int idIn) const
 
double m0Max (int idIn) const
 
double tau0 (int idIn) const
 
bool isResonance (int idIn) const
 
bool mayDecay (int idIn) const
 
bool tauCalc (int idIn) const
 
bool doExternalDecay (int idIn) const
 
bool isVisible (int idIn) const
 
bool doForceWidth (int idIn) const
 
bool hasChanged (int idIn) const
 
bool hasChangedMMin (int idIn) const
 
bool hasChangedMMax (int idIn) const
 
bool useBreitWigner (int idIn) const
 Give back special mass-related quantities.
 
bool varWidth (int idIn) const
 
double constituentMass (int idIn) const
 
double mSel (int idIn) const
 
double mRun (int idIn, double mH) const
 
bool canDecay (int idIn) const
 Give back other quantities.
 
bool isLepton (int idIn) const
 
bool isQuark (int idIn) const
 
bool isGluon (int idIn) const
 
bool isDiquark (int idIn) const
 
bool isParton (int idIn) const
 
bool isHadron (int idIn) const
 
bool isMeson (int idIn) const
 
bool isBaryon (int idIn) const
 
bool isOnium (int idIn) const
 
bool isExotic (int idIn) const
 
bool isOctetHadron (int idIn) const
 
int heaviestQuark (int idIn) const
 
int baryonNumberType (int idIn) const
 
int nQuarksInCode (int idIn, int idQIn) const
 
void rescaleBR (int idIn, double newSumBR=1.)
 Change branching ratios.
 
void setResonancePtr (int idIn, ResonanceWidthsPtr resonancePtrIn)
 Access methods stored in ResonanceWidths.
 
void resInit (int idIn)
 
double resWidth (int idIn, double mHat, int idInFlav=0, bool openOnly=false, bool setBR=false)
 
double resWidthOpen (int idIn, double mHat, int idInFlav=0)
 
double resWidthStore (int idIn, double mHat, int idInFlav=0)
 
double resOpenFrac (int id1In, int id2In=0, int id3In=0)
 Fractional width associated with open channels of one or two resonances. More...
 
double resWidthRescaleFactor (int idIn)
 
double resWidthChan (int idIn, double mHat, int idAbs1=0, int idAbs2=0)
 
ParticleDataEntryPtr particleDataEntryPtr (int idIn)
 Return pointer to entry.
 
bool getIsInit ()
 Check initialisation status.
 

Friends

class ParticleDataEntry
 The individual particle need access to the full database.
 

Detailed Description

This class holds a map of all ParticleDataEntries.

Member Function Documentation

void checkTable ( int  verbosity = 1)

Check that table makes sense, especially for decays.

Check that table makes sense: e.g. consistent names and mass ranges, that branching ratios sum to unity, that charge is conserved and that phase space is open in each channel. verbosity = 0: mimimal amount of checks, e.g. that no channels open. = 1: further warning if individual channels closed (except for resonances). = 2: also print branching-ratio-averaged threshold mass. = 11, 12: as 1, 2, but include resonances in detailed checks.

Header.

Loop through all particles.

Extract some particle properties. Set some flags.

Check that particle name consistent with charge information.

Check that antiparticle name consistent with charge information.

Check that mass, mass range and width are consistent.

Check that particle does not both have width and lifetime.

Begin study decay channels.

Loop through all decay channels.

Extract channel properties.

Sum branching ratios. Include off-channels.

Error printout when unknown decay product code.

Error printout when no decay products or 0 interspersed.

Check charge conservation and open phase space in decay channel.

Error printout when charge or baryon number not conserved.

Begin check that some matrix elements are used correctly.

Check matrix element mode 0: recommended not into partons.

Check matrix element mode 1: rho/omega -> pi+ pi- pi0.

Check matrix element mode 2: polarization in V -> PS + PS.

Check matrix element mode 11, 12 and 13: Dalitz decay with one or more particles in addition to the lepton pair, or double Dalitz decay.

Check matrix element mode 21: tau -> nu_tau hadrons.

Check matrix element mode 22, but only for semileptonic decay. For a -> b c d require types u = 2, ubar = -2, d = 1, dbar = -1.

Special case: for B_c either bbar or c decays.

Special cases.

Check for matrix element mode 31.

Check for unknown mode, or resonance-only mode.

Print if incorrect matrix element mode.

Warning printout when no phase space for decay.

End loop over decay channels.

Optional printout of threshold.

Error printout when no acceptable decay channels found.

Warning printout when branching ratios do not sum to unity.

End study of decay channels and loop over particles.

Final output. Done.

bool copyXML ( const ParticleData particleDataIn)

Copy and process XML information from another particleData object.

Read in database from pre-initialised particleData object.

First Reset everything.

Process XML file (now stored in memory)

Done.

vector<string> getReadHistory ( int  subrun = -999)
inline

Retrieve readString history (e.g., for inspection). Everything (subrun=-999), up to first subrun (=-1), or subrun-specific (>=0).

void initWidths ( vector< ResonanceWidthsPtr >  resonancePtrs)

Initialize pointers, normal Breit-Wigners and special resonances.

Initialize pointer for particles to the full database, the Breit-Wigners of normal hadrons and the ResonanceWidths of resonances. For the latter the order of initialization is essential to get secondary widths right.

Initialize some common data (but preserve history of read statements).

Pointer to database and Breit-Wigner mass initialization for each particle.

Remove any existing resonances.

Begin set up new resonance objects. Z0, W+- and top are almost always needed.

Higgs in SM.

Higgses in BSM.

A fourth generation: b', t', tau', nu'_tau.

New gauge bosons: Z', W', R.

A leptoquark.

Mediators for Dark Matter.

93 = Z0copy and 94 = W+-copy used to pick decay channels for W/Z production in parton showers.

Supersymmetry:

  • Squarks;

Sleptons and sneutrinos;

  • Gluino;
  • Charginos;
  • Neutralinos.

Excited quarks and leptons.

An excited graviton/gluon in extra-dimensional scenarios.

A left-right-symmetric scenario with new righthanded neutrinos, righthanded gauge bosons and doubly charged Higgses.

Attach user-defined external resonances and do basic initialization.

Set up lists to order resonances in ascending mass.

Put Z0 and W+- first, since known to be SM and often off-shell.

Loop through particle table to find resonances.

Set up a simple default object for uninitialized resonances.

Insert resonances in ascending mass, to respect decay hierarchies.

Initialize the resonances in ascending mass order. Reset mass generation.

void list ( ostream &  stream,
bool  chargedOnly = false,
bool  changedRes = true 
)

Print out complete or changed table of database in numerical order.

Table header; output for bool as off/on.

Iterate through the particle data table. Option to skip unchanged.

Pick format for mass and width based on mass value.

Print particle properties.

Loop through the decay channel table for each particle.

End of loop over database contents.

void list ( vector< int >  idList)

Print out partial table of database in input order.

Table header; output for bool as off/on.

Iterate through the given list of input particles.

Pick format for mass and width based on mass value.

Print particle properties.

Loop through the decay channel table for each particle.

End of loop over database contents.

void listFF ( string  outFile)

Print out complete database in numerical order as a free format file.

Convert file name to ofstream.

Iterate through the particle data table.

Pick format for mass and width based on mass value.

Print particle properties.

Loop through the decay channel table for each particle.

void listXML ( string  outFile)

Print out complete database in numerical order as an XML file.

Convert file name to ofstream.

Iterate through the particle data table.

Print particle properties.

Pick format for mass and width based on mass value.

Loop through the decay channel table for each particle.

Print decay channel properties.

Finish off line and loop over allowed decay channels.

Finish off existing particle.

bool loadXML ( string  inFile,
bool  reset = true 
)

Auxiliary functions to readXML() and copyXML().

Load a specific XML file into memory (which may refer to others).

bool loadXML ( istream &  is,
bool  reset = true 
)

Load a specific XML file into memory (which may refer to others).

Normally reset whole database before beginning.

Check that instream is OK.

Read in one line at a time.

Get first word of a line.

Check for occurence of a file also to be read.

Else save line to memory.

Done.

int nextId ( int  idIn) const

Return the id of the sequentially next particle stored in table.

Return 0 for negative or unknown codes. Return first for 0.

Find pointer to current particle and step up. Return 0 if impossible.

bool processXML ( bool  reset = true)

Process XML contents stored in memory.

Number of lines saved.

Process each line sequentially.

Retrieve line.

Get first word of a line.

Check for occurence of a particle. Add any continuation lines.

Read in particle properties.

Erase if particle already exists.

Store new particle. Save pointer, to be used for decay channels.

Check for occurence of a decay channel. Add any continuation lines.

Read in channel properties - products so far only as a string.

Read in decay products from stream. Must have at least one.

Store new channel (if particle already known).

End of loop over lines in input file and loop over files.

All particle data at this stage defines baseline original.

Done.

bool readFF ( string  inFile,
bool  reset = true 
)

Read or list whole (or part of) database from/to a free format file.

Read in database from specific free format file.

bool readFF ( istream &  is,
bool  reset = true 
)

Read in database from specific free format file.

Normally reset whole database before beginning.

Read in one line at a time.

Empty lines begins new particle.

Prepare to use standard read from line.

Read in a line with particle information.

Properties to be read.

Do the reading.

Error printout if something went wrong.

Erase if particle already exists.

Store new particle. Save pointer, to be used for decay channels.

Read in a line with decay channel information.

Properties to be read.

Read in data from stream. Need at least one decay product.

Store new channel.

End of while loop over lines in the file.

Done.

bool readString ( string  lineIn,
bool  warn = true 
)

Read in one update from a single line.

Read in updates from a character string, like a line of a file. Is used by readString (and readFile) in Pythia.

If empty line then done.

Take copy that will be modified.

If first character is not a digit then taken to be a comment.

Replace colons and equal signs by blanks to make parsing simpler.

Get particle id and property name.

Check that valid particle.

Store history of readString statements.

Identify particle property and read + set its value, case by case.

Addition or complete replacement of a particle.

Default values for properties to be read.

Read in data from stream.

To keep existing decay channels, only overwrite particle data.

Else start over completely from scratch.

Set onMode of all decay channels in one go.

For onMode allow the optional possibility of Bool input.

Selective search for matching decay channels.

Read in particles to match.

Loop over all decay channels.

Look for any match at all.

Look for match of all products provided.

Rescale all branching ratios by common factor.

Reset decay table in preparation for new input.

Add or change a decay channel: get channel number and new property.

Check that channel exists.

Find decay channel property and value, case by case. At same time also do case where all should be replaced.

For onMode allow the optional possibility of Bool input.

Scan for products until end of line.

Rescale an existing branching ratio.

Return false if failed to recognize property.

bool readXML ( string  inFile,
bool  reset = true 
)

Read and process or list whole (or part of) database from/to an XML file.

Read in database from specific XML file (which may refer to others).

Load XML file into memory

Process XML file (now stored in memory)

Done.

bool readXML ( istream &  is,
bool  reset = true 
)

Read in database from specific XML stream (which may refer to others).

Load XML file into memory

Process XML file (now stored in memory)

Done.

double resOpenFrac ( int  id1In,
int  id2In = 0,
int  id3In = 0 
)

Fractional width associated with open channels of one or two resonances.

Default value.

First resonance.

Possibly second resonance.

Possibly third resonance.

Done.


The documentation for this class was generated from the following files: