ROOTPWA
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
rpwa::particleProperties Class Reference

#include <particleProperties.h>

Inheritance diagram for rpwa::particleProperties:
rpwa::particle

Classes

struct  decayMode

Public Member Functions

 particleProperties ()
 particleProperties (const particleProperties &partProp)
 particleProperties (const std::string &partName, const int isospin, const int G, const int J, const int P, const int C)
virtual ~particleProperties ()
particlePropertiesoperator= (const particleProperties &partProp)
bool operator== (const particleProperties &rhsProp) const
bool operator!= (const particleProperties &rhsProp) const
std::string name () const
 returns particle name including charge
std::string bareName () const
 returns particle name w/o charge
std::string antiPartName () const
 returns antiparticle name including charge
std::string antiPartBareName () const
 returns antiparticle name w/o charge
int charge () const
 returns particle's charge
double mass () const
 returns particle mass
double mass2 () const
 returns particle mass squared
double width () const
 returns particle width
int baryonNmb () const
 returns particle's baryon number
int isospin () const
 returns particle's isospin [hbar/2]
int isospinProj () const
 returns z-component of isospin using Gell-Mann-Nishijima formula (see PDG 2008 eq. 14.1)
int strangeness () const
 returns particle's strangeness
int charm () const
 returns particle's charm
int beauty () const
 returns particle's beauty
int G () const
 returns particle's G-parity
int J () const
 returns particle's spin [hbar/2]
int P () const
 returns particle's parity
int C () const
 returns particle's C-parity
unsigned int geantId () const
 returns particle's Geant ID.
bool isXParticle () const
 returns whether particle's name is either of "X{,-,0,+}"
bool isMeson () const
 returns whether particle is a meson
bool isBaryon () const
 returns whether particle is a baryon
bool isLepton () const
 returns whether particle is a lepton
bool isPhoton () const
 returns whether particle is a lepton
bool isItsOwnAntiPart () const
 returns whether particle is its own antiparticle
bool isSpinExotic () const
 returns whether particle is spin-exotic
const std::vector< decayMode > & decayModes () const
 returns decay modes defined for this particle
unsigned int nmbDecays () const
 returns number of decay modes defined for this particle
bool hasDecay (const decayMode &decay) const
 returns whether given decay mode is in list of decays
void addDecayMode (const decayMode &decay)
 adds decay channel into list of allowed decay modes
void deleteDecayModes ()
 deletes all decay modes
bool fillFromDataTable (const std::string &name, const bool warnIfNotExistent=true)
 sets particle properties from entry in particle data table
void setName (const std::string &name)
 sets particle name and charge (if given in name)
void setAntiPartName (const std::string &name)
 sets antiparticle name (charge in name is ignored)
void setCharge (const int charge)
 sets particle's charge (limited to |q| <= 9)
void setMass (const double mass)
 sets particle mass
void setWidth (const double width)
 sets particle width
void setBaryonNmb (const int baryonNmb)
 sets particle's baryon number
void setIsospin (const int isospin)
 sets particle's isospin [hbar/2]
void setIsospinProj (const int isospinProj)
 sets particle's z component of the isospin [hbar/2]
void setStrangeness (const int strangeness)
 sets particle's strangeness
void setCharm (const int charm)
 sets particle's charm
void setBeauty (const int beauty)
 sets particle's beauty
void setG (const int G)
 sets particle's G-parity
void setJ (const int J)
 sets particle's spin in [hbar/2]
void setP (const int P)
 sets particle's parity
void setC (const int C)
 sets particle's C-parity
void setSCB (const int strangeness, const int charm, const int beauty)
 sets particle's strangeness, charm, and beauty
void setIGJPC (const int isospin, const int G, const int J, const int P, const int C)
 sets particle's isospin, G-parity, spin, parity, and C-parity
particleProperties antiPartProperties (const bool convertDecaysModes=false) const
 constructs antiparticle properties from particle
virtual std::string qnSummary () const
 returns particle's quantum number summary in form name[IG(JPC)]
