Gasfile issue during running

It’s pretty much what I said in my last reply:

  • Set up the environment as usual (source the thisroot.sh and Garfield setup scripts).
  • Edit the python script I sent you, make sure the name of the gas file is correct (and the path to the gas file, if the script and the path are not in the same directory).
  • Type python gain.py
  • Changing the absorber material from lead to glass won’t help much. It’s not Geant4 that’s slow but the Garfield part of the simulation. Also if you don’t care about the absorber, wouldn’t it be easier to run a standalone Garfield++ simulation? I know I’ve asked you this question before, but I didn’t understand what exactly you want to simulate.
  • As discussed before, C2H2F4 has a significant attachment cross-section so it’s indeed possible that the electrons become attached (i. e. are lost) before they can reach the high-field region close to the wire. I don’t know off-hand if that’s what happens in your case, but I think it’s plausible.
  • If you get zero avalanche size, then I would expect the simulation to be fast. Or is this a different configuration?

we want to simulate the avalanche size, and gain plots for different gas compositions in different proportions. like here i have put the gas file with c2h3f4 100%.
this is all first we want to simulate.

and avalanch size is zero gain also zero which changes i show you in previous pictures. otherwise as i was running the simulation with changes you told last time gain was also existing and avalanch size was also existing but simulation was slow.

see dear i have put the gain.py file in the
home/ahmer/Desktop/garfield/Examples/Geant4GarfieldInterface/build

and run the program and this answer occures.

In that case, using the Geant4/Garfield++ is really an overkill and I would strongly suggest to start with a standalone Garfield++ program/script. I can prepare a simple example for you if you want. Do you really want to simulate the gain in a drift tube (wire geometry) or rather for a parallel-plate chamber (i. e. in a uniform field)?

that’s a very generous of you. thanks a lot but i’m working on the interface dear. cannot just go with the garfield.

today i have tried to put the gas with three composition like C2H2F4_i_C4H10_SF6_90_9.7_0.3
most of the changes i have done as you told me. but this error is occuring. can you help me in this.

