Particle Class Reference

A class for particles. More...

#include <Particle.h>

Inheritance diagram for Particle:
[legend]

Detailed Description

A class for particles.

Author
HEPfit Collaboration

This is the class for defining particles and their properties like mass (GeV), width (GeV), charge, isospin. One can also specify the scale, in GeV, at which the mass of a particle is defined.

Definition at line 26 of file Particle.h.

Public Member Functions

double getCharge () const
 A get method to access the particle charge. More...
 
int getIndex () const
 
double getIsospin () const
 A get method to access the particle isospin. More...
 
const double & getMass () const
 A get method to access the particle mass. More...
 
double getMass_scale () const
 A get method to access the scale at which the particle mass is defined. More...
 
std::string getName () const
 
const double & getWidth () const
 A get method to access the particle width. More...
 
bool is (std::string name_i) const
 
 Particle ()
 The default constructor. More...
 
 Particle (std::string name, double mass, double mass_scale=0., double width=0., double charge=0., double isospin=0.)
 Constructor. More...
 
void setCharge (double charge)
 A set method to fix the particle charge. More...
 
void setIsospin (double isospin)
 A set method to fix the particle isospin. More...
 
void setMass (double mass)
 A set method to fix the particle mass. More...
 
void setMass_scale (double mass_scale)
 A set method to fix the scale at which the particle mass is defined. More...
 
void setName (std::string name)
 
void setWidth (double width)
 A set method to fix the particle width. More...
 
virtual ~Particle ()
 

Protected Member Functions

void setIndex ()
 

Protected Attributes

double charge
 The particle charge. More...
 
int index
 The index of the particle. More...
 
double isospin
 The particle isospin. More...
 
double mass
 The particle mass in GeV. More...
 
double mass_scale
 The scale in GeV at which the particle mass is defined. More...
 
std::string name
 The particle name. More...
 
double width
 The particle width in GeV. More...
 

Constructor & Destructor Documentation

Particle::Particle ( )
inline

The default constructor.

Definition at line 33 of file Particle.h.

34  {
35  name = "";
36  mass = 0.;
37  mass_scale = 0.;
38  width = 0.;
39  charge = 0.;
40  isospin = 0.;
41  setIndex();
42  };
double charge
The particle charge.
Definition: Particle.h:168
double width
The particle width in GeV.
Definition: Particle.h:167
double isospin
The particle isospin.
Definition: Particle.h:170
std::string name
The particle name.
Definition: Particle.h:171
double mass
The particle mass in GeV.
Definition: Particle.h:166
void setIndex()
Definition: Particle.cpp:40
double mass_scale
The scale in GeV at which the particle mass is defined.
Definition: Particle.h:169
Particle::Particle ( std::string  name,
double  mass,
double  mass_scale = 0.,
double  width = 0.,
double  charge = 0.,
double  isospin = 0. 
)

Constructor.

The properties of the particle can be initialized by passing arguments.

Parameters
[in]namethe name of the particle
[in]massthe mass of the particle in GeV
[in]mass_scalethe scale in GeV at which the mass is defined, set to 0 by default
[in]widththe decay width of the particle in GeV, set to 0 by default
[in]chargethe charge of the particle, set to 0 by default
[in]isospinthe isospin of the particle, set to 0 by default

Definition at line 12 of file Particle.cpp.

13 {
14  this->name = name;
15  this->mass = mass;
16  this->width = width;
17  this->charge = charge;
18  this->isospin = isospin;
19  this->mass_scale = mass_scale;
20  setIndex();
21 }
double charge
The particle charge.
Definition: Particle.h:168
double width
The particle width in GeV.
Definition: Particle.h:167
double isospin
The particle isospin.
Definition: Particle.h:170
std::string name
The particle name.
Definition: Particle.h:171
double mass
The particle mass in GeV.
Definition: Particle.h:166
void setIndex()
Definition: Particle.cpp:40
double mass_scale
The scale in GeV at which the particle mass is defined.
Definition: Particle.h:169
virtual Particle::~Particle ( )
inlinevirtual

Definition at line 56 of file Particle.h.

56 {};

Member Function Documentation

double Particle::getCharge ( ) const
inline

A get method to access the particle charge.

Returns
the particle charge

Definition at line 97 of file Particle.h.

98  {
99  return charge;
100  }
double charge
The particle charge.
Definition: Particle.h:168
int Particle::getIndex ( ) const
inline

Definition at line 160 of file Particle.h.

161  {
162  return index;
163  }
int index
The index of the particle.
Definition: Particle.h:172
double Particle::getIsospin ( ) const
inline

A get method to access the particle isospin.

Returns
the particle isospin

Definition at line 115 of file Particle.h.

116  {
117  return isospin;
118  }
double isospin
The particle isospin.
Definition: Particle.h:170
const double& Particle::getMass ( ) const
inline

A get method to access the particle mass.

Returns
the particle mass in GeV

Definition at line 61 of file Particle.h.

62  {
63  return mass;
64  }
double mass
The particle mass in GeV.
Definition: Particle.h:166
double Particle::getMass_scale ( ) const
inline

A get method to access the scale at which the particle mass is defined.

Returns
the scale in GeV at which the particle mass is defined

Definition at line 133 of file Particle.h.

134  {
135  return mass_scale;
136  }
double mass_scale
The scale in GeV at which the particle mass is defined.
Definition: Particle.h:169
std::string Particle::getName ( ) const
inline

Definition at line 147 of file Particle.h.

148  {
149  return name;
150  }
std::string name
The particle name.
Definition: Particle.h:171
const double& Particle::getWidth ( ) const
inline

A get method to access the particle width.

Returns
the particle width in GeV

Definition at line 79 of file Particle.h.

80  {
81  return width;
82  }
double width
The particle width in GeV.
Definition: Particle.h:167
bool Particle::is ( std::string  name_i) const

Definition at line 23 of file Particle.cpp.

24 {
25  if (name_i.compare("LEPTON") == 0) {
26  if (index >= 0 && index <= 5)
27  return true;
28  else
29  return false;
30  }
31  if (name_i.compare("QUARK") == 0) {
32  if (index >= 6 && index <= 11)
33  return true;
34  else
35  return false;
36  }
37  return (name.compare(name_i) == 0);
38 }
std::string name
The particle name.
Definition: Particle.h:171
int index
The index of the particle.
Definition: Particle.h:172
void Particle::setCharge ( double  charge)
inline

A set method to fix the particle charge.

Parameters
[in]chargethe particle charge

Definition at line 106 of file Particle.h.

107  {
108  this->charge = charge;
109  }
double charge
The particle charge.
Definition: Particle.h:168
void Particle::setIndex ( )
protected

Definition at line 40 of file Particle.cpp.

41 {
42  if (name.compare("NEUTRINO_1") == 0)
43  index = 0;
44  else if (name.compare("NEUTRINO_2") == 0)
45  index = 2;
46  else if (name.compare("NEUTRINO_3") == 0)
47  index = 4;
48  else if (name.compare("ELECTRON") == 0)
49  index = 1;
50  else if (name.compare("MU") == 0)
51  index = 3;
52  else if (name.compare("TAU") == 0)
53  index = 5;
54  else if (name.compare("UP") == 0)
55  index = 6;
56  else if (name.compare("CHARM") == 0)
57  index = 8;
58  else if (name.compare("TOP") == 0)
59  index = 10;
60  else if (name.compare("DOWN") == 0)
61  index = 7;
62  else if (name.compare("STRANGE") == 0)
63  index = 9;
64  else if (name.compare("BOTTOM") == 0)
65  index = 11;
66  else
67  index = -1;
68 }
std::string name
The particle name.
Definition: Particle.h:171
int index
The index of the particle.
Definition: Particle.h:172
void Particle::setIsospin ( double  isospin)
inline

A set method to fix the particle isospin.

Parameters
[in]isospinthe particle isospin

Definition at line 124 of file Particle.h.

125  {
126  this->isospin = isospin;
127  }
double isospin
The particle isospin.
Definition: Particle.h:170
void Particle::setMass ( double  mass)
inline

A set method to fix the particle mass.

Parameters
[in]massthe particle mass in GeV

Definition at line 70 of file Particle.h.

71  {
72  this->mass = mass;
73  }
double mass
The particle mass in GeV.
Definition: Particle.h:166
void Particle::setMass_scale ( double  mass_scale)
inline

A set method to fix the scale at which the particle mass is defined.

Parameters
[in]mass_scalethe scale in GeV at which the particle mass is defined

Definition at line 142 of file Particle.h.

143  {
144  this->mass_scale = mass_scale;
145  }
double mass_scale
The scale in GeV at which the particle mass is defined.
Definition: Particle.h:169
void Particle::setName ( std::string  name)
inline

Definition at line 152 of file Particle.h.

153  {
154  this->name = name;
155  setIndex();
156  }
std::string name
The particle name.
Definition: Particle.h:171
void setIndex()
Definition: Particle.cpp:40
void Particle::setWidth ( double  width)
inline

A set method to fix the particle width.

Parameters
[in]widththe particle width in GeV

Definition at line 88 of file Particle.h.

89  {
90  this->width = width;
91  }
double width
The particle width in GeV.
Definition: Particle.h:167

Member Data Documentation

double Particle::charge
protected

The particle charge.

Definition at line 168 of file Particle.h.

int Particle::index
protected

The index of the particle.

Definition at line 172 of file Particle.h.

double Particle::isospin
protected

The particle isospin.

Definition at line 170 of file Particle.h.

double Particle::mass
protected

The particle mass in GeV.

Definition at line 166 of file Particle.h.

double Particle::mass_scale
protected

The scale in GeV at which the particle mass is defined.

Definition at line 169 of file Particle.h.

std::string Particle::name
protected

The particle name.

Definition at line 171 of file Particle.h.

double Particle::width
protected

The particle width in GeV.

Definition at line 167 of file Particle.h.


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