std::string bareNameLaTeX () const
 returns particle name w/o charge in LaTeX markup
virtual std::ostream & print (std::ostream &out) const
 prints particle data in human-readable form
virtual std::ostream & dump (std::ostream &out) const
 dumps particle properties into one text line as in data file
bool read (std::istringstream &line)
 reads whitespace separated properties from single line

Static Public Member Functions

static std::string nameWithCharge (const std::string &bareName, const int charge)
 appends charge information to bare particle name
static std::string chargeFromName (const std::string &name, int &charge)
 checks whether last characters of particle name contain charge information and sets charge accordingly; returns name with charge stripped off
static std::string stripChargeFromName (const std::string &name)
 checks whether last characters of particle name contain charge information and returns name with charge stripped off
static bool debug ()
 returns debug flag
static void setDebug (const bool debug=true)
 sets debug flag

Protected Member Functions

virtual bool isEqualTo (const particleProperties &partProp) const
 returns whether partProp is equal to this by checking equality of all member variables

Private Attributes

std::string _name
 full PDG name of particle w/o charge
std::string _antiPartName
 full PDG name of antiparticle w/o charge
int _charge
 charge
double _mass
 mass [GeV/c^2]
double _mass2
 mass^2 [(GeV/c^2)^2]
double _width
 total width [GeV/c^2]
int _baryonNmb
 baryon number
int _isospin
 isospin [hbar/2]
int _strangeness
 strangeness
int _charm
 charm
int _beauty
 beauty
int _G
 G-parity (0 = undefined)
int _J
 spin [hbar/2]
int _P
 parity (0 = undefined)
int _C
 C-parity (0 = undefined)
std::vector< decayMode_decayModes
 allowed decay modes

Static Private Attributes

static bool _debug = false
 if set to true, debug messages are printed

Friends

bool operator== (const particleProperties &lhsProp, const std::pair< particleProperties, std::string > &rhsPropSel)
bool operator!= (const particleProperties &lhsProp, const std::pair< particleProperties, std::string > &rhsPropSel)

Detailed Description

Definition at line 59 of file particleProperties.h.

Constructor & Destructor Documentation

particleProperties::particleProperties ( )

Definition at line 103 of file particleProperties.cc.

particleProperties::particleProperties ( const particleProperties partProp)

Definition at line 123 of file particleProperties.cc.

particleProperties::particleProperties ( const std::string &  partName,
const int  isospin,
const int  G,
const int  J,
const int  P,
const int  C 
)

Definition at line 129 of file particleProperties.cc.

References setC(), setG(), setIsospin(), setJ(), setName(), and setP().

particleProperties::~particleProperties ( )
virtual

Definition at line 154 of file particleProperties.cc.

Member Function Documentation

void rpwa::particleProperties::addDecayMode ( const decayMode decay)
inline

adds decay channel into list of allowed decay modes

Definition at line 137 of file particleProperties.h.

References _decayModes.

Referenced by antiPartProperties(), and rpwa::particleDataTable::readDecayModeFile().

std::string rpwa::particleProperties::antiPartBareName ( ) const
inline

returns antiparticle name w/o charge

Definition at line 106 of file particleProperties.h.

References _antiPartName.

std::string rpwa::particleProperties::antiPartName ( ) const
inline

returns antiparticle name including charge

Definition at line 105 of file particleProperties.h.

References _antiPartName, _charge, and nameWithCharge().

Referenced by antiPartProperties(), dump(), isEqualTo(), isItsOwnAntiPart(), print(), and read().

particleProperties particleProperties::antiPartProperties ( const bool  convertDecaysModes = false) const
std::string rpwa::particleProperties::bareName ( ) const
inline

returns particle name w/o charge

Definition at line 104 of file particleProperties.h.

References _name.

Referenced by rpwa::particleDataTable::entriesMatching(), main(), and nameWithCharge().

string particleProperties::bareNameLaTeX ( ) const

returns particle name w/o charge in LaTeX markup

Definition at line 338 of file particleProperties.cc.

