# How to plot the drift line

**URL:** <https://root-forum.cern.ch/t/how-to-plot-the-drift-line/48120>\
**Category:** Garfield++\
**Created:** [December 20, 2021, 1:58am UTC](https://root-forum.cern.ch/t/how-to-plot-the-drift-line/48120 "2021-12-20T01:58:38Z")\
**Posts on this page:** 9\
**Page:** 2

<div class="post-metadata">

**Author:** ![XiCheng](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/x/aca169/32.png) [@XiCheng](https://root-forum.cern.ch/u/XiCheng)\
**Post date:** [December 22, 2021, 7:35am UTC](https://root-forum.cern.ch/t/how-to-plot-the-drift-line/48120/21 "2021-12-22T07:35:25Z")

</div>

Hi,  
I have changed the gas pressure to 750Torr, and the error and warning comes when I use the new gas file.

```auto
ComponentAnsys123::PrintMaterials:
    Currently 2 materials are defined.
      Index Permittivity Resistivity Notes
          0 1 -1 (drift medium)
          1 4.25 1e+10
MediumMagboltz::LoadGasFile:
    Reading file 4He.gas.
    Version 12.
    Gas composition set to He.
ComponentAnsys123::PrintMaterials:
    Currently 2 materials are defined.
      Index Permittivity Resistivity Notes
          0 1 -1 He, drift medium, ionisable (drift medium)
          1 4.25 1e+10
TrackHeed::Initialise:
    Database path: /home/xxc/garfieldpp/install/share/Heed/database/
TrackHeed::Initialise:
    Cluster density: 4.56788 cm-1
    Stopping power (restricted): 0.288462 keV/cm
    Stopping power (incl. tail): 0.412673 keV/cm
    W value: 41.3 eV
    Fano factor: 0.19
    Min. ionization potential: 24.6 eV
Sensor::SetArea:
    -0.167044 < x [cm] < -0.0670436
    0.172927 < y [cm] < 0.205927
    -0.115321 < z [cm] < -0.0353211
0 clusters...
Warning in <TCanvas::ResizePad>: Inf/NaN propagated to the pad. Check drawn objects.
Warning in <TCanvas::ResizePad>: CD width changed from 0 to 10

Warning in <TCanvas::ResizePad>: CD height changed from 0 to 10

Error in <TGaxis::PaintAxis>: wmin (0.000000) == wmax (0.000000)
Error in <TGaxis::PaintAxis>: wmin (0.000000) == wmax (0.000000)
Error in <TGaxis::PaintAxis>: wmin (0.000000) == wmax (0.000000)
Error in <TGaxis::PaintAxis>: wmin (0.000000) == wmax (0.000000)
Error in <TGaxis::PaintAxis>: wmin (0.000000) == wmax (0.000000)
Error in <TGaxis::PaintAxis>: wmin (0.000000) == wmax (0.000000)
Error in <TGaxis::PaintAxis>: wmin (0.000000) == wmax (0.000000)
Error in <TGaxis::PaintAxis>: wmin (0.000000) == wmax (0.000000)
Warning in <TCanvas::ResizePad>: Inf/NaN propagated to the pad. Check drawn objects.
Warning in <TCanvas::ResizePad>: CD width changed from 0 to 10

Warning in <TCanvas::ResizePad>: CD height changed from 0 to 10

Warning in <TCanvas::ResizePad>: Inf/NaN propagated to the pad. Check drawn objects.
Warning in <TCanvas::ResizePad>: CD width changed from 0 to 10

Warning in <TCanvas::ResizePad>: CD height changed from 0 to 10

Warning in <TCanvas::ResizePad>: Inf/NaN propagated to the pad. Check drawn objects.
Warning in <TCanvas::ResizePad>: CD width changed from 0 to 10

Warning in <TCanvas::ResizePad>: CD height changed from 0 to 10

Warning in <TCanvas::ResizePad>: Inf/NaN propagated to the pad. Check drawn objects.
Warning in <TCanvas::ResizePad>: CD width changed from 0 to 10

Warning in <TCanvas::ResizePad>: CD height changed from 0 to 10

Error in <TGaxis::PaintAxis>: wmin (0.000000) == wmax (0.000000)
Error in <TGaxis::PaintAxis>: wmin (0.000000) == wmax (0.000000)
Error in <TGaxis::PaintAxis>: wmin (0.000000) == wmax (0.000000)
Error in <TGaxis::PaintAxis>: wmin (0.000000) == wmax (0.000000)
Error in <TGaxis::PaintAxis>: wmin (0.000000) == wmax (0.000000)
Error in <TGaxis::PaintAxis>: wmin (0.000000) == wmax (0.000000)
Error in <TGaxis::PaintAxis>: wmin (0.000000) == wmax (0.000000)
Error in <TGaxis::PaintAxis>: wmin (0.000000) == wmax (0.000000)
Warning in <TCanvas::ResizePad>: Inf/NaN propagated to the pad. Check drawn objects.
Warning in <TCanvas::ResizePad>: CD width changed from 0 to 10

Warning in <TCanvas::ResizePad>: CD height changed from 0 to 10

Warning in <TCanvas::ResizePad>: Inf/NaN propagated to the pad. Check drawn objects.
Warning in <TCanvas::ResizePad>: CD width changed from 0 to 10

Warning in <TCanvas::ResizePad>: CD height changed from 0 to 10

```

---

<div class="post-metadata">

**Author:** ![XiCheng](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/x/aca169/32.png) [@XiCheng](https://root-forum.cern.ch/u/XiCheng)\
**Post date:** [December 22, 2021, 11:06am UTC](https://root-forum.cern.ch/t/how-to-plot-the-drift-line/48120/22 "2021-12-22T11:06:38Z")

</div>

Hi,  
I have changed my 4He.gas file to three\*Atmospheric Pressure, and tried to see the drift line. However there is still only one cluster generated.

```auto
TrackHeed::Initialise:
    Database path: /home/xxc/garfieldpp/install/share/Heed/database/
TrackHeed::Initialise:
    Cluster density: 13.5292 cm-1
    Stopping power (restricted): 0.864045 keV/cm
    Stopping power (incl. tail): 1.24165 keV/cm
    W value: 41.3 eV
    Fano factor: 0.19
    Min. ionization potential: 24.6 eV
Sensor::SetArea:
    -0.167044 < x [cm] < -0.0670436
    0.172927 < y [cm] < 0.205927
    -0.115321 < z [cm] < -0.0353211
DriftLineRKF::Avalanche:
    Cannot retrieve alpha at drift line point 10, segment 1.
1 clusters...

```

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

---

<div class="post-metadata">

**Author:** ![XiCheng](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/x/aca169/32.png) [@XiCheng](https://root-forum.cern.ch/u/XiCheng)\
**Post date:** [December 22, 2021, 1:00pm UTC](https://root-forum.cern.ch/t/how-to-plot-the-drift-line/48120/23 "2021-12-22T13:00:45Z")

</div>

Hi,  
when I add the code " driftview.Plot3d(true,true); " to see the 3D plot ,the error shows in the below, and the plot blinked and disapeared.

```auto
2 clusters...
Error in <TAxis3D::PaintAxis>: no TView in current pad

 ***Break*** segmentation violation

===========================================================
There was a crash.
This is the entire stack trace of all threads:
===========================================================
#0 0x000014808facddba in __GI___ wait4 (pid=430171, stat_loc=stat_loc
entry=0x7ffd8c4ccbe8, options=options
entry=0, usage=usage
entry=0x0) at ../sysdeps/unix/sysv/linux/wait4.c:27
#1 0x000014808facdd7b in __GI___ waitpid (pid=<optimized out>, stat_loc=stat_loc
entry=0x7ffd8c4ccbe8, options=options
entry=0) at waitpid.c:38
#2 0x000014808fa3d0e7 in do_system (line=<optimized out>) at ../sysdeps/posix/system.c:172
#3 0x00001480901049ae in TUnixSystem::StackTrace() () from /home/xxc/root-6.24.06/build/lib/libCore.so
#4 0x0000148090101825 in TUnixSystem::DispatchSignals(ESignals) () from /home/xxc/root-6.24.06/build/lib/libCore.so
#5 <signal handler called>
#6 0x00001480132c4ce9 in THistPainter::Paint(char const*) () from /home/xxc/root-6.24.06/build/lib/libHistPainter.so
#7 0x0000148012f7f956 in TGLScenePad::SubPadPaint(TVirtualPad*) () from /home/xxc/root-6.24.06/build/lib/libRGL.so
#8 0x0000148012f7fc2e in TGLScenePad::PadPaintFromViewer(TGLViewer*) () from /home/xxc/root-6.24.06/build/lib/libRGL.so
#9 0x0000148012fa922f in TGLViewer::PadPaint(TVirtualPad*) () from /home/xxc/root-6.24.06/build/lib/libRGL.so
#10 0x000014809040a3d9 in TPad::PaintModified() () from /home/xxc/root-6.24.06/build/lib/libGpad.so
#11 0x00001480903ca11c in TCanvas::Update() () from /home/xxc/root-6.24.06/build/lib/libGpad.so
#12 0x0000148090401c8a in TPad::GetViewer3D(char const*) () from /home/xxc/root-6.24.06/build/lib/libGpad.so
#13 0x00001480906fb813 in Garfield::ViewDrift::Plot3d(bool, bool) () from /home/xxc/garfieldpp/install/lib/libGarfield.so.0.3.0
#14 0x00005583cc1ba0d7 in main ()
===========================================================

The lines below might hint at the cause of the crash.
You may get help by asking at the ROOT forum https://root.cern.ch/forum
Only if you are really convinced it is a bug in ROOT then please submit a
report at https://root.cern.ch/bugs Please post the ENTIRE stack trace
from above as an attachment in addition to anything else
that might help us fixing this issue.
===========================================================
#6 0x00001480132c4ce9 in THistPainter::Paint(char const*) () from /home/xxc/root-6.24.06/build/lib/libHistPainter.so
#7 0x0000148012f7f956 in TGLScenePad::SubPadPaint(TVirtualPad*) () from /home/xxc/root-6.24.06/build/lib/libRGL.so
#8 0x0000148012f7fc2e in TGLScenePad::PadPaintFromViewer(TGLViewer*) () from /home/xxc/root-6.24.06/build/lib/libRGL.so
#9 0x0000148012fa922f in TGLViewer::PadPaint(TVirtualPad*) () from /home/xxc/root-6.24.06/build/lib/libRGL.so
#10 0x000014809040a3d9 in TPad::PaintModified() () from /home/xxc/root-6.24.06/build/lib/libGpad.so
#11 0x00001480903ca11c in TCanvas::Update() () from /home/xxc/root-6.24.06/build/lib/libGpad.so
#12 0x0000148090401c8a in TPad::GetViewer3D(char const*) () from /home/xxc/root-6.24.06/build/lib/libGpad.so
#13 0x00001480906fb813 in Garfield::ViewDrift::Plot3d(bool, bool) () from /home/xxc/garfieldpp/install/lib/libGarfield.so.0.3.0
#14 0x00005583cc1ba0d7 in main ()
===========================================================

Segmentation fault (core dumped)

```

---

<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:** [December 22, 2021, 3:12pm UTC](https://root-forum.cern.ch/t/how-to-plot-the-drift-line/48120/24 "2021-12-22T15:12:52Z")

</div>

Yes, that’s possible. If you look at the output that you posted you’ll see that the average number of clusters per cm is 13.5. Your detector is 300 micron thick.

---

<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:** [December 22, 2021, 3:15pm UTC](https://root-forum.cern.ch/t/how-to-plot-the-drift-line/48120/25 "2021-12-22T15:15:43Z")

</div>

Please provide a minimal working version of a macro/program that reproduces this issue.

---

<div class="post-metadata">

**Author:** ![XiCheng](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/x/aca169/32.png) [@XiCheng](https://root-forum.cern.ch/u/XiCheng)\
**Post date:** [December 23, 2021, 2:31am UTC](https://root-forum.cern.ch/t/how-to-plot-the-drift-line/48120/26 "2021-12-23T02:31:15Z")

</div>

Hi,  
Thank you for your reply.  
I understand now. I have generated four gas file, the He.gas, air.gas, N2.gas and P10.gas. However only the He.gas shows the error and warning result, I don’t know why, and the other gas file can get one to two cluster result.

---

<div class="post-metadata">

**Author:** ![XiCheng](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/x/aca169/32.png) [@XiCheng](https://root-forum.cern.ch/u/XiCheng)\
**Post date:** [December 23, 2021, 2:40am UTC](https://root-forum.cern.ch/t/how-to-plot-the-drift-line/48120/27 "2021-12-23T02:40:11Z")

</div>

Hi,  
Thanks for your reply and help.  
That’s my gas file and code below. and beside I want to get the 3D drift view, and when I type the code “driftview.plot3d(true,true);” there would be more errors.  
[gem.C](https://root-forum.cern.ch/uploads/short-url/R05u7skvdEQDgvaiMRjtkubmLg.C) (2.7 KB)  
[4He.zip](https://root-forum.cern.ch/uploads/short-url/qxJJzwzjHLLpupBdeC6eUfAz9An.zip) (3.0 KB)

---

<div class="post-metadata">

**Author:** ![XiCheng](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/x/aca169/32.png) [@XiCheng](https://root-forum.cern.ch/u/XiCheng)\
**Post date:** [December 23, 2021, 2:48am UTC](https://root-forum.cern.ch/t/how-to-plot-the-drift-line/48120/28 "2021-12-23T02:48:12Z")

</div>

Hi,  
That’s my drift line ,when the protons pass through the P10 gas, I don’t know how to understand it, the drift line is in the middle and lower half of the plot, why is that?

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

---

<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:** [January 6, 2022, 2:48am UTC](https://root-forum.cern.ch/t/how-to-plot-the-drift-line/48120/29 "2022-01-06T02:48:19Z")

</div>

Closed on January 6, 2022, 2:48am UTC

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

[Previous page](https://root-forum.cern.ch/t/how-to-plot-the-drift-line/48120.md?page=1)
