Garfield++ v2r0
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.
1#include <iomanip>
2
4
5namespace Heed {
6
8 int fs_primary_electron, HeedMatterDef* fhmd,
9 long fparticle_charge)
10 : particle_mass(fparticle_mass),
11 particle_charge(fparticle_charge),
12 s_primary_electron(fs_primary_electron),
13 hmd(fhmd),
14 mesh(fmesh) {
15 mfunnamep("EnTransfCS_BGM::EnTransfCS_BGM(...)");
16
17 const long q = mesh->q;
18 etcs_bgm.resize(q);
19 for (long n = 0; n < q; n++) {
20 double bg = mesh->x[n];
21 // gamma - 1
22 double gamma_1 = sqrt(1.0 + (bg * bg)) - 1.0;
23 etcs_bgm[n] = EnTransfCS(fparticle_mass, gamma_1, fs_primary_electron, fhmd,
24 fparticle_charge);
25 }
26}
27
28void EnTransfCS_BGM::print(std::ostream& file, int l) const {
29 if (l <= 0) return;
30 Ifile << "EnTransfCS_BGM(l=" << l << "):\n";
31 indn.n += 2;
32 Ifile << "particle_mass=" << particle_mass
33 << " particle_charge=" << particle_charge << std::endl;
34 Ifile << "s_primary_electron=" << s_primary_electron << std::endl;
35 Ifile << "hmd:\n";
36 hmd->print(file, 1);
37 Ifile << "mesh:\n";
38 mesh->print(file, 1);
39
40 Ifile << "Array of Cross Section:\n";
41 Ifile << "Number of elements = " << etcs_bgm.size() << '\n';
42
43 if (l >= 2) {
44 const long q = mesh->q;
45 for (long 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}
#define mfunnamep(string)
Definition: FunNameStack.h:49
std::vector< EnTransfCS > etcs_bgm
PassivePtr< HeedMatterDef > hmd
EnTransfCS_BGM(void)
Default constructor.
int s_primary_electron
Sign that the primary particle is an electron.
PassivePtr< BGMesh > mesh
virtual void print(std::ostream &file, int l) const
Definition: BGMesh.cpp:5
indentation indn
Definition: prstream.cpp:15
DoubleAc sqrt(const DoubleAc &f)
Definition: DoubleAc.cpp:314
#define Ifile
Definition: prstream.h:196