How to get drift time in garfield++

Excuse me sir, I am a freshman in garfield++ and I am researching the relevance between the dirft time of electron and the particle source distance in MDT.

I have read the example DriftTube ,it tells about relationship between time and singal. Now I want to know the dirft time(time of the fastest electron reach sensor) of each track, how could i modify the source code?

Hi,
after calculating a drift line using DriftLineRKF::DriftElectron you can retrieve the arrival time using the function GetEndPoint. To determine the arrival time of the first electron that reaches the wire, you could do something along these lines:

for (unsigned int j = 0; j < nTracks; ++j) {
  track.NewTrack(x0, y0, 0, 0, 0, 1, 0);
  double xc = 0., yc = 0., zc = 0., tc = 0., ec = 0., extra = 0.;
  int nc = 0;
  double tmin = std::numeric_limits<double>::max();
  while (track.GetCluster(xc, yc, zc, tc, nc, ec, extra)) {
    for (int k = 0; k < nc; ++k) {
      double xe = 0., ye = 0., ze = 0., te = 0., ee = 0.;
      double dx = 0., dy = 0., dz = 0.;
      track.GetElectron(k, xe, ye, ze, te, ee, dx, dy, dz);
      drift.DriftElectron(xe, ye, ze, te);
      double xf = 0., yf = 0., zf = 0., tf = 0.;
      int stat = 0;
      drift.GetEndPoint(xf, yf, zf, tf, stat);
      tmin = std::min(tmin, tf);
    }
  }
  std::cout << "First electron arrives at " << tmin << " ns.\n";
}

OK,I think I got it.
Sir ,there is another question. The example give a figure about signal and time. Is there any way to get the data of a specified point(for example I want to know the time when signal come to 10% of the climax)
Appreciate for your anwser sir!

You’re right, you can use GetDriftTime and GetEndPoint to get the arrival time, they return the same number.

You can retrieve the signal in a given time bin using the function
double GetSignal(const std::string& label, const unsigned int bin);
of the Sensor class, where label is the identifier of the electrode (in the drift tube example: “s”), and bin is the bin number (the number of bins and the spacing is set earlier when you call SetTimeWindow).

Sir, what is the unit of signal? I saw the figure write signal[fc], what is fc??

femto Coulomb

Thank you again!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.