11 TString type(detector.ClassName());
12 if (type.Contains(
"PointContact")) {
15 "Please assign even number of grid points along radius.");
22 else if (type.Contains(
"Segmented"))
26 "Please assign even number of grid points along radius.");
35 Error(
"SetupWith",
"%s is not expected.", type.Data());
36 Error(
"SetupWith",
"Please use " 37 "PointContact or Segmented detector.");
56 double vzm,vzp,vrm,vrp;
57 if (idx>=
N1) vzm=
Vp[idx-
N1];
61 if (idx%
N1==0) vrm=
Vp[idx];
63 if (idx%
N1==
N1-1) vrp=
Vp[idx];
67 double vnew = (
Src[idx]/2 + 0.5/
C1[idx]*(vrp-vrm)/(drm+drp)
68 + (vrp/drp+vrm/drm)/(drm+drp) + (vzp/dzp+vzm/dzm)/(dzp+dzm))
69 /((1/drm+1/drp)/(drm+drp) + (1/dzp+1/dzm)/(dzp+dzm));
79 if (vmin>vrp) vmin=vrp;
80 if (vmin>vzp) vmin=vzp;
81 if (vmin>vzm) vmin=vzm;
84 if (vmax<vrp) vmax=vrp;
85 if (vmax<vzp) vmax=vzp;
86 if (vmax<vzm) vmax=vzm;
88 if (vnew<vmin)
Vp[idx]=vmin;
89 else if(vnew>vmax)
Vp[idx]=vmax;
100 double dV=pc.
Bias[0]-pc.
Bias[1];
if(dV<0)dV=-dV;
101 double SumofElectricField=0;
102 for(
size_t i=0;i<
GetN();i++) {
107 SumofElectricField+=(e1*e1+e2*e2)*
C1[i]*dr*dz;
109 double c=SumofElectricField*2*3.14159*
epsilon/dV/dV;
110 Info(
"GetC",
"%.2f pF",c/
pF);
118 for (
size_t i=0; i<
N1; i++) {
123 E1.push_back(0);
E2.push_back(0);
Et.push_back(0);
Vp.push_back(0);
127 for (
size_t i=N1; i<N1*
N2; i++) {
130 C1.push_back(
C1[i-N1]);
C2.push_back(
C2[i-N1]+
dC2p[i-N1]);
131 E1.push_back(0);
E2.push_back(0);
Et.push_back(0);
Vp.push_back(0);
137 for (
size_t i=N1*N2; i-->0;) {
150 double slope, intercept;
154 if (
C2[i]>-slope*
C1[i]+intercept||
C2[i]>slope*
C1[i]+intercept) {
161 if (
C2[i]<=
C1[i]*slope+intercept ||
C2[i]<=-
C1[i]*slope+intercept) {
168 if ((
C2[i]>-slope*
C1[i]+intercept &&
C1[i]<=-pc.
BoreR) ||
169 (
C2[i]>slope*
C1[i]+intercept &&
C1[i]>=pc.
BoreR)) {
174 if (npc<1) { Error(
"GetInfoFrom",
"no point in point contact!"); abort(); }
175 for (
size_t i=N1*N2-1; i>=N1*N2-
N1; i--) {
178 for (
size_t i=0; i<=N1*N2-
N1; i=i+
N1) {
183 for (
size_t i=0; i<
N1; i++) {
197 double slope, intercept;
198 for (
size_t i=0; i<
GetN(); i++) {
241 if (
C1[i]+
C2[i]/slope-intercept/slope>0 &&
242 C1[i]+
C2[i]/slope-intercept/slope<
dC1m[i] &&
244 dC1m[i]=
C1[i]+
C2[i]/slope-intercept/slope;
245 if (-
C1[i]+
C2[i]/slope-intercept/slope>0 &&
246 -
C1[i]+
C2[i]/slope-intercept/slope<
dC1p[i] &&
248 dC1p[i]=-
C1[i]+
C2[i]/slope-intercept/slope;
249 if((
C1[i]*slope+intercept)-
C2[i]<
dC2p[i] &&
251 dC2p[i]=(
C1[i]*slope+intercept)-
C2[i];
252 if((-
C1[i]*slope+intercept)-
C2[i]<
dC2p[i] &&
254 dC2p[i]=(-
C1[i]*slope+intercept)-
C2[i];
259 if (
C2[i]-(slope*
C1[i]+intercept)<
dC2m[i]
260 &&
C2[i]-(slope*
C1[i]+intercept)>0 && i>=
N1-1)
261 dC2m[i]=
C2[i]-(slope*
C1[i]+intercept );
262 if ((
C2[i]-intercept)/slope-
C1[i]<
dC1p[i]
263 && (
C2[i]-intercept)/slope-
C1[i]>0)
264 dC1p[i]=(
C2[i]-intercept)/slope-
C1[i];
265 if (
C2[i]-(-slope*
C1[i]+intercept)<
dC2m[i]
266 &&
C2[i]-(-slope*
C1[i]+intercept)>0 && i>=
N1-1)
267 dC2m[i]=
C2[i]-(-slope*
C1[i]+intercept);
268 if (
C1[i]+(
C2[i]-intercept)/slope<
dC1m[i]
269 &&
C1[i]+(
C2[i]-intercept)/slope>0)
270 dC1m[i]=
C1[i]+(
C2[i]-intercept)/slope;
275 if (
C1[i]-
C2[i]/slope+intercept/slope<
dC1m[i] &&
277 C1[i]-
C2[i]/slope+intercept/slope>0)
278 dC1m[i]=
C1[i]-
C2[i]/slope+intercept/slope;
279 if (-
C1[i]-
C2[i]/slope+intercept/slope>0 &&
280 -
C1[i]-
C2[i]/slope+intercept/slope<
dC1p[i] &&
282 dC1p[i]=-
C1[i]-
C2[i]/slope+intercept/slope;
283 if((
C1[i]*slope+intercept)-
C2[i]<
dC2p[i] &&
285 && (
C1[i]*slope+intercept)-
C2[i]>0)
286 dC2p[i]=(
C1[i]*slope+intercept)-
C2[i];
287 if((-
C1[i]*slope+intercept)-
C2[i]<
dC2p[i] &&
289 && (-
C1[i]*slope+intercept)-
C2[i]>0)
290 dC2p[i]=(-
C1[i]*slope+intercept)-
C2[i];
299 for (
size_t i=0; i<
GetN(); i++) {
std::vector< double > dC1m
step length to previous point alone C1
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 > 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.
void CalculateE()
Calculate Et, E1, E2, E3 from Vp.
Configuration of segmented true coaxial detectors.
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 OverRelaxAt(size_t idx)
Over relax potential Vp[.
static const double mm
minimeter
std::vector< bool > fIsDepleted
true if a grid point is depleted
Detector * fDetector
! Pointer to associated detector object
std::vector< double > dC2p
step length to next point along C2
void ReallocateGridPointsNearBoundaries(PointContact &detector)
A file defining commonly used units & constants.
static const double pF
pico farad
double GetImpurity(double height)
Return net impurity concentration at.
void GetInfoFrom(Segmented &detector)
virtual void CalculateE()
Calculate Et, E1, E2, E3 from Vp.
double GetC()
Get detector capacitance.
void CheckConfigurations()
std::vector< double > Vp
potential at each point
static const double Qe
electron charge in Coulomb [C]
void SetupWith(Detector &detector)
Fix potentials on boundaries based on.
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
double RelaxationFactor
within (0,2), used to speed up convergence