GeFiCa Germanium detector Field Calculator
GeFiCa::RhoPhi Class Reference

2D cylindrical coordinates in rho-phi plane. More...

#include <RhoPhi.h>

Inheritance diagram for GeFiCa::RhoPhi:

## Public Member Functions

RhoPhi (size_t n1=101, size_t n2=180)

void SetupWith (Detector &detector)
Fix potentials on boundaries based on. More...

double GetC ()

Public Member Functions inherited from GeFiCa::Grid
Grid (size_t n1=0, size_t n2=0, size_t n3=0)
Default constructor. More...

virtual ~Grid ()

void SuccessiveOverRelax ()
Successively over-relax potentials on grid points. More...

void SolveAnalytically ()
Solve Poisson's Equation analytically. More...

double GetV (double c1, double c2=0, double c3=0) const
Get potential at (c1,c2,c3) by interpolation. More...

double GetE (double c1, double c2=0, double c3=0) const

double GetE1 (double c1, double c2=0, double c3=0) const

double GetE2 (double c1, double c2=0, double c3=0) const

double GetE3 (double c1, double c2=0, double c3=0) const

double GetC ()
Get detector capacitance. More...

TTree * GetTree (bool createNew=false)
Create &/or return a TTree with field data. More...

bool IsDepleted ()
Check if every grid point is depleted. More...

Gridoperator*= (double scale)
Potentials at all points are multiplied by. More...

Gridoperator+= (Grid &other)
Potentials of this grid are summed with those of. More...

virtual FieldLineGetFieldLineFrom (double c1, double c2, double c3=0, bool positive=true)
Propogate a field line from (c1,c2,c3). More...

Public Member Functions inherited from GeFiCa::Points
size_t GetN ()
total number of points More...

## Protected Member Functions

