Garfield 0.3
Toolkit for the detailed simulation of particle detectors based on ionization measurement in gases and semiconductors
Loading...
Searching...
No Matches
MagboltzInterface.hh
Go to the documentation of this file.
1// Interface to Magboltz (version 11.19)
2
3#ifndef G_MAGBOLTZ_INTERFACE
4#define G_MAGBOLTZ_INTERFACE
5
6#include <cstdint>
7
8#ifndef __CINT__
9
10namespace Garfield {
11
12namespace Magboltz {
13
14constexpr unsigned int nEnergySteps = 4000;
15constexpr unsigned int nMaxIonisationTerms = 30;
16constexpr unsigned int nMaxInelasticTerms = 250;
17constexpr unsigned int nMaxAttachmentTerms = 8;
18constexpr unsigned int nMaxNullTerms = 10;
19constexpr unsigned int nMaxLevelsPerComponent = 300;
20constexpr unsigned int nCharName = 25;
21constexpr unsigned int nCharDescr = 50;
22constexpr unsigned int nMaxLevels = 960;
23constexpr unsigned int nMaxComponents = 6;
24
25extern "C" {
26
27// Magboltz COMMON blocks
28
29// Magnetic field
30extern struct {
31 double eovb;
32 double wb;
33 double btheta, bmag;
35
36extern struct {
37 std::int64_t nGas;
38 std::int64_t nStep;
39 std::int64_t nAniso;
40 double efinal;
41 double estep;
42 double akt;
43 double ary;
44 double tempc;
45 double torr;
46 std::int64_t ipen;
48
49extern struct {
50 double tmax;
51 double small;
52 double api;
53 double estart;
54 double theta, phi;
55 double rstart;
56 double efield;
57 std::int64_t nmax;
59
60extern struct {
61 double amgas[6];
62 double vtmb[6];
63 double tcfmx;
64 double tcfmxg[6];
65 std::int64_t ithrm;
67
68// Physical constants
69extern struct {
70 double echarg;
71 double emass;
72 double amu;
73 double pir2;
75
76extern struct {
84
85extern struct {
88
89extern struct {
90 double time[300];
91 std::int64_t icoll[30];
93 double tmax1;
94 double ave;
95 double den;
96 double xid;
97 double x;
98 double y;
99 double z;
100 double st;
101 std::int64_t nnull;
102 std::int64_t icoln[nMaxLevels];
103 std::int64_t icolnn[60];
105
106extern struct {
107 double time[300];
108 std::int64_t icoll[5][nMaxComponents];
109 double spec[nEnergySteps];
110 double tmax1;
111 double ave;
112 double den;
113 double xid;
114 double x;
115 double y;
116 double z;
117 double st;
118 std::int64_t nnull;
119 std::int64_t icoln[290][nMaxComponents];
120 std::int64_t icolnn[10][nMaxComponents];
122
123extern struct {
127
128extern struct {
132
133extern struct {
137 std::int64_t iarry[nMaxLevels];
141 std::int64_t last;
142 std::int64_t isize;
143 double penfra[nMaxLevels][3];
144 double tcfmax[8];
146
147extern struct {
148 double cf[290][nEnergySteps][nMaxComponents];
149 double ein[290][nMaxComponents];
151 std::int64_t iarry[290][nMaxComponents];
152 double rgas[290][nMaxComponents];
153 double ipn[290][nMaxComponents];
154 double wpl[290][nMaxComponents];
155 std::int64_t last[nMaxComponents];
156 std::int64_t isize[nMaxComponents];
157 double penfra[290][3][nMaxComponents];
158 double tcfmax[nMaxComponents];
160
161// Definition of the gas mixture
162extern struct {
163 std::int64_t ngasn[6];
165
166extern struct {
167 double an1, an2, an3, an4, an5, an6, an;
168 double frac[6];
170
171// Calculation results
172// Drift velocity
173extern struct {
174 double wx, wy, wz;
176extern struct {
177 double dwx, dwy, dwz;
179
180// Diffusion
181extern struct {
182 double difxx, difyy, difzz;
183 double difyz, difxy, difxz;
185extern struct {
186 double dxxer, dyyer, dzzer;
187 double dyzer, dxyer, dxzer;
189extern struct {
190 double difln, diftr;
192extern struct {
193 double dfler, dfter;
195
196// Townsend and attachment coefficient
197extern struct {
198 double alpha, att;
200extern struct {
201 double alper, atter;
203
204// Time of flight swarm parameters
205extern struct {
206 double ralpha, ralper;
209 double tofwr, tofwrer;
212
213// Steady state townsend swarm parameters
214extern struct {
215 double vdout, vderr; //< diffusion modified drift
216 double wsout, wserr, dlout, dlerr; //< seems to be WS SST velocities i.e.
217 // mean arrival time drift velocity?
219 double attsst, atterr;
221
222void gasmix_(std::int64_t* ngs, double* q, double* qin, std::int64_t* nin,
223 double* e, double* ei, char* name, double* virl, double* eb,
224 double* peqel, double* peqin, double* penfra, std::int64_t* kel,
225 std::int64_t* kin, double* qion, double* peqion, double* eion,
226 std::int64_t* nion, double* qatt, std::int64_t* natt,
227 double* qnull, std::int64_t* nnull, double* scln,
228 std::int64_t* nc0, double* ec0, double* wk, double* efl,
229 std::int64_t* ng1, double* eg1, std::int64_t* ng2, double* eg2,
231 char scrptn[nMaxNullTerms][nCharDescr], short namelen,
232 short scrpt_len, short scrptn_len);
233
234void colf_(double* freq, double* freel, double* freion, double* freatt,
235 double* frein, std::int64_t* ntotal);
236
237void colft_(double* freq, double* freel, double* freion, double* freatt,
238 double* frein, std::int64_t* ntotal);
239
241}
242} // namespace Magboltz
243} // namespace Garfield
244#endif
245#endif
struct Garfield::Magboltz::@200151375376142367006354044165174301200273071223 setp_
struct Garfield::Magboltz::@333264205224170010044332261306355377050242076237 velerr_
struct Garfield::Magboltz::@051141352317111036004023220013037373261354145260 scrip_
struct Garfield::Magboltz::@062000331006051274315203174371114030302003210332 inpt_
struct Garfield::Magboltz::@303210140355070215343023371133061371335275221140 dens_
struct Garfield::Magboltz::@222343072213135266247110330327155274026002021366 gasn_
struct Garfield::Magboltz::@152333052161126141071324072360177332366244053120 difvel_
double ein[nMaxLevels]
constexpr unsigned int nMaxInelasticTerms
constexpr unsigned int nEnergySteps
char dscrptn[60][nCharDescr]
double den[nEnergySteps]
constexpr unsigned int nMaxAttachmentTerms
double eroot[nEnergySteps]
std::int64_t icolnn[60]
struct Garfield::Magboltz::@372167265247122211147337110057175027320162215060 script_
constexpr unsigned int nCharDescr
struct Garfield::Magboltz::@173370073230142275112065171302010312340232002062 outpt_
double qt3[nEnergySteps]
struct Garfield::Magboltz::@312324214072023240142013277162175211273133323305 diferl_
constexpr unsigned int nMaxComponents
double cf[nMaxLevels][nEnergySteps]
constexpr unsigned int nMaxIonisationTerms
constexpr unsigned int nCharName
struct Garfield::Magboltz::@143056055120167120033375274001011357330126023340 bfld_
struct Garfield::Magboltz::@326336253157037145044130361054317053225340170233 mix2_
double ipn[nMaxLevels]
double rgas[nMaxLevels]
struct Garfield::Magboltz::@301363100077254125070143004127320066271360100040 ctowns_
double eg[nEnergySteps]
std::int64_t icoln[nMaxLevels]
struct Garfield::Magboltz::@357134115346022270254251113044060365277132332052 thrm_
std::int64_t icoll[30]
struct Garfield::Magboltz::@240101102063021363335233364102115341303262167071 cnsts_
struct Garfield::Magboltz::@045044033016047061367364266363052350146325154372 larget_
struct Garfield::Magboltz::@003122340157271357075366304212300150364326360215 ratio_
double tcf[nEnergySteps]
struct Garfield::Magboltz::@114374004130066166157302054316307052322003327075 large_
struct Garfield::Magboltz::@064307242372113174123332346302326113324227203144 tofout_
std::int64_t iarry[nMaxLevels]
constexpr unsigned int nMaxLevels
void colf_(double *freq, double *freel, double *freion, double *freatt, double *frein, std::int64_t *ntotal)
constexpr unsigned int nMaxNullTerms
char dscrpt[nMaxLevels][nCharDescr]
double spec[nEnergySteps]
struct Garfield::Magboltz::@304022341315066221310006113025051322342142140037 diflab_
double qt4[nEnergySteps]
struct Garfield::Magboltz::@150371224152075233111073226143224003020360151343 vel_
void gasmix_(std::int64_t *ngs, double *q, double *qin, std::int64_t *nin, double *e, double *ei, char *name, double *virl, double *eb, double *peqel, double *peqin, double *penfra, std::int64_t *kel, std::int64_t *kin, double *qion, double *peqion, double *eion, std::int64_t *nion, double *qatt, std::int64_t *natt, double *qnull, std::int64_t *nnull, double *scln, std::int64_t *nc0, double *ec0, double *wk, double *efl, std::int64_t *ng1, double *eg1, std::int64_t *ng2, double *eg2, char scrpt[nMaxLevelsPerComponent][nCharDescr], char scrptn[nMaxNullTerms][nCharDescr], short namelen, short scrpt_len, short scrptn_len)
void colft_(double *freq, double *freel, double *freion, double *freatt, double *frein, std::int64_t *ntotal)
double qt1[nEnergySteps]
struct Garfield::Magboltz::@017262342360126140365324217335326245332313136136 outptt_
double penfra[nMaxLevels][3]
constexpr unsigned int nMaxLevelsPerComponent
struct Garfield::Magboltz::@332264272014303224331015010053315335352127316314 diferb_
double qt2[nEnergySteps]
struct Garfield::Magboltz::@054035012036233175302064276112163200136007327110 sstout_
struct Garfield::Magboltz::@216314304241241137034002206173273361320012036265 ctwner_
double wpl[nMaxLevels]