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

#include <particle.h>

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

Public Member Functions

 particle ()
 particle (const particle &part)
 particle (const particleProperties &partProp, const int index=-1, const int spinProj=0, const int refl=0, const TVector3 &momentum=TVector3())
 particle (const std::string &partName, const bool requirePartInTable=true, const int index=-1, const int spinProj=0, const int refl=0, const TVector3 &momentum=TVector3())
 particle (const std::string &partName, const int isospin, const int G, const int J, const int P, const int C, const int spinProj, const int refl=0, const int index=-1)
virtual ~particle ()
particleoperator= (const particle &part)
particlePtr clone () const
 creates deep copy of particle; must not be virtual
int spinProj () const
 returns particle's spin projection quantum number
TVector3 momentum () const
 returns three-momentum of particle
const TLorentzVector & lzVec () const
 returns Lorentz vector of particle
int index () const
 returns index label assigned to particle; -1 means undefined
int reflectivity () const
 returns particle's reflectivity; 0 means undefined
void setSpinProj (const int spinProj)
 sets particle's spin projection quantum number
void setMomentum (const TVector3 &momentum)
 sets particle's Lorentz vector
void setLzVec (const TLorentzVector &lzVec)
 sets particle's Lorentz vector; if this is used to inject external data the mass values likely become inconsistent
void setIndex (const int index)
 sets particle's index label
void setReflectivity (const int refl)
 sets particle's reflectivity
void setProperties (const particleProperties &prop)
 sets particle's poperties to those given by argument
const TLorentzVector & transform (const TLorentzRotation &L)
 applies Lorentz-transformation to particle
const TLorentzVector & transform (const TVector3 &boost)
virtual std::string qnSummary () const
 returns particle's quantum number summary in form name[IG(JPC)M]
virtual std::ostream & print (std::ostream &out) const
 prints particle parameters in human-readable form
virtual std::string label () const
 returns particle label
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
std::string bareNameLaTeX () const
 returns particle name w/o charge in LaTeX markup
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 bool debug ()
 returns debug flag
static void setDebug (const bool debug=true)
 sets debug flag
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

Protected Member Functions

virtual particledoClone () const
 helper function to use covariant return types with smart pointers; needed for public clone()
virtual bool isEqualTo (const particleProperties &partProp) const
 returns whether partProp is equal to this by checking equality of all member variables (except Lorentz-vector)

Private Attributes

int _spinProj
 spin projection quantum number; can be either M or helicity
TLorentzVector _lzVec
 Lorentz vector [GeV].
int _index
 index that can be used to label indistinguishable particles
int _refl
 reflectivity

Static Private Attributes

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

Detailed Description

Definition at line 60 of file amplitude/particle.h.

Constructor & Destructor Documentation

particle::particle ( )

Definition at line 51 of file amplitude/particle.cc.

Referenced by doClone().

particle::particle ( const particle part)

Definition at line 60 of file amplitude/particle.cc.

particle::particle ( const particleProperties partProp,
const int  index = -1,
const int  spinProj = 0,
const int  refl = 0,
const TVector3 &  momentum = TVector3() 
)

Definition at line 66 of file amplitude/particle.cc.

particle::particle ( const std::string &  partName,
const bool  requirePartInTable = true,
const int  index = -1,
const int  spinProj = 0,
const int  refl = 0,
const TVector3 &  momentum = TVector3() 
)
particle::particle ( const std::string &  partName,
const int  isospin,
const int  G,
const int  J,
const int  P,
const int  C,
const int  spinProj,
const int  refl = 0,
const int  index = -1 
)

Definition at line 97 of file amplitude/particle.cc.

particle::~particle ( )
virtual

Definition at line 113 of file amplitude/particle.cc.

Member Function Documentation

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

adds decay channel into list of allowed decay modes

Definition at line 137 of file particleProperties.h.

References rpwa::particleProperties::_decayModes.

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

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

returns antiparticle name w/o charge

Definition at line 106 of file particleProperties.h.

References rpwa::particleProperties::_antiPartName.

std::string rpwa::particleProperties::antiPartName ( ) const
inlineinherited
particleProperties particleProperties::antiPartProperties ( const bool  convertDecaysModes = false) const
inherited