ahmer@ahmer-Dell-Precision-M3800 ~ cd Desktop ahmer@ahmer-Dell-Precision-M3800 ~/Desktop cd garfield
ahmer@ahmer-Dell-Precision-M3800 ~/Desktop/garfield cd Examples/Geant4GarfieldInterface ahmer@ahmer-Dell-Precision-M3800 ~/Desktop/garfield/Examples/Geant4GarfieldInterface mkdir build
ahmer@ahmer-Dell-Precision-M3800 ~/Desktop/garfield/Examples/Geant4GarfieldInterface cd build ahmer@ahmer-Dell-Precision-M3800 ~/Desktop/garfield/Examples/Geant4GarfieldInterface/build ls
TETRAFLUOROETHANE_iC4H10_SF6_90_9.7_0.3.gas
ahmer@ahmer-Dell-Precision-M3800 ~/Desktop/garfield/Examples/Geant4GarfieldInterface/build source /home/ahmer/Desktop/Geant4/geant4.10.06.p01-install/bin/geant4.sh ahmer@ahmer-Dell-Precision-M3800 ~/Desktop/garfield/Examples/Geant4GarfieldInterface/build source /home/ahmer/Desktop/root/test_build/bin/thisroot.sh
ahmer@ahmer-Dell-Precision-M3800 ~/Desktop/garfield/Examples/Geant4GarfieldInterface/build source /home/ahmer/Desktop/garfield/build/setup.sh ahmer@ahmer-Dell-Precision-M3800 ~/Desktop/garfield/Examples/Geant4GarfieldInterface/build cmake …
– The C compiler identification is GNU 5.4.0
– The CXX compiler identification is GNU 5.4.0
– Check for working C compiler: /usr/bin/cc
– Check for working C compiler: /usr/bin/cc - works
– Detecting C compiler ABI info
– Detecting C compiler ABI info - done
– Detecting C compile features
– Detecting C compile features - done
– Check for working CXX compiler: /usr/bin/c++
– Check for working CXX compiler: /usr/bin/c++ - works
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– Detecting CXX compile features
– Detecting CXX compile features - done
– Found EXPAT: /usr/lib/x86_64-linux-gnu/libexpat.so (found suitable version “2.1.0”, minimum required is “2.1.0”)
– Found XercesC: /usr/lib/x86_64-linux-gnu/libxerces-c.so (found suitable version “3.1.3”, minimum required is “3.1.3”)
– Found X11: /usr/include
– Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so
– Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so - found
– Looking for gethostbyname
– Looking for gethostbyname - found
– Looking for connect
– Looking for connect - found
– Looking for remove
– Looking for remove - found
– Looking for shmat
– Looking for shmat - found
– Looking for IceConnectionNumber in ICE
– Looking for IceConnectionNumber in ICE - found
– Looking for Q_WS_X11
– Looking for Q_WS_X11 - found
– Looking for Q_WS_WIN
– Looking for Q_WS_WIN - not found
– Looking for Q_WS_QWS
– Looking for Q_WS_QWS - not found
– Looking for Q_WS_MAC
– Looking for Q_WS_MAC - not found
– Found Qt4: /usr/bin/qmake (found version “4.8.7”)
– Found OpenGL: /usr/lib/x86_64-linux-gnu/libGL.so
– Configuring done
– Generating done
– Build files have been written to: /home/ahmer/Desktop/garfield/Examples/Geant4GarfieldInterface/build
ahmer@ahmer-Dell-Precision-M3800 ~/Desktop/garfield/Examples/Geant4GarfieldInterface/build make -j8 Scanning dependencies of target exampleGeant4Interface [ 18%] Building CXX object CMakeFiles/exampleGeant4Interface.dir/src/GarfieldDetectorConstruction.cc.o [ 18%] Building CXX object CMakeFiles/exampleGeant4Interface.dir/exampleGarfield.cc.o [ 27%] Building CXX object CMakeFiles/exampleGeant4Interface.dir/src/GarfieldEventAction.cc.o [ 36%] Building CXX object CMakeFiles/exampleGeant4Interface.dir/src/GarfieldG4FastSimulationModel.cc.o [ 45%] Building CXX object CMakeFiles/exampleGeant4Interface.dir/src/GarfieldMessenger.cc.o [ 54%] Building CXX object CMakeFiles/exampleGeant4Interface.dir/src/GarfieldPhysics.cc.o [ 63%] Building CXX object CMakeFiles/exampleGeant4Interface.dir/src/GarfieldPhysicsList.cc.o [ 72%] Building CXX object CMakeFiles/exampleGeant4Interface.dir/src/GarfieldPrimaryGeneratorAction.cc.o [ 81%] Building CXX object CMakeFiles/exampleGeant4Interface.dir/src/GarfieldRunAction.cc.o /home/ahmer/Desktop/garfield/Examples/Geant4GarfieldInterface/src/GarfieldDetectorConstruction.cc: In member function ‘void GarfieldDetectorConstruction::DefineMaterials()’: /home/ahmer/Desktop/garfield/Examples/Geant4GarfieldInterface/src/GarfieldDetectorConstruction.cc:88:20: warning: unused variable ‘fractionmass’ [-Wunused-variable] G4double density, fractionmass; ^ [ 90%] Building CXX object CMakeFiles/exampleGeant4Interface.dir/src/GarfieldSteppingAction.cc.o [100%] Linking CXX executable exampleGeant4Interface [100%] Built target exampleGeant4Interface ahmer@ahmer-Dell-Precision-M3800 ~/Desktop/garfield/Examples/Geant4GarfieldInterface/build ./exampleGeant4Interface -m ./run.mac
Heed:
Database path: /home/ahmer/Desktop/garfield/Heed/heed++/database
RandomEngineRoot::Seed:
Seed: 1


Geant4 version Name: geant4-10-06-patch-01 (14-February-2020)
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/


<<< Geant4 Physics List simulation engine: QGSP_BERT_HP

RegisterPhysics: G4EmStandard
RegisterPhysics: G4GammaLeptoNuclearPhys
RegisterPhysics: Decay
RegisterPhysics: G4RadioactiveDecay
RegisterPhysics: hElasticWEL_CHIPS_HP
RegisterPhysics: hInelastic QGSP_BERT_HP
RegisterPhysics: stopping
RegisterPhysics: ionInelasticFTFP_BIC
Using Root
Visualization Manager instantiating with verbosity “warnings (3)”…
Visualization Manager initialising…
Registering graphics systems…

You have successfully registered the following graphics systems.
Current available graphics systems are:
ASCIITree (ATree)
DAWNFILE (DAWNFILE)
G4HepRep (HepRepXML)
G4HepRepFile (HepRepFile)
RayTracer (RayTracer)
VRML1FILE (VRML1FILE)
VRML2FILE (VRML2FILE)
gMocrenFile (gMocrenFile)
OpenGLImmediateQt (OGLIQt, OGLI)
OpenGLStoredQt (OGLSQt, OGL, OGLS)
OpenGLImmediateX (OGLIX, OGLIQt_FALLBACK)
OpenGLStoredX (OGLSX, OGLSQt_FALLBACK)
RayTracerX (RayTracerX)

Registering model factories…

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

