After a electron avalanche, the ions drift is expected, the code is:
mc.AvalancheElectron(xx, yy, zz, tt);
double x1,y1,z1,t1,x2,y2,z2,t2;
std::size_t num_tracks;
num_tracks=mc.GetNumberOfElectronEndpoints();
          
 for (std::size_t i = 0; i < num_tracks; i++)
 {
      mc.GetElectronEndpoint(i, x1, y1, z1, t1, x2, y2, z2, t2, status);
      mc.DriftIon(x1, y1, z1, t1);
 }
but the error occured:
“erminate called after throwing an instance of ‘Garfield::Exception’
what():  Index out of range in GetElectronEndpoint at /usr/local/garfieldpp-master/Source/AvalancheMC.cc:196:0”
what is the reason that cause this error?