constructs antiparticle properties from particle

Definition at line 292 of file particleProperties.cc.

References rpwa::particleProperties::_antiPartName, rpwa::particleProperties::_baryonNmb, rpwa::particleProperties::_beauty, rpwa::particleProperties::_C, rpwa::particleProperties::_charge, rpwa::particleProperties::_charm, rpwa::particleProperties::decayMode::_daughters, rpwa::particleProperties::_decayModes, rpwa::particleProperties::_G, rpwa::particleProperties::_isospin, rpwa::particleProperties::_J, rpwa::particleProperties::_mass, rpwa::particleProperties::_name, rpwa::particleProperties::_P, rpwa::particleProperties::_strangeness, rpwa::particleProperties::_width, rpwa::particleProperties::addDecayMode(), rpwa::particleProperties::antiPartName(), rpwa::particleProperties::deleteDecayModes(), rpwa::particleProperties::fillFromDataTable(), i, rpwa::particleProperties::isItsOwnAntiPart(), rpwa::particleProperties::nmbDecays(), rpwa::particleProperties::setAntiPartName(), rpwa::particleProperties::setBaryonNmb(), rpwa::particleProperties::setBeauty(), rpwa::particleProperties::setC(), rpwa::particleProperties::setCharge(), rpwa::particleProperties::setCharm(), rpwa::particleProperties::setG(), rpwa::particleProperties::setIsospin(), rpwa::particleProperties::setJ(), rpwa::particleProperties::setMass(), rpwa::particleProperties::setName(), rpwa::particleProperties::setP(), rpwa::particleProperties::setStrangeness(), and rpwa::particleProperties::setWidth().

Referenced by main(), and rpwa::particleDataTable::read().

std::string rpwa::particleProperties::bareName ( ) const
inlineinherited

returns particle name w/o charge

Definition at line 104 of file particleProperties.h.

References rpwa::particleProperties::_name.

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

string particleProperties::bareNameLaTeX ( ) const
inherited

returns particle name w/o charge in LaTeX markup

Definition at line 338 of file particleProperties.cc.

int rpwa::particleProperties::baryonNmb ( ) const
inlineinherited
int rpwa::particleProperties::beauty ( ) const
inlineinherited
int rpwa::particleProperties::C ( ) const
inlineinherited
int rpwa::particleProperties::charge ( ) const
inlineinherited
string particleProperties::chargeFromName ( const std::string &  name,
int charge 
)
staticinherited

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 rpwa::particleProperties::setName(), and rpwa::particleProperties::stripChargeFromName().

int rpwa::particleProperties::charm ( ) const
inlineinherited
particlePtr rpwa::particle::clone ( ) const
inline

creates deep copy of particle; must not be virtual

Definition at line 89 of file amplitude/particle.h.

References doClone().

static bool rpwa::particle::debug ( )
inlinestatic

returns debug flag

Reimplemented from rpwa::particleProperties.

Definition at line 118 of file amplitude/particle.h.

References _debug.

Referenced by setDebug().

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

returns decay modes defined for this particle

Definition at line 134 of file particleProperties.h.

References rpwa::particleProperties::_decayModes.

Referenced by main().

void rpwa::particleProperties::deleteDecayModes ( )
inlineinherited

deletes all decay modes

Definition at line 138 of file particleProperties.h.

References rpwa::particleProperties::_decayModes.

Referenced by rpwa::particleProperties::antiPartProperties().

particle * particle::doClone ( ) const
protectedvirtual

helper function to use covariant return types with smart pointers; needed for public clone()

Definition at line 132 of file amplitude/particle.cc.

References _debug, and particle().

Referenced by clone().

ostream & particleProperties::dump ( std::ostream &  out) const
virtualinherited
bool particleProperties::fillFromDataTable ( const std::string &  name,
const bool  warnIfNotExistent = true 
)
inherited
int rpwa::particleProperties::G ( ) const
inlineinherited
unsigned int particleProperties::geantId ( ) const
inherited

returns particle's Geant ID.

Definition at line 220 of file particleProperties.cc.

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

bool particleProperties::hasDecay ( const decayMode decay) const
inherited

returns whether given decay mode is in list of decays

Definition at line 234 of file particleProperties.cc.

