10 TString type(detector.ClassName());
11 if (type.Contains(
"SquarePointContact")) {
16 Error(
"SetupWith",
"%s is not expected.", type.Data());
17 Error(
"SetupWith",
"Please use SquarePointContact detector.");
36 double vxp,vxm,vyp,vym,vzp,vzm;
37 if (idx<
N1*
N2) vzm=
Vp[idx];
39 if (idx>=
N1*N2*
N3-
N1*N2) vzp=
Vp[idx];
41 if (idx%(
N1*N2)>(
N1*N2)-
N1-1) vyp=
Vp[idx];
43 if (idx%(
N1*N2)<
N1) vym=
Vp[idx];
45 if ((idx%(
N1*N2))%
N1==
N1-1) vxp=
Vp[idx];
47 if ((idx%(
N1*N2))%
N1==0) vxm=
Vp[idx];
51 double vnew = (
Src[idx]/2 + (vxp/dxp+vxm/dxm)/(dxm+dxp)
52 + (vyp/dyp+vym/dym)/(dym+dyp) + (vzp/dzp+vzm/dzm)/(dzp+dzm) )
53 / ( (1/dxp+1/dxm)/(dxp+dxm)
54 + (1/dyp+1/dym)/(dyp+dym) + (1/dzp+1/dzm)/(dzp+dzm) );
64 if (vmin>vxm)vmin=vxm;
65 if (vmin>vyp)vmin=vyp;
66 if (vmin>vym)vmin=vym;
67 if (vmin>vzp)vmin=vzp;
68 if (vmin>vzm)vmin=vzm;
71 if (vmax<vxm)vmax=vxm;
72 if (vmax<vyp)vmax=vyp;
73 if (vmax<vym)vmax=vym;
74 if (vmax<vzp)vmax=vzp;
75 if (vmax<vzm)vmax=vzm;
77 if (vnew<vmin)
Vp[idx]=vmin;
78 else if(vnew>vmax)
Vp[idx]=vmax;
92 double dV=spc.
Bias[0]-spc.
Bias[1];
if(dV<0)dV=-dV;
93 double SumofElectricField=0;
94 for(
size_t i=0;i<
GetN();i++) {
99 SumofElectricField+=(e1*e1+e2*e2)*
C1[i]*dr*dz;
101 double c=SumofElectricField*2*3.14159*
epsilon/dV/dV;
102 Info(
"GetC",
"%.2f pF",c/
pF);
111 for (
size_t i=0; i<
N3; i++) {
112 for (
size_t j=0; j<
N2; j++) {
113 for (
size_t k=0; k<
N1; k++) {
114 C1.push_back(k*dx);
C2.push_back(j*dy);
C3.push_back(i*dz);
115 dC1p.push_back(dx);
dC1m.push_back(dx);
116 dC2p.push_back(dy);
dC2m.push_back(dy);
117 dC3p.push_back(dz);
dC3m.push_back(dz);
118 E1.push_back(0);
E2.push_back(0);
E3.push_back(0);
119 Et.push_back(0);
Vp.push_back(0);
144 E1.back()=0;
E2.back()=0;
Vp.back()=spc.
Bias[1];
149 E1.back()=0;
E2.back()=0;
Vp.back()=spc.
Bias[1];
164 E1.back()=0;
E2.back()=0;
Vp.back()=spc.
Bias[1];
175 for (
size_t idx=0; idx<
GetN(); idx++) {
176 double dxm=
dC1m[idx];
177 double dxp=
dC1p[idx];
178 double dym=
dC2m[idx];
179 double dyp=
dC2p[idx];
180 double dzm=
dC3m[idx];
181 double dzp=
dC3p[idx];
182 double vym,vyp,vxm,vxp,vzp,vzm;
183 if (idx<
N1*
N2) vzm=
Vp[idx];
185 if (idx>=
N1*N2*
N3-
N1*N2) vzp=
Vp[idx];
189 if (idx%(
N1*N2)<
N1) vym=
Vp[idx];
191 if ((idx%(
N1*N2))%
N1==
N1-1) vxp=
Vp[idx];
193 if ((idx%(
N1*N2))%
N1==0) vxm=
Vp[idx];
195 E1[idx]=(vxp-vxm)/(dxm+dxp);
196 E2[idx]=(vyp-vym)/(dym+dyp);
197 E3[idx]=(vzp-vzm)/(dzm+dzp);
std::vector< double > dC1m
step length to previous point alone C1
std::vector< double > E3
projection of Et on C3
std::vector< double > Bias
bias on electrodes
std::vector< bool > fIsFixed
true if field values are fixed
std::vector< double > E1
projection of Et on C1
size_t N2
number of points along the 2nd coordinate
std::vector< double > dC3p
step length to next point alone C3
std::vector< double > Src
-(net impurity concentration)x|Qe|/epsilon
size_t N1
number of points along the 1st coordinate
std::vector< double > C2
the 2nd coordinates of the points
virtual void SetupWith(Detector &detector)
Fix potentials on boundaries based on.
Detector & crystal properties.
std::vector< double > dC1p
step length to next point alone C1
size_t GetN()
total number of points
double Height
height of crystal
std::vector< double > dC2m
step length to previous point along C2
static const double epsilon
permittivity of Ge [C/volt/cm]
void CalculateE()
Calculate Et, E1, E2, E3 from Vp.
std::vector< bool > fIsDepleted
true if a grid point is depleted
void OverRelaxAt(size_t idx)
Over relax potential Vp[.
Detector * fDetector
! Pointer to associated detector object
std::vector< double > dC2p
step length to next point along C2
A file defining commonly used units & constants.
size_t N3
number of points along the 3rd coordinate
static const double pF
pico farad
void SetupWith(Detector &detector)
Fix potentials on boundaries based on.
double GetImpurity(double height)
Return net impurity concentration at.
void GetInfoFrom(SquarePointContact &detector)
double GetC()
Get detector capacitance.
std::vector< double > Vp
potential at each point
static const double Qe
electron charge in Coulomb [C]
std::vector< double > dC3m
step length to previous point alone C3
The only namespace in GeFiCa.
std::vector< double > Et
total electric field strength
std::vector< double > E2
projection of Et on C2
std::vector< double > C1
the 1st coordinates of the points
std::vector< double > C3
the 3rd coordinates of the points
double RelaxationFactor
within (0,2), used to speed up convergence