Registered filter factories:
attributeFilter
chargeFilter
originVolumeFilter
particleFilter
encounteredVolumeFilter

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.
Garfield model (Heed) is applicable for G4Particle e- between 1e-06 MeV and 0.001 MeV
Garfield model (Heed) is applicable for G4Particle gamma between 1e-06 MeV and 1e+08 MeV
PAI is applicable for G4Particle e- between 0 MeV and 1e+08 MeV
PAI is applicable for G4Particle e+ between 0 MeV and 1e+08 MeV
PAI is applicable for G4Particle mu- between 0 MeV and 1e+08 MeV
PAI is applicable for G4Particle mu+ between 0 MeV and 1e+08 MeV
PAI is applicable for G4Particle proton between 0 MeV and 1e+08 MeV
PAI is applicable for G4Particle pi+ between 0 MeV and 1e+08 MeV
PAI is applicable for G4Particle pi- between 0 MeV and 1e+08 MeV
PAI is applicable for G4Particle alpha between 0 MeV and 1e+08 MeV
PAI is applicable for G4Particle He3 between 0 MeV and 1e+08 MeV
PAI is applicable for G4Particle GenericIon between 0 MeV and 1e+08 MeV
PAI is applicable for G4Particle e- between 0 MeV and 1e+08 MeV
PAI is applicable for G4Particle e+ between 0 MeV and 1e+08 MeV
PAI is applicable for G4Particle mi- between 0 MeV and 1e+08 MeV
PAI is applicable for G4Particle mu+ between 0 MeV and 1e+08 MeV
PAI is applicable for G4Particle proton between 0 MeV and 1e+08 MeV
PAI is applicable for G4Particle pi+ between 0 MeV and 1e+08 MeV
PAI is applicable for G4Particle pi- between 0 MeV and 1e+08 MeV
PAI is applicable for G4Particle alpha between 0 MeV and 1e+08 MeV
PAI is applicable for G4Particle He3 between 0 MeV and 1e+08 MeV
PAI is applicable for G4Particle GenericIon- between 0 MeV and 1e+08 MeV
Garfield model (Heed) is applicable for G4Particle gamma between 1e-06 MeV and 1e+08 MeV
Garfield model (Heed) is applicable for G4Particle e- between 1e-06 MeV and 0.001 MeV

***** Table : Nb of materials = 8 *****

Material: G4_Pb density: 11.350 g/cm3 RadL: 5.613 mm Nucl.Int.Length: 18.248 cm
Imean: 823.000 eV temperature: 293.15 K pressure: 1.00 atm

—> Element: Pb (Pb) Z = 82.0 N = 207 A = 207.217 g/mole
—> Isotope: Pb204 Z = 82 N = 204 A = 203.97 g/mole abundance: 1.400 %
—> Isotope: Pb206 Z = 82 N = 206 A = 205.97 g/mole abundance: 24.100 %
—> Isotope: Pb207 Z = 82 N = 207 A = 206.98 g/mole abundance: 22.100 %
—> Isotope: Pb208 Z = 82 N = 208 A = 207.98 g/mole abundance: 52.400 %
ElmMassFraction: 100.00 % ElmAbundance 100.00 %

Material: G4_Cu density: 8.960 g/cm3 RadL: 1.436 cm Nucl.Int.Length: 15.588 cm
Imean: 322.000 eV temperature: 293.15 K pressure: 1.00 atm

—> Element: Cu (Cu) Z = 29.0 N = 64 A = 63.546 g/mole
—> Isotope: Cu63 Z = 29 N = 63 A = 62.93 g/mole abundance: 69.170 %
—> Isotope: Cu65 Z = 29 N = 65 A = 64.93 g/mole abundance: 30.830 %
ElmMassFraction: 100.00 % ElmAbundance 100.00 %

Material: G4_Al density: 2.699 g/cm3 RadL: 8.896 cm Nucl.Int.Length: 38.894 cm
Imean: 166.000 eV temperature: 293.15 K pressure: 1.00 atm

—> Element: Al (Al) Z = 13.0 N = 27 A = 26.982 g/mole
—> Isotope: Al27 Z = 13 N = 27 A = 26.98 g/mole abundance: 100.000 %
ElmMassFraction: 100.00 % ElmAbundance 100.00 %

Material: G4_Au density: 19.320 g/cm3 RadL: 3.344 mm Nucl.Int.Length: 10.540 cm
Imean: 790.000 eV temperature: 293.15 K pressure: 1.00 atm

—> Element: Au (Au) Z = 79.0 N = 197 A = 196.967 g/mole
—> Isotope: Au197 Z = 79 N = 197 A = 196.97 g/mole abundance: 100.000 %
ElmMassFraction: 100.00 % ElmAbundance 100.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: 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 %

