/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Public Member Functions | Protected Member Functions | Static Protected Member Functions | Private Attributes | Static Private Attributes | Friends
HepMC::ParticleData Class Reference

an example ParticleData class More...

#include <ParticleData.h>

List of all members.

Public Member Functions

 ParticleData (std::string name, int id, double charge, double mass=0, double cLifetime=-1, double spin=0)
 constructor requiring name, ID, and charge
 ParticleData (const char *name, int id, double charge, double mass=0, double cLifetime=-1, double spin=0)
 constructor requiring name, ID, and charge
virtual ~ParticleData ()
bool operator== (const ParticleData &) const
 equality
bool operator!= (const ParticleData &) const
 inequality
void print (std::ostream &ostr=std::cout) const
 write particle data information to ostr
bool is_lepton () const
 true if charged lepton /neutrino
bool is_charged_lepton () const
 true if a charged lepton
bool is_em () const
 true if an electron or photon
bool is_neutrino () const
 true if a neutrino
bool is_hadron () const
 true if a hadron
bool is_boson () const
 true if a gauge or higgs boson
std::string name () const
 description of the particle according to PDG, i.e. "Delta(1900) S_31"
int pdg_id () const
 PDG ID number.
double charge () const
 charge
double mass () const
 nominal mass
double width () const
 width as calculated from clifetime
double clifetime () const
 lifetime in mm
double spin () const
 J spin.
void set_charge (double)
 set charge
void set_mass (double)
 set nominal mass
void set_width (double)
 set width
void set_clifetime (double)
 set lifetime in mm
void set_spin (double)
 set J spin

Protected Member Functions

int model_independent_pdg_id_ () const
 omits susy/excited/technicolor digit from returned ID

Static Protected Member Functions

static unsigned int counter ()
 num ParticleData objects in memory

Private Attributes

std::string m_name
int m_pdg_id
int m_3charge
double m_mass
double m_clifetime
unsigned char m_2spin

Static Private Attributes

static unsigned int s_counter

Friends

std::ostream & operator<< (std::ostream &, const ParticleData &)

Detailed Description

an example ParticleData class

Particle Data common to all particles of a given PDG id

Definition at line 69 of file ParticleData.h.


Constructor & Destructor Documentation

HepMC::ParticleData::ParticleData ( std::string  name,
int  id,
double  charge,
double  mass = 0,
double  cLifetime = -1,
double  spin = 0 
)

constructor requiring name, ID, and charge

HepMC::ParticleData::ParticleData ( const char *  name,
int  id,
double  charge,
double  mass = 0,
double  cLifetime = -1,
double  spin = 0 
)

constructor requiring name, ID, and charge

virtual HepMC::ParticleData::~ParticleData ( ) [virtual]

Member Function Documentation

bool HepMC::ParticleData::operator== ( const ParticleData a) const [inline]

equality

Definition at line 213 of file ParticleData.h.

                                                                      {
        // compares everything except the particle's name
        return ( a.m_pdg_id != m_pdg_id ||
                 a.m_mass != m_mass ||
                 a.m_clifetime != m_clifetime ||
                 a.m_3charge != m_3charge ||
                 a.m_2spin != m_2spin            ) ? 0 : 1;
    }
bool HepMC::ParticleData::operator!= ( const ParticleData a) const [inline]

inequality

Definition at line 222 of file ParticleData.h.

                                                                      {
        // compares everything except the particle's name
        return ( a.pdg_id() != this->pdg_id() );
    }
void HepMC::ParticleData::print ( std::ostream &  ostr = std::cout) const

write particle data information to ostr

bool HepMC::ParticleData::is_lepton ( ) const [inline]

true if charged lepton /neutrino

true if a charged lepton or neutrino --> | 11,13,15,12,14,16,17,18 |

Definition at line 142 of file ParticleData.h.

                                              {
        return ( abs(pdg_id()) >=11 &&  abs(pdg_id()) <= 18 );
    }
bool HepMC::ParticleData::is_charged_lepton ( ) const [inline]

true if a charged lepton

true if a charged lepton --> | 11,13,15 |

Definition at line 146 of file ParticleData.h.

                                                      {
        return ( is_lepton() && abs(pdg_id())%2==1 );
    }
bool HepMC::ParticleData::is_em ( ) const [inline]

true if an electron or photon

true if an electron or photon --> | 11, 22 |

Definition at line 154 of file ParticleData.h.

                                          {
        return ( abs(pdg_id()) == 11 || abs(pdg_id()) == 22 );
    }
bool HepMC::ParticleData::is_neutrino ( ) const [inline]

true if a neutrino

true if a neutrino --> | 12,14,16 |

Definition at line 150 of file ParticleData.h.

                                                {
        return ( is_lepton() && abs(pdg_id())%2==0 );
    }
bool HepMC::ParticleData::is_hadron ( ) const [inline]

true if a hadron

true if a hadron --> q,g,meson,baryon

Definition at line 158 of file ParticleData.h.

                                              {
        return ( abs(pdg_id()) <= 9 || abs(pdg_id()) == 21 
                 || abs(pdg_id()) >100 );
    }
bool HepMC::ParticleData::is_boson ( ) const [inline]

true if a gauge or higgs boson

true if a gauge or higgs boson --> | 9, 21-39 |

Definition at line 163 of file ParticleData.h.

                                             {
        return ( ( abs(pdg_id()) >20 && abs(pdg_id()) <=40 )
                 || abs(pdg_id()) == 9 );
    }
std::string HepMC::ParticleData::name ( ) const [inline]

description of the particle according to PDG, i.e. "Delta(1900) S_31"

Definition at line 173 of file ParticleData.h.

{ return m_name; }
int HepMC::ParticleData::pdg_id ( ) const [inline]

PDG ID number.

Definition at line 174 of file ParticleData.h.

{ return m_pdg_id; }
double HepMC::ParticleData::charge ( ) const [inline]

charge

Definition at line 175 of file ParticleData.h.

                                                  { 
        return ( (double)m_3charge )/3.; 
    }
double HepMC::ParticleData::mass ( ) const [inline]

nominal mass

Definition at line 178 of file ParticleData.h.

{ return m_mass; }
double HepMC::ParticleData::width ( ) const

width as calculated from clifetime

double HepMC::ParticleData::clifetime ( ) const [inline]

lifetime in mm

Definition at line 179 of file ParticleData.h.

{ return m_clifetime; }
double HepMC::ParticleData::spin ( ) const [inline]

J spin.

Definition at line 180 of file ParticleData.h.

{ return m_2spin/2.; }
void HepMC::ParticleData::set_charge ( double  charge) [inline]

set charge

Definition at line 181 of file ParticleData.h.

                                                               {
        if ( charge > 0 ) { 
            m_3charge = (int)(3.*charge+.1); 
        } else if ( charge < 0. ) { 
            m_3charge = (int)(3.*charge-.1); 
        } else { 
            m_3charge = 0; 
        }
    }
void HepMC::ParticleData::set_mass ( double  its_mass) [inline]

set nominal mass

Definition at line 190 of file ParticleData.h.

                                                               {
        m_mass = its_mass;
    }
void HepMC::ParticleData::set_width ( double  width) [inline]

set width

Definition at line 193 of file ParticleData.h.

                                                             {
        if ( width > 0 ) { 
            m_clifetime = HepMC_hbarc/width;
        } else if ( width == 0. ) { 
            m_clifetime = -1.;
        } else { 
            m_clifetime = 0.; 
        }
    }
void HepMC::ParticleData::set_clifetime ( double  its_clifetime) [inline]

set lifetime in mm

Definition at line 202 of file ParticleData.h.

                                                                         {
        m_clifetime = its_clifetime; 
    }
void HepMC::ParticleData::set_spin ( double  spin) [inline]

set J spin

Definition at line 205 of file ParticleData.h.

                                                           {
        m_2spin = (unsigned char)(2.*spin+.1);
    }
static unsigned int HepMC::ParticleData::counter ( ) [static, protected]

num ParticleData objects in memory

int HepMC::ParticleData::model_independent_pdg_id_ ( ) const [protected]

omits susy/excited/technicolor digit from returned ID


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  ,
const ParticleData  
) [friend]

Member Data Documentation

std::string HepMC::ParticleData::m_name [private]

Definition at line 127 of file ParticleData.h.

Definition at line 129 of file ParticleData.h.

Definition at line 130 of file ParticleData.h.

double HepMC::ParticleData::m_mass [private]

Definition at line 131 of file ParticleData.h.

Definition at line 132 of file ParticleData.h.

unsigned char HepMC::ParticleData::m_2spin [private]

Definition at line 133 of file ParticleData.h.

unsigned int HepMC::ParticleData::s_counter [static, private]

Definition at line 135 of file ParticleData.h.


The documentation for this class was generated from the following file:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 09:49:37 for HepMC by doxygen 1.7.4