Garfield++ 4.0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
MagboltzInterface.hh
Go to the documentation of this file.
1// Interface to Magboltz (version 9)
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 { double den[nEnergySteps]; } dens_;
86
87extern struct {
88 double time[300];
89 std::int64_t icoll[30];
91 double tmax1;
92 double ave;
93 double den;
94 double xid;
95 double x;
96 double y;
97 double z;
98 double st;
99 std::int64_t nnull;
100 std::int64_t icoln[nMaxLevels];
101 std::int64_t icolnn[60];
103
104extern struct {
105 double time[300];
106 std::int64_t icoll[5][nMaxComponents];
107 double spec[nEnergySteps];
108 double tmax1;
109 double ave;
110 double den;
111 double xid;
112 double x;
113 double y;
114 double z;
115 double st;
116 std::int64_t nnull;
117 std::int64_t icoln[290][nMaxComponents];
118 std::int64_t icolnn[10][nMaxComponents];
120
121extern struct {
125
126extern struct {
130
131extern struct {
135 std::int64_t iarry[nMaxLevels];
139 std::int64_t last;
140 std::int64_t isize;
141 double penfra[nMaxLevels][3];
142 double tcfmax[8];
144
145extern struct {
146 double cf[290][nEnergySteps][nMaxComponents];
147 double ein[290][nMaxComponents];
149 std::int64_t iarry[290][nMaxComponents];
150 double rgas[290][nMaxComponents];
151 double ipn[290][nMaxComponents];
152 double wpl[290][nMaxComponents];
153 std::int64_t last[nMaxComponents];
154 std::int64_t isize[nMaxComponents];
155 double penfra[290][3][nMaxComponents];
156 double tcfmax[nMaxComponents];
158
159// Definition of the gas mixture
160extern struct { std::int64_t ngasn[6]; } gasn_;
161
162extern struct {
163 double an1, an2, an3, an4, an5, an6, an;
164 double frac[6];
166
167// Calculation results
168// Drift velocity
169extern struct { double wx, wy, wz; } vel_;
170extern struct { double dwx, dwy, dwz; } velerr_;
171
172// Diffusion
173extern struct {
174 double difxx, difyy, difzz;
175 double difyz, difxy, difxz;
177extern struct {
178 double dxxer, dyyer, dzzer;
179 double dyzer, dxyer, dxzer;
181extern struct { double difln, diftr; } difvel_;
182extern struct { double dfler, dfter; } diferl_;
183
184// Townsend and attachment coefficient
185extern struct { double alpha, att; } ctowns_;
186extern struct { double alper, atter; } ctwner_;
187extern struct {
188 double ralpha, ralper;
191 double tofwr, tofwrer;
194
195void gasmix_(std::int64_t* ngs, double* q, double* qin, std::int64_t* nin, double* e,
196 double* ei, char* name, double* virl, double* eb, double* peqel,
197 double* peqin, double* penfra, std::int64_t* kel, std::int64_t* kin,
198 double* qion, double* peqion, double* eion, std::int64_t* nion,
199 double* qatt, std::int64_t* natt, double* qnull, std::int64_t* nnull,
200 double* scln, std::int64_t* nc0, double* ec0, double* wk, double* efl,
201 std::int64_t* ng1, double* eg1, std::int64_t* ng2, double* eg2,
203 char scrptn[nMaxNullTerms][nCharDescr],
204 short namelen, short scrpt_len, short scrptn_len);
205
206void colf_(double* freq, double* freel, double* freion, double* freatt,
207 double* frein, std::int64_t *ntotal);
208
209void colft_(double* freq, double* freel, double* freion, double* freatt,
210 double* frein, std::int64_t *ntotal);
211
213}
214}
215}
216#endif
217#endif
struct Garfield::Magboltz::@17 diflab_
struct Garfield::Magboltz::@6 dens_
struct Garfield::Magboltz::@11 large_
double ein[nMaxLevels]
constexpr unsigned int nMaxInelasticTerms
constexpr unsigned int nEnergySteps
struct Garfield::Magboltz::@23 tofout_
struct Garfield::Magboltz::@16 velerr_
char dscrptn[60][nCharDescr]
double den[nEnergySteps]
struct Garfield::Magboltz::@12 larget_
struct Garfield::Magboltz::@15 vel_
struct Garfield::Magboltz::@9 scrip_
constexpr unsigned int nMaxAttachmentTerms
double eroot[nEnergySteps]
std::int64_t icolnn[60]
std::int64_t ngasn[6]
constexpr unsigned int nCharDescr
double qt3[nEnergySteps]
constexpr unsigned int nMaxComponents
double cf[nMaxLevels][nEnergySteps]
constexpr unsigned int nMaxIonisationTerms
constexpr unsigned int nCharName
double ipn[nMaxLevels]
double rgas[nMaxLevels]
struct Garfield::Magboltz::@7 outpt_
double eg[nEnergySteps]
std::int64_t icoln[nMaxLevels]
std::int64_t icoll[30]
struct Garfield::Magboltz::@19 difvel_
struct Garfield::Magboltz::@22 ctwner_
struct Garfield::Magboltz::@0 bfld_
struct Garfield::Magboltz::@8 outptt_
double tcf[nEnergySteps]
std::int64_t iarry[nMaxLevels]
struct Garfield::Magboltz::@14 ratio_
struct Garfield::Magboltz::@21 ctowns_
struct Garfield::Magboltz::@2 setp_
constexpr unsigned int nMaxLevels
void colf_(double *freq, double *freel, double *freion, double *freatt, double *frein, std::int64_t *ntotal)
struct Garfield::Magboltz::@1 inpt_
constexpr unsigned int nMaxNullTerms
struct Garfield::Magboltz::@10 script_
char dscrpt[nMaxLevels][nCharDescr]
double spec[nEnergySteps]
struct Garfield::Magboltz::@20 diferl_
double qt4[nEnergySteps]
struct Garfield::Magboltz::@5 mix2_
struct Garfield::Magboltz::@3 thrm_
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)
struct Garfield::Magboltz::@4 cnsts_
double qt1[nEnergySteps]
struct Garfield::Magboltz::@13 gasn_
struct Garfield::Magboltz::@18 diferb_
double penfra[nMaxLevels][3]
constexpr unsigned int nMaxLevelsPerComponent
double qt2[nEnergySteps]
double wpl[nMaxLevels]