# I am facing Magboltz installation issue or i may be doing something wrong

**URL:** <https://root-forum.cern.ch/t/i-am-facing-magboltz-installation-issue-or-i-may-be-doing-something-wrong/62950>\
**Category:** Garfield++\
**Created:** [February 15, 2025, 9:59am UTC](https://root-forum.cern.ch/t/i-am-facing-magboltz-installation-issue-or-i-may-be-doing-something-wrong/62950 "2025-02-15T09:59:47Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ujjwal-gh](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ujjwal-gh/32/37306_2.png) [@Ujjwal-gh](https://root-forum.cern.ch/u/Ujjwal-gh)\
**Post date:** [February 15, 2025, 9:59am UTC](https://root-forum.cern.ch/t/i-am-facing-magboltz-installation-issue-or-i-may-be-doing-something-wrong/62950/1 "2025-02-15T09:59:47Z")

</div>

Hello

I Want to use Magboltz to write custom gas files, or I want to use Magboltz to do the analysis of a proportional counter properly. I think while installing the Garfield ++ the Magboltz didn’t installed properly because i am not able to generate any gas file.  
Can anyone help me rectifying this issue

I am using Ubuntu 22.04.5 LTS

Thanks

---

<div class="post-metadata">

**Author:** ![Danilo](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/danilo/32/34528_2.png) [@Danilo](https://root-forum.cern.ch/u/Danilo)\
**Post date:** [February 15, 2025, 12:23pm UTC](https://root-forum.cern.ch/t/i-am-facing-magboltz-installation-issue-or-i-may-be-doing-something-wrong/62950/2 "2025-02-15T12:23:12Z")

</div>

Hi,

@hschindl ?

D

---

<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 15, 2025, 4:14pm UTC](https://root-forum.cern.ch/t/i-am-facing-magboltz-installation-issue-or-i-may-be-doing-something-wrong/62950/3 "2025-02-15T16:14:36Z")

</div>

Hi,  
can you give more details? What do you mean by “not able to generate any gas file”? Did you try running this example?

> **[Examples/GasFile/generate.C · master · garfield / garfieldpp · GitLab](https://gitlab.cern.ch/garfield/garfieldpp/-/blob/master/Examples/GasFile/generate.C?ref_type=heads)**
>
> http://garfieldpp.web.cern.ch/garfieldpp/

What output did you get from the program?

---

<div class="post-metadata">

**Author:** ![Ujjwal-gh](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ujjwal-gh/32/37306_2.png) [@Ujjwal-gh](https://root-forum.cern.ch/u/Ujjwal-gh)\
**Post date:** [February 15, 2025, 5:46pm UTC](https://root-forum.cern.ch/t/i-am-facing-magboltz-installation-issue-or-i-may-be-doing-something-wrong/62950/4 "2025-02-15T17:46:48Z")

</div>

Hi  
Thank you for replying, Actually i am trying to use the gas properties in my Geant4 setup. Now in the included example i wasn’t able to figure out where and how to use magboltz for the same. I am trying to implement electric field properties for which i needed Garfield ++ but i am stuck.  
Can you suggest if there is any way to simulate energy deposition of charged particles in electric field.

Thanks

---

<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 16, 2025, 2:14pm UTC](https://root-forum.cern.ch/t/i-am-facing-magboltz-installation-issue-or-i-may-be-doing-something-wrong/62950/5 "2025-02-16T14:14:01Z")

</div>

I’m afraid I’m not sure I understand your question. You mention a few different things in your post(s):

- Energy deposition by charged particles (Garfield++ has a built-in tool - “Heed” - for simulating ionisation by fast charged particles; but you could indeed also use Geant4)
- Electric fields (depending on the type of detector you can use built-in functionalities for computing the electric field or you can import maps calculated with a finite-element solver)
- Calculating transport properties of electrons in a gas (this is what Magboltz does).

All of these are ingredients in a typical Garfield++ simulation, but they are distinct things. Which of them is your question about?

---

<div class="post-metadata">

**Author:** ![Ujjwal-gh](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ujjwal-gh/32/37306_2.png) [@Ujjwal-gh](https://root-forum.cern.ch/u/Ujjwal-gh)\
**Post date:** [February 16, 2025, 4:38pm UTC](https://root-forum.cern.ch/t/i-am-facing-magboltz-installation-issue-or-i-may-be-doing-something-wrong/62950/6 "2025-02-16T16:38:25Z")

</div>

Hi  
Actually, I have to do all three analyses that you have mentioned. After your suggestion I have used Magboltz perfectly, there were some library linking issues that I was facing earlier, and now I have rectified that. I have played with the transport properties one and now the gas file is generating. I will try Heed this week, and if i face any issue i will ask on this thread only.

Thanks

---

<div class="post-metadata">

**Author:** ![Ujjwal-gh](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ujjwal-gh/32/37306_2.png) [@Ujjwal-gh](https://root-forum.cern.ch/u/Ujjwal-gh)\
**Post date:** [February 21, 2025, 4:04pm UTC](https://root-forum.cern.ch/t/i-am-facing-magboltz-installation-issue-or-i-may-be-doing-something-wrong/62950/7 "2025-02-21T16:04:20Z")

</div>

Hi again, I have successfully modified the construction file for the Geant4Garfield ++ interface code according to my requirements and ran it to see the visualisation. It was working and then I started to modify other files as well.

When I modified the GarfieldPhysics.cc file and then tried to run the executable I got the following error

=========================================================================  
ujjwal@Jarvis:~/Geant4GarfieldInterface/build$ ./exampleGeant4Interface  
Available UI session types: [Qt, tcsh, csh]  
Warning: Ignoring XDG\_SESSION\_TYPE=wayland on Gnome. Use QT\_QPA\_PLATFORM=wayland to run on Wayland anyway.  
RandomEngineRoot::Seed: 1

* * *

Geant4 version Name: geant4-11-02-patch-02 [MT] (21-June-2024)  
Copyright : Geant4 Collaboration  
References : NIM A 506 (2003), 250-303  
: IEEE-TNS 53 (2006), 270-278  
: NIM A 835 (2016), 186-225  
WWW : [http://geant4.org/](http://geant4.org/)

* * *

\<\<\< Geant4 Physics List simulation engine: QGSP\_BERT\_HP

RegisterPhysics: G4EmStandard  
RegisterPhysics: G4GammaLeptoNuclearPhys  
RegisterPhysics: Decay  
RegisterPhysics: G4RadioactiveDecay  
RegisterPhysics: nElasticPhysics\_HP  
RegisterPhysics: hInelastic QGSP\_BERT\_HP  
RegisterPhysics: stopping  
RegisterPhysics: ionInelasticFTFP\_BIC  
RegisterPhysics: IonElasticPhysics  
Using  
Visualization Manager instantiating with verbosity “warnings (3)”…  
Visualization Manager initialising…  
Registering graphics systems…

You have successfully registered the following graphics systems.  
Registered graphics systems are:  
ASCIITree (ATree)  
DAWNFILE (DAWNFILE)  
G4HepRepFile (HepRepFile)  
RayTracer (RayTracer)  
VRML2FILE (VRML2FILE)  
gMocrenFile (gMocrenFile)  
TOOLSSG\_OFFSCREEN (TSG\_OFFSCREEN)  
TOOLSSG\_OFFSCREEN (TSG\_OFFSCREEN, TSG\_FILE)  
OpenGLImmediateQt (OGLIQt, OGLI)  
OpenGLStoredQt (OGLSQt, OGL, OGLS)  
RayTracerX (RayTracerX)  
TOOLSSG\_QT\_GLES (TSG\_QT\_GLES, TSGQt, TSG)  
TOOLSSG\_QT\_ZB (TSG\_QT\_ZB, TSGQtZB)  
Default graphics system is: OGL (based on build flags).  
Default window size hint is: 600x600-0+0 (based on G4VisManager initialisation).  
Note: Parameters specified on the command line will override these defaults.  
Use “vis/open” without parameters to get these defaults.

Registering model factories…

You have successfully registered the following model factories.  
Registered model factories:  
generic  
drawByAttribute  
drawByCharge  
drawByOriginVolume  
drawByParticleID  
drawByEncounteredVolume

Registered models:  
None

Registered filter factories:  
attributeFilter  
chargeFilter  
originVolumeFilter  
particleFilter  
encounteredVolumeFilter

Registered filters:  
None

You have successfully registered the following user vis actions.  
Run Duration User Vis Actions: none  
End of Event User Vis Actions: none  
End of Run User Vis Actions: none

Some /vis commands (optionally) take a string to specify colour.  
“/vis/list” to see available colours.  
/control/saveHistory  
/run/verbose 2

# 

# Change the default number of threads (in multi-threaded mode)

#/run/numberOfThreads 12

# 

/control/execute physics.mac

# Enable GarfieldModel for different particle types and energy ranges

# Possible models: PAI, PAIPhot, Heed

# Here we enable the PAIPhot model with default values (useDefaults = true)

# When useDefaults is set to false, the particle types and energy ranges

# have to be set by hand

/exampleGarfield/physics/setIonizationModel PAI false

# Here are the Geant4 particle types and energies that are set by useDefaults = true

/exampleGarfield/physics/setGeant4ParticleTypeAndEnergy e- 0 1e+8 MeV  
PAI is applicable for G4Particle e- between 0 MeV and 1e+08 MeV  
/exampleGarfield/physics/setGeant4ParticleTypeAndEnergy e+ 0 1e+8 MeV  
PAI is applicable for G4Particle e+ between 0 MeV and 1e+08 MeV  
/exampleGarfield/physics/setGeant4ParticleTypeAndEnergy mu- 0 1e+8 MeV  
PAI is applicable for G4Particle mu- between 0 MeV and 1e+08 MeV  
/exampleGarfield/physics/setGeant4ParticleTypeAndEnergy mu+ 0 1e+8 MeV  
PAI is applicable for G4Particle mu+ between 0 MeV and 1e+08 MeV  
/exampleGarfield/physics/setGeant4ParticleTypeAndEnergy proton 0 1e+8 MeV  
PAI is applicable for G4Particle proton between 0 MeV and 1e+08 MeV  
/exampleGarfield/physics/setGeant4ParticleTypeAndEnergy pi+ 0 1e+8 MeV  
PAI is applicable for G4Particle pi+ between 0 MeV and 1e+08 MeV  
/exampleGarfield/physics/setGeant4ParticleTypeAndEnergy pi- 0 1e+8 MeV  
PAI is applicable for G4Particle pi- between 0 MeV and 1e+08 MeV  
/exampleGarfield/physics/setGeant4ParticleTypeAndEnergy alpha 0 1e+8 MeV  
PAI is applicable for G4Particle alpha between 0 MeV and 1e+08 MeV  
/exampleGarfield/physics/setGeant4ParticleTypeAndEnergy He3 0 1e+8 MeV  
PAI is applicable for G4Particle He3 between 0 MeV and 1e+08 MeV  
/exampleGarfield/physics/setGeant4ParticleTypeAndEnergy GenericIon- 0 1e+8 MeV  
PAI is applicable for G4Particle GenericIon- between 0 MeV and 1e+08 MeV

# If PAI or PAIPhot model are chosen, per default gamma treatment in Heed is activated

/exampleGarfield/physics/setGarfieldParticleTypeAndEnergy gamma 1e-6 1e+8 MeV  
Garfield model (Heed) is applicable for G4Particle gamma between 1e-06 MeV and 1e+08 MeV

# If PAI or PAIPhot model are chosen, per default e- under 1 keV are treated as delta electrons in Heed

/exampleGarfield/physics/setGarfieldParticleTypeAndEnergy e- 1e-6 1e-3 MeV  
Garfield model (Heed) is applicable for G4Particle e- between 1e-06 MeV and 0.001 MeV

# If Heed is chosen as ionization model, the following particles are set by default

# /exampleGarfield/physics/setGarfieldParticleTypeAndEnergy gamma 1e-6 1e+8 MeV

# /exampleGarfield/physics/setGarfieldParticleTypeAndEnergy e- 6e-2 1e+7 MeV

# /exampleGarfield/physics/setGarfieldParticleTypeAndEnergy e+ 6e-2 1e+7 MeV

# /exampleGarfield/physics/setGarfieldParticleTypeAndEnergy mu- 1e+1 1e+8 MeV

# /exampleGarfield/physics/setGarfieldParticleTypeAndEnergy mu+ 1e+1 1e+8 MeV

# /exampleGarfield/physics/setGarfieldParticleTypeAndEnergy pi- 2e+1 1e+8 MeV

# /exampleGarfield/physics/setGarfieldParticleTypeAndEnergy pi+ 2e+1 1e+8 MeV

# /exampleGarfield/physics/setGarfieldParticleTypeAndEnergy kaon 1e+1 1e+8 MeV

# /exampleGarfield/physics/setGarfieldParticleTypeAndEnergy kaon+ 1e+1 1e+8 MeV

# /exampleGarfield/physics/setGarfieldParticleTypeAndEnergy proton 9e+1 1e+8 MeV

# /exampleGarfield/physics/setGarfieldParticleTypeAndEnergy anti\_proton 9e+1 1e+8 MeV

# /exampleGarfield/physics/setGarfieldParticleTypeAndEnergy deuteron 2e+2 1e+8 MeV

# /exampleGarfield/physics/setGarfieldParticleTypeAndEnergy alpha 4e+2 1e+8 MeV

# 

# Initialize kernel

/run/initialize  
userDetector-\>Construct() start.

\*\*\*\*\* Table : Nb of materials = 5 \*\*\*\*\*

Material: G4\_AIR density: 1.205 mg/cm3 RadL: 303.921 m Nucl.Int.Length: 710.095 m  
Imean: 85.700 eV temperature: 293.15 K pressure: 1.00 atm

—\> Element: C (C) Z = 6.0 N = 12 A = 12.011 g/mole  
—\> Isotope: C12 Z = 6 N = 12 A = 12.00 g/mole abundance: 98.930 %  
—\> Isotope: C13 Z = 6 N = 13 A = 13.00 g/mole abundance: 1.070 %  
ElmMassFraction: 0.01 % ElmAbundance 0.02 %

—\> Element: N (N) Z = 7.0 N = 14 A = 14.007 g/mole  
—\> Isotope: N14 Z = 7 N = 14 A = 14.00 g/mole abundance: 99.632 %  
—\> Isotope: N15 Z = 7 N = 15 A = 15.00 g/mole abundance: 0.368 %  
ElmMassFraction: 75.53 % ElmAbundance 78.44 %

—\> Element: O (O) Z = 8.0 N = 16 A = 15.999 g/mole  
—\> Isotope: O16 Z = 8 N = 16 A = 15.99 g/mole abundance: 99.757 %  
—\> Isotope: O17 Z = 8 N = 17 A = 17.00 g/mole abundance: 0.038 %  
—\> Isotope: O18 Z = 8 N = 18 A = 18.00 g/mole abundance: 0.205 %  
ElmMassFraction: 23.18 % ElmAbundance 21.07 %

—\> Element: Ar (Ar) Z = 18.0 N = 40 A = 39.948 g/mole  
—\> Isotope: Ar36 Z = 18 N = 36 A = 35.97 g/mole abundance: 0.337 %  
—\> Isotope: Ar38 Z = 18 N = 38 A = 37.96 g/mole abundance: 0.063 %  
—\> Isotope: Ar40 Z = 18 N = 40 A = 39.96 g/mole abundance: 99.600 %  
ElmMassFraction: 1.28 % ElmAbundance 0.47 %

Material: G4\_STAINLESS-STEEL density: 8.000 g/cm3 RadL: 1.738 cm Nucl.Int.Length: 16.678 cm  
Imean: 282.977 eV temperature: 293.15 K pressure: 1.00 atm

—\> Element: Fe (Fe) Z = 26.0 N = 56 A = 55.845 g/mole  
—\> Isotope: Fe54 Z = 26 N = 54 A = 53.94 g/mole abundance: 5.845 %  
—\> Isotope: Fe56 Z = 26 N = 56 A = 55.93 g/mole abundance: 91.754 %  
—\> Isotope: Fe57 Z = 26 N = 57 A = 56.94 g/mole abundance: 2.119 %  
—\> Isotope: Fe58 Z = 26 N = 58 A = 57.93 g/mole abundance: 0.282 %  
ElmMassFraction: 74.62 % ElmAbundance 74.00 %

—\> Element: Cr (Cr) Z = 24.0 N = 52 A = 51.996 g/mole  
—\> Isotope: Cr50 Z = 24 N = 50 A = 49.95 g/mole abundance: 4.345 %  
—\> Isotope: Cr52 Z = 24 N = 52 A = 51.94 g/mole abundance: 83.789 %  
—\> Isotope: Cr53 Z = 24 N = 53 A = 52.94 g/mole abundance: 9.501 %  
—\> Isotope: Cr54 Z = 24 N = 54 A = 53.94 g/mole abundance: 2.365 %  
ElmMassFraction: 16.90 % ElmAbundance 18.00 %

—\> Element: Ni (Ni) Z = 28.0 N = 59 A = 58.693 g/mole  
—\> Isotope: Ni58 Z = 28 N = 58 A = 57.94 g/mole abundance: 68.077 %  
—\> Isotope: Ni60 Z = 28 N = 60 A = 59.93 g/mole abundance: 26.223 %  
—\> Isotope: Ni61 Z = 28 N = 61 A = 60.93 g/mole abundance: 1.140 %  
—\> Isotope: Ni62 Z = 28 N = 62 A = 61.93 g/mole abundance: 3.635 %  
—\> Isotope: Ni64 Z = 28 N = 64 A = 63.93 g/mole abundance: 0.926 %  
ElmMassFraction: 8.48 % ElmAbundance 8.00 %

Material: G4\_W density: 19.300 g/cm3 RadL: 3.504 mm Nucl.Int.Length: 10.312 cm  
Imean: 727.000 eV temperature: 293.15 K pressure: 1.00 atm

—\> Element: W (W) Z = 74.0 N = 184 A = 183.842 g/mole  
—\> Isotope: W180 Z = 74 N = 180 A = 179.95 g/mole abundance: 0.120 %  
—\> Isotope: W182 Z = 74 N = 182 A = 181.95 g/mole abundance: 26.500 %  
—\> Isotope: W183 Z = 74 N = 183 A = 182.95 g/mole abundance: 14.310 %  
—\> Isotope: W184 Z = 74 N = 184 A = 183.95 g/mole abundance: 30.640 %  
—\> Isotope: W186 Z = 74 N = 186 A = 185.95 g/mole abundance: 28.430 %  
ElmMassFraction: 100.00 % ElmAbundance 100.00 %

Material: CH4 density: 0.667 mg/cm3 RadL: 696.640 m Nucl.Int.Length: 907.478 m  
Imean: 45.542 eV temperature: 293.15 K pressure: 1.00 atm

—\> Element: C (C) Z = 6.0 N = 12 A = 12.011 g/mole  
—\> Isotope: C12 Z = 6 N = 12 A = 12.00 g/mole abundance: 98.930 %  
—\> Isotope: C13 Z = 6 N = 13 A = 13.00 g/mole abundance: 1.070 %  
ElmMassFraction: 74.87 % ElmAbundance 20.00 %

—\> Element: H (H) Z = 1.0 N = 1 A = 1.008 g/mole  
—\> Isotope: H1 Z = 1 N = 1 A = 1.01 g/mole abundance: 99.989 %  
—\> Isotope: H2 Z = 1 N = 2 A = 2.01 g/mole abundance: 0.011 %  
ElmMassFraction: 25.13 % ElmAbundance 80.00 %

Material: P10 density: 1.500 mg/cm3 RadL: 138.339 m Nucl.Int.Length: 726.668 m  
Imean: 155.640 eV temperature: 293.15 K pressure: 1.00 atm

—\> Element: Ar (Ar) Z = 18.0 N = 40 A = 39.948 g/mole  
—\> Isotope: Ar36 Z = 18 N = 36 A = 35.97 g/mole abundance: 0.337 %  
—\> Isotope: Ar38 Z = 18 N = 38 A = 37.96 g/mole abundance: 0.063 %  
—\> Isotope: Ar40 Z = 18 N = 40 A = 39.96 g/mole abundance: 99.600 %  
ElmMassFraction: 90.00 % ElmAbundance 41.96 %

—\> Element: C (C) Z = 6.0 N = 12 A = 12.011 g/mole  
—\> Isotope: C12 Z = 6 N = 12 A = 12.00 g/mole abundance: 98.930 %  
—\> Isotope: C13 Z = 6 N = 13 A = 13.00 g/mole abundance: 1.070 %  
ElmMassFraction: 7.49 % ElmAbundance 11.61 %

—\> Element: H (H) Z = 1.0 N = 1 A = 1.008 g/mole  
—\> Isotope: H1 Z = 1 N = 1 A = 1.01 g/mole abundance: 99.989 %  
—\> Isotope: H2 Z = 1 N = 2 A = 2.01 g/mole abundance: 0.011 %  
ElmMassFraction: 2.51 % ElmAbundance 46.43 %

Checking overlaps for volume PRCOuter:0 (G4Box) … OK!  
Checking overlaps for volume PRCInner:0 (G4Box) … OK!  
Checking overlaps for volume AnodeWire:0 (G4Tubs) … OK!  
MediumMagboltz::SetComposition: Ar/CH4 (90/10)  
MediumMagboltz::Mixer:  
4000 linear energy steps between 0 and 40 eV.  
ARGON ANISOTROPIC 2014�� 3n�16I�  
mass: 39.948 amu  
ionisation threshold: 15.7596 eV  
44 inelastic terms (44 excitations, 0 superelastic, 0 other)  
CH4 2015 ANISOTROPIC �� 3n�16I�  
mass: 16.0426 amu  
ionisation threshold: 12.65 eV  
34 inelastic terms (25 excitations, 2 superelastic, 7 other)  
MediumMagboltz::Mixer:  
Lowest ionisation threshold in the mixture: 12.65 eV (CH4)  
MediumMagboltz::Mixer:  
Energy [eV] Collision Rate [ns-1]  
2.50 1122.23  
7.50 3517.83  
12.50 6805.63  
17.50 10411.14  
22.50 13030.24  
27.50 14339.80  
32.50 13896.79  
37.50 13164.04  
MediumMagboltz::ComputePhotonCollisionTable:  
Energy [eV] Mean free path [um]  
1.00 ------------  
3.00 ------------  
5.00 ------------  
7.00 ------------  
9.00 929.7192  
11.00 212.0893  
13.00 83.0227  
15.00 77.8212  
17.00 11.1085  
19.00 10.4533  
MediumMagboltz::EnablePenningTransfer:  
Warning: present gas table has no ionisation rates.  
Ignore this message if you are using microscopic tracking only.  
MediumMagboltz::EnablePenningTransfer:  
Penning transfer probability for 44 Ar excitation levels set to r = 0.57  
MediumMagboltz::LoadGasFile:  
Cannot open file p10\_modified.gas.

# \*\*\* Break \*\*\* segmentation violation

I am attaching the construction as well as the physics list file please have a look

Thanks  
[GarfieldDetectorConstruction.cc](https://root-forum.cern.ch/uploads/short-url/ctaNRWFo0hIA6fIzR5meLriNlMx.cc) (8.6 KB)  
[GarfieldPhysics.cc](https://root-forum.cern.ch/uploads/short-url/o1HvS9qdh7FMbtNo0CATIuRe8Jd.cc) (14.0 KB)

---

<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 21, 2025, 4:30pm UTC](https://root-forum.cern.ch/t/i-am-facing-magboltz-installation-issue-or-i-may-be-doing-something-wrong/62950/8 "2025-02-21T16:30:27Z")

</div>

`Cannot open file p10_modified.gas.`

Looks like this file is not in your working directory.

---

<div class="post-metadata">

**Author:** ![Ujjwal-gh](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ujjwal-gh/32/37306_2.png) [@Ujjwal-gh](https://root-forum.cern.ch/u/Ujjwal-gh)\
**Post date:** [February 21, 2025, 4:45pm UTC](https://root-forum.cern.ch/t/i-am-facing-magboltz-installation-issue-or-i-may-be-doing-something-wrong/62950/9 "2025-02-21T16:45:00Z")

</div>

Thankyou for pointing this out, After adding this and linking it in CMakeLists.txt file I got the following error

=========================================================================  
MediumMagboltz::EnablePenningTransfer:  
Warning: present gas table has no ionisation rates.  
Ignore this message if you are using microscopic tracking only.  
MediumMagboltz::EnablePenningTransfer:  
Penning transfer probability for 44 Ar excitation levels set to r = 0.57  
MediumMagboltz::LoadGasFile:  
Reading file p10\_modified.gas.  
Version 12.  
Gas composition set to Ar/CH4 (90/10).

\*\*\* Break \*\*\* segmentation violation

=========================================================================

---

<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 21, 2025, 5:16pm UTC](https://root-forum.cern.ch/t/i-am-facing-magboltz-installation-issue-or-i-may-be-doing-something-wrong/62950/10 "2025-02-21T17:16:42Z")

</div>

Can you highlight what modifications you made to the code?

---

<div class="post-metadata">

**Author:** ![Ujjwal-gh](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ujjwal-gh/32/37306_2.png) [@Ujjwal-gh](https://root-forum.cern.ch/u/Ujjwal-gh)\
**Post date:** [February 21, 2025, 6:00pm UTC](https://root-forum.cern.ch/t/i-am-facing-magboltz-installation-issue-or-i-may-be-doing-something-wrong/62950/11 "2025-02-21T18:00:11Z")

</div>

Yeah sure

- I have attached the GarfieldDetectorConstruction.cc file, i changed the geometry to a proportional counter. I didn’t had any major issue while changing and running the executable.
- Now in the GarfieldPhysics.cc file i have changed

from (Orignal code)

```auto
void GarfieldPhysics::InitializePhysics() {
  // Define the gas mixture.
  fMediumMagboltz = new Garfield::MediumMagboltz();
  fMediumMagboltz->SetComposition("ar", 70., "co2", 30.);
  fMediumMagboltz->SetTemperature(293.15);
  fMediumMagboltz->SetPressure(760.);
  fMediumMagboltz->Initialise(true);
  // Set the Penning transfer efficiency.
  const double rPenning = 0.57;
  const double lambdaPenning = 0.;
  fMediumMagboltz->EnablePenningTransfer(rPenning, lambdaPenning, "ar");
  fMediumMagboltz->LoadGasFile("ar_70_co2_30_1000mbar.gas");

  fComponentAnalyticField = new Garfield::ComponentAnalyticField();
  fComponentAnalyticField->SetMedium(fMediumMagboltz);
  // Wire radius [cm]
  constexpr double rWire = 25.e-4;
  // Tube radius [cm]
  constexpr double rTube = 1.451;
  // Voltages
  constexpr double vWire = 1000.;
  constexpr double vTube = 0.;
  // Add the wire in the center.
  fComponentAnalyticField->AddWire(0., 0., 2 * rWire, vWire, "w");
  // Add the tube.
  fComponentAnalyticField->AddTube(rTube, vTube, 0, "t");

  fSensor = new Garfield::Sensor();
  fSensor->AddComponent(fComponentAnalyticField);

  fTrackHeed = new Garfield::TrackHeed();
  fTrackHeed->SetSensor(fSensor);
  fTrackHeed->EnableDeltaElectronTransport();
}

```

to (Modified)

```auto
void GarfieldPhysics::InitializePhysics() {
  // Define the gas mixture (P10: 90% argon, 10% methane)
  fMediumMagboltz = new Garfield::MediumMagboltz();
  fMediumMagboltz->SetComposition("ar", 90., "ch4", 10.);
  fMediumMagboltz->SetTemperature(295.15); // Standard temperature in Kelvin
  fMediumMagboltz->SetPressure(814.); // Standard pressure in Torr
  fMediumMagboltz->Initialise(true);

  // Set the Penning transfer efficiency
  const double rPenning = 0.57;
  const double lambdaPenning = 0.;
  fMediumMagboltz->EnablePenningTransfer(rPenning, lambdaPenning, "ar");
  fMediumMagboltz->LoadGasFile("p10_modified.gas");

  fComponentAnalyticField = new Garfield::ComponentAnalyticField();
  fComponentAnalyticField->SetMedium(fMediumMagboltz);

  // Set the detector's wire and tube dimensions
  constexpr double rWire = 50.e-6; // Tungsten anode wire radius in cm
  constexpr double rTube = 4.77; // PRC tube radius in cm (adjusted for your setup)
  constexpr double vWire = 3000.; // Voltage on the anode wire in V
  constexpr double vTube = 0.; // Voltage on the tube (grounded)

  // Add the wire at the center of the tube
  fComponentAnalyticField->AddWire(0., 0., 2 * rWire, vWire, "w");

  // Add the tube surrounding the wire
  fComponentAnalyticField->AddTube(rTube, vTube, 0, "t");

  // Create and configure the sensor
  fSensor = new Garfield::Sensor();
  fSensor->AddComponent(fComponentAnalyticField);

  // Set up the track simulation with Heed
  fTrackHeed = new Garfield::TrackHeed();
  fTrackHeed->SetSensor(fSensor);
  fTrackHeed->EnableDeltaElectronTransport();
}

```

- This error I found only after modifying this physics list file, I had no error after modifying the construction file.

Thanks

---

<div class="post-metadata">

**Author:** ![Ujjwal-gh](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ujjwal-gh/32/37306_2.png) [@Ujjwal-gh](https://root-forum.cern.ch/u/Ujjwal-gh)\
**Post date:** [February 28, 2025, 6:27pm UTC](https://root-forum.cern.ch/t/i-am-facing-magboltz-installation-issue-or-i-may-be-doing-something-wrong/62950/12 "2025-02-28T18:27:56Z")

</div>

Hi, can anybody help me understand why the Garfield++ ad Geant4 code isn’t triggering an avalanche and showing gain ??

[GarfieldDetectorConstruction.cc](https://root-forum.cern.ch/uploads/short-url/SixXUZRdfRx9U1G7BRrjNw6nKZ.cc) (7.0 KB)  
[GarfieldPhysics.cc](https://root-forum.cern.ch/uploads/short-url/AeDREbC159nEAcDrHrJS3aASyNP.cc) (14.4 KB)  
[GarfieldPhysicsList.cc](https://root-forum.cern.ch/uploads/short-url/zzXZFRMpJmHAYBCrGChCiG3N4Hh.cc) (4.7 KB)

========================================================================  
The output is as follows

```auto
Event 99 starts.
Primary muon generated at (0, 20.05, 0) m with direction (0, -1, 0)
Step in PRCOuter (Shell), Edep = 2.1999 MeV
Step in PRCInner (Gas), Edep = 0.00569154 MeV
Step in PRCInner (Gas), Edep = 0.00359258 MeV
Step in PRCInner (Gas), Edep = 0.000840207 MeV
Step in PRCInner (Gas), Edep = 0.00163683 MeV
Step in PRCInner (Gas), Edep = 6.46213e-05 MeV
Step in PRCInner (Gas), Edep = 0.00602431 MeV
Step in PRCInner (Gas), Edep = 0.00164082 MeV
Step in PRCOuter (Shell), Edep = 2.52587 MeV
Step in PRCInner (Gas), Edep = 0.0009472 MeV
Step in PRCInner (Gas), Edep = 0.000371256 MeV
Step in PRCInner (Gas), Edep = 0.000164142 MeV
Step in PRCInner (Gas), Edep = 0.000185416 MeV
Step in PRCInner (Gas), Edep = 0.000176215 MeV
Step in PRCInner (Gas), Edep = 0.000370921 MeV
---> End of event: 99
   Gas: total energy: 21.7061 keV Wire: total energy: 0 eV Shell: total energy: 4.72578 MeV
   Total Detector Energy: 4.74748 MeV Avalanche size: 0 Gain: 0
... write file : Garfield.root - done
... close file : Garfield.root - done
GarfieldRunAction: Closed file Garfield.root
There are histograms that can be viewed with visualization:
  7 h1 histograms(s)
  List them with "/analysis/list".
  View them immediately with "/vis/plot" or "/vis/reviewPlots".
  But...there are no entries. To make your histograms available for
  plotting in this UI session, use CloseFile(false) in your
  EndOfRunAction and Reset() in your BeginOfRunAction.
Graphics systems deleted.
Visualization Manager deleting...
GarfieldPhysics: Instance destructed
GarfieldPhysics: Singleton disposed

```

```auto
This is the run.mac
/exampleGarfield/physics/setIonizationModel Heed true
/run/initialize
/gun/particle mu-
/gun/energy 100 GeV
/gun/position 0 1.05 0 m
/gun/direction 0 -1 0
/run/beamOn 100

```

---

<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:** [March 5, 2025, 6:18pm UTC](https://root-forum.cern.ch/t/i-am-facing-magboltz-installation-issue-or-i-may-be-doing-something-wrong/62950/13 "2025-03-05T18:18:55Z")

</div>

Hi,  
have you managed to make progress on understanding your issue in the mean time?  
I just had a quick look at the code in your `GarfieldPhysics.cc` and I noticed that you have a line

```auto
fMediumMagboltz->SetMaxElectronEnergy(100000.);

```

This is an extremely (unphysically) high value.

---

<div class="post-metadata">

**Author:** ![Ujjwal-gh](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ujjwal-gh/32/37306_2.png) [@Ujjwal-gh](https://root-forum.cern.ch/u/Ujjwal-gh)\
**Post date:** [March 6, 2025, 4:53am UTC](https://root-forum.cern.ch/t/i-am-facing-magboltz-installation-issue-or-i-may-be-doing-something-wrong/62950/14 "2025-03-06T04:53:45Z")

</div>

Hi,  
I have made significant progress since the last query. Now everything seems to work, but the processing is slow, i want to run 100000 events in this interface to see the energy deposition and then match it with the experimental data. But right now it takes about 2.5 hours just to compute 1000 events.  
Thankyou for pointing it out, i will reduce it, i set it up as a placeholder value, Can you suggest what should be the ideal value so that i can check it by running ?

Thanks

---

<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 20, 2025, 4:53am UTC](https://root-forum.cern.ch/t/i-am-facing-magboltz-installation-issue-or-i-may-be-doing-something-wrong/62950/15 "2025-03-20T04:53:59Z")

</div>

Closed on March 20, 2025, 4:53am UTC

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