*** Break *** segmentation violation

===========================================================
There was a crash.
This is the entire stack trace of all threads:

#0 0x00007f2de6ba90fa in __GI___waitpid (pid=6173, stat_loc=stat_loc
entry=0x7ffec375a3c0, options=options
entry=0) at …/sysdeps/unix/sysv/linux/waitpid.c:29
#1 0x00007f2de6b21fcb in do_system (line=) at …/sysdeps/posix/system.c:148
#2 0x00007f2de779cea2 in TUnixSystem::StackTrace() (shellcmd=, this=0x6be570) at /home/ahmer/Desktop/root/root-6.16.00/core/unix/src/TUnixSystem.cxx:2119
#3 0x00007f2de779cea2 in TUnixSystem::StackTrace() (this=0x6be570) at /home/ahmer/Desktop/root/root-6.16.00/core/unix/src/TUnixSystem.cxx:2413
#4 0x00007f2de779f773 in TUnixSystem::DispatchSignals(ESignals) (this=0x6be570, sig=kSigSegmentationViolation) at /home/ahmer/Desktop/root/root-6.16.00/core/unix/src/TUnixSystem.cxx:3644
#5 0x00007f2de6b124c0 in () at /lib/x86_64-linux-gnu/libc.so.6
#6 0x00007f2de8515277 in operator<<(std::ostream&, G4Material const*) () at /home/ahmer/Desktop/Geant4/geant4.10.06.p01-install/lib/libG4materials.so
#7 0x00007f2de85159f6 in operator<<(std::ostream&, std::vector<G4Material*, std::allocator<G4Material*> >) () at /home/ahmer/Desktop/Geant4/geant4.10.06.p01-install/lib/libG4materials.so
#8 0x0000000000410b2a in GarfieldDetectorConstruction::DefineMaterials() ()
#9 0x0000000000411fd9 in GarfieldDetectorConstruction::Construct() ()
#10 0x00007f2dee7bd5f8 in G4RunManager::InitializeGeometry() () at /home/ahmer/Desktop/Geant4/geant4.10.06.p01-install/lib/libG4run.so
#11 0x00007f2dee7bd441 in G4RunManager::Initialize() () at /home/ahmer/Desktop/Geant4/geant4.10.06.p01-install/lib/libG4run.so
#12 0x00007f2dee7dad08 in G4RunMessenger::SetNewValue(G4UIcommand*, G4String) () at /home/ahmer/Desktop/Geant4/geant4.10.06.p01-install/lib/libG4run.so
#13 0x00007f2de80417d3 in G4UIcommand::DoIt(G4String) () at /home/ahmer/Desktop/Geant4/geant4.10.06.p01-install/lib/libG4intercoms.so
#14 0x00007f2de805ee4b in G4UImanager::ApplyCommand(char const*) () at /home/ahmer/Desktop/Geant4/geant4.10.06.p01-install/lib/libG4intercoms.so
#15 0x00007f2de802c7b7 in G4UIbatch::ExecCommand(G4String const&) () at /home/ahmer/Desktop/Geant4/geant4.10.06.p01-install/lib/libG4intercoms.so
#16 0x00007f2de802e45e in G4UIbatch::SessionStart() () at /home/ahmer/Desktop/Geant4/geant4.10.06.p01-install/lib/libG4intercoms.so
#17 0x00007f2de805fe6c in G4UImanager::ExecuteMacroFile(char const*) () at /home/ahmer/Desktop/Geant4/geant4.10.06.p01-install/lib/libG4intercoms.so
#18 0x00007f2de804e90a in G4UIcontrolMessenger::SetNewValue(G4UIcommand*, G4String) () at /home/ahmer/Desktop/Geant4/geant4.10.06.p01-install/lib/libG4intercoms.so
#19 0x00007f2de80417d3 in G4UIcommand::DoIt(G4String) () at /home/ahmer/Desktop/Geant4/geant4.10.06.p01-install/lib/libG4intercoms.so
#20 0x00007f2de805ee4b in G4UImanager::ApplyCommand(char const*) () at /home/ahmer/Desktop/Geant4/geant4.10.06.p01-install/lib/libG4intercoms.so
#21 0x000000000040e99d in main ()