int rpwa::particleProperties::baryonNmb ( ) const
inline
int rpwa::particleProperties::beauty ( ) const
inline
int rpwa::particleProperties::C ( ) const
inline
int rpwa::particleProperties::charge ( ) const
inline

returns particle's charge

Definition at line 107 of file particleProperties.h.

References _charge.

Referenced by isBaryon(), isEqualTo(), isItsOwnAntiPart(), isLepton(), isMeson(), isPhoton(), main(), rpwa::operator==(), setCharge(), and setName().

string particleProperties::chargeFromName ( const std::string &  name,
int charge 
)
static

checks whether last characters of particle name contain charge information and sets charge accordingly; returns name with charge stripped off

Definition at line 526 of file particleProperties.cc.

Referenced by setName(), and stripChargeFromName().

int rpwa::particleProperties::charm ( ) const
inline
static bool rpwa::particleProperties::debug ( )
inlinestatic

returns debug flag

Reimplemented in rpwa::particle.

Definition at line 188 of file particleProperties.h.

References _debug.

Referenced by rpwa::operator>>(), and setDebug().

const std::vector<decayMode>& rpwa::particleProperties::decayModes ( ) const
inline

returns decay modes defined for this particle

Definition at line 134 of file particleProperties.h.

References _decayModes.

Referenced by main().

void rpwa::particleProperties::deleteDecayModes ( )
inline

deletes all decay modes

Definition at line 138 of file particleProperties.h.

References _decayModes.

Referenced by antiPartProperties().

ostream & particleProperties::dump ( std::ostream &  out) const
virtual

dumps particle properties into one text line as in data file

Definition at line 439 of file particleProperties.cc.

References antiPartName(), baryonNmb(), beauty(), C(), charm(), G(), isospin(), J(), mass(), mass2(), name(), P(), strangeness(), and width().

bool particleProperties::fillFromDataTable ( const std::string &  name,
const bool  warnIfNotExistent = true 
)

sets particle properties from entry in particle data table

Definition at line 241 of file particleProperties.cc.

References _debug, rpwa::particleDataTable::entry(), rpwa::particleDataTable::instance(), name(), and stripChargeFromName().

Referenced by antiPartProperties(), lookupJ(), lookupP(), main(), and rpwa::particle::particle().

int rpwa::particleProperties::G ( ) const
inline
unsigned int particleProperties::geantId ( ) const

returns particle's Geant ID.

Definition at line 220 of file particleProperties.cc.

References rpwa::particleDataTable::geantIdFromParticleName(), and name().

bool particleProperties::hasDecay ( const decayMode decay) const

returns whether given decay mode is in list of decays

Definition at line 234 of file particleProperties.cc.

References _decayModes.

Referenced by rpwa::particleDataTable::entriesMatching().

bool rpwa::particleProperties::isBaryon ( ) const
inline

returns whether particle is a baryon

Definition at line 252 of file particleProperties.h.

References baryonNmb(), beauty(), C(), charge(), charm(), G(), isospin(), J(), P(), and strangeness().

Referenced by print().

bool particleProperties::isEqualTo ( const particleProperties partProp) const
protectedvirtual

returns whether partProp is equal to this by checking equality of all member variables

Reimplemented in rpwa::particle.

Definition at line 570 of file particleProperties.cc.

References antiPartName(), baryonNmb(), beauty(), C(), charge(), charm(), G(), isospin(), J(), mass(), name(), P(), strangeness(), and width().

Referenced by rpwa::particle::isEqualTo(), and operator==().

bool rpwa::particleProperties::isItsOwnAntiPart ( ) const
inline

returns whether particle is its own antiparticle

Definition at line 283 of file particleProperties.h.

References antiPartName(), baryonNmb(), beauty(), charge(), charm(), isMeson(), isospinProj(), isPhoton(), name(), and strangeness().

Referenced by antiPartProperties(), print(), and rpwa::particleDataTable::read().

bool rpwa::particleProperties::isLepton ( ) const
inline

returns whether particle is a lepton

Definition at line 263 of file particleProperties.h.

