Garfield++ v1r0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
ElElasticScat.h
Go to the documentation of this file.
1#ifndef ELELASCTICSCAT_H
2#define ELELASCTICSCAT_H
6#include "HeedGlobals.h"
7
8/*
9Definition of elastic scattering for low-energy delta-electron.
10
112003, I. Smirnov
12*/
13
14// People, who does not want to link with graphics,
15// can uncomment the following macro.
16// The result will be the disappearance of the two functions
17// from class ElElasticScat, which are the only functions in heed++,
18// which call histdef.
19// These functions were used at preparation of the condensed simulation
20// scheme, namely fitting condensed cross-sections.
21// During actual simulations these two functions are not necessary.
22//#define EXCLUDE_FUNCTIONS_WITH_HISTDEF
23
24// Fit parameters for particular element and energy,
25// The fit gives dependence of cross section on angle.
26
27namespace Heed {
28
30 public:
31 double A[4]; // in -1.0 then the combination is not valid
32 double C[7];
33 double B;
34 double CS(double theta); // return -1 if not valid
35};
36
37// Contains array of the structures defined above for a set of energies.
39 public:
40 long Z;
41 DynLinArr<ElElasticScatDataStruct> data; // dimension: different energies
42 ElElasticScatData(void) : Z(0) { ; }
43 ElElasticScatData(long fZ, long qe) : Z(fZ), data(qe) { ; }
44};
45
46// The following class presentes the data for any atom.
47// One object contains all data and presents them by request.
48
49class ElElasticScat : public RegPassivePtr {
50 public:
51 double get_CS(long Z, double energy, // kinetic energy in MeV
52 double angle,
53 int s_interp = 0); // the last parameter is only for
54 // debug and for various checks.
55 // In particular, fill_hist call this function with s_interp=1
56 // for histograms "int...".
57 // Return value is in angstrom^2/srad
58
59 double get_CS_Rutherford(long Z, double energy, // kinetic energy in MeV
60 double angle); // internal units (radian)
61 // Return value is in angstrom^2
62 long get_qe(void) const { return qe; }
63 double get_energy_mesh(long ne) const { return energy_mesh[ne]; }
64
65 ElElasticScat(void) : atom(0) { ; }
66 ElElasticScat(const String& file_name);
67 void print(std::ostream& file, int l) const;
68#ifndef EXCLUDE_FUNCTIONS_WITH_HISTDEF
69 void fill_hist(void);
70 // Makes a package of histograms for all atoms for which the
71 // fit is presented in the data file.
72 // There are 6 types of histograms:
73 // raw..., cor..., corrad, int..., rut..., rutrad
74 // Difference between raw and cor I forgot for the moment.
75 // The plots looks the same but created by diffeent manner.
76 // raw by the call of atom[na].data[ne].CS(angle/180.0 * M_PI );
77 // cor by the normal call:
78 // get_CS(atom[na].Z, energyMeV, angle/180.0 * M_PI );
79 // int is produced by interpolation between neighboring presented atoms.
80 // It is useful, in particular, to check the precision of interpolation.
81 // rut is Rutherford cross section.
82 // histograms with suffix rad are the same but with factor
83 // 2.0 * M_PI * sin(anglerad)
84 // path length is inverse linear coefficient of absorption
85 // for unit A and dencity ( they are not known in this program)
86 // So you should multiply by A and divide by dencity in gr/cm3.
87
88 void fill_hist_low_scat(const String& file_name,
89 const String& file_name_dist);
90// It fills some histograms and write file with tables
91// energy vs coefficient which gives dependency (proportional)
92// of root from dispertion
93// on number of interactions.
94// If file_name_dist != "" and "none",
95// the program will write there the shapes of distributions.
96// As far as I now understood, the second file is not used.
97#endif
98 private:
99 long qe; // number of energies (local mesh)
100 DynLinArr<double> energy_mesh; // KeV
101 DynLinArr<double> gamma_beta2; // gamma * beta2 for electron of
102 // this energy
103 DynLinArr<ElElasticScatData> atom; // dimension: different atoms
104 double get_CS_for_presented_atom(long na,
105 double energy, // kinetic energy in MeV
106 double angle);
107};
108
109class ElElasticScatLowSigma : public RegPassivePtr {
110 public:
111 double get_mean_coef(long Z, long ne) const { return mean_coef[Z - 1][ne]; }
112 double get_coef(long Z, long ne) const { return coef[Z - 1][ne]; }
113 long get_qscat(void) const { return qscat; }
114 ElElasticScat* get_ees(void) const { return ees.get(); }
116 ElElasticScatLowSigma(ElElasticScat* fees, const String& file_name);
117
118 private:
120 long qat; // number of atoms registered in this class (Z is sequencial)
121 long qscat; // maximal number of scaterings
122 // qe and energies are taken form ElElasticScat
123
124 // addition for new format:
125 DynLinArr<DynLinArr<double> > mean_coef; // mean( (1-cos(theta)) )
126 // old format:
127 DynLinArr<DynLinArr<double> > coef; // sqrt(mean( (1-cos(theta))^2 ))
128 // first index - number of atom = z - 1
129 // second index - energy
130
131};
132
133}
134
135#endif
std::string String
Definition: String.h:75
DynLinArr< ElElasticScatDataStruct > data
Definition: ElElasticScat.h:41
ElElasticScatData(long fZ, long qe)
Definition: ElElasticScat.h:43
long get_qscat(void) const
double get_coef(long Z, long ne) const
double get_mean_coef(long Z, long ne) const
ElElasticScat * get_ees(void) const
void fill_hist_low_scat(const String &file_name, const String &file_name_dist)
double get_CS(long Z, double energy, double angle, int s_interp=0)
double get_energy_mesh(long ne) const
Definition: ElElasticScat.h:63
void print(std::ostream &file, int l) const
double get_CS_Rutherford(long Z, double energy, double angle)
long get_qe(void) const
Definition: ElElasticScat.h:62
Definition: BGMesh.cpp:3