Garfield++ v2r0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
Heed::particle_def Class Reference

#include <particle_def.h>

+ Inheritance diagram for Heed::particle_def:

Public Member Functions

 particle_def ()
 
 particle_def (const std::string &fname, const std::string &fnotation, double fmass, double fcharge, int flepton_n, int fbarion_n, float fspin, const spin_def &fisospin)
 
 particle_def (const std::string &fname, const std::string &fnotation, double fmass, double fcharge, int flepton_n, int fbarion_n, float fspin, float fisospin_total, float fisospin_proj)
 
 particle_def (const particle_def &f)
 
particle_def anti_particle (const particle_def &p)
 Function for making an anti-particle.
 
 particle_def (const std::string &fname, const std::string &fnotation, particle_def &p)
 Create anti-particle through the call of anti_particle(p)
 
 ~particle_def ()
 
void print (std::ostream &file, int l) const
 
void set_mass (const double m)
 
void set_charge (const double z)
 
void verify ()
 Check that there is no particle with the same name in the container.
 
- Public Member Functions inherited from Heed::RegPassivePtr
 RegPassivePtr (void)
 
 RegPassivePtr (char fs_ban_del, char fs_ban_sub, char fs_ban_cop=0)
 
 RegPassivePtr (const RegPassivePtr &f)
 
RegPassivePtroperator= (const RegPassivePtr &f)
 
CountPP_ns::CountPassivePtrbook (void) const
 
void clear_pointers (void) const
 
virtual RegPassivePtrcopy () const
 
virtual ~RegPassivePtr ()
 
virtual void print (std::ostream &file, int l=1) const
 
void set_s_ban_del (char fs_ban_del)
 
char get_s_ban_del (void) const
 
void set_s_ban_sub (char fs_ban_sub)
 
char get_s_ban_sub (void) const
 
void set_s_ban_cop (char fs_ban_cop)
 
char get_s_ban_cop (void) const
 
void set_s_allow_del_at_zero_count (char fs_allow_del_at_zero_count)
 
char get_s_allow_del_at_zero_count (void) const
 
long get_total_number_of_references (void) const
 

Static Public Member Functions

static void printall (std::ostream &file)
 
static std::list< particle_def * > & get_logbook ()
 
static const std::list< particle_def * > & get_const_logbook ()
 
static particle_defget_particle_def (const std::string &fnotation)
 
- Static Public Member Functions inherited from Heed::RegPassivePtr
static void set_s_ban_del_ignore (char fs_ban_del_ignore)
 
static char get_s_ban_del_ignore (void)
 
static void set_s_print_adr_cpp (char fs_print_adr_cpp)
 
static char get_s_print_adr_cpp (void)
 

Public Attributes

std::string name
 
std::string notation
 Short name to make data summary files short.
 
double mass
 
double charge
 
int lepton_n
 
int baryon_n
 
float spin
 
spin_def isospin
 

Detailed Description

Definition of particles. Only the basic information: the name, the notation, the mass, the charge, and other auxiliary data.

The organization is similar to AtomDef from directory matter, with the exception that the internal data are not declared as private. Of course, the user should not change them.

The principle of definitions of particles is dictionary or a database: the particles are not repeated, each particle is presented in the total system no more than one time. The system knows each particle presented in it. The particle characteristics can be obtained by literal notation. The system declines the secondary initialization. The copying is not declined. When the user program wants to refer to particle, it has to use either char* (string) notation, or pointer (or reference) to one of these objects. As usually, in the case of pointers I recommend to use protected pointers to external objects PassivePtr. The user pogram can initialize the new particles. The standard particles are initiated right here, below.

1999 - 2004, I. Smirnov

Definition at line 45 of file particle_def.h.

Constructor & Destructor Documentation

◆ particle_def() [1/5]

Heed::particle_def::particle_def ( )
inline

Definition at line 57 of file particle_def.h.

58 : name("none"),
59 notation("none"),
60 mass(0),
61 charge(0),
62 lepton_n(0),
63 baryon_n(0),
64 spin(0),
65 isospin(0, 0) {
66 particle_def::get_logbook().push_back(this);
67 }
std::string name
Definition: particle_def.h:47
static std::list< particle_def * > & get_logbook()
std::string notation
Short name to make data summary files short.
Definition: particle_def.h:49

Referenced by anti_particle(), and particle_def().

◆ particle_def() [2/5]

Heed::particle_def::particle_def ( const std::string &  fname,
const std::string &  fnotation,
double  fmass,
double  fcharge,
int  flepton_n,
int  fbarion_n,
float  fspin,
const spin_def fisospin 
)

Definition at line 78 of file particle_def.cpp.

81 {
82 name = fname;
83 notation = fnotation;
84 mass = fmass;
85 charge = fcharge;
86 baryon_n = fbaryon_n;
87 lepton_n = flepton_n;
88 spin = fspin;
89 isospin = fisospin;
90 verify();
91 particle_def::get_logbook().push_back(this);
92}
void verify()
Check that there is no particle with the same name in the container.
Definition: particle_def.h:106

◆ particle_def() [3/5]

Heed::particle_def::particle_def ( const std::string &  fname,
const std::string &  fnotation,
double  fmass,
double  fcharge,
int  flepton_n,
int  fbarion_n,
float  fspin,
float  fisospin_total,
float  fisospin_proj 
)
inline

Definition at line 71 of file particle_def.h.

73 {
74 *this = particle_def(fname, fnotation, fmass, fcharge, flepton_n, fbarion_n,
75 fspin, spin_def(fisospin_total, fisospin_proj));
76 }

◆ particle_def() [4/5]

Heed::particle_def::particle_def ( const particle_def f)
inline

