# Garfield ++ installation and Geant-4 interfacing

**URL:** <https://root-forum.cern.ch/t/garfield-installation-and-geant-4-interfacing/60594>\
**Category:** Garfield++\
**Created:** [August 24, 2024, 4:34pm UTC](https://root-forum.cern.ch/t/garfield-installation-and-geant-4-interfacing/60594 "2024-08-24T16:34:05Z")\
**Posts on this page:** 6\
**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:** [August 24, 2024, 4:34pm UTC](https://root-forum.cern.ch/t/garfield-installation-and-geant-4-interfacing/60594/1 "2024-08-24T16:34:06Z")

</div>

Hi, i want to study the effects of Electric field and charge particle interaction on the energy deposition inside a Proportional counter, so i was suggested to use Garfield ++ on the geant4 forum. I have installed the Garfield ++ package and tried the example. Almost every example worked but the Geant4GarfieldInterface didn’t worked.  
How can i rectify this error.

 ![image](https://root-forum.cern.ch/uploads/default/original/3X/4/1/41de8e3c273d7b34d4c66957e283bc3bdc32fb87.png)  
 ![image](https://root-forum.cern.ch/uploads/default/original/3X/a/c/ac111088d03be83caff77f02d9b683d90fd77f2e.png)  
 ![image](https://root-forum.cern.ch/uploads/default/original/3X/f/f/ff2dc82bf6d408cb87a4757dd15f356b96a1fa8e.png)

Here is the commands i used to install and make the package.  
export GARFIELD\_HOME=/home/ujjwal/garfield/  
ujjwal@Jarvis:~$ git clone [garfield / garfieldpp · GitLab](https://gitlab.cern.ch/garfield/garfieldpp.git) $GARFIELD\_HOME  
cd $GARFIELD\_HOME  
git pull  
mkdir build  
cd build/  
source /home/ujjwal/root/build/bin/thisroot.sh  
source /home/ujjwal/software/geant4/geant4-v11.2.1-mt-install/bin/geant4.sh  
cmake $GARFIELD\_HOME or cmake -DWITH\_EXAMPLES=OFF $GARFIELD\_HOME

make -j14  
make install

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:** [August 24, 2024, 5:37pm UTC](https://root-forum.cern.ch/t/garfield-installation-and-geant-4-interfacing/60594/2 "2024-08-24T17:37:41Z")

</div>

Hi,  
it looks like your Geant4 installation was built without the GDML option. Can you try re-building G4 with the CMake option “-DGEANT4\_USE\_GDML=ON”?

> [@Problem in installation](https://root-forum.cern.ch/t/problem-in-installation/45918):
>
> I have downloaded a garfield-master version ,and then cmake successfully. But when i use ‘make -j8’ ,it feedback error as follow Then i skip this step ,however i couldn’t find install folder in next step. How could i deal with these problem I am very appreciated if you could give me some advices.

---

<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:** [August 25, 2024, 5:16pm UTC](https://root-forum.cern.ch/t/garfield-installation-and-geant-4-interfacing/60594/3 "2024-08-25T17:16:37Z")

</div>

Thankyou for your reply, now i’ve implemented this and tried the example provided in the garfield ++ example folder and it worked. After that i tried 1 example provided in a paper titled “Interfacing Geant4, Garfield++ and Degrad for the simulation of gaseous detectors”. The link for the example is " [GitHub - lennertdekeukeleere/Geant4GarfieldDegradInterface: A general example on how to interface Geant4 with Garfield++ and Degrad](https://github.com/lennertdekeukeleere/Geant4GarfieldDegradInterface)". It was having the following issue. Can you suggest me how can i rectify this

 ![image](https://root-forum.cern.ch/uploads/default/original/3X/6/0/601dd6995ac8b3146c171f4d2bf465b096967864.png)

As i am very new into this, your help would be appreciable  
Once again 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:** [September 2, 2024, 7:28am UTC](https://root-forum.cern.ch/t/garfield-installation-and-geant-4-interfacing/60594/4 "2024-09-02T07:28:25Z")

</div>

No idea, sorry. I noticed that the example is quite old (last change was 5 years ago), maybe it was based on an older version of Geant4?  
Is there something specific to this example that you need?

---

<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:** [September 4, 2024, 8:19am UTC](https://root-forum.cern.ch/t/garfield-installation-and-geant-4-interfacing/60594/5 "2024-09-04T08:19:13Z")

</div>

Alright, thanks for your reply. I’ll try to investigate this further.

---

<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:** [September 18, 2024, 8:19am UTC](https://root-forum.cern.ch/t/garfield-installation-and-geant-4-interfacing/60594/6 "2024-09-18T08:19:23Z")

</div>

Closed on September 18, 2024, 8:19am UTC

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