References baryonNmb(), beauty(), C(), charge(), charm(), G(), isospin(), J(), P(), and strangeness().

Referenced by print().

bool rpwa::particleProperties::isMeson ( ) const
inline

returns whether particle is a meson

Definition at line 241 of file particleProperties.h.

References baryonNmb(), beauty(), C(), charge(), charm(), G(), isospin(), J(), P(), and strangeness().

Referenced by isItsOwnAntiPart(), isSpinExotic(), and print().

int rpwa::particleProperties::isospin ( ) const
inline
int rpwa::particleProperties::isospinProj ( ) const
inline

returns z-component of isospin using Gell-Mann-Nishijima formula (see PDG 2008 eq. 14.1)

Definition at line 113 of file particleProperties.h.

References _charge, baryonNmb(), beauty(), charm(), and strangeness().

Referenced by isItsOwnAntiPart().

bool rpwa::particleProperties::isPhoton ( ) const
inline

returns whether particle is a lepton

Definition at line 273 of file particleProperties.h.

References baryonNmb(), beauty(), C(), charge(), charm(), G(), isospin(), J(), P(), and strangeness().

Referenced by isItsOwnAntiPart(), and print().

bool particleProperties::isSpinExotic ( ) const

returns whether particle is spin-exotic

Definition at line 227 of file particleProperties.cc.

References G(), isMeson(), isospin(), J(), and P().

Referenced by print().

bool rpwa::particleProperties::isXParticle ( ) const
inline

returns whether particle's name is either of "X{,-,0,+}"

Definition at line 233 of file particleProperties.h.

References _name.

int rpwa::particleProperties::J ( ) const
inline
double rpwa::particleProperties::mass ( ) const
inline
double rpwa::particleProperties::mass2 ( ) const
inline

returns particle mass squared

Definition at line 109 of file particleProperties.h.

References _mass2.

Referenced by dump().

std::string rpwa::particleProperties::name ( ) const
inline
string particleProperties::nameWithCharge ( const std::string &  bareName,
const int  charge 
)
static

appends charge information to bare particle name

Definition at line 507 of file particleProperties.cc.

References bareName(), name(), and q().

Referenced by antiPartName(), and name().

unsigned int rpwa::particleProperties::nmbDecays ( ) const
inline

returns number of decay modes defined for this particle

Definition at line 135 of file particleProperties.h.

References _decayModes.

Referenced by antiPartProperties(), rpwa::particleDataTable::entriesMatching(), main(), and print().

bool rpwa::particleProperties::operator!= ( const particleProperties rhsProp) const
inline

Definition at line 95 of file particleProperties.h.

particleProperties & particleProperties::operator= ( const particleProperties partProp)
bool rpwa::particleProperties::operator== ( const particleProperties rhsProp) const
inline

Definition at line 94 of file particleProperties.h.

References isEqualTo().

int rpwa::particleProperties::P ( ) const
inline
ostream & particleProperties::print ( std::ostream &  out) const
virtual

prints particle data in human-readable form

Reimplemented in rpwa::particle.

Definition at line 391 of file particleProperties.cc.

References _decayModes, antiPartName(), baryonNmb(), beauty(), C(), charm(), G(), i, isBaryon(), isItsOwnAntiPart(), isLepton(), isMeson(), isospin(), isPhoton(), isSpinExotic(), J(), mass(), name(), nmbDecays(), P(), strangeness(), and width().

Referenced by rpwa::operator<<().

string particleProperties::qnSummary ( ) const
virtual

returns particle's quantum number summary in form name[IG(JPC)]

Reimplemented in rpwa::particle.

Definition at line 381 of file particleProperties.cc.

References C(), G(), isospin(), J(), name(), and P().

Referenced by rpwa::waveSetGenerator::generateWaveSet().

bool particleProperties::read ( std::istringstream &  line)
void rpwa::particleProperties::setAntiPartName ( const std::string &  name)
inline

sets antiparticle name (charge in name is ignored)

Definition at line 144 of file particleProperties.h.

References _antiPartName, and stripChargeFromName().