The lines below might hint at the cause of the crash.
You may get help by asking at the ROOT forum http://root.cern.ch/forum
Only if you are really convinced it is a bug in ROOT then please submit a
report at http://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 0x00007f2de8515277 in operator<<(std::ostream&, G4Material const*) () at /home/ahmer/Desktop/Geant4/geant4.10.06.p01-install/lib/libG4materials.so
#7 0x00007f2de85159f6 in operator<<(std::ostream&, std::vector<G4Material*, std::allocator<G4Material*> >) () at /home/ahmer/Desktop/Geant4/geant4.10.06.p01-install/lib/libG4materials.so
#8 0x0000000000410b2a in GarfieldDetectorConstruction::DefineMaterials() ()
#9 0x0000000000411fd9 in GarfieldDetectorConstruction::Construct() ()
#10 0x00007f2dee7bd5f8 in G4RunManager::InitializeGeometry() () at /home/ahmer/Desktop/Geant4/geant4.10.06.p01-install/lib/libG4run.so
#11 0x00007f2dee7bd441 in G4RunManager::Initialize() () at /home/ahmer/Desktop/Geant4/geant4.10.06.p01-install/lib/libG4run.so
#12 0x00007f2dee7dad08 in G4RunMessenger::SetNewValue(G4UIcommand*, G4String) () at /home/ahmer/Desktop/Geant4/geant4.10.06.p01-install/lib/libG4run.so
#13 0x00007f2de80417d3 in G4UIcommand::DoIt(G4String) () at /home/ahmer/Desktop/Geant4/geant4.10.06.p01-install/lib/libG4intercoms.so
#14 0x00007f2de805ee4b in G4UImanager::ApplyCommand(char const*) () at /home/ahmer/Desktop/Geant4/geant4.10.06.p01-install/lib/libG4intercoms.so
#15 0x00007f2de802c7b7 in G4UIbatch::ExecCommand(G4String const&) () at /home/ahmer/Desktop/Geant4/geant4.10.06.p01-install/lib/libG4intercoms.so
#16 0x00007f2de802e45e in G4UIbatch::SessionStart() () at /home/ahmer/Desktop/Geant4/geant4.10.06.p01-install/lib/libG4intercoms.so
#17 0x00007f2de805fe6c in G4UImanager::ExecuteMacroFile(char const*) () at /home/ahmer/Desktop/Geant4/geant4.10.06.p01-install/lib/libG4intercoms.so
#18 0x00007f2de804e90a in G4UIcontrolMessenger::SetNewValue(G4UIcommand*, G4String) () at /home/ahmer/Desktop/Geant4/geant4.10.06.p01-install/lib/libG4intercoms.so
#19 0x00007f2de80417d3 in G4UIcommand::DoIt(G4String) () at /home/ahmer/Desktop/Geant4/geant4.10.06.p01-install/lib/libG4intercoms.so
#20 0x00007f2de805ee4b in G4UImanager::ApplyCommand(char const*) () at /home/ahmer/Desktop/Geant4/geant4.10.06.p01-install/lib/libG4intercoms.so
#21 0x000000000040e99d in main ()

Suit yourself. Just two last comments on this topic:

  • If your goal is to simulate the gain for different gas compositions, you can do that in a simple script with maybe a few tens of lines of code. There is absolutely no reason for using the Geant4/Garfield++ interface. It just makes things unnecessarily complicated (and you’ve been struggling a lot implementing small changes).
  • The gas mixture you are using is normally used for RPCs. I’m not sure if it’s a sensible choice for a straw tube.

Anyway, we are starting to reach the end of the line here. If you are convinced that you need to use Geant4+Garfield++ for your simulations, by all means go ahead. But please try to make a minimum effort to debug problems yourself.

I don’t know (I’ve not seen your code). Is it possible that you are trying to access a material that is not defined?

ok dear i’ll try just can you tell me how we can you the root output files of geant4 in the garfield as input? and here in the screen shot are changes for the material. yes working for RPC’s. want to extract the plots of one your paper with Dr. Dorothea.

This is not the correct way to describe the gas, you need to do it like you did it in one of your earlier versions of the code:

  • Create G4Material objects for each of the three components in the mixture (C2H2F4, iC4H10, SF6) and describe the molecules using AddElement.
  • Create a G4Material describing the gas mixture, and add the three G4Materials to it with the correct fractions.

It might help to read one of the tutorials explaining how to describe materials in Geant4, like for instance this one:

By the way, the density of the gas cannot possibly by 18 g / cm3.

The geometry simulated in the Geant4/Garfield++ interface example is not an RPC. It’s a straw tube (cylindrical tube with a wire inside).

I’m not sure I understand your question about using the output ROOT file. I believe this file includes a tree with the deposited energy, avalanche size, etc in each event, and histograms of these variables. Which of these variables do you want to use in another simulation and how?

i have calculated the density by fraction of gas c2h2f4 density+ fracion of i-c4h10density+fraction of sf6*density. this is how calculated the density of full this compostion of gas. as you told me in last message. no i have generated some geant4 root files and want to use them in garfield as input how to do that?

https://garfield.web.cer.ch/garfieldpp/examples/geant4_interface/

