# Alpha particle with GEANT4 and GARFIELD

**URL:** <https://root-forum.cern.ch/t/alpha-particle-with-geant4-and-garfield/55036>\
**Category:** Garfield++\
**Created:** [May 25, 2023, 3:57pm UTC](https://root-forum.cern.ch/t/alpha-particle-with-geant4-and-garfield/55036 "2023-05-25T15:57:12Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![acorsi](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/c57346/32.png) [@acorsi](https://root-forum.cern.ch/u/acorsi)\
**Post date:** [May 25, 2023, 3:57pm UTC](https://root-forum.cern.ch/t/alpha-particle-with-geant4-and-garfield/55036/1 "2023-05-25T15:57:13Z")

</div>

Hello,  
I would like to simulate ionization induced by an alpha particle of about 1 MeV in a gas volume and the avalanche of the ionization electrons. I see two options:

1. Generate alpha track with Heeds, and then AvalacheMicroscopic, but it seems Heeds does not support alpha
2. Combine GEANT4 and GARFIELD. I started from the example in  
Garfield/Examples/Geant4GarfieldInterface, but I have the following runtime error:  
-------- EEEE ------- G4Exception-START -------- EEEE -------  
\*\*\* G4Exception : Analysis\_F001  
issued by : G4GenericAnalysisManager::OpenFileImpl  
Cannot open file “Garfield”.  
Please, use a file name with an extension or define the default file type  
via G4AnalysisManager::SetDefaultFileType()  
\*\*\* Fatal Exception \*\*\* core dump \*\*\*  
\*\*\*\* Track information is not available at this moment  
\*\*\*\* Step information is not available at this moment

-------- EEEE -------- G4Exception-END --------- EEEE -------

Any suggestion on which is the best way to go, and what’s the reason of the runtime error?  
Thanks and best regards  
Anna

---

<div class="post-metadata">

**Author:** ![vpadulan](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/vpadulan/32/25315_2.png) [@vpadulan](https://root-forum.cern.ch/u/vpadulan)\
**Post date:** [May 25, 2023, 5:44pm UTC](https://root-forum.cern.ch/t/alpha-particle-with-geant4-and-garfield/55036/2 "2023-05-25T17:44:06Z")

</div>

Dear @acorsi ,

From a very rough looking at what you report, I see

```auto
Cannot open file “Garfield”.

```

So maybe there’s some file missing for the tutorial to work? Other than that, maybe @hschindl can help you better.

Cheers,  
Vincenzo

---

<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:** [May 25, 2023, 5:59pm UTC](https://root-forum.cern.ch/t/alpha-particle-with-geant4-and-garfield/55036/3 "2023-05-25T17:59:06Z")

</div>

Hi,  
the runtime error should be have been fixed by this merge request (from yesterday):

> **[Add .root extension to the filename. (!355) · Merge requests · garfield /...](https://gitlab.cern.ch/garfield/garfieldpp/-/merge_requests/355)**
>
> Thanks to Jean-Michel Friedt for reporting the issue and proposing the fix.

Can you do a git pull and try again?

Heed is indeed not suitable for alphas. You could try the SRIM/TRIM interface:  
[https://garfieldpp.web.cern.ch/garfieldpp/examples/srim/](https://garfieldpp.web.cern.ch/garfieldpp/examples/srim/)

or indeed adapt the G4/Garfield++ example…

---

<div class="post-metadata">

**Author:** ![acorsi](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/c57346/32.png) [@acorsi](https://root-forum.cern.ch/u/acorsi)\
**Post date:** [May 26, 2023, 2:14pm UTC](https://root-forum.cern.ch/t/alpha-particle-with-geant4-and-garfield/55036/4 "2023-05-26T14:14:40Z")

</div>

Indeed the runtime error disappeared, thanks! Now I can run up to the filling of the Garfield.root file. But just after I see a segfault, and the tree in garfield.root is empty.  
Anna

```auto
### CAUGHT SIGNAL: 11 ### address: 0x0, signal = SIGSEGV, value = 11, description = segmentation violation. Unknown segmentation fault error: 0.

Backtrace:
[PID=90446, TID=-1][0/5]> 0 libdyld.dylib 0x00007fff73260692 dyld_stub_binder + 282
[PID=90446, TID=-1][1/5]> 1 libG4analysis.dylib 0x00000001098cb4d0 _ZN22G4ThreadLocalSingletonI24G4GenericAnalysisManagerED2Ev + 32
[PID=90446, TID=-1][2/5]> 2 libsystem_c.dylib 0x00007fff7330b13c __cxa_finalize_ranges + 319
[PID=90446, TID=-1][3/5]> 3 libsystem_c.dylib 0x00007fff7330b412 exit + 55
[PID=90446, TID=-1][4/5]> 4 libdyld.dylib 0x00007fff73261cd0 start + 8

```

---

<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:** [May 26, 2023, 4:22pm UTC](https://root-forum.cern.ch/t/alpha-particle-with-geant4-and-garfield/55036/5 "2023-05-26T16:22:05Z")

</div>

Hmm… no idea… Is this the G4/Garfield example out-of-the-box or did you make some changes?

---

<div class="post-metadata">

**Author:** ![acorsi](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/c57346/32.png) [@acorsi](https://root-forum.cern.ch/u/acorsi)\
**Post date:** [May 27, 2023, 6:32am UTC](https://root-forum.cern.ch/t/alpha-particle-with-geant4-and-garfield/55036/6 "2023-05-27T06:32:24Z")

</div>

Yes, out of the box…  
For the precision, the tree is empty but the histogram are filled in the output root file.  
Anna

---

<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:** [May 31, 2023, 9:08am UTC](https://root-forum.cern.ch/t/alpha-particle-with-geant4-and-garfield/55036/7 "2023-05-31T09:08:14Z")

</div>

Sorry for the delay in getting back to you. On which platform are you running?

---

<div class="post-metadata">

**Author:** ![acorsi](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/c57346/32.png) [@acorsi](https://root-forum.cern.ch/u/acorsi)\
**Post date:** [May 31, 2023, 11:33am UTC](https://root-forum.cern.ch/t/alpha-particle-with-geant4-and-garfield/55036/8 "2023-05-31T11:33:33Z")

</div>

Hello, it is MacOS Catalina.  
Anna

---

<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:** [June 14, 2023, 11:34am UTC](https://root-forum.cern.ch/t/alpha-particle-with-geant4-and-garfield/55036/9 "2023-06-14T11:34:06Z")

</div>

Closed on June 14, 2023, 11:34am UTC

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