Garfield++ 5.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::@060222016335007357276230325267072324307245075335 velerr_
struct Garfield::Magboltz::@334041350373203315335371210247356134174034202364 difvel_
struct Garfield::Magboltz::@071266015331337350342074140245340115315173206173 script_
double ein[nMaxLevels]
constexpr unsigned int nMaxInelasticTerms
constexpr unsigned int nEnergySteps
char dscrptn[60][nCharDescr]
double den[nEnergySteps]
struct Garfield::Magboltz::@272077330053140267135131315064054111215365003061 inpt_
constexpr unsigned int nMaxAttachmentTerms
double eroot[nEnergySteps]
struct Garfield::Magboltz::@236122006074061251067327101212023331117065272002 larget_
std::int64_t icolnn[60]
constexpr unsigned int nCharDescr
struct Garfield::Magboltz::@016351066267021123171150005363312076230027317210 outpt_
double qt3[nEnergySteps]
constexpr unsigned int nMaxComponents
double cf[nMaxLevels][nEnergySteps]
struct Garfield::Magboltz::@367143224022215036160202274360277173043324053167 diferl_
constexpr unsigned int nMaxIonisationTerms
constexpr unsigned int nCharName
double ipn[nMaxLevels]
double rgas[nMaxLevels]
struct Garfield::Magboltz::@221254070224001152104034073063240127337154001241 diferb_
double eg[nEnergySteps]
std::int64_t icoln[nMaxLevels]
struct Garfield::Magboltz::@157012065177270115006254216365004043341121046005 vel_
std::int64_t icoll[30]
struct Garfield::Magboltz::@245266170301200003106052333313347204035061117342 ratio_
struct Garfield::Magboltz::@010063252323105360345105253327133025274175326133 bfld_
struct Garfield::Magboltz::@367172176335371151066116323064254124322366107157 diflab_
struct Garfield::Magboltz::@057270266311332313123374024066154010246130331023 cnsts_
double tcf[nEnergySteps]
struct Garfield::Magboltz::@222150133151105054154302130362347315126001152334 dens_
std::int64_t iarry[nMaxLevels]
struct Garfield::Magboltz::@304340026334031267143114007126147372164074306062 outptt_
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]
struct Garfield::Magboltz::@043341123353356340117075350116005072335377127162 gasn_
double spec[nEnergySteps]
struct Garfield::Magboltz::@152023163236327126074317062211255304316001105103 tofout_
struct Garfield::Magboltz::@261142307054266253060114162042322335114302253152 ctowns_
double qt4[nEnergySteps]
struct Garfield::Magboltz::@343242004052315221243247367236006336135121373020 setp_
struct Garfield::Magboltz::@363161251140110014365135052375245247262302340235 large_
struct Garfield::Magboltz::@243337270271362237030277156013024035163331176157 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)
double qt1[nEnergySteps]
struct Garfield::Magboltz::@301116172155326317070225220046057374317172177377 ctwner_
double penfra[nMaxLevels][3]
constexpr unsigned int nMaxLevelsPerComponent
double qt2[nEnergySteps]
struct Garfield::Magboltz::@276025017301256117263211055021110262335047200203 mix2_
struct Garfield::Magboltz::@024075325050032167066064232170013161226346016145 scrip_
double wpl[nMaxLevels]