by doing all i want to produce these plots.

Well, maybe there is a typo and you meant to write “mg / cm3”.

You can write a C++ program in which you open the ROOT file, retrieve a histogram, and then use the information stored in the histogram somehow as input to the Garfield++ classes. You can also do it in PyROOT if you prefer. But I really don’t understand what output of the Geant4+Garfield simulation you want to use as input in another simulation.

i have calculated it like. 90 % c2h2f4 then 90 * 0.00424 + similarly other gases.

and i have generated the deposited energy of particles, particles produced at exit. secondaries energy deposition. all these graphs for G4_GLASS_Plate, bakelite, and aluminium. using example TestEm5. i have these root files which i want to use as input in the garfield.

the changes i have made but still some errors. see is it ok or still somwthing wrong.

That looks better.
You still need to replace C2H2F4_iC4H10_SF6->AddElement by C2H2F4_iC4H10_SF6->AddMaterial.
Also the densities of iC4H10, SF6, and C2H2F4_iC4H10_SF6 are still wrong.

i have calculated the densities like this
for (SF6)
=32(1)+6(19)
=146 u
=1461.660532-24 g
=9.152
10^-9 g
=9.152*10^-9 * 2.686774e19 cm-3
=4.38895 g/cm3
same i have done for ic4h10 this is the way you told me for C2H2F4.

dear code works and it was generating very fast. but gain and avalanch size is zero again why it is so. gas file also loaded. and also i have set the voltage on wire to 8000 volts for the three mixtures of gases. but again it killed the whole process see?