References rpwa::particleProperties::_decayModes.

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

int rpwa::particle::index ( ) const
inline

returns index label assigned to particle; -1 means undefined

Definition at line 94 of file amplitude/particle.h.

References _index.

Referenced by isEqualTo(), and setIndex().

bool rpwa::particleProperties::isBaryon ( ) const
inlineinherited
bool particle::isEqualTo ( const particleProperties partProp) const
protectedvirtual

returns whether partProp is equal to this by checking equality of all member variables (except Lorentz-vector)

Reimplemented from rpwa::particleProperties.

Definition at line 142 of file amplitude/particle.cc.

References index(), rpwa::particleProperties::isEqualTo(), reflectivity(), and spinProj().

bool rpwa::particleProperties::isItsOwnAntiPart ( ) const
inlineinherited
bool rpwa::particleProperties::isLepton ( ) const
inlineinherited
bool rpwa::particleProperties::isMeson ( ) const
inlineinherited
int rpwa::particleProperties::isospin ( ) const
inlineinherited
int rpwa::particleProperties::isospinProj ( ) const
inlineinherited
bool rpwa::particleProperties::isPhoton ( ) const
inlineinherited
bool particleProperties::isSpinExotic ( ) const
inherited
bool rpwa::particleProperties::isXParticle ( ) const
inlineinherited

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

Definition at line 233 of file particleProperties.h.

References rpwa::particleProperties::_name.

int rpwa::particleProperties::J ( ) const
inlineinherited
string particle::label ( ) const
virtual
const TLorentzVector& rpwa::particle::lzVec ( ) const
inline

returns Lorentz vector of particle

Definition at line 93 of file amplitude/particle.h.

References _lzVec.

Referenced by setLzVec().

double rpwa::particleProperties::mass ( ) const
inlineinherited
double rpwa::particleProperties::mass2 ( ) const
inlineinherited

returns particle mass squared

Definition at line 109 of file particleProperties.h.

References rpwa::particleProperties::_mass2.

Referenced by rpwa::particleProperties::dump().

TVector3 rpwa::particle::momentum ( ) const
inline

returns three-momentum of particle

Definition at line 92 of file amplitude/particle.h.

References _lzVec.

std::string rpwa::particleProperties::name ( ) const
inlineinherited
string particleProperties::nameWithCharge ( const std::string &  bareName,
const int  charge 
)
staticinherited

appends charge information to bare particle name

Definition at line 507 of file particleProperties.cc.

References rpwa::particleProperties::bareName(), rpwa::particleProperties::name(), and q().

Referenced by rpwa::particleProperties::antiPartName(), and rpwa::particleProperties::name().

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

returns number of decay modes defined for this particle

Definition at line 135 of file particleProperties.h.

References rpwa::particleProperties::_decayModes.

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

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

Definition at line 95 of file particleProperties.h.

particle & particle::operator= ( const particle part)

Definition at line 118 of file amplitude/particle.cc.

References _index, _lzVec, _refl, and _spinProj.

Referenced by setProperties().

bool rpwa::particleProperties::operator== ( const particleProperties rhsProp) const
inlineinherited

Definition at line 94 of file particleProperties.h.

References rpwa::particleProperties::isEqualTo().

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

prints particle parameters in human-readable form

Reimplemented from rpwa::particleProperties.

Definition at line 175 of file amplitude/particle.cc.

References _index, _lzVec, _refl, and _spinProj.

Referenced by compareAmplitudes(), and rpwa::operator<<().

string particle::qnSummary ( ) const
virtual
bool particleProperties::read ( std::istringstream &  line)
inherited
int rpwa::particle::reflectivity ( ) const
inline
void rpwa::particleProperties::setAntiPartName ( const std::string &  name)
inlineinherited
void rpwa::particleProperties::setBaryonNmb ( const int  baryonNmb)
inlineinherited
void rpwa::particleProperties::setBeauty ( const int  beauty)
inlineinherited
void rpwa::particleProperties::setC ( const int  C)
inlineinherited
void rpwa::particleProperties::setCharge ( const int  charge)
inlineinherited

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

Definition at line 303 of file particleProperties.h.

References rpwa::particleProperties::_charge, and rpwa::particleProperties::charge().

