# Unexpexted signal shape of MDT tube

**URL:** <https://root-forum.cern.ch/t/unexpexted-signal-shape-of-mdt-tube/63046>\
**Category:** Garfield++\
**Created:** [February 27, 2025, 5:39pm UTC](https://root-forum.cern.ch/t/unexpexted-signal-shape-of-mdt-tube/63046 "2025-02-27T17:39:17Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Linnuo](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/439d5e/32.png) [@Linnuo](https://root-forum.cern.ch/u/Linnuo)\
**Post date:** [February 27, 2025, 5:39pm UTC](https://root-forum.cern.ch/t/unexpexted-signal-shape-of-mdt-tube/63046/1 "2025-02-27T17:39:17Z")

</div>

Dear experts,

I am working on the simulation for a MDT tube.And I use`TrackHeed' and 'DriftLineRKF`module. I expext the shape of the signal (without convolution) should have a rising edge sharper than falling edge but actually not. Could you help me to figure it out?

```auto
  // Make a sensor.
  Sensor sensor;
  // sensor.EnableDebugging();
  sensor.AddComponent(&fm);
  sensor.AddElectrode(&fm,"s");
  sensor.SetArea(
    -1, -1, 0,
    1, 1, 30
  );
  const double tmax = 2000;
  const double tmin = 200;
  const unsigned int nbins = 80000;
  const double tstep = (tmax-tmin)/nbins;
  sensor.SetTimeWindow(tmin, tstep, nbins);
  // Set the delta reponse function.
  if (!readTransferFunction(sensor)) return 0;
  sensor.ClearSignal();
  TrackHeed track;
  track.SetParticle("muon");
  track.SetEnergy(0.5e9);
  track.SetSensor(&sensor);

  // // RKF integration.
  DriftLineRKF drift(&sensor);
  drift.SetGainFluctuationsPolya(0., 20000.);
  drift.EnableIonTail();

 TCanvas* cD = nullptr;
  ViewDrift driftView;
  constexpr bool plotDrift = true;
  if (plotDrift) {
    cD = new TCanvas("cD", "", 600, 600);
    driftView.SetCanvas(cD);
    drift.EnablePlotting(&driftView);
    track.EnablePlotting(&driftView);
    // cD->SaveAs("tubedrift.png")
  }
 
  TCanvas* cS = nullptr;
  TCanvas* cS1 = nullptr;

  constexpr bool plotSignal = true;
  if (plotSignal) {
    cS = new TCanvas("cS", "", 3200, 2400);
    cS1 = new TCanvas("cS1", "", 3200, 2400);
  }

  
  const double x0 = rTrack;
  const double y0 = -sqrt(rTube * rTube - rTrack * rTrack);
  const unsigned int nTracks = 5;

  for (unsigned int j = 0; j < nTracks; ++j) {
    std::ofstream outfile_cluster_time;
    TString cluster_time_filename;
    cluster_time_filename.Form("cluster_time_%d.txt",j);
    outfile_cluster_time.open(data_path+cluster_time_filename, std::ios::out);
    sensor.ClearSignal();
    track.NewTrack(x0, y0, 15, 0, 0, 1, 0);
    for (const auto& cluster : track.GetClusters()) {
      double tmin = std::numeric_limits<double>::max();
      for (const auto& electron : cluster.electrons) {
        drift.DriftElectron(electron.x, electron.y, electron.z, electron.t);
        
        double xf = 0., yf = 0., zf = 0., tf = 0.;
        int stat = 0;
        drift.GetEndPoint(xf, yf, zf, tf, stat);
        tmin = std::min(tmin, tf);
        drift.DriftIon(electron.x, electron.y, electron.z, electron.t);
        // std::cout<<electron.e<<std::endl;
      }
      outfile_cluster_time << tmin << "\n";
    }
    if (plotDrift) {
      cD->Clear();
      // cmp.PlotCell(cD);
      ViewFEMesh* meshView = new ViewFEMesh(&fm);
      meshView->SetArea(-1,-1,0,1,1,30);
      meshView->SetCanvas(cD);
      // x-z projection.
      meshView->SetPlane(0, 0, 1, 0, 0, 0);
      meshView->SetFillMesh(true);
      // Set the color of the kapton and the metal.
      meshView->SetColor(1, kYellow + 3);
      meshView->SetColor(2, kGray);
      meshView->EnableAxes();
      meshView->Plot();
      // cd->SaveAs("Mesh.png");
      constexpr bool twod = true;
      constexpr bool drawaxis = false;
      driftView.Plot(twod, drawaxis);
      cD->SaveAs("tubedrift.png");
    }
    // sensor.ConvoluteSignals();
    int nt = 0;
    if (!sensor.ComputeThresholdCrossings(-0.5, "s", nt)) continue;
    if (plotSignal){

      std::cout<<"print signal"<<std::endl;
      ViewSignal signalView;
      signalView.SetCanvas(cS);
      // signalView.EnableLegend();
      signalView.SetSensor(&sensor);
      signalView.PlotSignal("s","tei");
      sensor.PlotSignal("s", cS1,"t");
      TString fig1_name;
      fig1_name.Form("te_noCon_thr0_%d.png",j);
      TString fig2_name;
      fig2_name.Form("t_noCon_thr0_%d.png",j);
      cS->SaveAs(data_path+fig1_name);
      cS1->SaveAs(data_path+fig2_name);
    }

```

 ![image](https://root-forum.cern.ch/uploads/default/original/3X/3/2/32bda6cfe274cc7d70b2e2a165c03b957216c574.png)

---

<div class="post-metadata">

**Author:** ![hschindl](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/h/977dab/32.png) [@hschindl](https://root-forum.cern.ch/u/hschindl)\
**Post date:** [February 27, 2025, 5:59pm UTC](https://root-forum.cern.ch/t/unexpexted-signal-shape-of-mdt-tube/63046/2 "2025-02-27T17:59:23Z")

</div>

Hi,  
I guess you are referring to the signal induced by the electrons (the “spikes” in your plot)? What shape would you expect?

---

<div class="post-metadata">

**Author:** ![Linnuo](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/439d5e/32.png) [@Linnuo](https://root-forum.cern.ch/u/Linnuo)\
**Post date:** [February 27, 2025, 6:31pm UTC](https://root-forum.cern.ch/t/unexpexted-signal-shape-of-mdt-tube/63046/3 "2025-02-27T18:31:06Z")

</div>

Hi, it refers to the spike. I think the rising edge should be steeper than falling edge.  
Thank you so much!

---

<div class="post-metadata">

**Author:** ![Piet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/piet/32/12536_2.png) [@Piet](https://root-forum.cern.ch/u/Piet)\
**Post date:** [February 28, 2025, 2:32pm UTC](https://root-forum.cern.ch/t/unexpexted-signal-shape-of-mdt-tube/63046/4 "2025-02-28T14:32:23Z")

</div>

Dear @Linnuo can you provide a piece of code that reproduce the problem? Maybe you are not plotting the ion tails. Did you load the ion drift velocity. Can you try to plot the electron signal and ion signal separately?  
greets  
Piet

---

<div class="post-metadata">

**Author:** ![Linnuo](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/439d5e/32.png) [@Linnuo](https://root-forum.cern.ch/u/Linnuo)\
**Post date:** [March 3, 2025, 12:08pm UTC](https://root-forum.cern.ch/t/unexpexted-signal-shape-of-mdt-tube/63046/5 "2025-03-03T12:08:16Z")

</div>

Dear Piet,

Thank you so much. I rechecked the configuration and find that my geometry has some problem and electric field near the wire is not high enough to got the avalanche. Now I have solved it.

Best,  
Linnuo

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [March 17, 2025, 12:09pm UTC](https://root-forum.cern.ch/t/unexpexted-signal-shape-of-mdt-tube/63046/6 "2025-03-17T12:09:00Z")

</div>

Closed on March 17, 2025, 12:09pm UTC

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