# How to gain the Bragg peak curve of proton

**URL:** <https://root-forum.cern.ch/t/how-to-gain-the-bragg-peak-curve-of-proton/48035>\
**Category:** Garfield++\
**Created:** [December 13, 2021, 5:50am UTC](https://root-forum.cern.ch/t/how-to-gain-the-bragg-peak-curve-of-proton/48035 "2021-12-13T05:50:21Z")\
**Posts on this page:** 15\
**Page:** 1

<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 13, 2021, 5:50am UTC](https://root-forum.cern.ch/t/how-to-gain-the-bragg-peak-curve-of-proton/48035/1 "2021-12-13T05:50:21Z")

</div>

I want to gain the bragg peak generated by proton incident into the model. But the error notice “the Initial position of proton is not in the ionizable region”, after I modified the coordinates, there is no any plot and the particles are killed.

```auto
RandomEngineRoot::Seed:
    Seed: 624
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::SetComposition:
    N2
MediumMagboltz::Mixer:
    4000 linear energy steps between 0 and 200 eV.
    NITROGEN 2015 ANISOTROPIC
                             E�\U
      mass: 27.794 amu
      ionisation threshold: 15.581 eV
      127 inelastic terms (35 excitations, 39 superelastic, 53 other)
MediumMagboltz::Mixer:
    Lowest ionisation threshold in the mixture: 15.581 eV (N2)
MediumMagboltz::Mixer:
    Energy [eV] Collision Rate [ns-1]
         12.50 6536.65
         37.50 9886.76
         62.50 10601.99
         87.50 11295.64
        112.50 11759.86
        137.50 12110.84
        162.50 12313.23
        187.50 12559.57
MediumMagboltz::ComputePhotonCollisionTable:
    Energy [eV] Mean free path [um]
          1.00 ------------
          3.00 ------------
          5.00 ------------
          7.00 ------------
          9.00 ------------
         11.00 ------------
         13.00 ------------
         15.00 0.0000
         17.00 0.0000
         19.00 0.0000
MediumMagboltz::GenerateGasTable: Found 0 excitations and 12 ionisations.
    N2 IONISATION N2+ X2SIGMA VIB=0 ELOSS= 15.581 , energy = 15.5807 eV.
    N2 IONISATION N2+ X2SIGMA VIB>0 ELOSS= 15.855 , energy = 15.8547 eV.
    N2 IONISATION N2+ A2PI VIB=0 ELOSS= 16.699 , energy = 16.6987 eV.
    N2 IONISATION N2+ A2PI VIB=1 ELOSS= 16.935 , energy = 16.9347 eV.
    N2 IONISATION N2+ A2PI VIB>1 ELOSS= 17.171 , energy = 17.1707 eV.
    N2 IONISATION N2+ B2SIGMA ELOSS= 18.751 , energy = 18.7506 eV.
    N2 IONISATION N2+ C2SIGMA ELOSS= 23.591 , energy = 23.5905 eV.
    N2 DISSOC ION (N+,N) ELOSS= 24.294 , energy = 24.2935 eV.
    N2 DISSOC ION (N+,N*) ELOSS= 24.4 , energy = 24.3995 eV.
    N2 DISSOC ION (N+*,N) ELOSS= 35.7 , energy = 35.6993 eV.
    N2 DISSOC ION (N++,N) AND (N+,N+) ELOSS= 38.8 , energy = 38.7992 eV.
    N2 IONISATION K-SHELL ELOSS= 401.6 , energy = 401.592 eV.
MediumMagboltz::GenerateGasTable: E = 100 V/cm, B = 0 T, angle: 1.5708 rad
 RM48 INITIALIZED: 54217137 0 0

          PROGRAM MAGBOLTZ 2 VERSION 11.13

          MONTE CARLO SOLUTION FOR MIXTURE OF 1 GASES.
     ------------------------------------------------------

       GASES USED PERCENTAGE USED 

      NITROGEN 2015 ANISOTROPIC 100.0000

  GAS TEMPERATURE = 20.0 DEGREES CENTIGRADE.
  GAS PRESSURE = 760.0 TORR.

  INTEGRATION FROM 0.0 TO 1.00 EV. IN 4000 STEPS. 

 PENNING EFFECTS NOT INCLUDED

 ANISOTROPIC SCATTERING TYPE 2 (OKHRIMOVSKYY) USED IF AVAILABLE

 SHORT DECORRELATION LENGTH = 400000 COLLISIONS.

 THERMAL MOTION OF GAS NOT INCLUDED

  ELECTRIC FIELD = 100.0000 VOLTS/CM.
  MAGNETIC FIELD = 0.0000 KILOGAUSS.
  ANGLE BETWEEN ELECTRIC AND MAGNETIC FIELD = 90.000 DEGREES.
  CYCLOTRON FREQ. = 0.000D+00 RADIANS/PICOSECOND

  INITIAL ELECTRON ENERGY = 0.020 EV.

  TOTAL NUMBER OF REAL COLLISIONS = 400000000

  NULL COLLISION FREQUENCY AT 8 EQUALLY SPACED ENERGY INTERVALS (*10**12/SEC)
      0.109D+01 0.121D+01 0.134D+01 0.146D+01
      0.146D+01 0.146D+01 0.146D+01 0.146D+01

  REAL COLLISION FREQUENCY AT 8 EQUALLY SPACED ENERGY INTERVALS (*10**12/SEC)
      0.169D+00 0.442D+00 0.670D+00 0.859D+00
      0.102D+01 0.114D+01 0.127D+01 0.140D+01

    VEL POS TIME ENERGY COUNT DIFXX DIFYY DIFZZ

     3.36 0.361D+00 0.107D+09 0.1616 100 531.5 464.8 0.0
     3.34 0.719D+00 0.215D+09 0.1612 200 465.6 436.1 0.0
     3.34 0.108D+01 0.323D+09 0.1610 300 436.5 452.7 194.7
     3.34 0.144D+01 0.431D+09 0.1609 400 433.7 453.2 194.9
     3.34 0.180D+01 0.539D+09 0.1609 500 440.6 448.7 180.7
     3.34 0.216D+01 0.647D+09 0.1609 600 431.2 440.6 178.7
     3.34 0.252D+01 0.755D+09 0.1608 700 446.3 435.8 178.5
     3.34 0.288D+01 0.863D+09 0.1608 800 445.6 440.7 177.1
     3.34 0.324D+01 0.971D+09 0.1607 900 441.2 438.6 177.9
     3.34 0.360D+01 0.108D+10 0.1608 1000 443.7 432.7 176.9
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------

  CALCULATED MAX. COLLISION TIME = 187.06 PICOSECONDS.

  NUMBER OF NULL COLLISIONS = 882390740
  NUMBER OF REAL COLLISIONS = 400000000

  Z DRIFT VELOCITY = 0.3338E+01 MICRONS/NANOSECOND +- 0.16% 
  Y DRIFT VELOCITY = 0.0000E+00 MICRONS/NANOSECOND +- 0.00%
  X DRIFT VELOCITY = 0.0000E+00 MICRONS/NANOSECOND +- 0.00%

           DIFFUSION IN CM**2/SEC.

  TRANSVERSE DIFFUSION = 0.4382D+03 +- 3.32%
          = 0.1313 EV. +- 3.32%
          = 512.384 MICRONS/CENTIMETER**0.5 +- 1.66%

  LONGITUDINAL DIFFUSION = 0.1769D+03 +- 2.8%
          = 0.0530 EV. +- 2.83%
          = 325.540 MICRONS/CENTIMETER**0.5 +- 1.41%

  IONISATION RATE /CM.= 0.0000D+00 +/- 0.00 PERCENT.
  ATTACHMENT RATE /CM.= 0.0000D+00 +/- 0.00 PERCENT.

  MEAN ELECTRON ENERGY = 0.1608 EV. ERROR = +- 0.09%

-----------------------------------------------------------------------------
-----------------------------------------------------------------------------

 NUMBER OF COLLISIONS IN FINAL ENERGY BIN = 69.0

      TOTAL COLL. FREQ. = 0.3709D+00 (*10**12)/SEC.
    ELASTIC COLL. FREQ. = 0.3567D+00 (*10**12)/SEC.
  INELASTIC COLL. FREQ. = 0.1414D-01 (*10**12)/SEC.
 IONISATION COLL. FREQ. = 0.0000D+00 (*10**12)/SEC.
 ATTACHMENT COLL. FREQ. = 0.0000D+00 (*10**12/SEC.

-----------------------------------------------------------------------------

  DETAILED COLLISION FREQUENCIES FOR EACH GAS IN UNITS OF 10**12/SEC. :

   NITROGEN 2015 ANISOTROPIC
-----------------------------

    ELASTIC ANISOTROPIC NITROGEN 0.3567D+00 +- 0.0051 %
    ATTACHMENT 0.0000D+00 +- 0.0000 %
    ROTATION 2-0 ELOSS= -0.00148 0.2354D-03 +- 0.1984 %
    ROTATION 3-1 ELOSS= -0.00247 0.2005D-03 +- 0.2150 %
    ROTATION 4-2 ELOSS= -0.00345 0.5340D-03 +- 0.1318 %
    ROTATION 5-3 ELOSS= -0.00444 0.3135D-03 +- 0.1720 %
    ROTATION 6-4 ELOSS= -0.00543 0.6899D-03 +- 0.1159 %
    ROTATION 7-5 ELOSS= -0.00641 0.3575D-03 +- 0.1610 %
    ROTATION 8-6 ELOSS= -0.00740 0.7101D-03 +- 0.1143 %
    ROTATION 9-7 ELOSS= -0.00839 0.3391D-03 +- 0.1654 %
    ROTATION 10-8 ELOSS= -0.00937 0.6278D-03 +- 0.1215 %
    ROTATION 11-9 ELOSS= -0.0104 0.2799D-03 +- 0.1820 %
    ROTATION 12-10 ELOSS= -0.0113 0.4869D-03 +- 0.1380 %
    ROTATION 13-11 ELOSS= -0.0123 0.2059D-03 +- 0.2122 %
    ROTATION 14-12 ELOSS= -0.0133 0.3401D-03 +- 0.1651 %
    ROTATION 15-13 ELOSS= -0.0143 0.1365D-03 +- 0.2606 %
    ROTATION 16-14 ELOSS= -0.0153 0.2146D-03 +- 0.2079 %
    ROTATION 17-15 ELOSS= -0.0163 0.8209D-04 +- 0.3361 %
    ROTATION 18-16 ELOSS= -0.0173 0.1233D-03 +- 0.2742 %
    ROTATION 19-17 ELOSS= -0.0183 0.4483D-04 +- 0.4548 %
    ROTATION 20-18 ELOSS= -0.0192 0.6472D-04 +- 0.3785 %
    ROTATION 21-19 ELOSS= -0.0202 0.2271D-04 +- 0.6390 %
    ROTATION 22-20 ELOSS= -0.0212 0.3085D-04 +- 0.5483 %
    ROTATION 23-21 ELOSS= -0.0222 0.1050D-04 +- 0.9397 %
    ROTATION 24-22 ELOSS= -0.0232 0.1350D-04 +- 0.8288 %
    ROTATION 25-23 ELOSS= -0.0242 0.4355D-05 +- 1.4591 %
    ROTATION 26-24 ELOSS= -0.0252 0.5508D-05 +- 1.2974 %
    ROTATION 27-25 ELOSS= -0.0261 0.1722D-05 +- 2.3206 %
    ROTATION 28-26 ELOSS= -0.0271 0.1979D-05 +- 2.1647 %
    ROTATION 29-27 ELOSS= -0.0281 0.5971D-06 +- 3.9406 %
    ROTATION 30-28 ELOSS= -0.0291 0.6861D-06 +- 3.6761 %
    ROTATION 31-29 ELOSS= -0.0301 0.1780D-06 +- 7.2169 %
    ROTATION 32-30 ELOSS= -0.0311 0.2105D-06 +- 6.6372 %
    ROTATION 33-31 ELOSS= -0.0321 0.6398D-07 +- 12.0386 %
    ROTATION 34-32 ELOSS= -0.0331 0.5007D-07 +- 13.6083 %
    ROTATION 35-33 ELOSS= -0.0340 0.1947D-07 +- 21.8218 %
    ROTATION 36-34 ELOSS= -0.0350 0.1483D-07 +- 25.0000 %
    ROTATION 37-35 ELOSS= -0.0360 0.2782D-08 +- 57.7350 %
    ROTATION 38-36 ELOSS= -0.0370 0.5563D-08 +- 40.8248 %
    ROTATION 39-37 ELOSS= -0.0380 0.1854D-08 +- 70.7107 %
    ROTATION 0-2 ELOSS= 0.00148 0.2468D-03 +- 0.1938 %
    ROTATION 1-3 ELOSS= 0.00247 0.2170D-03 +- 0.2067 %
    ROTATION 2-4 ELOSS= 0.00345 0.5950D-03 +- 0.1248 %
    ROTATION 3-5 ELOSS= 0.00444 0.3608D-03 +- 0.1603 %
    ROTATION 4-6 ELOSS= 0.00543 0.8175D-03 +- 0.1065 %
    ROTATION 5-7 ELOSS= 0.00641 0.4356D-03 +- 0.1459 %
    ROTATION 6-8 ELOSS= 0.00740 0.8953D-03 +- 0.1018 %
    ROTATION 7-9 ELOSS= 0.00839 0.4388D-03 +- 0.1454 %
    ROTATION 8-10 ELOSS= 0.00937 0.8387D-03 +- 0.1051 %
    ROTATION 9-11 ELOSS= 0.0104 0.3869D-03 +- 0.1548 %
    ROTATION 10-12 ELOSS= 0.0113 0.6940D-03 +- 0.1156 %
    ROTATION 11-13 ELOSS= 0.0123 0.3031D-03 +- 0.1749 %
    ROTATION 12-14 ELOSS= 0.0133 0.5154D-03 +- 0.1341 %
    ROTATION 13-15 ELOSS= 0.0143 0.2141D-03 +- 0.2081 %
    ROTATION 14-16 ELOSS= 0.0153 0.3456D-03 +- 0.1638 %
    ROTATION 15-17 ELOSS= 0.0163 0.1368D-03 +- 0.2603 %
    ROTATION 16-18 ELOSS= 0.0173 0.2114D-03 +- 0.2094 %
    ROTATION 17-19 ELOSS= 0.0183 0.8006D-04 +- 0.3403 %
    ROTATION 18-20 ELOSS= 0.0192 0.1170D-03 +- 0.2815 %
    ROTATION 19-21 ELOSS= 0.0202 0.4246D-04 +- 0.4673 %
    ROTATION 20-22 ELOSS= 0.0212 0.5993D-04 +- 0.3933 %
    ROTATION 21-23 ELOSS= 0.0222 0.2069D-04 +- 0.6694 %
    ROTATION 22-24 ELOSS= 0.0232 0.2815D-04 +- 0.5739 %
    ROTATION 23-25 ELOSS= 0.0242 0.9280D-05 +- 0.9996 %
    ROTATION 24-26 ELOSS= 0.0252 0.1189D-04 +- 0.8829 %
    ROTATION 25-27 ELOSS= 0.0261 0.3839D-05 +- 1.5542 %
    ROTATION 26-28 ELOSS= 0.0271 0.4766D-05 +- 1.3948 %
    ROTATION 27-29 ELOSS= 0.0281 0.1377D-05 +- 2.5950 %
    ROTATION 28-30 ELOSS= 0.0291 0.1721D-05 +- 2.3212 %
    ROTATION 29-31 ELOSS= 0.0301 0.4933D-06 +- 4.3355 %
    ROTATION 30-32 ELOSS= 0.0311 0.5711D-06 +- 4.0291 %
    ROTATION 31-33 ELOSS= 0.0321 0.1576D-06 +- 7.6696 %
    ROTATION 32-34 ELOSS= 0.0331 0.1789D-06 +- 7.1982 %
    ROTATION 33-35 ELOSS= 0.0340 0.5285D-07 +- 13.2453 %
    ROTATION 34-36 ELOSS= 0.0350 0.4636D-07 +- 14.1421 %
    ROTATION 35-37 ELOSS= 0.0360 0.8345D-08 +- 33.3333 %
    ROTATION 36-38 ELOSS= 0.0370 0.1113D-07 +- 28.8675 %
    ROTATION 37-39 ELOSS= 0.0380 0.2782D-08 +- 57.7350 %
    VIBRATION V1 ELOSS= -0.2889 0.1854D-08 +- 70.7107 %
    VIBRATION V1 ELOSS= 0.2889 0.2654D-04 +- 0.5910 %
    VIBRATION 2V1 ELOSS= 0.5742 0.3709D-08 +- 50.0000 %
    VIBRATION 3V1 ELOSS= 0.8559 0.0000D+00 +- 0.0000 %
-----------------------------------------------------------------------------

           NORMALISED ENERGY DISTRIBUTION
      E= 0.013 SPEC= 0.6236D-02
      E= 0.038 SPEC= 0.2474D-01
      E= 0.063 SPEC= 0.4503D-01
      E= 0.088 SPEC= 0.6325D-01
      E= 0.113 SPEC= 0.7717D-01
      E= 0.138 SPEC= 0.8575D-01
      E= 0.163 SPEC= 0.8982D-01
      E= 0.188 SPEC= 0.8983D-01
      E= 0.213 SPEC= 0.8564D-01
      E= 0.238 SPEC= 0.7905D-01
      E= 0.263 SPEC= 0.7054D-01
      E= 0.288 SPEC= 0.6053D-01
      E= 0.313 SPEC= 0.5004D-01
      E= 0.338 SPEC= 0.4039D-01
      E= 0.363 SPEC= 0.3219D-01
      E= 0.388 SPEC= 0.2530D-01
      E= 0.413 SPEC= 0.1958D-01
      E= 0.438 SPEC= 0.1484D-01
      E= 0.463 SPEC= 0.1119D-01
      E= 0.488 SPEC= 0.8364D-02
      E= 0.513 SPEC= 0.6087D-02
      E= 0.538 SPEC= 0.4348D-02
      E= 0.563 SPEC= 0.3108D-02
      E= 0.588 SPEC= 0.2179D-02
      E= 0.613 SPEC= 0.1564D-02
      E= 0.638 SPEC= 0.1091D-02
      E= 0.663 SPEC= 0.7487D-03
      E= 0.688 SPEC= 0.4970D-03
      E= 0.713 SPEC= 0.3238D-03
      E= 0.738 SPEC= 0.2106D-03
      E= 0.763 SPEC= 0.1401D-03
      E= 0.788 SPEC= 0.9570D-04
      E= 0.813 SPEC= 0.5608D-04
      E= 0.838 SPEC= 0.3547D-04
      E= 0.863 SPEC= 0.1767D-04
      E= 0.888 SPEC= 0.1052D-04
      E= 0.913 SPEC= 0.4992D-05
      E= 0.938 SPEC= 0.2923D-05
      E= 0.963 SPEC= 0.2930D-05
      E= 0.988 SPEC= 0.1395D-05
MediumMagboltz::RunMagboltz: Results:
    Drift velocity along E: 0.00033383 cm/ns +/- 0.16%
    Drift velocity along Bt: 0.00000000 cm/ns +/- 0.00%
    Drift velocity along ExB: 0.00000000 cm/ns +/- 0.00%
    Lorentz angle: 0.000 degree
    Longitudinal diffusion: 0.03255402 cm1/2 +/- 1.41%
    Transverse diffusion: 0.05123840 cm1/2 +/- 1.66%
    Townsend coefficient: 0.0000 cm-1 +/- 0.00%
    Attachment coefficient: 0.0000 cm-1 +/- 0.00%
MediumMagboltz::GenerateGasTable: E = 143.845 V/cm, B = 0 T, angle: 1.5708 rad

          PROGRAM MAGBOLTZ 2 VERSION 11.13

          MONTE CARLO SOLUTION FOR MIXTURE OF 1 GASES.
     ------------------------------------------------------

       GASES USED PERCENTAGE USED 

      NITROGEN 2015 ANISOTROPIC 100.0000

  GAS TEMPERATURE = 20.0 DEGREES CENTIGRADE.
  GAS PRESSURE = 760.0 TORR.

  INTEGRATION FROM 0.0 TO 1.41 EV. IN 4000 STEPS. 

 PENNING EFFECTS NOT INCLUDED

 ANISOTROPIC SCATTERING TYPE 2 (OKHRIMOVSKYY) USED IF AVAILABLE

 SHORT DECORRELATION LENGTH = 400000 COLLISIONS.

 THERMAL MOTION OF GAS NOT INCLUDED

  ELECTRIC FIELD = 143.8450 VOLTS/CM.
  MAGNETIC FIELD = 0.0000 KILOGAUSS.
  ANGLE BETWEEN ELECTRIC AND MAGNETIC FIELD = 90.000 DEGREES.
  CYCLOTRON FREQ. = 0.000D+00 RADIANS/PICOSECOND

  INITIAL ELECTRON ENERGY = 0.028 EV.

  TOTAL NUMBER OF REAL COLLISIONS = 400000000

  NULL COLLISION FREQUENCY AT 8 EQUALLY SPACED ENERGY INTERVALS (*10**12/SEC)
      0.154D+01 0.173D+01 0.190D+01 0.190D+01
      0.190D+01 0.190D+01 0.190D+01 0.190D+01

  REAL COLLISION FREQUENCY AT 8 EQUALLY SPACED ENERGY INTERVALS (*10**12/SEC)
      0.230D+00 0.590D+00 0.866D+00 0.108D+01
      0.125D+01 0.143D+01 0.161D+01 0.180D+01

    VEL POS TIME ENERGY COUNT DIFXX DIFYY DIFZZ

     3.68 0.314D+00 0.853D+08 0.2151 100 456.9 399.8 0.0
     3.72 0.632D+00 0.170D+09 0.2162 200 420.2 418.3 0.0
     3.72 0.950D+00 0.255D+09 0.2161 300 457.2 409.1 196.3
     3.72 0.127D+01 0.340D+09 0.2159 400 458.9 419.2 194.1
     3.71 0.158D+01 0.425D+09 0.2159 500 450.0 418.7 191.1
     3.72 0.190D+01 0.510D+09 0.2159 600 449.9 426.7 196.8
     3.71 0.221D+01 0.595D+09 0.2161 700 452.7 433.1 198.3
     3.71 0.253D+01 0.680D+09 0.2160 800 451.4 432.9 199.0
     3.71 0.284D+01 0.765D+09 0.2160 900 460.1 436.4 198.0
     3.71 0.316D+01 0.850D+09 0.2161 1000 463.0 439.2 202.3
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------

  CALCULATED MAX. COLLISION TIME = 150.65 PICOSECONDS.

  NUMBER OF NULL COLLISIONS = 1016073111
  NUMBER OF REAL COLLISIONS = 400000000

  Z DRIFT VELOCITY = 0.3714E+01 MICRONS/NANOSECOND +- 0.24% 
  Y DRIFT VELOCITY = 0.0000E+00 MICRONS/NANOSECOND +- 0.00%
  X DRIFT VELOCITY = 0.0000E+00 MICRONS/NANOSECOND +- 0.00%

           DIFFUSION IN CM**2/SEC.

  TRANSVERSE DIFFUSION = 0.4511D+03 +- 2.62%
          = 0.1747 EV. +- 2.63%
          = 492.860 MICRONS/CENTIMETER**0.5 +- 1.32%

  LONGITUDINAL DIFFUSION = 0.2023D+03 +- 2.6%
          = 0.0783 EV. +- 2.62%
          = 330.023 MICRONS/CENTIMETER**0.5 +- 1.31%

  IONISATION RATE /CM.= 0.0000D+00 +/- 0.00 PERCENT.
  ATTACHMENT RATE /CM.= 0.0000D+00 +/- 0.00 PERCENT.

  MEAN ELECTRON ENERGY = 0.2161 EV. ERROR = +- 0.11%

-----------------------------------------------------------------------------
-----------------------------------------------------------------------------

 NUMBER OF COLLISIONS IN FINAL ENERGY BIN = 979.0

      TOTAL COLL. FREQ. = 0.4705D+00 (*10**12)/SEC.
    ELASTIC COLL. FREQ. = 0.4540D+00 (*10**12)/SEC.
  INELASTIC COLL. FREQ. = 0.1648D-01 (*10**12)/SEC.
 IONISATION COLL. FREQ. = 0.0000D+00 (*10**12)/SEC.
 ATTACHMENT COLL. FREQ. = 0.0000D+00 (*10**12/SEC.

-----------------------------------------------------------------------------

  DETAILED COLLISION FREQUENCIES FOR EACH GAS IN UNITS OF 10**12/SEC. :

   NITROGEN 2015 ANISOTROPIC
-----------------------------

    ELASTIC ANISOTROPIC NITROGEN 0.4540D+00 +- 0.0051 %
    ATTACHMENT 0.0000D+00 +- 0.0000 %
    ROTATION 2-0 ELOSS= -0.00148 0.2724D-03 +- 0.2078 %
    ROTATION 3-1 ELOSS= -0.00247 0.2335D-03 +- 0.2244 %
    ROTATION 4-2 ELOSS= -0.00345 0.6154D-03 +- 0.1383 %
    ROTATION 5-3 ELOSS= -0.00444 0.3640D-03 +- 0.1798 %
    ROTATION 6-4 ELOSS= -0.00543 0.7941D-03 +- 0.1217 %
    ROTATION 7-5 ELOSS= -0.00641 0.4125D-03 +- 0.1689 %
    ROTATION 8-6 ELOSS= -0.00740 0.8164D-03 +- 0.1200 %
    ROTATION 9-7 ELOSS= -0.00839 0.3898D-03 +- 0.1737 %
    ROTATION 10-8 ELOSS= -0.00937 0.7192D-03 +- 0.1279 %
    ROTATION 11-9 ELOSS= -0.0104 0.3217D-03 +- 0.1912 %
    ROTATION 12-10 ELOSS= -0.0113 0.5594D-03 +- 0.1450 %
    ROTATION 13-11 ELOSS= -0.0123 0.2359D-03 +- 0.2233 %
    ROTATION 14-12 ELOSS= -0.0133 0.3899D-03 +- 0.1737 %
    ROTATION 15-13 ELOSS= -0.0143 0.1565D-03 +- 0.2741 %
    ROTATION 16-14 ELOSS= -0.0153 0.2459D-03 +- 0.2187 %
    ROTATION 17-15 ELOSS= -0.0163 0.9384D-04 +- 0.3540 %
    ROTATION 18-16 ELOSS= -0.0173 0.1405D-03 +- 0.2893 %
    ROTATION 19-17 ELOSS= -0.0183 0.5165D-04 +- 0.4772 %
    ROTATION 20-18 ELOSS= -0.0192 0.7447D-04 +- 0.3974 %
    ROTATION 21-19 ELOSS= -0.0202 0.2555D-04 +- 0.6785 %
    ROTATION 22-20 ELOSS= -0.0212 0.3534D-04 +- 0.5769 %
    ROTATION 23-21 ELOSS= -0.0222 0.1176D-04 +- 1.0000 %
    ROTATION 24-22 ELOSS= -0.0232 0.1558D-04 +- 0.8688 %
    ROTATION 25-23 ELOSS= -0.0242 0.5025D-05 +- 1.5300 %
    ROTATION 26-24 ELOSS= -0.0252 0.6429D-05 +- 1.3526 %
    ROTATION 27-25 ELOSS= -0.0261 0.1935D-05 +- 2.4656 %
    ROTATION 28-26 ELOSS= -0.0271 0.2294D-05 +- 2.2646 %
    ROTATION 29-27 ELOSS= -0.0281 0.7622D-06 +- 3.9284 %
    ROTATION 30-28 ELOSS= -0.0291 0.7975D-06 +- 3.8405 %
    ROTATION 31-29 ELOSS= -0.0301 0.2305D-06 +- 7.1429 %
    ROTATION 32-30 ELOSS= -0.0311 0.2658D-06 +- 6.6519 %
    ROTATION 33-31 ELOSS= -0.0321 0.5058D-07 +- 15.2499 %
    ROTATION 34-32 ELOSS= -0.0331 0.5999D-07 +- 14.0028 %
    ROTATION 35-33 ELOSS= -0.0340 0.1882D-07 +- 25.0000 %
    ROTATION 36-34 ELOSS= -0.0350 0.2000D-07 +- 24.2536 %
    ROTATION 37-35 ELOSS= -0.0360 0.5881D-08 +- 44.7214 %
    ROTATION 38-36 ELOSS= -0.0370 0.8233D-08 +- 37.7964 %
    ROTATION 39-37 ELOSS= -0.0380 0.0000D+00 +- 0.0000 %
    ROTATION 0-2 ELOSS= 0.00148 0.2876D-03 +- 0.2022 %
    ROTATION 1-3 ELOSS= 0.00247 0.2533D-03 +- 0.2155 %
    ROTATION 2-4 ELOSS= 0.00345 0.6919D-03 +- 0.1304 %
    ROTATION 3-5 ELOSS= 0.00444 0.4210D-03 +- 0.1671 %
    ROTATION 4-6 ELOSS= 0.00543 0.9525D-03 +- 0.1111 %
    ROTATION 5-7 ELOSS= 0.00641 0.5102D-03 +- 0.1518 %
    ROTATION 6-8 ELOSS= 0.00740 0.1046D-02 +- 0.1060 %
    ROTATION 7-9 ELOSS= 0.00839 0.5150D-03 +- 0.1511 %
    ROTATION 8-10 ELOSS= 0.00937 0.9820D-03 +- 0.1094 %
    ROTATION 9-11 ELOSS= 0.0104 0.4538D-03 +- 0.1610 %
    ROTATION 10-12 ELOSS= 0.0113 0.8168D-03 +- 0.1200 %
    ROTATION 11-13 ELOSS= 0.0123 0.3558D-03 +- 0.1818 %
    ROTATION 12-14 ELOSS= 0.0133 0.6070D-03 +- 0.1392 %
    ROTATION 13-15 ELOSS= 0.0143 0.2515D-03 +- 0.2163 %
    ROTATION 14-16 ELOSS= 0.0153 0.4093D-03 +- 0.1695 %
    ROTATION 15-17 ELOSS= 0.0163 0.1619D-03 +- 0.2695 %
    ROTATION 16-18 ELOSS= 0.0173 0.2498D-03 +- 0.2170 %
    ROTATION 17-19 ELOSS= 0.0183 0.9423D-04 +- 0.3533 %
    ROTATION 18-20 ELOSS= 0.0192 0.1403D-03 +- 0.2895 %
    ROTATION 19-21 ELOSS= 0.0202 0.5069D-04 +- 0.4817 %
    ROTATION 20-22 ELOSS= 0.0212 0.7197D-04 +- 0.4043 %
    ROTATION 21-23 ELOSS= 0.0222 0.2487D-04 +- 0.6877 %
    ROTATION 22-24 ELOSS= 0.0232 0.3334D-04 +- 0.5939 %
    ROTATION 23-25 ELOSS= 0.0242 0.1102D-04 +- 1.0333 %
    ROTATION 24-26 ELOSS= 0.0252 0.1453D-04 +- 0.8997 %
    ROTATION 25-27 ELOSS= 0.0261 0.4552D-05 +- 1.6075 %
    ROTATION 26-28 ELOSS= 0.0271 0.5782D-05 +- 1.4262 %
    ROTATION 27-29 ELOSS= 0.0281 0.1694D-05 +- 2.6352 %
    ROTATION 28-30 ELOSS= 0.0291 0.2162D-05 +- 2.3325 %
    ROTATION 29-31 ELOSS= 0.0301 0.6387D-06 +- 4.2914 %
    ROTATION 30-32 ELOSS= 0.0311 0.7198D-06 +- 4.0423 %
    ROTATION 31-33 ELOSS= 0.0321 0.2235D-06 +- 7.2548 %
    ROTATION 32-34 ELOSS= 0.0331 0.2164D-06 +- 7.3721 %
    ROTATION 33-35 ELOSS= 0.0340 0.5411D-07 +- 14.7442 %
    ROTATION 34-36 ELOSS= 0.0350 0.5058D-07 +- 15.2499 %
    ROTATION 35-37 ELOSS= 0.0360 0.1529D-07 +- 27.7350 %
    ROTATION 36-38 ELOSS= 0.0370 0.1176D-07 +- 31.6228 %
    ROTATION 37-39 ELOSS= 0.0380 0.5881D-08 +- 44.7214 %
    VIBRATION V1 ELOSS= -0.2889 0.5881D-08 +- 44.7214 %
    VIBRATION V1 ELOSS= 0.2889 0.6833D-04 +- 0.4149 %
    VIBRATION 2V1 ELOSS= 0.5742 0.1059D-06 +- 10.5409 %
    VIBRATION 3V1 ELOSS= 0.8559 0.5881D-08 +- 44.7214 %
    VIBRATION 4V1 ELOSS= 1.1342 0.0000D+00 +- 0.0000 %
    VIBRATION 5V1 ELOSS= 1.4088 0.0000D+00 +- 0.0000 %
-----------------------------------------------------------------------------

           NORMALISED ENERGY DISTRIBUTION
      E= 0.018 SPEC= 0.7093D-02
      E= 0.053 SPEC= 0.2816D-01
      E= 0.088 SPEC= 0.5127D-01
      E= 0.124 SPEC= 0.7140D-01
      E= 0.159 SPEC= 0.8621D-01
      E= 0.194 SPEC= 0.9527D-01
      E= 0.230 SPEC= 0.9787D-01
      E= 0.265 SPEC= 0.9492D-01
      E= 0.301 SPEC= 0.8688D-01
      E= 0.336 SPEC= 0.7601D-01
      E= 0.371 SPEC= 0.6484D-01
      E= 0.407 SPEC= 0.5398D-01
      E= 0.442 SPEC= 0.4395D-01
      E= 0.477 SPEC= 0.3515D-01
      E= 0.513 SPEC= 0.2762D-01
      E= 0.548 SPEC= 0.2131D-01
      E= 0.583 SPEC= 0.1619D-01
      E= 0.619 SPEC= 0.1213D-01
      E= 0.654 SPEC= 0.8874D-02
      E= 0.689 SPEC= 0.6405D-02
      E= 0.725 SPEC= 0.4557D-02
      E= 0.760 SPEC= 0.3189D-02
      E= 0.795 SPEC= 0.2194D-02
      E= 0.831 SPEC= 0.1488D-02
      E= 0.866 SPEC= 0.1002D-02
      E= 0.902 SPEC= 0.6961D-03
      E= 0.937 SPEC= 0.4650D-03
      E= 0.972 SPEC= 0.3066D-03
      E= 1.008 SPEC= 0.2053D-03
      E= 1.043 SPEC= 0.1448D-03
      E= 1.078 SPEC= 0.8344D-04
      E= 1.114 SPEC= 0.4884D-04
      E= 1.149 SPEC= 0.3500D-04
      E= 1.184 SPEC= 0.2307D-04
      E= 1.220 SPEC= 0.1389D-04
      E= 1.255 SPEC= 0.7158D-05
      E= 1.290 SPEC= 0.2915D-05
      E= 1.326 SPEC= 0.2242D-05
      E= 1.361 SPEC= 0.1227D-05
      E= 1.397 SPEC= 0.3457D-05
MediumMagboltz::RunMagboltz: Results:
    Drift velocity along E: 0.00037139 cm/ns +/- 0.24%
    Drift velocity along Bt: 0.00000000 cm/ns +/- 0.00%
    Drift velocity along ExB: 0.00000000 cm/ns +/- 0.00%
    Lorentz angle: 0.000 degree
    Longitudinal diffusion: 0.03300231 cm1/2 +/- 1.31%
    Transverse diffusion: 0.04928603 cm1/2 +/- 1.32%
    Townsend coefficient: 0.0000 cm-1 +/- 0.00%
    Attachment coefficient: 0.0000 cm-1 +/- 0.00%
MediumMagboltz::GenerateGasTable: E = 206.914 V/cm, B = 0 T, angle: 1.5708 rad

          PROGRAM MAGBOLTZ 2 VERSION 11.13

          MONTE CARLO SOLUTION FOR MIXTURE OF 1 GASES.
     ------------------------------------------------------

       GASES USED PERCENTAGE USED 

      NITROGEN 2015 ANISOTROPIC 100.0000

  GAS TEMPERATURE = 20.0 DEGREES CENTIGRADE.
  GAS PRESSURE = 760.0 TORR.

  INTEGRATION FROM 0.0 TO 2.00 EV. IN 4000 STEPS. 

 PENNING EFFECTS NOT INCLUDED

 ANISOTROPIC SCATTERING TYPE 2 (OKHRIMOVSKYY) USED IF AVAILABLE

 SHORT DECORRELATION LENGTH = 400000 COLLISIONS.

 THERMAL MOTION OF GAS NOT INCLUDED

  ELECTRIC FIELD = 206.9138 VOLTS/CM.
  MAGNETIC FIELD = 0.0000 KILOGAUSS.
  ANGLE BETWEEN ELECTRIC AND MAGNETIC FIELD = 90.000 DEGREES.
  CYCLOTRON FREQ. = 0.000D+00 RADIANS/PICOSECOND

  INITIAL ELECTRON ENERGY = 0.040 EV.

  TOTAL NUMBER OF REAL COLLISIONS = 400000000

  NULL COLLISION FREQUENCY AT 8 EQUALLY SPACED ENERGY INTERVALS (*10**12/SEC)
      0.368D+01 0.545D+01 0.545D+01 0.545D+01
      0.545D+01 0.545D+01 0.545D+01 0.545D+01

  REAL COLLISION FREQUENCY AT 8 EQUALLY SPACED ENERGY INTERVALS (*10**12/SEC)
      0.311D+00 0.768D+00 0.108D+01 0.133D+01
      0.159D+01 0.185D+01 0.229D+01 0.399D+01

    VEL POS TIME ENERGY COUNT DIFXX DIFYY DIFZZ

     4.18 0.279D+00 0.668D+08 0.2969 100 496.4 417.4 0.0
     4.16 0.557D+00 0.134D+09 0.2956 200 527.8 437.7 0.0
     4.15 0.833D+00 0.201D+09 0.2960 300 489.5 443.8 190.2
     4.16 0.111D+01 0.267D+09 0.2966 400 474.4 440.0 183.0
     4.17 0.139D+01 0.334D+09 0.2967 500 488.8 447.9 187.9
     4.16 0.167D+01 0.401D+09 0.2963 600 479.8 449.7 187.8
Killed

```

---

<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 13, 2021, 6:25am UTC](https://root-forum.cern.ch/t/how-to-gain-the-bragg-peak-curve-of-proton/48035/2 "2021-12-13T06:25:56Z")

</div>

The program output that you posted is from running Magboltz (which calculates electron transport properties like drift velocity, Townsend coefficient etc.), which has nothing to do with proton energy loss.  
Can you explain a bit better what you are trying to do and the specific problem that you are encountering?

---

<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 13, 2021, 7:38am UTC](https://root-forum.cern.ch/t/how-to-gain-the-bragg-peak-curve-of-proton/48035/3 "2021-12-13T07:38:29Z")

</div>

Hi，  
Thanks for replying me so quickly.  
I need to gain the Bragg Peak like the plot below.

 ![bragg peak](https://root-forum.cern.ch/uploads/default/original/3X/9/1/91a96b86df10a36336972fd26be3b36154622b02.png)  
When the proton incident into the detector,the energy will continue to decrease because of ionizing the gas, eventually deposited in the detector, forming Bragg peak.  
I want to get the Bragg peak and the track curve of the proton.  
Otherwise, I also can’t get plot of the electron transport properties like drift velocity, Townsend coefficient etc. I will try to figure it out

---

<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 13, 2021, 8:00am UTC](https://root-forum.cern.ch/t/how-to-gain-the-bragg-peak-curve-of-proton/48035/4 "2021-12-13T08:00:32Z")

</div>

Hi,  
This is the result I got so far, I will try to fix under your advice, Thanks again for your help.

 ![image](https://root-forum.cern.ch/uploads/default/original/3X/8/6/8655d9b9c854d4610f4fe13439c07c95f8222721.png)

```auto
Info in <TCanvas::Print>: pdf file ne.pdf has been created
Info in <TCanvas::Print>: pdf file edep.pdf has been created
Info in <TGeoManager::TGeoManager>: Geometry ViewFEMeshGeoManager, created
Info in <TGeoManager::SetTopVolume>: Top volume is Top. Master volume is Top
Info in <TGeoNavigator::BuildCache>: --- Maximum geometry depth set to 100
Info in <TGeoManager::CheckGeometry>: Fixing runtime shapes...
Info in <TGeoManager::CheckGeometry>: ...Nothing to fix
Info in <TGeoManager::CloseGeometry>: Counting nodes...
Info in <TGeoManager::Voxelize>: Voxelizing...
Error in <TGeoVoxelFinder::SortAll>: Cannot voxelize Top :less than 2 boundaries on X
Info in <TGeoManager::CloseGeometry>: Building cache...
Info in <TGeoManager::CountLevels>: max level = 1, max placements = 10437
Info in <TGeoManager::CloseGeometry>: 10438 nodes/ 10438 volume UID's in 
Info in <TGeoManager::CloseGeometry>: ----------------modeler ready----------------
Info in <TGeoManager::SetMaxVisNodes>: Automatic visible depth for 10439 visible nodes

```

---

<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 13, 2021, 11:06am UTC](https://root-forum.cern.ch/t/how-to-gain-the-bragg-peak-curve-of-proton/48035/5 "2021-12-13T11:06:17Z")

</div>

Hi,  
as discussed by e-mail, the model used by Heed is not suitable for simulating the slowing down of protons. SRIM or TRIM are probably the best option for this kind of application:  
[https://garfieldpp.web.cern.ch/examples/srim/](https://garfieldpp.web.cern.ch/examples/srim/)  
[https://garfieldpp.web.cern.ch/examples/trim/](https://garfieldpp.web.cern.ch/examples/trim/)

---

<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 13, 2021, 11:44am UTC](https://root-forum.cern.ch/t/how-to-gain-the-bragg-peak-curve-of-proton/48035/6 "2021-12-13T11:44:37Z")

</div>

Hi,  
Thanks a lot for your reply. your advice helps me a lot, I will try to figure them out under your advice, first I want to solve the plot of field line and generation of gas file, then after I have learn the SRIM and TRIM, I will try to solve the Bragg peak curve of proton problem.

---

<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 13, 2021, 12:59pm UTC](https://root-forum.cern.ch/t/how-to-gain-the-bragg-peak-curve-of-proton/48035/7 "2021-12-13T12:59:02Z")

</div>

Hi,  
I have read the introduce of SRIM and TRIM, they are all about the transportation and energy loss of the ions,but I need to simulate the the transportation and energy loss of the electrons. Is there any class suitable for the electrons?

---

<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 13, 2021, 1:10pm UTC](https://root-forum.cern.ch/t/how-to-gain-the-bragg-peak-curve-of-proton/48035/8 "2021-12-13T13:10:28Z")

</div>

Not sure I understand. You said earlier that you want to simulate the Bragg peak of an incident proton, no?

---

<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 13, 2021, 1:16pm UTC](https://root-forum.cern.ch/t/how-to-gain-the-bragg-peak-curve-of-proton/48035/9 "2021-12-13T13:16:59Z")

</div>

yes,indeed. the proton will ionize the gas ,and generate the ions and electrons. I want to get some plots about the electrons but not the ions.

---

<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 13, 2021, 1:20pm UTC](https://root-forum.cern.ch/t/how-to-gain-the-bragg-peak-curve-of-proton/48035/10 "2021-12-13T13:20:59Z")

</div>

Hi,  
there is some problem about generate the gas files. I have just saved the basic code to generate the gas files,but I failed,there is no gas file generated,and I don’t know why, that’s my code.

```auto
               using namespace Garfield;
		int main(int argc, char * argv[]) {
		 TApplication app("app", &argc, argv);
		// Load the field map.
		 ComponentAnsys123 fm;
		 fm.Initialise("ELIST.lis", "NLIST.lis", "MPLIST.lis", "PRNSOL.lis", "cm");
	   fm.PrintRange();
		 fm.PrintMaterials();
		// Get the extent of the field map.
		 double x0, y0, z0, x1, y1, z1;
		 fm.GetBoundingBox(x0, y0, z0, x1, y1, z1);
               MediumMagboltz gas;
		 gas.SetComposition("N2");
		// Set temperature [K] and pressure [Torr].
		 gas.SetTemperature(293.15);
		 gas.SetPressure(760.);
		 gas.SetMaxElectronEnergy(200.);
		 gas.Initialise(true);
	
		 const unsigned int nMaterials = fm.GetNumberOfMaterials();
		 for (unsigned int i = 0; i < nMaterials; ++i) {
		 const double eps = fm.GetPermittivity(i);
		 if (fabs(eps - 1.) < 1.e-3) fm.SetMedium(i, &gas);
		}
	

		 const int nFields=20; //set the field range to be covered by the gas table
		 const double emin=100.;
		 const double emax=100000.;
		 const bool useLog=true; //flag to request logarithmic spacing
		 gas.SetFieldGrid(emin,emax,nFields,useLog);
		 const int ncoll=10; //simulate number of events is ncoll*1E6
		 gas.EnableDebugging(); //switch on debugging to print the Magboltz output
		 gas.GenerateGasTable(ncoll); //Run Magboltz to generate the gas table
		 gas.DisableDebugging();
		 gas.WriteGasFile("N2.gas");
		 app.Run();

```

---

<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 13, 2021, 4:48pm UTC](https://root-forum.cern.ch/t/how-to-gain-the-bragg-peak-curve-of-proton/48035/11 "2021-12-13T16:48:47Z")

</div>

Ok, I see… It’s a bit hard to follow if we change topic from post to post…

What is the error message that you get when calculating the gas table?  
If there is no error message and the program just stops midway through the calculation, try increasing the stack size limit, i. e. type

```auto
ulimit -s unlimited

```

and rerun.

---

<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 14, 2021, 4:15am UTC](https://root-forum.cern.ch/t/how-to-gain-the-bragg-peak-curve-of-proton/48035/12 "2021-12-14T04:15:17Z")

</div>

Hi,  
Thank you for your reply, sorry for changing topic from post to post…  
there is no error message and the program just stops midway through the calculation, and I have tried the"ulimit -s unlimited", and it still don’t proceed.

```auto
   Drift velocity along E: 0.03348164 cm/ns +/- 0.02%
    Drift velocity along Bt: 0.00000000 cm/ns +/- 0.00%
    Drift velocity along ExB: 0.00000000 cm/ns +/- 0.00%
    Lorentz angle: 0.000 degree
    Longitudinal diffusion: 0.00904648 cm1/2 +/- 1.02%
    Transverse diffusion: 0.01047772 cm1/2 +/- 1.65%
    Townsend coefficient: 723.2759 cm-1 +/- 0.08%
    Attachment coefficient: 0.0000 cm-1 +/- 0.00%
    TOF effective Townsend: 724.2625 cm-1 (alpha - eta)
    Excitation and ionisation rates:
                         Level Rate [ns-1]
        N2 IONISATION N2+ X2SIGMA VIB=0 ELOSS= 15.581 1903085.62593960
        N2 IONISATION N2+ X2SIGMA VIB>0 ELOSS= 15.855 477537.40289777
        N2 IONISATION N2+ A2PI VIB=0 ELOSS= 16.699 569138.73886919
        N2 IONISATION N2+ A2PI VIB=1 ELOSS= 16.935 843568.59500107
        N2 IONISATION N2+ A2PI VIB>1 ELOSS= 17.171 1386429.90588957
        N2 IONISATION N2+ B2SIGMA ELOSS= 18.751 683317.88999705
        N2 IONISATION N2+ C2SIGMA ELOSS= 23.591 72381.90721370
        N2 DISSOC ION (N+,N) ELOSS= 24.294 98348.04091145
        N2 DISSOC ION (N+,N*) ELOSS= 24.4 18369.35590813
        N2 DISSOC ION (N+*,N) ELOSS= 35.7 727.35106496
        N2 DISSOC ION (N++,N) AND (N+,N+) ELOSS= 38.8 1337.96677382
ulimit -s unlimited

```

---

<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 14, 2021, 7:25am UTC](https://root-forum.cern.ch/t/how-to-gain-the-bragg-peak-curve-of-proton/48035/13 "2021-12-14T07:25:45Z")

</div>

Are you sure? What is the electric field value for which you got the output in your last post?

---

<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 14, 2021, 7:52am UTC](https://root-forum.cern.ch/t/how-to-gain-the-bragg-peak-curve-of-proton/48035/14 "2021-12-14T07:52:47Z")

</div>

Hi,  
I have modified the code ,and copy the ([Examples/GasFile/generate.C · master · garfield / garfieldpp](https://gitlab.cern.ch/garfield/garfieldpp/-/blob/master/Examples/GasFile/generate.C)),and it works,maybe the other code would be a interference. next time I would use the LoadGasFile and implement the other thoughts one by one.  
Thanks again for helping me

---

<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:** [December 28, 2021, 7:53am UTC](https://root-forum.cern.ch/t/how-to-gain-the-bragg-peak-curve-of-proton/48035/15 "2021-12-28T07:53:49Z")

</div>

Closed on December 28, 2021, 7:53am UTC

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