Garfield++ v1r0
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 (void)
 
 particle_def (const String &fname, const String &fnotation, double fmass, double fcharge, int flepton_n, int fbarion_n, float fspin, const spin_def &fisospin)
 
 particle_def (const String &fname, const 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)
 
 particle_def (const String &fname, const String &fnotation, particle_def &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 (void)
 

Static Public Member Functions

static void printall (std::ostream &file)
 
static AbsList< particle_def * > & get_logbook (void)
 
static const AbsList< particle_def * > & get_const_logbook (void)
 
static particle_defget_particle_def (const String &fnotation)
 

Public Attributes

String name
 
String notation
 
double mass
 
double charge
 
int lepton_n
 
int barion_n
 
float spin
 
spin_def isospin
 

Detailed Description

Definition at line 57 of file particle_def.h.

Constructor & Destructor Documentation

◆ particle_def() [1/5]

Heed::particle_def::particle_def ( void  )
inline

Definition at line 69 of file particle_def.h.

70 : name("none"),
71 notation("none"),
72 mass(0),
73 charge(0),
74 lepton_n(0),
75 barion_n(0),
76 spin(0),
77 isospin(0, 0) {
78 particle_def::get_logbook().append(this);
79 }
static AbsList< particle_def * > & get_logbook(void)

Referenced by anti_particle(), and particle_def().

◆ particle_def() [2/5]

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

Definition at line 73 of file particle_def.cpp.

76 {
77 name = fname;
78 notation = fnotation;
79 //mcout<<"particle_def::particle_def: name="<<name<<'\n';
80 mass = fmass;
81 charge = fcharge;
82 barion_n = fbarion_n;
83 lepton_n = flepton_n;
84 spin = fspin;
85 isospin = fisospin;
86 verify();
87 particle_def::get_logbook().append(this);
88 //printall(mcout);
89}

◆ particle_def() [3/5]

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

Definition at line 83 of file particle_def.h.

85 {
86 *this = particle_def(fname, fnotation, fmass, fcharge, flepton_n, fbarion_n,
87 fspin, spin_def(fisospin_total, fisospin_proj));
88 }

◆ particle_def() [4/5]

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

Definition at line 90 of file particle_def.h.

90 : RegPassivePtr() {
91 *this = f;
92 verify();
93 particle_def::get_logbook().append(this);
94 }

◆ particle_def() [5/5]

Heed::particle_def::particle_def ( const String fname,
const String fnotation,
particle_def p 
)

Definition at line 91 of file particle_def.cpp.

92 {
93 // creates anti-particle through the call of anti_particle(p)
94 *this = anti_particle(p);
95 //if(strlen(fname) > 0)
96 //strcpy(name,fname);
97 if (!(fname == "" || fname == " ")) name = fname;
98 if (!(fnotation == "" || fnotation == " ")) notation = fnotation;
99 verify();
100 particle_def::get_logbook().append(this);
101}
particle_def anti_particle(const particle_def &p)

◆ ~particle_def()

Heed::particle_def::~particle_def ( )
inline

Definition at line 101 of file particle_def.h.

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

Member Function Documentation

◆ anti_particle()

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

Definition at line 103 of file particle_def.cpp.

103 {
104 String aname = String("anti-") + p.name;
105 String anot = String("anti-") + p.notation;
106 return particle_def(aname, anot, p.mass, -p.charge, -p.lepton_n, -p.barion_n,
107 -p.spin, p.isospin);
108}
std::string String
Definition: String.h:75

Referenced by particle_def().

◆ get_const_logbook()

const AbsList< particle_def * > & Heed::particle_def::get_const_logbook ( void  )
static

Definition at line 114 of file particle_def.cpp.

114 {
116}

◆ get_logbook()

AbsList< particle_def * > & Heed::particle_def::get_logbook ( void  )
static

Definition at line 109 of file particle_def.cpp.

109 {
110 static AbsList<particle_def*> logbook;
111 return logbook;
112}

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 String fnotation)
static

Definition at line 118 of file particle_def.cpp.

118 {
121 while ((an = logbook.get_next_node(an)) != NULL) {
122 if (an->el->notation == fnotation) return an->el;
123 }
124 return NULL;
125}
AbsListNode< T > * get_next_node(AbsListNode< T > *an) const
Definition: AbsList.h:175

◆ print()

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

Definition at line 131 of file particle_def.cpp.

131 {
132 if (l > 0) {
133 file << (*this);
134 /*
135 file<<name<<" mass="<<mass<<" mass/(GeV/c_squared)="<<mass/(GeV/c_squared)
136 <<" charge="<<charge<<" charge/eplus="<<charge/eplus
137 <<" lepton_n="<<lepton_n<<" barion_n="<<barion_n
138 <<" spin="<<spin<<" isospin="<<isospin<<'\n';
139 */
140 }
141}

◆ printall()

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

Definition at line 142 of file particle_def.cpp.

142 {
143 Ifile << "particle_def::printall:\n";
146 while ((an = logbook.get_next_node(an)) != NULL) {
147 file << (*(an->el));
148 }
149}
#define Ifile
Definition: prstream.h:207

◆ set_charge()

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

Definition at line 129 of file particle_def.cpp.

129{ charge = z * eplus; }

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

◆ set_mass()

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

Definition at line 127 of file particle_def.cpp.

127{ mass = m * MeV / c_squared; }

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

◆ verify()

void Heed::particle_def::verify ( void  )
inline

Definition at line 117 of file particle_def.h.

117{}

Referenced by particle_def().

Member Data Documentation

◆ barion_n

int Heed::particle_def::barion_n

Definition at line 66 of file particle_def.h.

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

◆ charge

double Heed::particle_def::charge

Definition at line 63 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 68 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 65 of file particle_def.h.

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

◆ mass

◆ name

String Heed::particle_def::name

Definition at line 59 of file particle_def.h.

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

◆ notation

String Heed::particle_def::notation

Definition at line 61 of file particle_def.h.

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

◆ spin

float Heed::particle_def::spin

Definition at line 67 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: