How to plot the drift line

Hi,
Thanks a lot for telling me the reason of the problem. I put the driftview after simulating the charged particle track and electron drift lines. the results show in the below. It seems the particles are all killed.

Looks like the process was killed by the kernel (maybe because it ran out of memory).
I can’t say offhand what’s the reason for that, but I noticed something else when reading your code. The starting point is at the “top edge” of the geometry and the direction vector is (0, 1, 0). I guess you meant to use (0, -1, 0) instead, otherwise the proton has a high chance of escaping from the detector before it ionises.

I would also start with simulating and visualising a single electron drift line, and once you have checked that this works fine move on to simulating a charged particle track.

Hi,
Thanks a lot for your reply.
you are so meticulous,yes the direction vector actually should be -1. I have modified it ,and start with simulating and visualising a single electron drift line by setting the K value from K<nc to K<1. But the result seems the same, after get the bounding box, then killed.

 //loop electrons in a cluster
      for (int k = 0; **k < 1**; k++)//loop electrons in a cluster,one cluster has nc number of electrons
      {
        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);//gain the electron information in one cluster
        drift.DriftElectron(xe, ye, ze, te);//calculate the drift of the electron
      }

Hi,
There is indeed kernel problem, sometimes there maybe plot a curve and then disappeared. I don’t know how to enlarge the home directory. there are a lot of methods on line ,but they seem not fit for my ubuntu system.

Hi,
That’s the running results in the below

xxc@xxc-linux:~/garfieldpp/Gem/build$ ./gem
ComponentAnsys123::Initialise:
    Read properties of 2 materials from file MPLIST.lis.
ComponentAnsys123::Initialise:
    Read 2159067 elements from file ELIST.lis,
    highest node number: 3124105,
    background elements skipped: 0
ComponentAnsys123::Initialise:
    Read 3124105 nodes from file NLIST.lis.
ComponentAnsys123::Initialise:
    Read 3124105 potentials from file PRNSOL.lis.
ComponentAnsys123::Prepare:
    Caching the bounding boxes of all elements... done.
ComponentAnsys123::InitializeTetrahedralTree: Success.
ComponentAnsys123::PrintRange:
        Dimensions of the elementary block
                  -0.167044 < x < -0.0670436      cm,
                   0.172927 < y < 0.205927        cm,
                  -0.115321 < z < -0.0353211      cm,
                          0 < V < 1500            V.
        Periodicities
            x: none
            y: none
            z: none
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 N2.gas.
    Version 12.
    Gas composition set to N2.
MediumMagboltz::PrintGas:
    Gas composition: N2
    Pressure:    10 Torr
    Temperature: 293.15 K
    Gas file:
      Pressure:    10 Torr
      Temperature: 293.15 K
    Electric field range:  0.5 - 3 V/cm in 19 steps.
    Magnetic field:        0 T
    Angle between E and B: 1.5708 rad
    Available electron transport data:
      Velocity along E
      Velocity along Bt
      Velocity along ExB
        Low field extrapolation:  constant
        High field extrapolation:  linear
        Interpolation order: 2
      Longitudinal diffusion coefficient
      Transverse diffusion coefficient
      Diffusion tensor
        Low field extrapolation:  constant
        High field extrapolation:  linear
        Interpolation order: 2
      Townsend coefficient
        Low field extrapolation:  constant
        High field extrapolation:  linear
        Interpolation order: 2
      Attachment coefficient
        Low field extrapolation:  constant
        High field extrapolation:  linear
        Interpolation order: 2
      Lorentz Angle
        Low field extrapolation:  constant
        High field extrapolation:  linear
        Interpolation order: 2
      Ionisation rates
        N2 IONISATION N2+ X2SIGMA VIB=0     ELOSS=  15.581  
          Threshold = 15.5807 eV
        N2 IONISATION N2+ X2SIGMA VIB>0     ELOSS=  15.855  
          Threshold = 15.8547 eV
        N2 IONISATION N2+ A2PI    VIB=0     ELOSS=  16.699  
          Threshold = 16.6987 eV
        N2 IONISATION N2+ A2PI    VIB=1     ELOSS=  16.935  
          Threshold = 16.9347 eV
        N2 IONISATION N2+ A2PI    VIB>1     ELOSS=  17.171  
          Threshold = 17.1707 eV
        N2 IONISATION N2+ B2SIGMA           ELOSS=  18.751  
          Threshold = 18.7506 eV
        N2 IONISATION N2+ C2SIGMA           ELOSS=  23.591  
          Threshold = 23.5905 eV
        N2 DISSOC ION (N+,N)                ELOSS=  24.294  
          Threshold = 24.2935 eV
        N2 DISSOC ION (N+,N*)               ELOSS=  24.4    
          Threshold = 24.3995 eV
        N2 DISSOC ION (N+*,N)               ELOSS=  35.7    
          Threshold = 35.6993 eV
        N2 DISSOC ION (N++,N) AND (N+,N+)   ELOSS=  38.8    
          Threshold = 38.7992 eV
        N2 IONISATION K-SHELL               ELOSS= 401.6    
          Threshold = 401.592 eV
        Low field extrapolation:  constant
        High field extrapolation:  linear
        Interpolation order: 2
    Available ion transport data:
      none
Killed

Hi,
Thanks for your advice, I will try to execute “ulimit -s unlimited” BEFORE I start my executable to see whether it can fix.

Hi,
I have tried the ulimit -s unlimited, it can work. However the drift lines are empty and notice "could not determine the plot limits.

Hi,

the reason you don’t see any drift lines is that the proton has very little chance to ionize the gas before it leaves the detector.
I don’t have your gas file, so I used another one (the one from the drift tube example) to run (a slightly modified version of) your program. In my version of the program (which you’l find attached) I added a line track.Initialise(&gas, true); to print out some information about the ionisation cross-section of the charged particle. For the gas file I’m using, which is at a pressure of 3 atmospheres, the cluster density (average number of ionising collisions per track length) is about 100 / cm.

Your field map has a length of 300 um along y. So, with the gas file I’m using, the charged particle should on average have about 3 ionising collisions (=clusters) inside the detector. I’ve run the program a few times and this seems about right, that is I did get a couple of clusters and electron drift lines.

The gas file you are using is for a pressure of 10 Torr though, so the cluster density is very low and that’s why in most cases there will be no clusters, and thus no drift lines in your plot.

test.C (2.7 KB)

Hi,
Thanks for your help.
I don’t know how to say, you are indeed a Garfield++ master, what you say is clear and intelligible.
I have modified the pressure to 750 Torr which is the biggest pressure of the detector, maybe the detector’s design approaches to the vacuum condition.
Thanks again!

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

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




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.

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...

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.

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)

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.

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

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.

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 (2.7 KB)
4He.zip (3.0 KB)

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?

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