I am currently working on simulating cluster formation in sMDT tubes and am particularly interested in distinguishing primary from secondary ionization clusters.
From my understanding, using DisableDeltaElectronTransport() allows us to isolate only primary clusters, while enabling delta electron transport introduces both primary and secondary ionizations. I would like to ask whether Garfield++ provides a way to directly trace the origin of individual electrons—i.e., whether an electron was produced in a primary ionization or is a result of a secondary interaction.
In particular, in high-density gases such as isobutane (iC₄H₁₀), a single cluster may contain multiple electrons, potentially originating from both primary and secondary ionizations. In such cases, is there a more robust method within Garfield++ to distinguish primary clusters from secondary ones beyond simply counting electrons per cluster?
I am no expert, but I think you can achieve what you’re looking for by using two separate instances of TrackHeed. The 1st instance would be responsible for the transport of the charged relativistic particle and the 2nd one would be responsible for the transport of the delta electrons. Basically you would need to disable the delta electron transport of the 1st instance and call TrackHeed::TransportDeltaElectron from the 2nd instance for each of the primary electrons.
// Transport of charged relativistic particles
TrackHeed track(&sensor);
track.SetParticle("muon");
track.SetKineticEnergy(1e9);
track.DisableDeltaElectronTransport();
// Transport of delta electrons
TrackHeed delta(&sensor);
// Initial position and direction of the particle
double x0 = 0., y0 = 0., z0 = 0., t0 = 0.;
double dx0 = 0., dy0 = 0., dz0 = 1.;
// Simulate the particle track
track.NewTrack(x0, y0, z0, t0, dx0, dy0, dz0);
// Loop over the clusters
for (const auto &cluster : track.GetClusters()) {
// Loop over the cluster electrons
for (const auto &electron : cluster.electrons) {
int ne= 0;
delta.TransportDeltaElectron(electron.x, electron.y, electron.z, electron.t, electron.e,
electron.dx, electron.dy, electron.dz, ne);
/* Some I-O here */
for (const auto &dcluster : delta.GetClusters()) {
for (const auto &delectron : dcluster.electrons) {
/* Some more I-O here */
}
}
}
}
I’ve attached a more complete example, I hope it is more or less what you’re looking for.
Thanks a lot for your answer, and the code! This is indeed what I needed. I just want to ask to confirm if my understanding is correct: When you are plotting the primary electrons, it is indeed the primary ionizations (electrons), but the number of delta electrons consists of both the primaries and secondaries. Is this correct? So nd - np should give the number of secondary electrons.
Hi,
how do you define nd and np? If you switch off delta electron transport, a “cluster” will contain the “photoelectron” (i. e. the electron kicked out in the interaction of the primary charged particle with the atom/molecule) and - depending on if it was an inner-shell electron or not, and the subsequent relaxation process - the Auger electrons and electrons created by the absorption of a fluorescence photon.
If delta electron is switched on, the “cluster” will contain the coordinates of all electrons once the ionization cascade has finished. Does that make sense?
Yes, it makes sense! nd is the number of delta electrons, and np is the primary electrons, as in the code that Gabriel has attached. So the TransportDeltaElectron takes the primary electrons as the input, and calculates the secondary ionization caused by the primaries. Therefore, delta in the Gabriel’s code contains all electrons.
Thanks a lot.