Referenced by rpwa::particleProperties::antiPartProperties(), and rpwa::particleProperties::setName().

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

sets debug flag

Reimplemented from rpwa::particleProperties.

Definition at line 119 of file amplitude/particle.h.

References _debug, and debug().

void rpwa::particleProperties::setG ( const int  G)
inlineinherited
void particleProperties::setIGJPC ( const int  isospin,
const int  G,
const int  J,
const int  P,
const int  C 
)
inherited
void rpwa::particle::setIndex ( const int  index)
inline

sets particle's index label

Definition at line 100 of file amplitude/particle.h.

References _index, and index().

void rpwa::particleProperties::setIsospin ( const int  isospin)
inlineinherited
void rpwa::particleProperties::setIsospinProj ( const int  isospinProj)
inlineinherited
void rpwa::particleProperties::setJ ( const int  J)
inlineinherited
void rpwa::particle::setLzVec ( const TLorentzVector &  lzVec)
inline

sets particle's Lorentz vector; if this is used to inject external data the mass values likely become inconsistent

Definition at line 99 of file amplitude/particle.h.

References _lzVec, and lzVec().

void rpwa::particleProperties::setMass ( const double  mass)
inlineinherited
void rpwa::particle::setMomentum ( const TVector3 &  momentum)
inline

sets particle's Lorentz vector

Definition at line 98 of file amplitude/particle.h.

References _lzVec, and rpwa::particleProperties::mass().

void rpwa::particleProperties::setName ( const std::string &  name)
inlineinherited
void rpwa::particleProperties::setP ( const int  P)
inlineinherited
void particle::setProperties ( const particleProperties prop)

sets particle's poperties to those given by argument

Definition at line 156 of file amplitude/particle.cc.

References operator=().

void rpwa::particle::setReflectivity ( const int  refl)
inline

sets particle's reflectivity

Definition at line 101 of file amplitude/particle.h.

References _refl.

void particleProperties::setSCB ( const int  strangeness,
const int  charm,
const int  beauty 
)
inherited
void rpwa::particle::setSpinProj ( const int  spinProj)
inline

sets particle's spin projection quantum number

Definition at line 97 of file amplitude/particle.h.

References _spinProj, and spinProj().

Referenced by main().

void rpwa::particleProperties::setStrangeness ( const int  strangeness)
inlineinherited
void rpwa::particleProperties::setWidth ( const double  width)
inlineinherited
int rpwa::particle::spinProj ( ) const
inline
int rpwa::particleProperties::strangeness ( ) const
inlineinherited
string particleProperties::stripChargeFromName ( const std::string &  name)
staticinherited

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 rpwa::particleProperties::chargeFromName().

Referenced by rpwa::particleProperties::fillFromDataTable(), and rpwa::particleProperties::setAntiPartName().

const TLorentzVector& rpwa::particle::transform ( const TLorentzRotation &  L)
inline

applies Lorentz-transformation to particle

Definition at line 105 of file amplitude/particle.h.

References _lzVec.

const TLorentzVector& rpwa::particle::transform ( const TVector3 &  boost)
inline
Parameters
boostapplies Lorentz-boost to particle

Definition at line 106 of file amplitude/particle.h.

References _lzVec.

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

Member Data Documentation

bool particle::_debug = false
staticprivate

if set to true, debug messages are printed

Definition at line 135 of file amplitude/particle.h.

Referenced by debug(), doClone(), and setDebug().

int rpwa::particle::_index
private

index that can be used to label indistinguishable particles

Definition at line 132 of file amplitude/particle.h.

Referenced by index(), operator=(), print(), and setIndex().

TLorentzVector rpwa::particle::_lzVec
private

Lorentz vector [GeV].

Definition at line 131 of file amplitude/particle.h.

Referenced by lzVec(), momentum(), operator=(), particle(), print(), setLzVec(), setMomentum(), and transform().

int rpwa::particle::_refl
private

reflectivity

Definition at line 133 of file amplitude/particle.h.

Referenced by operator=(), print(), reflectivity(), and setReflectivity().

int rpwa::particle::_spinProj
private

spin projection quantum number; can be either M or helicity

Definition at line 130 of file amplitude/particle.h.

Referenced by operator=(), print(), setSpinProj(), and spinProj().


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