Garfield++ v1r0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
EnTransfCS_BGM.cpp
Go to the documentation of this file.
2
3namespace Heed {
4
6 int fs_primary_electron, HeedMatterDef* fhmd,
7 long fparticle_charge)
8 : particle_mass(fparticle_mass),
9 particle_charge(fparticle_charge),
10 s_primary_electron(fs_primary_electron),
11 hmd(fhmd),
12 mesh(fmesh) {
13 mfunnamep("EnTransfCS_BGM::EnTransfCS_BGM(...)");
14
15 long q = mesh->q;
17 long n;
18 for (n = 0; n < q; n++) {
19 double bg = mesh->x[n];
20 double gamma_1 = sqrt(1.0 + (bg * bg)) - 1.0; // gamma - 1
21 etcs_bgm[n] = EnTransfCS(fparticle_mass, gamma_1, fs_primary_electron, fhmd,
22 fparticle_charge);
23 }
24
25}
26
27void EnTransfCS_BGM::print(std::ostream& file, int l) const {
28 if (l <= 0) return;
29 Ifile << "EnTransfCS_BGM(l=" << l << "):\n";
30 indn.n += 2;
31 Ifile << "particle_mass=" << particle_mass
32 << " particle_charge=" << particle_charge << std::endl;
33 Ifile << "s_primary_electron=" << s_primary_electron << std::endl;
34 Ifile << "hmd:\n";
35 hmd->print(file, 1);
36 Ifile << "mesh:\n";
37 mesh->print(file, 1);
38
39 Ifile << "Array of Cross Section:\n";
40 Ifile << "Number of elements = " << etcs_bgm.get_qel() << '\n';
41
42 if (l >= 2) {
43 long q = mesh->q;
44 long n;
45 for (n = 0; n < q; n++) {
46 Ifile << "n=" << std::setw(5) << n << " bg=" << std::setw(14)
47 << mesh->x[n] << " quan=" << std::setw(14) << etcs_bgm[n].quanC;
48#ifndef EXCLUDE_MEAN
49 file << " mean=" << std::setw(14) << etcs_bgm[n].meanC;
50#endif
51 file << '\n';
52 }
53 }
54 indn.n -= 2;
55}
56
57std::ostream& operator<<(std::ostream& file, const EnTransfCS_BGM_Type& f) {
58 mfunname("std::ostream& operator << (std::ostream& file, const "
59 "EnTransfCS_BGM_Type& f)");
60 if (f.etcs_bgm.get() == NULL) {
61 Ifile << "EnTransfCS_BGM_Type: type is not initialized\n";
62 } else {
63 Ifile << "EnTransfCS_BGM_Type: =";
64 f.etcs_bgm->print(file, 1);
65 }
66 return file;
67}
68
69}
DoubleAc sqrt(const DoubleAc &f)
Definition: DoubleAc.cpp:313
#define mfunnamep(string)
Definition: FunNameStack.h:77
#define mfunname(string)
Definition: FunNameStack.h:67
PassivePtr< EnTransfCS_BGM > etcs_bgm
PassivePtr< HeedMatterDef > hmd
DynLinArr< EnTransfCS > etcs_bgm
PassivePtr< BGMesh > mesh
virtual void print(std::ostream &file, int l) const
Definition: BGMesh.cpp:3
std::ostream & operator<<(std::ostream &file, const BGMesh &bgm)
Definition: BGMesh.cpp:22
indentation indn
Definition: prstream.cpp:13
#define Ifile
Definition: prstream.h:207