 holding structure nearby.
Overall, fieldgen seems to be the maturest at this moment for users interested in HPGe field calculation as long as their detector geometry is similar to that of point-contact ones 1. However, the lack of detailed documentation makes it hard for a developer to modify the code of fieldgen for other geometries or to add new features. This is one of the reasons why many research groups write their own code for HPGe detector field calculation instead of using the mentioned major players. An obvious advantage of home brewed code is that it is well understood and easy to tune if needed. The second advantage is that writing their own code instead of using existing ones deepens the understanding of junior researchers on HPGe detector working principles and numerical calculation techniques. Drawbacks of this approach include the limited functionality, the lack of verification and the waste of time in reinventing the wheel.
GeFiCa is aimed at clear explanation and demonstration of the analytic and numeric methods to solve Poisson's equation, practical coding considerations and visualization methods. It does so by providing intensive documentation and example macros, and serves as a one-stop resource for people who want to understand the operating mechanism of such a package under the hood. None of the tools mentioned above fits all applications. Home brewed codes built on top of some existing tools may be the best choice for education and specific applications, as long as the drawbacks mentioned previously can be effectively overcome through the demonstration provided in GeFiCa.

Space charges
HPGe crystals come in two types. As shown in Fig. 1, if the trace impurity atoms in a crystal provide freemoving electrons (phosphorus, for example), the crystal is of n-type, and if the atoms provide free-moving holes (boron, for example), the crystal is of p-type. In both literature and popular science articles, these freemoving charge carriers are often preceded with adjectives like "extra" or "excess", which may lead to a false impression that an n-type crystal has "extra" electrons donated by donor impurity atoms and is hence negatively charged, or that a p-type crystal has "extra" holes (vacancies in covalent bonds) due to acceptor impurity atoms and is positively charged. These free-moving charges can be regarded as "extra" since they are not used in forming covalent bonds between atoms, which is the fundamental reason why they are free. But they are not "extra" charges that break the balance of the numbers of protons and electrons in a crystal. Actually, no matter which type it is, a crystal is electrically neutral as a whole because the number of protons are the same as the number of electrons in both impurity and Ge atoms. As trivial as it sounds, this fact is worthy of emphasizing, especially for one to understand the sign of space charges to be mentioned in the following paragraph. When the bias voltage applied to a crystal is high enough, all free-moving charge carriers can be swept out of the bulk of the crystal. The crystal is said to be depleted of free charge carriers. In an n-type crystal, it is the free-moving electrons that are swept out. Consequently, the trace impurity atoms are positively ionized. Since the ions are fixed in their locations in the crystal, they cannot be swept out by the external electric field, and are hence called "space charges". In a p-type crystal, however, the space charges are negative, since it is the free-moving holes that are swept out. It is quite counter intuitive for one to realize the fact that a depleted n-type crystal is actually positively charged and a p-type negatively charged. Space charges create an electric field in addition to the one that is created by the bias voltage. The total electric field inside a depleted crystal is a linear combination of these two.
The space charge density distribution, normally denoted as ρ, can be quite complicated due to the nature of HPGe single crystal growth process [30,31]. It is normally characterized in the following way. First, a few wafers are cut from various axial positions in a HPGe single-crystal boule pulled using the Czochralski method, typically, one from the shoulder and one from the tail of the boule. Second, small samples are cut from individual wafers along their radius. Net impurity concentrations of these samples, N A − N D, are then measured using Hall-effect, where N A is the acceptor concentration, N D donor concentration, with a unit of cm −3. Since there is a relationship between ρ and N A − N D as explained in the previous paragraph: where e = 1.6 × 10 −19 C is the elementary charge, both the vertical (axial) and radial distributions of ρ can be investigated this way. A typical vertical net impurity concentration profile of a HPGe single-crystal boule is shown in Fig. 3 taken from [30] with a vertical double-dotted dashed line added to clearly indicate the p-type and n-type regions. The dashed line indicates the contribution from a typical p-type impurity element, Al. The dotted dashed curve indicates the contribution from another typical ptype impurity element, B. The dotted curve shows the contribution from a typical n-type impurity element, P. The solid curve broken around 80% of the boule is the overall net impurity concentration. The crystal is of p-type from 0 to 80% of its length, and changes to n-type after that. The curve is approximately flat from 20% to 40%, which is a typical portion of the boule to be harvested for detector fabrication. A typical radial net impurity concentration profile of a HPGe single crystal is shown in Fig. 4 taken from [31]. It is basically flat from 0 to a certain radius, but increases dramatically close to the skin of the crystal. Sometimes, a crystal may even change its type from its center to its outer radius, as mentioned in [30]. The skin of a boule may be removed so that the central part used for detector fabrication has a relatively constant impurity distribution. Given those experimental evidences, the space charge density in general has to be expressed as a function of location, i.e., ρ(x), where x is a vector indicating the location of interest. Since the measurement of impurity is destructive for the raw material, the real impurity distribution in a crystal used for detector fabrication is usually unknown. Normally, only the average impurities close to the top and bottom of the cut portion of the crystal are known. The impurity distribution in between is regarded as a constant or approximated by a first-order polynomial determined by the average top and bottom impurities. If the right portion of a crystal (20-40% of the black line in Fig. 3, for example) is harvested for detector fabrication, this is normally an acceptable approximation. However, one has to keep in mind that our knowledge of the real impurity distribution is incomplete, and our approximation may have sizable uncertainties.

