AvalancheMC: DriftElectron does simulate avalanche multiplication in some cases
From my understanding, the goal of the AvalancheMC::DriftElectron
function is to calculate the drift of a single electron, without avalanche multiplication (compared to AvalancheMC::AvalancheElectron
).
This is achieved by passing aval == false
to AvalancheMC::TransportParticles
, which is passed on to AvalancheMC::DriftLine
.
Within DriftLine
, the aval
value is used to decide to call (or not) the AvalancheMC::ComputeGainLoss
function on line 483.
From my understanding, this function (ComputeGainLoss
) handles both avalanche multiplication and attachment (trapping).
Now the problem comes, from how this function is called:
if ((particle == Particle::Electron || particle == Particle::Hole) &&
(aval || m_useAttachment) &&
(m_sizeCut == 0 || m_nElectrons < m_sizeCut)) {
ComputeGainLoss(particle, path, status, secondaries, semiconductor);
if (status == StatusAttached && m_debug) std::cout << " Attached.\n";
}
(aval || m_useAttachment)
indicates, that the ComputeGainLoss
is calculated when either avalanche multiplication is enabled, or if attachment is enabled. But this means, that for example if only attachment is enabled m_useAttachment == true
(as by default), the avalanche process is still simulated.
This is summarized in this table:
m_useAttachment == false |
m_useAttachment == true (default) |
|
---|---|---|
aval == false |
No attachment and no avalanche | Attachment and avalanche |
aval == true |
Attachment and avalanche | Attachment and avalanche |
The entries marked in bold are wrong in my opinion.
So in summary, in my opinion the current behaviour of AvalancheMC, with respect to enabling or not avalanche multiplication is wrong and certainly not intuitive.