End of event: 220
Absorber: total energy: 12.9699 MeV total track length: 1.00001 cm
Gas: total energy: 99.177 MeV avalanche size: 0 gain: 0
→ Event 221 starts.
TrackHeed::UpdateBoundingBox:
Bounding box dimensions:
x: 2.902 cm
y: 2.902 cm
z: 20 cm
TrackHeed::UpdateBoundingBox:
Center of bounding box:
x: 0 cm
y: 0 cm
z: 0 cm
TrackHeed::UpdateBoundingBox:
Bounding box dimensions:
x: 2.902 cm
y: 2.902 cm
z: 20 cm
TrackHeed::UpdateBoundingBox:
Center of bounding box:
x: 0 cm
y: 0 cm
z: 0 cm
TrackHeed::UpdateBoundingBox:
Bounding box dimensions:
x: 2.902 cm
y: 2.902 cm
z: 20 cm
TrackHeed::UpdateBoundingBox:
Center of bounding box:
x: 0 cm
y: 0 cm
z: 0 cm
TrackHeed::UpdateBoundingBox:
Bounding box dimensions:
x: 2.902 cm
y: 2.902 cm
z: 20 cm
TrackHeed::UpdateBoundingBox:
Center of bounding box:
x: 0 cm
y: 0 cm
z: 0 cm
TrackHeed::UpdateBoundingBox:
Bounding box dimensions:
x: 2.902 cm
y: 2.902 cm
z: 20 cm
TrackHeed::UpdateBoundingBox:
Center of bounding box:
x: 0 cm
y: 0 cm
z: 0 cm
TrackHeed::UpdateBoundingBox:
Bounding box dimensions:
x: 2.902 cm
y: 2.902 cm
z: 20 cm
TrackHeed::UpdateBoundingBox:
Center of bounding box:
x: 0 cm
y: 0 cm
z: 0 cm
TrackHeed::UpdateBoundingBox:
Bounding box dimensions:
x: 2.902 cm
y: 2.902 cm
z: 20 cm
TrackHeed::UpdateBoundingBox:
Center of bounding box:
x: 0 cm
y: 0 cm
z: 0 cm
TrackHeed::UpdateBoundingBox:
Bounding box dimensions:
x: 2.902 cm
y: 2.902 cm
z: 20 cm
TrackHeed::UpdateBoundingBox:
Center of bounding box:
x: 0 cm
y: 0 cm
z: 0 cm
TrackHeed::UpdateBoundingBox:
Bounding box dimensions:
x: 2.902 cm
y: 2.902 cm
z: 20 cm
TrackHeed::UpdateBoundingBox:
Center of bounding box:
x: 0 cm
y: 0 cm
z: 0 cm
TrackHeed::UpdateBoundingBox:
Bounding box dimensions:
x: 2.902 cm
y: 2.902 cm
z: 20 cm
TrackHeed::UpdateBoundingBox:
Center of bounding box:
x: 0 cm
y: 0 cm
z: 0 cm
TrackHeed::UpdateBoundingBox:
Bounding box dimensions:
x: 2.902 cm
y: 2.902 cm
z: 20 cm
TrackHeed::UpdateBoundingBox:
Center of bounding box:
x: 0 cm
y: 0 cm
z: 0 cm
TrackHeed::UpdateBoundingBox:
Bounding box dimensions:
x: 2.902 cm
y: 2.902 cm
z: 20 cm
TrackHeed::UpdateBoundingBox:
Center of bounding box:
x: 0 cm
y: 0 cm
z: 0 cm
TrackHeed::UpdateBoundingBox:
Bounding box dimensions:
x: 2.902 cm
y: 2.902 cm
z: 20 cm
TrackHeed::UpdateBoundingBox:
Center of bounding box:
x: 0 cm
y: 0 cm
z: 0 cm
TrackHeed::UpdateBoundingBox:
Bounding box dimensions:
x: 2.902 cm
y: 2.902 cm
z: 20 cm
TrackHeed::UpdateBoundingBox:
Center of bounding box:
x: 0 cm
y: 0 cm
z: 0 cm
TrackHeed::UpdateBoundingBox:
Bounding box dimensions:
x: 2.902 cm
y: 2.902 cm
z: 20 cm
TrackHeed::UpdateBoundingBox:
Center of bounding box:
x: 0 cm
y: 0 cm
z: 0 cm
TrackHeed::UpdateBoundingBox:
Bounding box dimensions:
x: 2.902 cm
y: 2.902 cm
z: 20 cm
TrackHeed::UpdateBoundingBox:
Center of bounding box:
x: 0 cm
y: 0 cm
z: 0 cm
TrackHeed::UpdateBoundingBox:
Bounding box dimensions:
x: 2.902 cm
y: 2.902 cm
z: 20 cm
TrackHeed::UpdateBoundingBox:
Center of bounding box:
x: 0 cm
y: 0 cm
z: 0 cm
TrackHeed::UpdateBoundingBox:
Bounding box dimensions:
x: 2.902 cm
y: 2.902 cm
z: 20 cm
TrackHeed::UpdateBoundingBox:
Center of bounding box:
x: 0 cm
y: 0 cm
z: 0 cm
TrackHeed::UpdateBoundingBox:
Bounding box dimensions:
x: 2.902 cm
y: 2.902 cm
z: 20 cm
TrackHeed::UpdateBoundingBox:
Center of bounding box:
x: 0 cm
y: 0 cm
z: 0 cm
TrackHeed::UpdateBoundingBox:
Bounding box dimensions:
x: 2.902 cm
y: 2.902 cm
z: 20 cm
TrackHeed::UpdateBoundingBox:
Center of bounding box:
x: 0 cm
y: 0 cm
z: 0 cm
TrackHeed::UpdateBoundingBox:
Bounding box dimensions:
x: 2.902 cm
y: 2.902 cm
z: 20 cm
TrackHeed::UpdateBoundingBox:
Center of bounding box:
x: 0 cm
y: 0 cm
z: 0 cm
TrackHeed::UpdateBoundingBox:
Bounding box dimensions:
x: 2.902 cm
y: 2.902 cm
z: 20 cm
TrackHeed::UpdateBoundingBox:
Center of bounding box:
x: 0 cm
y: 0 cm
z: 0 cm
TrackHeed::UpdateBoundingBox:
Bounding box dimensions:
x: 2.902 cm
y: 2.902 cm
z: 20 cm
TrackHeed::UpdateBoundingBox:
Center of bounding box:
x: 0 cm
y: 0 cm
z: 0 cm
TrackHeed::UpdateBoundingBox:
Bounding box dimensions:
x: 2.902 cm
y: 2.902 cm
z: 20 cm
TrackHeed::UpdateBoundingBox:
Center of bounding box:
x: 0 cm
y: 0 cm
z: 0 cm
TrackHeed::UpdateBoundingBox:
Bounding box dimensions:
x: 2.902 cm
y: 2.902 cm
z: 20 cm
TrackHeed::UpdateBoundingBox:
Center of bounding box:
x: 0 cm
y: 0 cm
z: 0 cm
TrackHeed::UpdateBoundingBox:
Bounding box dimensions:
x: 2.902 cm
y: 2.902 cm
z: 20 cm
TrackHeed::UpdateBoundingBox:
Center of bounding box:
x: 0 cm
y: 0 cm
z: 0 cm
TrackHeed::UpdateBoundingBox:
Bounding box dimensions:
x: 2.902 cm
y: 2.902 cm
z: 20 cm
TrackHeed::UpdateBoundingBox:
Center of bounding box:
x: 0 cm
y: 0 cm
z: 0 cm
TrackHeed::UpdateBoundingBox:
Bounding box dimensions:
x: 2.902 cm
y: 2.902 cm
z: 20 cm
TrackHeed::UpdateBoundingBox:
Center of bounding box:
x: 0 cm
y: 0 cm
z: 0 cm
TrackHeed::UpdateBoundingBox:
Bounding box dimensions:
x: 2.902 cm
y: 2.902 cm
z: 20 cm
TrackHeed::UpdateBoundingBox:
Center of bounding box:
x: 0 cm
y: 0 cm
z: 0 cm
TrackHeed::UpdateBoundingBox:
Bounding box dimensions:
x: 2.902 cm
y: 2.902 cm
z: 20 cm
TrackHeed::UpdateBoundingBox:
Center of bounding box:
x: 0 cm
y: 0 cm
z: 0 cm
TrackHeed::UpdateBoundingBox:
Bounding box dimensions:
x: 2.902 cm
y: 2.902 cm
z: 20 cm
TrackHeed::UpdateBoundingBox:
Center of bounding box:
x: 0 cm
y: 0 cm
z: 0 cm
TrackHeed::UpdateBoundingBox:
Bounding box dimensions:
x: 2.902 cm
y: 2.902 cm
z: 20 cm
TrackHeed::UpdateBoundingBox:
Center of bounding box:
x: 0 cm
y: 0 cm
z: 0 cm
TrackHeed::UpdateBoundingBox:
Bounding box dimensions:
x: 2.902 cm
y: 2.902 cm
z: 20 cm
TrackHeed::UpdateBoundingBox:
Center of bounding box:
x: 0 cm
y: 0 cm
z: 0 cm
MediumMagboltz::GetElectronCollisionRate:
Rate at 40.4397 eV is not included in the current table.
Increasing energy range to 42.4617 eV.
MediumMagboltz::Mixer:
Photon collision rates could not be calculated.
MediumMagboltz::GetElectronCollisionRate:
Rate at 43.2665 eV is not included in the current table.
Increasing energy range to 45.4298 eV.
MediumMagboltz::Mixer:
Photon collision rates could not be calculated.
AvalancheMicroscopic::TransportElectron: Increasing null-collision rate by 5%.
MediumMagboltz::GetElectronCollisionRate:
Rate at 45.6032 eV is not included in the current table.
Increasing energy range to 47.8834 eV.
MediumMagboltz::Mixer:
Photon collision rates could not be calculated.
MediumMagboltz::GetElectronCollisionRate:
Rate at 48.1939 eV is not included in the current table.
Increasing energy range to 50.6036 eV.
MediumMagboltz::Mixer:
Photon collision rates could not be calculated.
MediumMagboltz::GetElectronCollisionRate:
Rate at 50.8527 eV is not included in the current table.
Increasing energy range to 53.3953 eV.
MediumMagboltz::Mixer:
Photon collision rates could not be calculated.
AvalancheMicroscopic::TransportElectron: Increasing null-collision rate by 5%.
MediumMagboltz::GetElectronCollisionRate:
Rate at 54.4221 eV is not included in the current table.
Increasing energy range to 57.1432 eV.
MediumMagboltz::Mixer:
Photon collision rates could not be calculated.
MediumMagboltz::GetElectronCollisionRate:
Rate at 57.5766 eV is not included in the current table.
Increasing energy range to 60.4554 eV.
MediumMagboltz::Mixer:
Photon collision rates could not be calculated.
MediumMagboltz::GetElectronCollisionRate:
Rate at 71.3022 eV is not included in the current table.
Increasing energy range to 74.8673 eV.
MediumMagboltz::Mixer:
Photon collision rates could not be calculated.
AvalancheMicroscopic::TransportElectron: Increasing null-collision rate by 5%.
AvalancheMicroscopic::TransportElectron: Increasing null-collision rate by 5%.
MediumMagboltz::GetElectronCollisionRate:
Rate at 75.0319 eV is not included in the current table.
Increasing energy range to 78.7835 eV.
MediumMagboltz::Mixer:
Photon collision rates could not be calculated.
MediumMagboltz::GetElectronCollisionRate:
Rate at 81.325 eV is not included in the current table.
Increasing energy range to 85.3912 eV.
MediumMagboltz::Mixer:
Photon collision rates could not be calculated.
Killed
ahmer@ahmer-Dell-Precision-M3800 ~/Desktop/garfield/Examples/Geant4GarfieldInterface/build $

dear i need written documentation of PAI model of Geant4 if you have it can you send me please.

https://doi.org/10.1016/S0168-9002(00)00457-5

You need to check carefully what you type:

146 * 1.660538782e-24 * 2.6867774e19 = 0.006513787184099645

And check if the results make sense. The density of liquid water is 1 g / cm3. So the density of the gas cannot possibly be 4 g / cm3.