I have few questions about the avalanche model used in AvalancheMC. I am a PhD student working in detector simulation it is very necessary to understand for me the following questions. I will be thankful to you is you please answer all these.

Is that model derived from the yule-furry model. If yes the as i know yule furry model does not take into account attachment; however here i have seen attachment is introduced.

what is the length of the subdivision of a drift step? is it probth=0.01? how do we get the value?

What is the physical interpretation of the sum of alpha and eta (alps[i] + etas[i])?

Is it possible to get explanation of the following portion of the code from AvalancheMC

// Subdivision of a step.
constexpr double probth = 0.01;
// Compute the number of subdivisions.
const int nDiv = std::max(int((alps[i] + etas[i]) / probth), 1);
// Compute the probabilities for gain and loss.
const double p = std::max(alps[i] / nDiv, 0.);
const double q = std::max(etas[i] / nDiv, 0.);
// Loop over the subdivisions.
for (int j = 0; j < nDiv; ++j) {
if (ne > 100) {
// Gaussian approximation.
const int gain = int(ne * p + RndmGaussian() * sqrt(ne * p * (1. - p)));
const int loss = int(ne * q + RndmGaussian() * sqrt(ne * q * (1. - q)));
ne += gain - loss;
ni += gain;
} else {
// Binomial approximation
for (int k = ne; k--;) {
if (RndmUniform() < p) {
++ne;
++ni;
}
if (RndmUniform() < q) --ne;
}
}

Correct. In a scenario without attachment, the avalanche size distribution (for a flat electric field) you get using AvalancheMC should correspond to a Yule-Furry distribution.

The probability that an electron ionises over a small step dx is given by αdx and the probability for attachment is given by ηdx. The idea is to choose the step size dx such that αdx and ηdx are small compared to 1. The value 0.01 is somewhat arbitrary though, another number << 1 should also do the trick.

Thank you, sir, for your reply. It really helped me to clear my concepts. I have a few more questions regarding the below portion of the code.

// Subdivision of a step.
constexpr double probth = 0.01;
// Compute the number of subdivisions.
const int nDiv = std::max(int((alps[i] + etas[i]) / probth), 1);
// Compute the probabilities for gain and loss.
const double p = std::max(alps[i] / nDiv, 0.);
const double q = std::max(etas[i] / nDiv, 0.);

I understood that αdx and ηdx is corresponding probabilities of ionisation and attachment within length dx. Therefore the total probability is (α+ η)dx (Please correct me if I am wrong) and (α+ η) is total probability per unit length (in Garfield++ unit it is per cm).

Here in the above code probth=0.01. How probth corresponds to dx? is probth unit less?

From this line “const int nDiv = std::max(int((alps[i] + etas[i]) / probth), 1);”, here we are dividing (α+ η)/probth , that means nDiv has unit of number of subdivisions per unit length. Do we here subdivide the total probability per unit length into equal 0.01 segments (Please correct me if I am wrong)?

if we choose probth=0.001 or further small value does it affect the gain? if yes what is the proper criteria to choose it?

Yes, probth is dimensionless (it’s a probability). You want to choose the number of steps nDiv such that (α+η)dx is around probth.

alps[i] and etas[i] are the Townsend coefficient and attachment coefficient integrated over a drift line segment, so they are also dimensionless. nDiv is the number of subdivisions of the drift line segment.

Changing probth to 0.01 should, in theory, not affect the average gain (but the simulation will take longer because you have more steps).