Definition at line 78 of file particle_def.h.

78 : RegPassivePtr() {
79 *this = f;
80 verify();
81 particle_def::get_logbook().push_back(this);
82 }
RegPassivePtr(void)
Definition: AbsPtr.h:651

◆ particle_def() [5/5]

Heed::particle_def::particle_def ( const std::string &  fname,
const std::string &  fnotation,
particle_def p 
)

Create anti-particle through the call of anti_particle(p)

Definition at line 94 of file particle_def.cpp.

95 {
96 // creates anti-particle through the call of anti_particle(p)
97 *this = anti_particle(p);
98 // if(strlen(fname) > 0)
99 // strcpy(name,fname);
100 if (!(fname == "" || fname == " ")) name = fname;
101 if (!(fnotation == "" || fnotation == " ")) notation = fnotation;
102 verify();
103 particle_def::get_logbook().push_back(this);
104}
particle_def anti_particle(const particle_def &p)
Function for making an anti-particle.

◆ ~particle_def()

Heed::particle_def::~particle_def ( )
inline

Definition at line 90 of file particle_def.h.

90{ particle_def::get_logbook().remove(this); }

Member Function Documentation

◆ anti_particle()

particle_def Heed::particle_def::anti_particle ( const particle_def p)

Function for making an anti-particle.

Definition at line 106 of file particle_def.cpp.

106 {
107 std::string aname = "anti-" + p.name;
108 std::string anot = "anti-" + p.notation;
109 return particle_def(aname, anot, p.mass, -p.charge, -p.lepton_n, -p.baryon_n,
110 -p.spin, p.isospin);
111}

Referenced by particle_def().

◆ get_const_logbook()

const std::list< particle_def * > & Heed::particle_def::get_const_logbook ( )
static

Definition at line 117 of file particle_def.cpp.

117 {
119}

◆ get_logbook()

std::list< particle_def * > & Heed::particle_def::get_logbook ( )
static

Initialize the logbook at the first request and keep it as internal static variable.

Definition at line 112 of file particle_def.cpp.

112 {
113 static std::list<particle_def*> logbook;
114 return logbook;
115}

Referenced by get_const_logbook(), get_particle_def(), particle_def(), Heed::particle_type::particle_type(), printall(), and ~particle_def().

◆ get_particle_def()

particle_def * Heed::particle_def::get_particle_def ( const std::string &  fnotation)
static

Return the address of particle with this name if it is registered in system, or NULL otherwise.

Definition at line 121 of file particle_def.cpp.

121 {
122 std::list<particle_def*>& logbook = particle_def::get_logbook();
123 std::list<particle_def*>::iterator it;
124 std::list<particle_def*>::const_iterator end = logbook.end();
125 for (it = logbook.begin(); it != end; ++it) {
126 particle_def* node = *it;
127 if (!node) continue;
128 if (node->notation == fnotation) return node;
129 }
130 return NULL;
131}

◆ print()

void Heed::particle_def::print ( std::ostream &  file,
int  l 
) const
virtual

Reimplemented from Heed::RegPassivePtr.

Definition at line 137 of file particle_def.cpp.

137 {
138 if (l > 0) file << (*this);
139}

◆ printall()

void Heed::particle_def::printall ( std::ostream &  file)
static

Definition at line 140 of file particle_def.cpp.

140 {
141 Ifile << "particle_def::printall:\n";
142 std::list<particle_def*>& logbook = particle_def::get_logbook();
143 std::list<particle_def*>::const_iterator it;
144 std::list<particle_def*>::const_iterator end;
145 for (it = logbook.begin(); it != end; ++it) {
146 if (*it) file << *it;
147 }
148}
#define Ifile
Definition: prstream.h:196

◆ set_charge()

void Heed::particle_def::set_charge ( const double  z)

Definition at line 135 of file particle_def.cpp.

135{ charge = z * eplus; }

Referenced by Garfield::TrackHeed::NewTrack().

◆ set_mass()

void Heed::particle_def::set_mass ( const double  m)

Definition at line 133 of file particle_def.cpp.

133{ mass = m * MeV / c_squared; }

Referenced by Garfield::TrackHeed::NewTrack().

◆ verify()

void Heed::particle_def::verify ( )
inline

Check that there is no particle with the same name in the container.

Definition at line 106 of file particle_def.h.

106{};

Referenced by particle_def().

Member Data Documentation

◆ baryon_n

int Heed::particle_def::baryon_n

Definition at line 54 of file particle_def.h.

Referenced by anti_particle(), Heed::operator<<(), and particle_def().

◆ charge

double Heed::particle_def::charge

Definition at line 51 of file particle_def.h.

Referenced by anti_particle(), Heed::operator<<(), particle_def(), and set_charge().

◆ isospin

spin_def Heed::particle_def::isospin

Definition at line 56 of file particle_def.h.

Referenced by anti_particle(), Heed::operator<<(), and particle_def().

◆ lepton_n

int Heed::particle_def::lepton_n

Definition at line 53 of file particle_def.h.

Referenced by anti_particle(), Heed::operator<<(), and particle_def().

◆ mass

double Heed::particle_def::mass

◆ name

std::string Heed::particle_def::name

Definition at line 47 of file particle_def.h.

Referenced by anti_particle(), Heed::operator<<(), and particle_def().

◆ notation

std::string Heed::particle_def::notation

Short name to make data summary files short.

Definition at line 49 of file particle_def.h.

Referenced by anti_particle(), get_particle_def(), Heed::operator<<(), and particle_def().

◆ spin

float Heed::particle_def::spin

Definition at line 55 of file particle_def.h.

Referenced by anti_particle(), Heed::operator<<(), and particle_def().


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