Poisson's Equation
The existence of space charges complicates the calculation of the electrostatic potential in a HPGe detector. Without space charges, the potential can be calculated by solving Laplace's equation, where V (x) is the potential to be determined. With space charges, however, the potential must be calculated by solving Poisson's equation, which takes into account the space charge distribution in the bulk of a detector: where = 0 r with 0 ≈ 8.854 × 10 −12 F/m being the permittivity in vacuum, and r ≈ 16.0 being the relative permittivity (or dielectric constant) of Ge. Both differential equations have an infinite amount of solutions characterized by a few undetermined constants. These constants can be fixed by boundary conditions, which refers to the voltage values on detector electrodes. The relationship between these two equations can be understood better when we consider two different boundary condition setups: first, potentials of electrodes of a detector are set based on the bias voltage applied to the detector, second, they are all set to zero. If Laplace's equation is solved with the first setup, its solution is a potential field caused by the bias only. If Poisson's equation is solved with the second setup, its solution is simply the potential caused by the space charges only. The potential in a detector is a linear combination of these two solutions. We can also solve Poisson's equation with the first set of boundary conditions, which directly results in the combined potential.
In addition to the potential, we are also interested in the electric field distribution in a detector. The electric field vector E can be then determined with the equation These equations are rather abstract. A concrete expression can be obtained in a specific coordinate system. For example, in Cartesian coordinates, Poisson's equation reads, where, x, y, z are the three Cartesian coordinates. The expression of Poisson's equation in spherical and cylindrical coordinates are listed in Appendix A.

Planar Detectors
As mentioned in section 2, in general, the space charge density ρ is a function of x, and there is no analytic solution for three dimensional Poisson's equation with a complicated ρ(x). However, in certain highly symmetric detector configurations, Poisson's equation can be significantly simplified and its analytic solution can be obtained. For example, at the center of a large but thin planar HPGe detector, the electric potential can be regarded as only varying along the thickness of the detector, x, and ρ can be regarded as a constant. Eq. 5 can then be simplified to Its analytic solution reads, where C 1 and C 2 are constants which can be determined using two boundary conditions, i.e., the voltages of two planar detector electrodes. The electric field reads,   6 shows the voltage versus the thickness of a planar detector, assuming a thickness of 1 cm and a voltage of 2,000 V applied to its top electrode. The net impurity concentration corresponding to each curve in the figure is listed in the legend. When ρ = 0, Eq. 7 becomes V = C 2 x