# Problems about plot signal in Garfield++

**URL:** <https://root-forum.cern.ch/t/problems-about-plot-signal-in-garfield/63746>\
**Category:** Garfield++\
**Created:** [June 17, 2025, 12:16pm UTC](https://root-forum.cern.ch/t/problems-about-plot-signal-in-garfield/63746 "2025-06-17T12:16:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![wxj-imp](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/w/b5e925/32.png) [@wxj-imp](https://root-forum.cern.ch/u/wxj-imp)\
**Post date:** [June 17, 2025, 12:16pm UTC](https://root-forum.cern.ch/t/problems-about-plot-signal-in-garfield/63746/1 "2025-06-17T12:16:58Z")

</div>

Dear experts  
I am a freshman about Garfield++.I have meet some problems in simulating a parallel-plate ion chamber.In my code,I simulated the drift of electrons successfully.But when I try to plot the induced signal,it failed,and the terminal print “Sensor::ConvoluteSignal: No signals present.”.The signal printed in canvas is 0.  
The code and gas table is followed,Thanks for your help.  
[code and gas table.zip](https://root-forum.cern.ch/uploads/short-url/l6icevVGDBTwCGk7q9lys5c2Xv5.zip) (8.7 KB)

 ![error in terminal](https://root-forum.cern.ch/uploads/default/original/3X/3/6/36bf02e39ece70769c0cd9f9c9cbe71ec68c3bbc.jpeg)  
 ![屏幕截图 2025-06-17 202639](https://root-forum.cern.ch/uploads/default/original/3X/6/3/63122c827dbafe4dbb5118f8d51135b8c8e7a6df.jpeg)

---

<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:** [June 17, 2025, 1:07pm UTC](https://root-forum.cern.ch/t/problems-about-plot-signal-in-garfield/63746/2 "2025-06-17T13:07:14Z")

</div>

Hi,  
I’m not sure if the drift line simulation worked. There are a few issues with your code that need to be fixed:

- You should remove the lines

```cpp
    //set sensitive volume
    GeometrySimple geo;
    SolidTube sen_vol(0.,0.,0.,radius,half_gap,0.,1.,0.);
    geo.AddSolid(&sen_vol,&gas);

```

because (1) you already set the sensitive medium with the line

```cpp
cmp.SetMedium(&gas);

```

and (2) the geometry you set (a cylinder) is not consistent with the parallel-plate geometry you are trying to simulate. You can/should also remove the lines related to `ViewGeometry`.

- You can remove the lines

```cpp
cmp.AddReadout("anode");
cmp.AddReadout("cathode");

```

(the weighting fields for the planes are computed automatically if you give them a label).

- As you can see from the error message printed by `TrackHeed`, the energy of the particle is too low.

```auto
track.SetParticle("alpha");
track.SetEnergy(5.4e6);

```

Note that `SetEnergy` sets the total energy of the particle, to set the kinetic energy you can use `SetKineticEnergy`. Be aware that the model used by Heed to compute the inelastic cross-section is not reliable at low energies though.

- You should take the line

```cpp
	track.Initialise(&gas, true);

```

out of the for loop. You need to call it only once (unless you change the particle energy or energy, or the medium).

- Remove the call ` track.GetElectron(0., xe, ye, ze, te, ee, dx, dy, dz);`. The loop over the clusters and electrons should then look like this

```cpp
	for (const auto& cluster : track.GetClusters()) {
		for (const auto& electron : cluster.electrons) {
			drift.DriftElectron(electron.x,electron.y,electron.z,electron.t);
		}
	}

```

---

<div class="post-metadata">

**Author:** ![wxj-imp](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/w/b5e925/32.png) [@wxj-imp](https://root-forum.cern.ch/u/wxj-imp)\
**Post date:** [June 18, 2025, 6:43am UTC](https://root-forum.cern.ch/t/problems-about-plot-signal-in-garfield/63746/3 "2025-06-18T06:43:25Z")

</div>

Thank you for your advice,I have solve the problem by changing the order of the ViewSignal.Meanwhile,It seems the drift line simulation have worked,and your advice have help me do this better.

---

<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:** [July 2, 2025, 6:44am UTC](https://root-forum.cern.ch/t/problems-about-plot-signal-in-garfield/63746/4 "2025-07-02T06:44:03Z")

</div>

Closed on July 2, 2025, 6:44am UTC

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