I want to calculate the time of the electrons drifting to the collecting plate when proton passing through the gas ionization chamber, which function I should use and how to confirm the coordinates of the collecting plate because the model is imported from the ansys.
It depends on the class that you are using for simulating the electron drift.
With AvalancheMicroscopic and AvalancheMC you can do something like this:
for (const auto& electron : aval.GetElectrons()) {
const auto& endPoint = electron.path.back();
const double driftTime = endPoint.t;
}
See also Examples/Gem/gem.C · master · garfield / garfieldpp · GitLab
With DriftLineRKF you can use the function GetDriftTime.
Hi,
Thanks for your help. I have used the DriftLineRKF in my code, so I choose to use the GetDriftTime, however there must be something wrong like the code used below
DriftLineRKF drift;
drift.SetSensor(&sensor);
drift.SetMaximumStepSize(0.01);
drift.GetDriftTime();
I can’t get the result of the drifttime
You first need to simulate a drift line (drift.DriftElectron(...)).
GetDriftTime returns a double; if you want to print out the drift time you need to do something like
std::cout << "Drift time: " << drift.GetDriftTime(); << " ns\n";
What exactly does the plot show? The signal from a single electron? Or from all electrons on a charged-particle track?
it’s the IntegrateSignals, looks like all lectrons on a charged-particle track and then normalized.
Ok. So to what starting point does the drift time (239 ns) correspond to? If it’s for an electron that has to drift all the way through the chamber then I would indeed expect it to be identical to the duration of the signal; but maybe it’s an electron released somewhere in the middle of the gap?