void OverRelaxAt (size_t idx)
Over relax potential Vp[. More...

void CalculateE ()
Calculate Et, E1, E2, E3 from Vp. More...

ClassDef (RhoPhi, 1)

Protected Member Functions inherited from GeFiCa::Grid
size_t GetIdxOfPointToTheRightOf (double c1, size_t begin, size_t end) const
Get index of point near. More...

size_t GetIdxOfPointToTheRightOf (double c1, double c2, size_t begin, size_t end) const

size_t GetIdxOfPointToTheRightOf (double c1, double c2, double c3, size_t begin, size_t end) const

virtual double GetData (const std::vector< double > &data, double c1, double c2, double c3) const
Interpolate grid data at (c1,c2,c3). More...

size_t GetIdxOfMaxV ()
Get index of the grid point with max potential. More...

size_t GetIdxOfMinV ()
Get index of the grid point with min potential. More...

double twopoint (double dataset[2], double tarlocationset, double pointxset[2]) const
Calculate interpolation value between two point. More...

double threepoint (double dataset[3], double tarlocationset[2], double pointxset[3], double pointyset[3]) const
Calculate interpolation value between three point (triangle) More...

double fourpoint (double dataset[4], double tarlocationset[2], double pointxset[4], double pointyset[4]) const
Calculate interpolation value between four point (rectangle) More...

ClassDef (Grid, 1)

Public Attributes inherited from GeFiCa::Grid
size_t N1
number of points along the 1st coordinate More...

size_t N2
number of points along the 2nd coordinate More...

size_t N3
number of points along the 3rd coordinate More...

std::vector< double > Src
-(net impurity concentration)x|Qe|/epsilon More...

size_t MaxIterations
maximal iterations of SOR to be performed More...

double RelaxationFactor
within (0,2), used to speed up convergence More...

double Tolerance
SOR stops when error<Tolerance. More...

size_t Iterations
number of iterations of SOR performed More...

Public Attributes inherited from GeFiCa::Points
std::vector< double > C1
the 1st coordinates of the points More...

std::vector< double > C2
the 2nd coordinates of the points More...

std::vector< double > C3
the 3rd coordinates of the points More...

std::vector< double > Vp
potential at each point More...

std::vector< double > Et
total electric field strength More...

std::vector< double > E1
projection of Et on C1 More...

std::vector< double > E2
projection of Et on C2 More...

std::vector< double > E3
projection of Et on C3 More...

std::vector< double > dC1p
step length to next point alone C1 More...

std::vector< double > dC1m
step length to previous point alone C1 More...

std::vector< double > dC2p
step length to next point along C2 More...

std::vector< double > dC2m
step length to previous point along C2 More...

std::vector< double > dC3p
step length to next point alone C3 More...

std::vector< double > dC3m
step length to previous point alone C3 More...

Protected Attributes inherited from GeFiCa::Grid
std::vector< bool > fIsFixed
true if field values are fixed More...

std::vector< bool > fIsDepleted
true if a grid point is depleted More...

TTree * fTree
! ROOT tree to visualize fields More...

DetectorfDetector
! Pointer to associated detector object More...

## Detailed Description

2D cylindrical coordinates in rho-phi plane.

Examples:
segmented/drawSliceInPhi.cc.

Definition at line 9 of file RhoPhi.h.

## § RhoPhi()

 GeFiCa::RhoPhi::RhoPhi ( size_t n1 = 101, size_t n2 = 180 )
inline

Definition at line 12 of file RhoPhi.h.

12  : Grid(n1, n2) {
13  fName="rhophi"; fTitle="2D cylindrical coordinates in rho-phi"; }
Grid(size_t n1=0, size_t n2=0, size_t n3=0)
Default constructor.
Definition: Grid.cc:26

## § CalculateE()

 void RhoPhi::CalculateE ( )
protectedvirtual

Calculate Et, E1, E2, E3 from Vp.

Reimplemented from GeFiCa::Grid.

Definition at line 83 of file RhoPhi.cc.

84 {
85  Grid::CalculateE(); // deal with E1
86  for (size_t i=0; i<GetN(); i++) { // deal with E2
87  E2[i]=(Vp[i+N1]-Vp[i-N1])/(dC2p[i]+dC2m[i])/C1[i];
88  if (i<N1) E2[i]=(Vp[i+N1]-Vp[i])/dC2p[i]/C1[i]; // lower boundary
89  if (i>GetN()-N1) E2[i]=(Vp[i]-Vp[i-N1])/dC2m[i]/C1[i]; // upper boundary
90  if (i%N1==0) E1[i]=(Vp[i+1]-Vp[i])/dC1p[i]/C1[i]; // left boundary
91  if ((i+1)%N1==0) E1[i]=(Vp[i]-Vp[i-1])/dC1m[i]/C1[i]; // right boundary
92  Et[i]=sqrt(E1[i]*E1[i]+E2[i]*E2[i]);
93  }
94 }
std::vector< double > dC1m
step length to previous point alone C1
Definition: Grid.h:21
std::vector< double > E1
projection of Et on C1
Definition: Grid.h:17
size_t N1
number of points along the 1st coordinate
Definition: Grid.h:53
std::vector< double > dC1p
step length to next point alone C1
Definition: Grid.h:20
size_t GetN()
total number of points
Definition: Grid.h:26
std::vector< double > dC2m
step length to previous point along C2
Definition: Grid.h:23
std::vector< double > dC2p
step length to next point along C2
Definition: Grid.h:22
virtual void CalculateE()
Calculate Et, E1, E2, E3 from Vp.
Definition: Grid.cc:551
std::vector< double > Vp
potential at each point
Definition: Grid.h:15
std::vector< double > Et
total electric field strength
Definition: Grid.h:16
std::vector< double > E2
projection of Et on C2
Definition: Grid.h:18
std::vector< double > C1
the 1st coordinates of the points
Definition: Grid.h:12

## § ClassDef()

 GeFiCa::RhoPhi::ClassDef ( RhoPhi , 1 )
protected

## § GetC()

 double GeFiCa::RhoPhi::GetC ( )

## § OverRelaxAt()

 void RhoPhi::OverRelaxAt ( size_t idx )
protectedvirtual

Over relax potential Vp[.

Parameters
 idx].

Reimplemented from GeFiCa::Grid.

Definition at line 43 of file RhoPhi.cc.

44 {
45  if (fIsFixed[idx]) return; // no need to calculate on boundaries
46
47  double vphip=Vp[idx+N1],vphim=Vp[idx-N1]; // v_phi_+/-
48  double vrhop=Vp[idx+1],vrhom=Vp[idx-1]; // v_rho_+/-
49  if (idx<N1) vphim=Vp[idx+GetN()-N1]; // phi==0 line
50  if (idx>=GetN()-N1) vphip=Vp[idx-GetN()+N1]; // phi==2pi line
51  double vnew = (vrhop/(dC1p[idx]*(dC1m[idx]+dC1p[idx]))
52  +vrhom/(dC1m[idx]*(dC1m[idx]+dC1p[idx]))
53  +vphip/C1[idx]/C1[idx]/dC2m[idx]/(dC2p[idx]+dC2m[idx])
54  +vphim/C1[idx]/C1[idx]/dC2p[idx]/(dC2p[idx]+dC2m[idx])
55  -Src[idx]/2+(vrhop-vrhom)/2/C1[idx]/(dC1m[idx]+dC1p[idx]))
56  /(1/dC1p[idx]/(dC1m[idx]+dC1p[idx])+1/dC1m[idx]/(dC1m[idx]+dC1p[idx])
57  +1/C1[idx]/C1[idx]/dC2p[idx]/(dC2p[idx]+dC2m[idx])
58  +1/C1[idx]/C1[idx]/dC2m[idx]/(dC2p[idx]+dC2m[idx]));
59  vnew=RelaxationFactor*(vnew-Vp[idx])+Vp[idx]; // over relex
60
61  double vmin=vrhom; // minimal Vp around point[idx]
62  if (vmin>vrhop) vmin=vrhop;
63  if (vmin>vphip) vmin=vphip;
64  if (vmin>vphim) vmin=vphim;
65
66  double vmax=vrhom; // maximal Vp around point[idx]
67  if (vmax<vrhop) vmax=vrhop;
68  if (vmax<vphip) vmax=vphip;
69  if (vmax<vphim) vmax=vphim;
70
71  if (vnew<vmin) {
72  Vp[idx]=vmin; fIsDepleted[idx]=false;
73  } else if (vnew>vmax) {
74  Vp[idx]=vmax; fIsDepleted[idx]=false;
75  } else {
76  Vp[idx]=vnew; fIsDepleted[idx]=true;
77  }
78  // update Vp for impurity-only case even if the point is undepleted
79  if (fDetector->Bias[0]==fDetector->Bias[1]) Vp[idx]=vnew;
80 }
std::vector< double > dC1m
step length to previous point alone C1
Definition: Grid.h:21
std::vector< double > Bias
bias on electrodes
Definition: Detector.h:35
std::vector< bool > fIsFixed
true if field values are fixed
Definition: Grid.h:128
std::vector< double > Src
-(net impurity concentration)x|Qe|/epsilon
Definition: Grid.h:56
size_t N1
number of points along the 1st coordinate
Definition: Grid.h:53
std::vector< double > dC1p
step length to next point alone C1
Definition: Grid.h:20
size_t GetN()
total number of points
Definition: Grid.h:26
std::vector< double > dC2m
step length to previous point along C2
Definition: Grid.h:23
std::vector< bool > fIsDepleted
true if a grid point is depleted
Definition: Grid.h:129
Detector * fDetector
! Pointer to associated detector object
Definition: Grid.h:131
std::vector< double > dC2p
step length to next point along C2
Definition: Grid.h:22
std::vector< double > Vp
potential at each point
Definition: Grid.h:15
std::vector< double > C1
the 1st coordinates of the points
Definition: Grid.h:12
double RelaxationFactor
within (0,2), used to speed up convergence
Definition: Grid.h:58

## § SetupWith()

 void RhoPhi::SetupWith ( Detector & detector )
virtual

Fix potentials on boundaries based on.

Parameters
 detector geometry. It fills Points data based on detector geometry and N1, N2 and/or N3, and raises the flag fIsFixed for points on/outside electrodes. It has to be called before SuccessiveOverRelax().

Reimplemented from GeFiCa::Grid.

Examples:
segmented/drawSliceInPhi.cc.

Definition at line 6 of file RhoPhi.cc.

7 {
8  Grid::SetupWith(detector); // check number of calls
9
10  TString type(detector.ClassName());
11  if (type.Contains("Segmented")==false) {
12  Error("SetupWith", "%s is not expected. "
13  "Please pass in a Segmented detector.", type.Data());
14  abort();
15  }
16  Segmented& sip = (Segmented&) detector;
17  sip.CheckConfigurations();
18  fDetector = &detector; // for GetC to use fDetector->Bias[]
19
21  for (size_t i=0; i<N1*N2; i++) {
22  dC1p.push_back(dR/(N1-1)); dC1m.push_back(dR/(N1-1));
23  dC2p.push_back(2*Pi/N2); dC2m.push_back(2*Pi/N2);
24  C1.push_back(sip.BoreR+i%N1*dC1p[i]); C2.push_back(i/N1*2*Pi/N2);
25  E1.push_back(0); E2.push_back(0); Et.push_back(0); Vp.push_back(0);
26  fIsFixed.push_back(false); fIsDepleted.push_back(false);
27  Src.push_back(-sip.TopImpurity*Qe/epsilon);
28  // fine tuning
29  if (i%N1==0) { // inner surface
30  dC1m[i]=0; fIsFixed[i]=true; Vp[i]=sip.Bias[0];
31  } else if ((i+1)%N1==0) { // outer surface
32  dC1p[i]=0; fIsFixed[i]=true;
33  if (C2[i]>=2*Pi/sip.Nphi*(sip.SegmentId-1)
34  && C2[i]<=2*Pi/sip.Nphi*sip.SegmentId)
35  Vp[i]=sip.Bias[1]; // weighting potential for the selected segment
36  else Vp[i]=sip.Bias[0]; // weighting potential for other segments
37  } else
38  Vp[i]=(sip.Bias[0]+sip.Bias[1])/2;
39  }
40 }
std::vector< double > dC1m
step length to previous point alone C1
Definition: Grid.h:21
std::vector< double > Bias
bias on electrodes
Definition: Detector.h:35
size_t Nphi
total number of segments in phi
Definition: Segmented.h:16
static const double Pi
Definition: Units.h:29
Definition: Segmented.h:14
std::vector< bool > fIsFixed
true if field values are fixed
Definition: Grid.h:128
std::vector< double > E1
projection of Et on C1
Definition: Grid.h:17
size_t N2
number of points along the 2nd coordinate
Definition: Grid.h:54
size_t SegmentId
segment Id in [0, Nphi*Nz]
Definition: Segmented.h:18
std::vector< double > Src
-(net impurity concentration)x|Qe|/epsilon
Definition: Grid.h:56
size_t N1
number of points along the 1st coordinate
Definition: Grid.h:53
std::vector< double > C2
the 2nd coordinates of the points
Definition: Grid.h:13
virtual void SetupWith(Detector &detector)
Fix potentials on boundaries based on.
Definition: Grid.cc:111
Configuration of segmented true coaxial detectors.
Definition: Segmented.h:11
std::vector< double > dC1p
step length to next point alone C1
Definition: Grid.h:20
std::vector< double > dC2m
step length to previous point along C2
Definition: Grid.h:23
static const double epsilon
permittivity of Ge [C/volt/cm]
Definition: Units.h:27
std::vector< bool > fIsDepleted
true if a grid point is depleted
Definition: Grid.h:129
Detector * fDetector
! Pointer to associated detector object
Definition: Grid.h:131
double BoreR
Definition: Segmented.h:15
std::vector< double > dC2p
step length to next point along C2
Definition: Grid.h:22
void CheckConfigurations()
Definition: Segmented.cc:11
std::vector< double > Vp
potential at each point
Definition: Grid.h:15
double TopImpurity
net impurity concentration at top of crystal
Definition: Detector.h:14
static const double Qe
electron charge in Coulomb [C]
Definition: Units.h:24
std::vector< double > Et
total electric field strength
Definition: Grid.h:16
std::vector< double > E2
projection of Et on C2
Definition: Grid.h:18
std::vector< double > C1
the 1st coordinates of the points
Definition: Grid.h:12

The documentation for this class was generated from the following files: