Garfield++ 4.0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
|
#include <EnergyMesh.h>
Public Member Functions | |
EnergyMesh ()=default | |
Default constructor. | |
EnergyMesh (double femin, double femax, long fq) | |
Constructor from min./max energy and number of bins. | |
EnergyMesh (const std::vector< double > &fec) | |
Constructor from a list of energies. | |
long | get_q () const |
Return number of bins. | |
double | get_emin () const |
Return left side of the first bin. | |
double | get_emax () const |
Return right side of the last bin. | |
double | get_e (long n) const |
Return left side of a given bin. | |
double | get_ec (long n) const |
Return center of a given bin. | |
const double * | get_ae (void) const |
Return all left sides. | |
const double * | get_aec (void) const |
Return all interval centres. | |
long | get_interval_number (const double ener) const |
long | get_interval_number_between_centers (const double ener) const |
EnergyMesh * | copy () const |
void | print (std::ostream &file, int l) const |
Friends | |
std::ostream & | operator<< (std::ostream &file, EnergyMesh &f) |
Energy mesh (in MeV, as everywhere in HEED, unless otherwise specified). Internal calculations in HEED are conveniently performed with some standard energy mesh. This mesh should be logarithmic or similar, with dense spacing at small energies and sparse spacing at large energies. The class below determines such mesh and some standard functions, namely getting center of energy interval get_ec(long n), left edge of interval get_e(long n) (right edge is left one for the next bin), and some other simple functions. There may be many meshes in program (but currently only one mesh is used in a single program, different meshes may be used for totally different matters and cross sections). The pointer to mesh should be given as parameter of class constructor, when a class depends on mesh.
The class keeps the left sides of bins and their centers in arrays. Since the right side of interval is the left of the next one, the array keeping the left sides should be by one larger then the dimension of the mesh.
For reasons of speed the internal arrays keep right sides of intervals and their centers are defined as simple fixed-size arrays.
2003, I. Smirnov
Definition at line 32 of file EnergyMesh.h.
|
default |
Default constructor.
Referenced by copy().
Heed::EnergyMesh::EnergyMesh | ( | double | femin, |
double | femax, | ||
long | fq | ||
) |
Constructor from min./max energy and number of bins.
Definition at line 8 of file EnergyMesh.cpp.
Heed::EnergyMesh::EnergyMesh | ( | const std::vector< double > & | fec | ) |
Constructor from a list of energies.
Definition at line 23 of file EnergyMesh.cpp.
|
inline |
Definition at line 60 of file EnergyMesh.h.
|
inline |
Return all left sides.
Definition at line 52 of file EnergyMesh.h.
Referenced by Heed::EnTransfCS::EnTransfCS(), Heed::HeedParticle::physics(), and Heed::HeedParticle_BGM::physics().
|
inline |
|
inline |
Return left side of a given bin.
Definition at line 48 of file EnergyMesh.h.
Referenced by Heed::EnTransfCS::EnTransfCS(), and Heed::HeedMatterDef::print().
|
inline |
Return center of a given bin.
Definition at line 50 of file EnergyMesh.h.
Referenced by Heed::EnTransfCS::EnTransfCS(), Heed::HeedDeltaElectronCS::HeedDeltaElectronCS(), Heed::EnTransfCS::print(), Heed::HeedDeltaElectronCS::print(), and Heed::HeedMatterDef::replace_epsi12().
|
inline |
Return right side of the last bin.
Definition at line 46 of file EnergyMesh.h.
Referenced by Heed::EnTransfCS::EnTransfCS().
|
inline |
Return left side of the first bin.
Definition at line 44 of file EnergyMesh.h.
Referenced by Heed::EnTransfCS::EnTransfCS().
long Heed::EnergyMesh::get_interval_number | ( | const double | ener | ) | const |
Definition at line 45 of file EnergyMesh.cpp.
long Heed::EnergyMesh::get_interval_number_between_centers | ( | const double | ener | ) | const |
Definition at line 62 of file EnergyMesh.cpp.
|
inline |
Return number of bins.
Definition at line 42 of file EnergyMesh.h.
Referenced by Heed::EnTransfCS::EnTransfCS(), Heed::HeedDeltaElectronCS::HeedDeltaElectronCS(), Heed::HeedParticle::physics(), Heed::HeedParticle_BGM::physics(), Heed::EnTransfCS::print(), Heed::HeedDeltaElectronCS::print(), Heed::HeedMatterDef::print(), and Heed::HeedMatterDef::replace_epsi12().
void Heed::EnergyMesh::print | ( | std::ostream & | file, |
int | l | ||
) | const |
Definition at line 95 of file EnergyMesh.cpp.
|
friend |
Definition at line 79 of file EnergyMesh.cpp.