Referenced by antiPartProperties(), and read().

void rpwa::particleProperties::setBaryonNmb ( const int  baryonNmb)
inline
void rpwa::particleProperties::setBeauty ( const int  beauty)
inline
void rpwa::particleProperties::setC ( const int  C)
inline

sets particle's C-parity

Definition at line 157 of file particleProperties.h.

References _C.

Referenced by antiPartProperties(), particleProperties(), read(), and setIGJPC().

void rpwa::particleProperties::setCharge ( const int  charge)
inline

sets particle's charge (limited to |q| <= 9)

Definition at line 303 of file particleProperties.h.

References _charge, and charge().

Referenced by antiPartProperties(), and setName().

void rpwa::particleProperties::setCharm ( const int  charm)
inline
static void rpwa::particleProperties::setDebug ( const bool  debug = true)
inlinestatic

sets debug flag

Reimplemented in rpwa::particle.

Definition at line 189 of file particleProperties.h.

References _debug, and debug().

void rpwa::particleProperties::setG ( const int  G)
inline

sets particle's G-parity

Definition at line 154 of file particleProperties.h.

References _G.

Referenced by antiPartProperties(), particleProperties(), read(), and setIGJPC().

void particleProperties::setIGJPC ( const int  isospin,
const int  G,
const int  J,
const int  P,
const int  C 
)

sets particle's isospin, G-parity, spin, parity, and C-parity

Definition at line 277 of file particleProperties.cc.

References setC(), setG(), setIsospin(), setJ(), and setP().

Referenced by rpwa::waveSetGenerator::generateWaveSet().

void rpwa::particleProperties::setIsospin ( const int  isospin)
inline

sets particle's isospin [hbar/2]

Definition at line 149 of file particleProperties.h.

References _isospin.

Referenced by antiPartProperties(), particleProperties(), read(), and setIGJPC().

void rpwa::particleProperties::setIsospinProj ( const int  isospinProj)
inline

sets particle's z component of the isospin [hbar/2]

Definition at line 150 of file particleProperties.h.

References _charge, baryonNmb(), beauty(), charm(), and strangeness().

void rpwa::particleProperties::setJ ( const int  J)
inline

sets particle's spin in [hbar/2]

Definition at line 155 of file particleProperties.h.

References _J.

Referenced by antiPartProperties(), particleProperties(), read(), and setIGJPC().

void rpwa::particleProperties::setMass ( const double  mass)
inline

sets particle mass

Definition at line 317 of file particleProperties.h.

References _mass, _mass2, and mass().

Referenced by antiPartProperties(), and read().

void rpwa::particleProperties::setName ( const std::string &  name)
inline

sets particle name and charge (if given in name)

Definition at line 293 of file particleProperties.h.

References _name, charge(), chargeFromName(), and setCharge().

Referenced by antiPartProperties(), main(), rpwa::particle::particle(), particleProperties(), and read().

void rpwa::particleProperties::setP ( const int  P)
inline

sets particle's parity

Definition at line 156 of file particleProperties.h.

References _P.

Referenced by antiPartProperties(), particleProperties(), read(), and setIGJPC().

void particleProperties::setSCB ( const int  strangeness,
const int  charm,
const int  beauty 
)

sets particle's strangeness, charm, and beauty

Definition at line 266 of file particleProperties.cc.

References setBeauty(), setCharm(), and setStrangeness().

Referenced by rpwa::waveSetGenerator::generateWaveSet().

void rpwa::particleProperties::setStrangeness ( const int  strangeness)
inline
void rpwa::particleProperties::setWidth ( const double  width)
inline

sets particle width

Definition at line 147 of file particleProperties.h.

References _width, and width().

Referenced by antiPartProperties(), and read().

int rpwa::particleProperties::strangeness ( ) const
inline
string particleProperties::stripChargeFromName ( const std::string &  name)
static

checks whether last characters of particle name contain charge information and returns name with charge stripped off

Definition at line 562 of file particleProperties.cc.

References chargeFromName().

Referenced by fillFromDataTable(), and setAntiPartName().

double rpwa::particleProperties::width ( ) const
inline

returns particle width

Definition at line 110 of file particleProperties.h.

References _width.

Referenced by dump(), rpwa::particleDataTable::entriesMatching(), isEqualTo(), print(), read(), and setWidth().

Friends And Related Function Documentation

bool operator!= ( const particleProperties lhsProp,
const std::pair< particleProperties, std::string > &  rhsPropSel 
)
friend

Definition at line 99 of file particleProperties.h.

bool operator== ( const particleProperties lhsProp,
const std::pair< particleProperties, std::string > &  rhsPropSel 
)
friend

Member Data Documentation

std::string rpwa::particleProperties::_antiPartName
private

full PDG name of antiparticle w/o charge

Definition at line 200 of file particleProperties.h.

Referenced by antiPartBareName(), antiPartName(), antiPartProperties(), operator=(), and setAntiPartName().

int rpwa::particleProperties::_baryonNmb
private

baryon number

Definition at line 205 of file particleProperties.h.

Referenced by antiPartProperties(), baryonNmb(), operator=(), and setBaryonNmb().

int rpwa::particleProperties::_beauty
private

beauty

Definition at line 209 of file particleProperties.h.

Referenced by antiPartProperties(), beauty(), operator=(), and setBeauty().

int rpwa::particleProperties::_C
private

C-parity (0 = undefined)

Definition at line 213 of file particleProperties.h.

Referenced by antiPartProperties(), C(), operator=(), and setC().

int rpwa::particleProperties::_charge
private
int rpwa::particleProperties::_charm
private

charm

Definition at line 208 of file particleProperties.h.

Referenced by antiPartProperties(), charm(), operator=(), and setCharm().

bool particleProperties::_debug = false
staticprivate

if set to true, debug messages are printed

Definition at line 217 of file particleProperties.h.

Referenced by debug(), fillFromDataTable(), read(), and setDebug().

std::vector<decayMode> rpwa::particleProperties::_decayModes
private

allowed decay modes

Definition at line 215 of file particleProperties.h.

Referenced by addDecayMode(), antiPartProperties(), decayModes(), deleteDecayModes(), hasDecay(), nmbDecays(), operator=(), and print().

int rpwa::particleProperties::_G
private

G-parity (0 = undefined)

Definition at line 210 of file particleProperties.h.

Referenced by antiPartProperties(), G(), operator=(), and setG().

int rpwa::particleProperties::_isospin
private

isospin [hbar/2]

Definition at line 206 of file particleProperties.h.

Referenced by antiPartProperties(), isospin(), operator=(), and setIsospin().

int rpwa::particleProperties::_J
private

spin [hbar/2]

Definition at line 211 of file particleProperties.h.

Referenced by antiPartProperties(), J(), operator=(), and setJ().

double rpwa::particleProperties::_mass
private

mass [GeV/c^2]

Definition at line 202 of file particleProperties.h.

Referenced by antiPartProperties(), mass(), operator=(), and setMass().

double rpwa::particleProperties::_mass2
private

mass^2 [(GeV/c^2)^2]

Definition at line 203 of file particleProperties.h.

Referenced by mass2(), operator=(), and setMass().

std::string rpwa::particleProperties::_name
private

full PDG name of particle w/o charge

Definition at line 199 of file particleProperties.h.

Referenced by antiPartProperties(), bareName(), isXParticle(), name(), operator=(), and setName().

int rpwa::particleProperties::_P
private

parity (0 = undefined)

Definition at line 212 of file particleProperties.h.

Referenced by antiPartProperties(), operator=(), P(), and setP().

int rpwa::particleProperties::_strangeness
private

strangeness

Definition at line 207 of file particleProperties.h.

Referenced by antiPartProperties(), operator=(), setStrangeness(), and strangeness().

double rpwa::particleProperties::_width
private

total width [GeV/c^2]

Definition at line 204 of file particleProperties.h.

Referenced by antiPartProperties(), operator=(), setWidth(), and width().


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