Science topic

GEANT4 - Science topic

Explore the latest questions and answers in GEANT4, and find GEANT4 experts.
Questions related to GEANT4
  • asked a question related to GEANT4
Question
1 answer
Hi everyone
I am trying to detect ion products during ionisation by the electric field in geant4 .
i have implemented electric field inside the box which have been fiiled by some materials that is being exposed by electrons with energy equal to the ionisation energy (incident electrons energy range 5 ev - 30 ev ) of inside material.
i want to detect ion after ionisation,but electrons are being produced and there are no ions.
I have used G4VModularPhysicsList class and have used G4EmStandardPhysics , G4DecayPhysics and G4RadioactiveDecayPhysics at construct method of physicslist class.
Why i can not detect ions? Are there any Physicslists to produce ion products during ionisation in geant4?
Regards,
Tabaei
Relevant answer
Answer
Hi there! I stumbled upon this post and was wondering if you have found a solu to this problem. I am currently asking the same question.
Cheers!
  • asked a question related to GEANT4
Question
6 answers
Very many published papers exist on radiation shielding glasses, all with identical simulation techniques, performed with the MCNPX, FLUKA and GEANT4. I don't really realize if such extensive simulation practices are necessary to be published.
Relevant answer
Answer
My question was about the simulation techniques which are repeated in these simulations. People only change the compositions and densities of compound glasses, and publish their work.
I prefer papers with different applications of these shielding glasses or different radio-mechanical characterization techniques. But they are very few.
  • asked a question related to GEANT4
Question
3 answers
I want to calculate deposited energy of the electron pencil beam in the z direction inside a sphere filled with water which its edge located at z=5 cm. If you have any resource, input file or guidance, help me please.
Relevant answer
Hassan Ghavidel you can see how I have done it in my last paper https://www.sciencedirect.com/science/article/abs/pii/S0969806X23003018?via%3Dihub. Also, you can see the code in my GitHub repo: https://github.com/sebassaras02/RPT_NaI_4array
  • asked a question related to GEANT4
Question
2 answers
Dosimetry
Relevant answer
Answer
you may have a look at:
Good luck and
best regards
G.M.
  • asked a question related to GEANT4
Question
3 answers
dosimetry simulation
Relevant answer
Answer
Not sure about your definition of Dosimetry.
If you mainly focus on dosimetry in radiotherapy,
the Geant4 and FLUKA are all good choice.
Geant4 is more flexible but requires more skill of C++ program.
MCNP is not free, I guess. And not allowed to be used in some region of the world.
EGS mainly focus on low-enegy radiation of electrons.
From ChatGPT:
GEANT4, FLUKA, EGS, and MCNP are all popular simulation programs for dosimetry. Each program has its strengths and weaknesses, and the choice between them depends on the specific requirements of the user.
GEANT4 is widely used in the field of high-energy physics and offers a comprehensive set of tools for simulating a wide range of particle interactions with matter. It has excellent support for simulating electromagnetic and hadronic interactions, making it a good choice for dosimetry applications that involve high-energy particles.
FLUKA is a general-purpose Monte Carlo simulation program that is widely used in the field of radiation physics. It offers excellent support for simulating both electromagnetic and hadronic interactions, making it a good choice for dosimetry applications that involve a wide range of particles and energies.
EGS (Electron Gamma Shower) is a Monte Carlo simulation program designed specifically for simulating the interactions of electrons, photons, and positrons with matter. It offers excellent accuracy for low-energy interactions, making it a good choice for dosimetry applications that involve low-energy radiation.
MCNP (Monte Carlo N-Particle) is a general-purpose Monte Carlo simulation program that is widely used in the field of nuclear engineering. It offers excellent support for simulating a wide range of particle interactions with matter, making it a good choice for dosimetry applications that involve a wide range of particles and energies.
In summary, the choice of dosimetry simulation program depends on the specific requirements of the user, and each program has its strengths and weaknesses.
  • asked a question related to GEANT4
Question
3 answers
Hello everyone,
I am working on cell dosimetry by simulating cell irradiation in biological wells. In the wells, a volume of water in which the cells are constructed independently. Concerning the irradiation source, I want it to just fill the water volume but not the cells, and inversely. By researching, I found the (confine) method using GPS. However I could not apply it appropriately. Can have any help on how to apply it, or any already constructed example that implement this method ? Or even if there are any different methods ?
Thanks in advance for any help.
Relevant answer
Answer
I developed a method for generating irregular volume sources. It has been tested and could be used with any volume sources. It might be helpful to you.
  • asked a question related to GEANT4
Question
2 answers
I am using Ubuntu 20..04.4 LTS and the version of geant4 is 10.07.
I am attaching the error file here.
Relevant answer
Answer
You must install Cmake-13 or heigh versions in your device.
  • asked a question related to GEANT4
Question
9 answers
Hello dear all;
I am a beginner in GEANT4 use and I have issue to determine the neutron flux spectrum entering in a small cylindrical detector (n/cm2/event). But I can't add the appropriate code concerning this aim in my application.
Please someone tell me how can I do that?
I'll be very grateful for any help.
Thank you in advance!
-Abdesslam LAMRABET-
Relevant answer
Answer
Hi did you solved this? In a case not then my suggestion is to call physical volume of detector in steppingAction keeping its material vacuum. Since u interested in number of neutrons. Run 1000 events and check how many you find inside it. Now in postprocessing way you can calculate n/cm2/events Vs energy plot.
  • asked a question related to GEANT4
Question
3 answers
I would like to add TOF into my GEANT4 simulation, but I want to get TOF for each radiation detector.
I know that TOF can be done through GetGlobalTime function, but I do not understand well the physics behind.
I employed GetGlobalTime in the Stepping Action Class, and a counter (k). I understand that Stepping is called several times around a whole event, so to avoid count again the same particle I used counter (k). I saved the TOF and plot it for a run in different ntuples.
I did something like this:
if (volume == fScoringVolume1 && k1==0) {
G4StepPoint *preStepPoint = step->GetPreStepPoint();
G4double tof1 = preStepPoint->GetGlobalTime();
k1+=1;
fEventAction->AddTOF1(tof1); }
I got a TOF of 10 ns for a gamma source at 10 cm from the detector's cover; however, I am not quite sure if my simulation works properly.
Perhaps, someone who can help me with a GEANT4 example which does something similar or a GitHub repository.
Relevant answer
Answer
GetGlobalTime will provide the amount of time elapsed from the beginning of the simulation. For time of flight, you may need to compute the difference in time between two events. You should thus have at least 2 detectors that are operating in coincidence.
  • asked a question related to GEANT4
Question
1 answer
I am trying to run a simulation in geant4. I have written a macro file and I need to run the code for about 50 times for some research related task. I have tried to use /control/foreach but does not seem to work.
Relevant answer
Answer
Maybe you can write a batch script to do the job with the necessary commands needed to run the same macro 50 times.
  • asked a question related to GEANT4
Question
3 answers
I have an interview to face and I don't know any thing about GEANT. But I am sure the question will be from that topic. Can any body help about giving some idea regarding GEANT, and what kind of questions can be expected.
Relevant answer
Answer
if you want to install Geant4, You can install Linux os (Ubuntu series) then prepare your device to install it. Download initial program to install Geant4 from below link:
  • asked a question related to GEANT4
Question
3 answers
Are there any specific classes in geant4 for nano-materials? Or anyone could share an example of detectorconstruction.cc for simulating nanoparticles induced detectors?
Relevant answer
Answer
I think you can make such a model in GEANT4 if you have some average data of cross-sections, permittivity, etc. And this model will have many restrictions. If you need to calculate some electromagnetic processes in nanoparticles, you should look for another program, GEANT4 is not the best for such problems. This is my opinion.
  • asked a question related to GEANT4
Question
4 answers
Good day!
I have indefinite situation for me arose with gamma particle detection simulations.
My detector is a 10 * 10 pixel of cadmium_telluride.
pixel size 55 * 55 um, thickness 0.5 cm.
Beam gamma 80 keV.
When using G4EmStandardPhysics_option4, I get secondary gamma photons with energy ~ 23 keV.
The question arises with the LengthTracks for this secondary particle, in some cases it is over 300 micrometers.
This happens when there "CoupledTransportation" process takes place without any interactions along the path of the particle.
Tell me what caused this movement of the particle, or am I missing something when creating PhysicsList?
Relevant answer
Answer
see
The Geant4 Simulation Toolkit – Short Course, IEEE NSS-MIC 2013
  • asked a question related to GEANT4
Question
3 answers
I am working on the simulation of a HPGe detector, and when I do simulations for a cylindrical source of radium 226, I can't reproduce the Compon Edge, I use the standard phystic list option2
Relevant answer
Answer
my be due to low activity of the source . yes you can use another standed of high activity and single energy or of two gammay energy Co60 and Na and Cs137
  • asked a question related to GEANT4
Question
1 answer
Hello, I want to produce radioisotopes from different targets, specially for simulating a cyclotron operation. I tried STCyclotron example but it is valid only for few solid targets like Ni, Co. Is there any similar example which can be modified to get my desired outcome? If not, how can I achieve it? please suggest. Thanks in advance. Arnab
Relevant answer
Answer
A Systematic Review of Medical Cyclotron, Producing F-18 & FDG Radio Isotopes for Pet Scan Imaging (ijedr.org)
  • asked a question related to GEANT4
Question
4 answers
Hello everyone,
As you've probably guessed I'm fairly new to Geant4 and I am working on a project where I have to determine energy deposits in various organs after Irradiating the thyroid with I(131).
For starter I want to use the available human phantom just to get the gist of it but my problem is how should I simulate the radiation, provided that Iodine is concentrated in the thyroid and that it has a half life of 8 days, said Iodine disintegrate by emitting an electron and a gamma ray.
My questions are many:
1/Should I take the thyroid as the point from where the radiation is being emitted?
2/How will the half life be taken into account?
3/Do the organs provided in the example have sensitive detectors or should I create them?
4/How does the scoring goes?
All in all I would appreciate any and all help and if anyone has a clear idea of how I should proceed please your help is most welcome.
Thank you.
Relevant answer
Answer
Hello,
Thank you Hadi Jabbar Alagealy & Keyvan Tabaei for responding to my question.
I will try to explain myself better so you would get a clear idea of what I am trying to achieve.
I have sent you a message and I would be very glad if you responded.
  • asked a question related to GEANT4
Question
1 answer
Hi,
I tried to simulate the SPECT system with GATE and I could visualize interactions in the detector. However, I would like to visualize source energy distribution too.
I tried to simulate a SPECT system and set up source as below:
/gate/source/addSource SourceConfinement
/gate/source/SourceConfinement/gps/type Volume
/gate/source/SourceConfinement/gps/shape Sphere
/gate/source/SourceConfinement/gps/radius 1.5 mm
/gate/source/SourceConfinement/gps/centre 0. 0. 0. mm
/gate/source/SourceConfinement/gps/particle gamma
/gate/source/SourceConfinement/gps/energy 140. keV
/gate/source/SourceConfinement/setActivity 740000. Bq
/gate/source/SourceConfinement/gps/angtype iso
I didn't mention any energy distribution here. So, what will be the actual energy distribution with this simulation and is there any way to plot the source energy distribution?
Relevant answer
Answer
Hi,
You can simply use the Energy Distribution actor from GATE and attach it to your detector.
  • asked a question related to GEANT4
Question
2 answers
Hello Experts,
I want to know that how to find theta maximum when i am using GPS and sphere and surface type distribution. and using cosine distribution.
then i want to know that is there any mathematical calculation to find theta maximum for biasing.
like in the Geant4/examples/advanced/radio-protection theta maximum is 0.003 deg. how they got this using the surface area of source or object. like how can i get for my object ?
any type of help will be appreciated.
Thanks in advance !
Best Regards
Priyanshu
Relevant answer
Answer
no, i am talking about polar angle that is used in General particle source (GPS) in Geant4.
in this we have to give theta maximum and theta minimum according to our object so most of radiation should incident on my object.
but i don't know how can i calculate this for my object.
  • asked a question related to GEANT4
Question
2 answers
I am a novice in using Geant4, and I want to use Geant4 to do some study or research in radiobiology. What comes to my mind is to use Geant4 to simulate heavy ion irradiation. Could anyone please give me some suggestions?
Relevant answer
Dear Hu Jb
It is easy to simulate C-12 ion, if you instantiate GPS class in primary generator.
You only have to write these in your macro files for your simulation.
/gps/particle ion
/gps/ion 6 12 (atomic number and mass number)
Additionally, you have to set your position and angular distribution of your source.
  • asked a question related to GEANT4
Question
4 answers
Hi,
Can anyone please help me that how i can see the connections between all the Src file as i am very new to Geant4 and also know very less knowledge of C++.
so how can i proceed ?
Thanks in advance !
  • asked a question related to GEANT4
Question
5 answers
I have created a geometry of a concrete hollow box, placed a point source inside it. I got the Edep plot, now I need to calculate the depth dose profile in it.
I see extended example TestEm2,4, and 11 but I got bogged down seeing the enormous jungle of code. My understanding so far is, I need to access longitudinal and radial depth of the detector. Then need to get dose= edep/mass in each profile. Then show it in a histogram.
I need instructions whether my way is right and how can I do it simply.
Please do help, I got stuck here for a long.
Regards,
Relevant answer
Answer
Thanks Ashok Tiwari , I have done it with scoring volume in geant4.
  • asked a question related to GEANT4
Question
3 answers
Hello every one,
I am trying to simulate beta spectrum using Geant4/example/extended/radioactivedecay/rdecay01. In fact the problem is that when asking for the beta spectrum, it gives me a beta spectrum but with gamma pics. I am trying to understand why the program includes gamma pics in the beta spectrum, if there is any one can help me ?
In the two donwloaded images, it is possible to note that ceratain pics, corresponding to the deexcitation pics are removed thus by removing the deexcitation process in the physicslist, but gamma pics are stil there.
Thanks any way fo any help.
Relevant answer
Answer
Hello, first of all thank you for your answers.
In fact after deactivating deexcitation phenomena from the physics list, and force the program to do a simple desintegration, thus by putting fullchain on (false), i have no additional pics and the beta spectrum is obtained alone.
Thanks again.
  • asked a question related to GEANT4
Question
2 answers
I am thinking of simulating Gamma rays in FEM software like Ansys, COMSOL, etc. I tried to see some reference papers to start with but haven't got any relevant ones. Also, I have been looking for any sort of previous work done in this part, but unfortunately found none.
I saw somewhere that Gamma rays can be simulated in software like GEANT4 but I am not thinking of learning a new software only to simulate gamma rays and later it becomes of no use to me. So I am sticking with the common software used in academic institutes.
Can anyone tell me what do you think that whether gamma rays can be simulated in FEM or not? If yes, can you share some relevant papers or modules to start with.
Relevant answer
Answer
Thank you so much Lukas Carter for replying. I will read the information you have provided and hope that this solves my problem.
I further request that is there any method to simulate Gamma rays in FEM software without coding, but only using modules provided in the software? I am asking this because I belong to a mechanical background and working in medical fields so can't learn coding too to incorporate in this work in a short time.
  • asked a question related to GEANT4
Question
6 answers
I am making a simulation of energy deposited of some radioactive sources in scintillation detector. I have some results, but I don't have the same distribution energy between experimental spectra and simulated spectra. I do not know why.
For instance, the spectra of Cs-137 is shown. However, it does not have the same resolution.
Someone who can help me how to improve the simulation.
The scintillation detector is of NaI:Tl.
Relevant answer
Answer
The most significant difference is the width of the photoelectric peak at 662 keV. This width occurs after gamma-ray energy is transferred to the scintillator crystal. Your simulation probably may not include this part.
The number of scintillation photons generated, when 662 keV is totally absorbed by the NaI:Tl crystal, is statistically distributed. It is also a stochastic process whether each scintillation photon is successfully detected by a photodetector (photomultiplier tube or semiconductor device) or lost.
There are two ways to improve the distribution. One simple way is to assume the energy resolution of the detector (crystal + photodetector) and perform a convolution with your results. You can fine the typical energy resolutions in literature: typically ca. 7% [*].
Another detailed method is to add, if necessary, simulation to track the behavior of the scintillation photons.
The other differences seem to be related to Compton scattering; since the NaI:Tl crystal is sealed in a package, some of the energy may be lost by Compton scattering in the package before it enters the crystal. Then, the gamma-ray energy is not 662 keV but less than 475 keV for the detector. Similarly, Compton scattering from surrounding desks, walls, and other objects may enter the crystal and increase the proportion of that component of the experimental data.
  • asked a question related to GEANT4
Question
6 answers
Hi everyone,
I need to achieve some radiation protection calculation with MCNP6.2 but my partner is using Geant4. Does somebody know a simple way to swap from Geant4 to MCNP6.2?
Kind regards
Lucas
Relevant answer
Answer
Dear Lukas,
There is no way to convert those inputs since both have different style TOTALLY!. To make it more clear, one is like apple while the other is like orange. From the input structure to used language, all the essential steps are totally different. If you are going to use both of them, you will need to learn the basics of input files. However, as a personal recommendation, try to focus on one of them.
Truly
  • asked a question related to GEANT4
Question
4 answers
Hello,
I am a newbie in geant4. I'm learning it playing with example. Sometimes, when I go to simulate an example code, it doesn't create an executable file (the green one in my ubuntu terminal). Why does it happen? There is no error while building the file.
Please help.
File lists from terminal, there is no executable file.
anamika@anamika-Inspiron-3421:~/Cyclotron/g4work/B5$ ls
CMakeCache.txt cmake_install.cmake exampleB5.cc exampleB5.out gui.mac icons.mac init.mac Makefile run1.mac run.png vis.mac
CMakeFiles CMakeLists.txt exampleB5.in GNUmakefile History include init_vis.mac README run2.mac src
anamika@anamika-Inspiron-3421:~/Cyclotron/g4work/B5$
Relevant answer
I would recommend to use CRNS's virtual machine. If you run GEANT in Ubuntu, you have to install a lot of dependences for correct running. Also, when you want to run a simulation, you have to set GEANT enviroment.
This virtual machine avoid some thricky problems. On the other hand, for provinding a good solution, it is necessary more information that you have in your CLI interface (terminal) about the error.
Here is the link for virtual machine with GEANT.
  • asked a question related to GEANT4
Question
1 answer
I have tweaked around and modified the examples to learn how the coding works. But I want to build a detector from scratch. After reading the documents from the official website I got a rough idea but still not something concrete enough to start working. It'll be really helpful if someone can give me rough idea.
Relevant answer
Geant4 is not easy to learn and develop in few days. I suggest to you some steps to start with a good simulation. First, you need to define which field of science is the aim. For instance, if you want to simulate radioactive decay you should learn more about that in extended examples. Next, whatever topic you want to simulate, it must be necessary to have three mandatory classes. They are Detector Construction class, Primary Generator class and Physics List class and main function. In main function, you should initialize three mandatory classes. After that, you should write the .hh files. In these files, you must create methods and classes and inherit classes such as G4VUserDetectorConstruction. Then, you must create your objects in .cc files with the methods instantiated in .hh file of each class. Finally, when you don't get any error with simulation it is good to start to create more complex classes as RunAction and EventAction.
On the other hand, if you don't have enough experience in physics list another option is using predefining list in main function. Check exampleB1 to better understand this.
For these complex classes, you could check basic examples to understand the performance of those.
  • asked a question related to GEANT4
Question
4 answers
hi everyone. i'm a PhD student and i'm stuck when i came to developing my own simulation code using GEANT4 ; i know how to define the detector , the physics list , the generator and the action initialization ; but it's hard for me to deal with scoring , the run and the event action; i need a practical example which covers those points and help me finish the simulation.
thanks.
Relevant answer
Answer
thanks ,
appreciations ,
  • asked a question related to GEANT4
Question
4 answers
Very long simulations may be subject to computer failure for many reasons. Is there a command in Gate to save (or dump) the state of a simulation and be able to resume it later?
Relevant answer
Answer
Can you try using a virtual machine?
  • asked a question related to GEANT4
Question
3 answers
I would like to estimate proton damage during an irradiation with either Geant IV or MCNP X softwares and I would like to know what are the pros and contras of these two different softwares.
I would like also to estimate neutron damage during a different irradiation on the same material and then make a transferability study of proton irradiation to neutron irradiation.
What software would you recommend and why?
thank you
Relevant answer
Answer
I prefer The Monti Carlo Program
  • asked a question related to GEANT4
Question
3 answers
I want to make radio-active source in G4PrimaryGeneratorAction.cc class. How to do?
Relevant answer
Answer
Mikhail Demichev could you recommend how to load Pu-Be spectrum to particleGun and which format ?
  • asked a question related to GEANT4
Question
3 answers
I have built a detector for the detection of the cosmic-ray muon. Till now, I was using point particle gun for shooting high energy muons into the detector. Now I want to create a rectangular plane above the detector to throw thousands on particles in a single event by covering the whole detector plane. It is easy to do in a macro file. But I want to implement it in src file so that I can visualize the entire process. Kindly answer.
Relevant answer
Answer
Hi, if I understood your question currently - you want to create a muon beam that doesn't have a point source but multiple point sources such that the generation area resemble a rectangle? - if that is the case, I suggest two things - look into using CRY (https://nuclear.llnl.gov/simulation/doc_cry_v1.7/cry.pdf) to generate the initial muon flux and then in the PrimaryGeneratorAction.cc file create a nested for loop (2 loops) to create an array of such point sources that would effectively create the rectangular source that you need.
Hints:
1) Define a particle Gun:
% particleGun = new G4ParticleGun();
2) Define a generation point and angle:
% particleGun->SetParticlePosition(G4ThreeVector(x, y, z));
% particleGun->SetParticleMomentumDirection(G4ThreeVector(( xu,yu,zu ))
3) Loop over x and y points to create the rectangle
  • asked a question related to GEANT4
Question
2 answers
Hi,
I am a beginning user of Geant4. I am trying to work with voxel phantoms. Therefore, I have some difficulties:
- following the title of my question - my Geant4 environment is creating .wrl file instead of .gdd. First type of file is not supported by gMocren viewer.
- additionaly - I cannot visualize voxels in OGLSWin32 Mode (OpenGL). Without QT. Is it normal situation?
I am working on Windows 10 with cMake and Visual Studio 2019.
I would appreciate any tip any help or files.
Thanks in advance.
Mateusz
Relevant answer
Answer
Dear Mateusz Mirowski ,
To understand voxelization you can try DICOM sample in GEANT4.
  • asked a question related to GEANT4
Question
2 answers
Hello, I am trying to simulate the collision of two proton beams in the VeLo in LHCb by using Geant4. However, it does not seem possible to interact two beams with each other and so, I was wondering if it is possible to use ions (protons in this case) as target material instead.
Furthermore, I found that PYTHIA 6 (or 8) might offer a solution and I was wondering if anyone has experience in importing PYTHIA package in Geant4, since I cannot find anything helpful in doing this online.
Hopefully someone can help, thanks in advance.
Relevant answer
Answer
Yes
  • asked a question related to GEANT4
Question
5 answers
Does anyone have a fully modeled proton therapy treatment unit available?
It can be in either Geant4 (G4/Topas/Gate) or MCNP.
Relevant answer
Answer
I guess "have" and "willing to share" are two totally different topics. We generate and use those models as the basis for our extremely fast shielding calculation process. If you like to find out more, I just uploaded my presentation from PTCOG 57 to Research Gate. Contact me via my website/email if you like more information. www.meissner-consulting.com
  • asked a question related to GEANT4
Question
3 answers
I am trying to get cross sections for photonuclear reactions (gamma, n). So I have gamma beam with energy from 0.1 MeV up to 50 MeV and gold target. And I want to get cross sections for the next reactions for different gamma beam energy: Au197 + gamma = A196 + n, Au197 + gamma = A194 + 3n (attached image, I want to get the to compare). Now I use ShieldingLEND physics list.
Relevant answer
Answer
Could you pls give me the link for this work?
  • asked a question related to GEANT4
Question
2 answers
Hi,
I am trying to simulate a pinhole SPECT system in GATE. I want to block gamma penetration through collimator in this simulation(no penetration of pinholes through collimator other than holes as in ideal collimator). How can I stop penetration?
am I need to modify the following command:
/gate/physics/Gamma/SetCutInRegion collimator 0.1 mm
or any other command. I am new to GATE simulation and I will be grateful for your reply.
Thanks in Advance !
Manu
Relevant answer
Answer
Oleksandra Ivashchenko : Thanks a lot for your reply
  • asked a question related to GEANT4
Question
1 answer
Hi all,
I’m running a modified version of Example B1 for my graduate thesis. Pretty simple setup, the geometry is all modded and brand new (Basically just a bunch of boxes) and I cleared all overlaps so that part is good to go. For my source, I’m trying to use a GPS that takes up 99.9999% of the world volume in the shape of the world volume (world volume is a square, so I have a ParaP with all angles set to 90’), which shoots off gamma’s. So the problem I’m having is that the GPS code is seg Faulting when a gamma leaves the world volume instead of killing the interaction. I’m wondering how to fix the issue? I’ve tried to modify it in the stepping action, but do I need to find the StackingAction.hh file and modify it there/include it in exampleB1.cc?
Here is the error:
Some /vis commands (optionally) take a string to specify colour. “/vis/list” to see available colours. Checking overlaps for volume FrontWall1 … OK! Checking overlaps for volume FrontWall2 … OK! Checking overlaps for volume RightWall … OK! Checking overlaps for volume LeftWall … OK! Checking overlaps for volume BackWall … OK! Checking overlaps for volume TopWall … OK! Checking overlaps for volume BottomWall … OK! Checking overlaps for volume PbFW … OK! Checking overlaps for volume PbBW … OK! Checking overlaps for volume PbRW … OK! Checking overlaps for volume PbLW … OK! Checking overlaps for volume PbTW … OK! Checking overlaps for volume PbBottom … OK! Checking overlaps for volume WATER … OK! Issue /vis/viewer/refresh or flush to see effect. /tracking/storeTrajectory 1 Attributes available for modeling and filtering with “/vis/modeling/trajectories/create/drawByAttribute” and “/vis/filtering/trajectories/create/attributeFilter” commands: G4TrajectoriesModel: Event ID (EventID): G4int Run ID (RunID): G4int G4Trajectory: Charge (Ch): unit: e+ (G4double) Track ID (ID): G4int Initial kinetic energy (IKE): G4BestUnit (G4double) Initial momentum magnitude (IMag): G4BestUnit (G4double) Initial momentum (IMom): G4BestUnit (G4ThreeVector) No. of points (NTP): G4int PDG Encoding (PDG): G4int Parent ID (PID): G4int Particle Name (PN): G4String G4TrajectoryPoint: Position (Pos): G4BestUnit (G4ThreeVector) WARNING: Trajectory storing has been requested. This action may be reversed with “/tracking/storeTrajectory 0”. G4VisManager: Using G4TrajectoryDrawByCharge as fallback trajectory model. See commands in /vis/modeling/trajectories/ for other options. HepRepFile writing to G4Data0.heprep /run/verbose 1 /event/verbose 1 /tracking/verbose 1 /gps/verbose 1 /gps/particle gamma /gps/pos/type Plane /gps/pos/shape Rectangle /gps/pos/centre 0 0 0 cm /gps/pos/halfx 816 cm /gps/pos/halfy 228 cm /gps/pos/halfz 230 cm /gps/ang/type iso /gps/energy 10 MeV /gps/ene/min 0.1 MeV /gps/ene/max 30 MeV /run/beamOn 100
========= Table of registered couples ==============================
Index : 0 used in the geometry : Yes Material : G4_AIR Range cuts : gamma 1 mm e- 1 mm e+ 1 mm proton 1 mm Energy thresholds : gamma 990 eV e- 990 eV e+ 990 eV proton 100 keV Region(s) which use this couple : DefaultRegionForTheWorld
Index : 1 used in the geometry : Yes Material : G4_STAINLESS-STEEL Range cuts : gamma 1 mm e- 1 mm e+ 1 mm proton 1 mm Energy thresholds : gamma 20.9232 keV e- 1.31345 MeV e+ 1.22809 MeV proton 100 keV Region(s) which use this couple : DefaultRegionForTheWorld
Index : 2 used in the geometry : Yes Material : G4_PLEXIGLASS Range cuts : gamma 1 mm e- 1 mm e+ 1 mm proton 1 mm Energy thresholds : gamma 2.78665 keV e- 389.196 keV e+ 376.336 keV proton 100 keV Region(s) which use this couple : DefaultRegionForTheWorld
Index : 3 used in the geometry : Yes Material : G4_Pb Range cuts : gamma 1 mm e- 1 mm e+ 1 mm proton 1 mm Energy thresholds : gamma 101.843 keV e- 1.36749 MeV e+ 1.27862 MeV proton 100 keV Region(s) which use this couple : DefaultRegionForTheWorld
Index : 4 used in the geometry : Yes Material : G4_WATER Range cuts : gamma 1 mm e- 1 mm e+ 1 mm proton 1 mm Energy thresholds : gamma 2.94056 keV e- 351.877 keV e+ 342.545 keV proton 100 keV Region(s) which use this couple : DefaultRegionForTheWorld
====================================================================
/vis/scene/notifyHandlers scene-0
Run 0 starts.
Rotated and Translated position (-2113.3,-799.247,0) Generating isotropic vector: (0.759379,0.522945,-0.387133)
G4EventManager::ProcessOneEvent()
G4PrimaryTransformer::PrimaryVertex (-2113.3(mm),-799.247(mm),0(mm),0(nsec)) 1 primaries are passed from G4EventTransformer. !!! Now start processing an event !!!
  • G4Track Information: Particle = gamma, Track ID = 1, Parent ID = 0
Step# X(mm) Y(mm) Z(mm) KinE(MeV) dE(MeV) StepLeng TrackLeng NextVolume ProcName 0 -2.11e+03 -799 0 10 0 0 0 World initStep 1 -1.47e+03 -357 -328 10 0 846 846 RightWall Transportation 2 -1.46e+03 -349 -333 10 0 14.6 861 World Transportation 3 -573 262 -785 10 0 1.17e+03 2.03e+03 BackWall Transportation 4 -551 277 -797 10 0 28.5 2.06e+03 World Transportation 5 5.69e+03 4.57e+03 -3.98e+03 10 0 8.21e+03 1.03e+04 OutOfWorld Transportation Segmentation fault (core dumped)
Relevant answer
Answer
Hi Konnor!
I had a similar issue (Segfault in my implementation of G4UserSteppingAction::UserSteppingAction). In order to ascertain if a particle is en route to leave the world volume I came up with the following solution:
Provided the step pointer s, i used retrieved the step's track (eg. track = s->GetTrack()) and then checked if track->GetNextVolume() returns a null pointer. This is the case if the particle is about to leave the world volume (link to docs eg: http://www.apc.univ-paris7.fr/~franco/g4doxy/html/classG4Track.html#0dabd467c3157ce11e54612bf24b1ffd)
Hope this still helps, cheers
  • asked a question related to GEANT4
Question
2 answers
I made a detector consisting of one adsorber and gap by replicating then throughout the volume in GEANT4. Now I want to place a single converter box in a particular gap. I have modified' Basic example B4'. But the problem is when I assigned another box, it has been replicating in all the gaps as its physical volume is replicated. Are there other ways to do it?
Relevant answer
Answer
Hello.
Indeed when you add a daughter volume "D1" to a logical volume "L1", then it will appear inside all physical volume which are 'copies' of "L1", i.e. whose logical volume is "L1".
The answer is to create a second logical volume "L2" in which you will place the daughter volume "D1". Whereever you want "D1" to appear, you must create a physical volume using "L2" as the logical volume.
Note: it is best to ask your questions on the Geant4 User forum - at https://geant4-forum.web.cern.ch/
  • asked a question related to GEANT4
Question
1 answer
Hi everyone,
I tried to simulate Th232 source in Geant4 using two different formats to get the data: in root and .csv, the root format is giving funny Gaussian shape and .csv output is giving me 3 columns. Is there a way to make the peaks look like the experimental one instead of dotted lines? Also what could be the problem of getting 3 columns? and how do I identify my counts from the columns? I have attached the two formats below.
Note: If I try with Co60 or Na22, the spectra normally comes out with nice Gaussian shape but with a lot of gamma energies the shape is something else.
Regards,
Mistura.
Relevant answer
Answer
Thanks guys, I solved the root format, the problem is not from Geant4 but from root. Also can someone help with CSV format because with any source the CSV file still have the same values, though is not important since I can extract the data from root but am just curious to know it.
  • asked a question related to GEANT4
Question
2 answers
Hi
I am trying to calculate PDD using Geant4
I divided a water phantom to voxels (2 mm x 2mm x 2 mm) by G4NestedParameterisation and i have created a class derived from Sensitive Detector class using Hit (I am not sure that this sensitive detector must be used)
How can I calculate the dose at each voxel?
Relevant answer
Answer
Dear @Keyvan Tabaei,
To calculate PDD using a voxelized geometry, you need first to create you own SensitiveDetector class derived from the Geant4 class G4VSensitiveDetector, and assign this object to your geometry. In this class (SensitiveDetector) you have a virtual method called ProcessHits(G4Step*, G4TouchableHistory* ) in which you can accumulate the dose deposition (dE/dm).
I suggest you to see in details the source code of the project medical_linac in your geant4 example folder ($Geant4-install-folder/share/Geant4-vx.x/examples/advanced/medical_linac/).
  • asked a question related to GEANT4
Question
1 answer
I am trying to simulate the electroluminescence process in noble gases (argon and xenon) through Geant4 but I haven't found any documentation on how to add this process to the physics list.
Is there a standard physics list that already has this process? Or a simple way by which I can define the secondary scintillation phenomena within the simulation?
  • asked a question related to GEANT4
Question
5 answers
Dear Experts, I am beginner in Geant4. I have modified geant4/examples/basic/B4d input to score energy spectrum in the sensitive volume. I have used the following code for energy binning char name[16]; for (G4int i=0; i<48;i++){ std::sprintf(name,“current%03d”,i); G4String name; primitive= new G4PSSphereSurfaceCurrent(“current”, fcurrent_in); G4double kmin=i*0.025MeV; G4double kmax=(i+1)*0.025MeV; G4SDParticleWithEnergyFilter*filter=new G4SDParticleWithEnergyFilter(flrname = “filter”); filter->add(“gamma”); filter->SetKineticEnergy(kmin,kmax); primitive->SetFilter(filter);
logvol->RegisterPrimitive(primitive); Now as per B4d examples, B4dEventAction.cc for hist collection I did the foloowing
 fphotonCurrentHCID=G4SDManager::GetSDpointer()->GetCollectionID("Det/current"); Then auto current=GetSum(GetHitsCollection(  fphotonCurrentHCID, event)); Now as per B4d examples,  B4dRunAction.cc for hist collection I did the foloowing analysismanager->CreateH1("current","photon current", 48, 0., 1.2*MeV); Now, how I feel that some modification is required in B4dEventAction.cc and B4dRunAction.cc to get histogram in the format of (energy-bin vs counts)?But I do not know how to do it.
Kindly give me some suggestion. Thanking you in advance.
Relevant answer
Answer
Agree with the previous advice
  • asked a question related to GEANT4
Question
4 answers
How we can define a small molecule in geant4-DNA,for example water (H2O)?,May we define it in idle?
Relevant answer
Answer
Dear Torkamani;
Just to give you a general principle off any Monte Carlo code, you have to define it with their elemental mass fractions as well as densities. On the other hand, each code has their material definition rules. So, better to read guide of Geant4 carefully. I agree with Al-Noor about the link that given in previous response.
Good luck.
  • asked a question related to GEANT4
Question
5 answers
I am seeking for the possible procedures to install Geant4 on Windows 7.
Relevant answer
Answer
1. Install VMware workstation 14 on your Windows.
2. Install Ubuntu (14.04 or other versions) in VMware workstation.
3. Install Geant4 on ubuntu.
Enjoy
  • asked a question related to GEANT4
Question
2 answers
I simulated a SPECT camera using GATE (GEANT4 Application for the the Tomographic Emission) code . I am going to reconstruct the GATE output using iterative methods from STIR. How can I deform projection data ( .sin) to sinogram data (.s)?
Relevant answer
Answer
You can reconstruct the GATE SPECT simulation data using STIR.
Please see the attached manual from GATE SPECT simulation to STIR image reconstruction.
The attached slide (with manual) was presented in 2018 IEEE NSS/MIC STIR User's and Developer's Meeting in Sydney.
  • asked a question related to GEANT4
Question
2 answers
Please someone tell me what is the difference in the Target material of world volume and sensitive detector material of chamber volume of B2 Basic example in Geant4 simulation?
I am using QGSP_BERT_HP physics list in B2 Basic example.
I am changing target material to Boron-10, sensitive detector material to Si and particle to neutron in B2 Basic example of Geant4.10.01. I am getting the secondary particles Lithium,alpha and gamma.
If I am changing sensitive detector material to Boron-10, target material to Xe and particle to neutron in the same example. I am getting the same secondary particle. Just at the output file in the bottom there are just displaying the energy deposition. Nothing else everything is the same as above.
I really want to know the difference in Target material and sensitive detector material in B2 Basic example?
Relevant answer
Answer
Why the event 0 of run 0 does not have any hits despite it has many tracks. On the other hand event0 of run 1 has 352 hits @ Patrik Eschle
Thanks in advance,
  • asked a question related to GEANT4
Question
7 answers
I was thinking of simulating a cyclotron using GATE as a platform and I was wondering if it's the correct platform to use or is it better to use another platform (Geant4 for example).
Relevant answer
Answer
PHITS is my preferred platform for these types of calculations: https://phits.jaea.go.jp/index.html -- it is simultaneously very powerful, versatile, user-friendly (easy to install/run, and no programming knowledge required), and the manual/documentation is replete with examples describing how to set up these types of calculations.
  • asked a question related to GEANT4
Question
7 answers
Hi all,
I'm running a simulation involving many particles. How can I decrease the time for checking the overlap of geometries in my code when there are more than million particles in the geant4 code?
Thanks a million in advance
Relevant answer
Answer
@Shiva Zarifi
I'm sorry. Your name was written mistakenly.
  • asked a question related to GEANT4
Question
9 answers
Hi,
It is posible to create geant4 simulations under qtcreator ide ? 
Relevant answer
Answer
Other solutions? According to above solution you can compile your code and use qt creator as an IDE. Only thing is to run you have to run it from your terminal. Or check the build and run settings. Once you set the environment right. Everything will work fine.
  • asked a question related to GEANT4
Question
9 answers
I want to send a pencil beam of electrons onto a target. I am modifying the example B1 to get this. I do send electrons with defined energy and direction on to the given geometry via command line by using /gun and /run commands but I do not know how to define them as a pencil beam.
Relevant answer
Answer
Hi Jilberto,
I think a more simple solution would be to make the changes directly in your B1PrimaryGeneratorAction, sampling from the distribution you want. This method is not as general as the previous, but might be more simple. The only changes you need are made inside the B1PrimaryGeneratorAction.
The initial X and Y position of the source are given in (line 141 and 142):
G4double x0 = size * envSizeXY * (G4UniformRand()-0.5);
G4double y0 = size * envSizeXY * (G4UniformRand()-0.5);
You can change the previous two sentences in the code, and sample for the distribution you want.
For example, for a circular source replace the previous two sentences with:
G4double x0;
G4double y0;
G4double r = 50*mm; // this is the radius of the circular area; notice the units
do
{
x0 = r*(2*G4UniformRand()-1);
y0 = r*(2*G4UniformRand()-1);
}while( x0*x0+y0*y0 > r*r);
*In case you want to use my previous suggestion:
1. You will need to modify your PrimaryGeneratorAction.hh and .cc to include the GPS. The easiest way to do it is to copy from the example mentioned before. You will probably need to modify the ActionInitialization so that you have the PrimaryGeneratorAction rather than B1PrimaryGeneratorAction, and remove a section in RunAction named as ''Run conditions''. Do not remove the 'G4String runCondition;' as needed later.
In case you are using the gun/ commands, after the change of the PrimaryGeneratorAction it won't be available anymore.
2. As Geant4 is a toolkit that allows to create your simulation from a C++ library, you have to recompile your code every time you make a change. However, in most of the cases, we need to run the same simulation for a set of parameters, for instance the primary particle energy. For this purpose Geant4 has an interface that allows to control some functionality through a macro file. It also offers the tools to be able to create a simulation where basic parameters are given from a macro file, although this might be a bit advance at the moment. In B1 example there are two macro files, run1.mac, run2.mac, vis.mac, and init_vis.mac. The first two are to be used in batch mode, and the later two are to setup the visualization in interactive mode (look comment below for what the modes are). Please note that usually macro files have the extension .mac.
3. B1 example can be run in two modes, batch and interactive:
-Batch mode: the simulation runs without any user interface, ie graphics. All the information are given in a macro file. To run in batch mode use the name of the application followed by the macro file. In the case of example B1 is './exampleB1 run2.mac'.
-Interactive mode: you can run the simulation command by command, or you can run a macro file which contains a set of commands. You can start an interactive mode by writing './exampleB1'.
Now the important part, the following commands will create a square 2x2 cm2 source on the X-Y plane with the particles traveling towards +Z. I have 6 MeV gamma (i.e. photons).
# anything starting with a hash (#) is considered a comment
# if you want to run this macro file in batch mode
# uncomment (ie remove the #) the following command
# /run/initialize
# SOURCE DEFINITION
# select particle type
/gps/particle gamma
# select energy
/gps/energy 6 MeV
# select source type /gps/pos/type Plane /gps/pos/shape Square
# center of the source /gps/pos/centre 0. 0. 0. cm /gps/pos/halfx 1. cm /gps/pos/halfy 1. cm
# RUN SIMULATION
# this will run the simulation with 1 primary
/run/beamOn 1
# end of macro file
I think that now you can change the parameters of the GPS and create your own source, see the site with the examples from the previous post.
  • asked a question related to GEANT4
Question
2 answers
I guess we need the optical part of GATE. But how do I modify / set the physics to simulate this effect (because geant4 seems to have it already)?
Relevant answer
  • asked a question related to GEANT4
Question
4 answers
This is my first time using Geant4 . I use it in calculating mass attenuation coefficient. i know that TestEm13 is used for that but i can not run it or edit the source or target. and from where can i get easy and clear instruction to deal with Geant4
Relevant answer
Answer
Hi there. The target in most cases is defined in DetectorConstruction.cc while the particle source is defined in PrimaryGeneratorAction.cc files. You should read the manual or start from the more basic examples to better understand the structure of geant simulations.
  • asked a question related to GEANT4
Question
4 answers
Hi, I use rdecay02 to implemented my application. In README, I read on point 5 (visualization) the following instructions: "Visualisation of the geometry and the tracks is possible with many of the G4 visualisation packages. An example of display the geometry and tracks using VRML is given in the macro file macros/vis.mac." But in my macros files in this example, I don't have a file name's vis.mac. I use geant4 V10.2. if anyone had already perform this example with visualization set, help me please.
Relevant answer
Answer
Hi, to ask for a Geant4 problem, please post your message first on the Geant4 forum, you'll reach more people ! http://hypernews.slac.stanford.edu/HyperNews/geant4/cindex
A vis.mac file is only a file containing commands, you can copy/paste one of any example and modify it to your which
  • asked a question related to GEANT4
Question
3 answers
I want to randomize particle gun within the volume of body phantom. what should be the code for PrimaryGeneratorAction.cc....
Relevant answer
Answer
An easy, but very flexible, way to define a particle source in Geant4 is to use the General Particle Source (GPS). You will have to define it in PrimaryGeneratorAction.cc and after that you can use a macro file for inputting your options.
In particular you would probably find useful the '/gps/pos/type Volume' and '/gps/pos/shape Cylinder' command. If you have a more arbitrary volume you can also use the '/gps/pos/confine Physical_Volume_Name' command.
For further details you can always see the section in Geant4's manual:
Also you can find some additional examples here:
I think you could find the examples 10,11, and 17 useful.
  • asked a question related to GEANT4
Question
4 answers
I'm planning to use Geant4 to calculate the effective dose for mammography examination but I faced two problems:
1. I was trying to use the human phantom in advance example but some of the organs eg liver, lung and thyroid etc are missing. People suggests I could use XCAT phantom but it is quite expensive and I'm not so sure whether this phantom is suitable for mammography dosimetry or not?
2. Unlike PET or SPECT in GATE there are no benchmark for mammography unit do I need to build it from scratch? Even I modeled the mammography unit I cannot verify my simulation results...
Relevant answer
Answer
The license policy shouldn't be unfriendly. We're always glad to help as far as I know.
  • asked a question related to GEANT4
Question
4 answers
Hi all,
I'm trying to simulate the photon decay spectrum of Eu155 in Geant4. I'm not using the decay file provided by Geant4 because the energies and intensities listed are incorrect. I've changed/added values to match trusted literature, ensuring that the syntax is the same and the intensity column sums to 100.
The resulting spectra however is not right. There are too few photons per decay for most energies. I'm confident I'm collecting all the photons. I've attached my decay file and the resulting plot. The picture also has a 2nd plot of what the spectra should approximately look like for comparison.
I want to know what the intensity column is actually doing and how to adjust it such that the photons per decay match the values I've placed in the intensity column (noting that it's as a percentage there).
Any help is greatly appreciated
Thanks,
- Giuseppe
Relevant answer
Answer
Hi All,
Thanks for your responses, especially Jose who replied very quickly.
Relative intensity makes sense and its working now. Co60 is a simple example however, Eu155 has many decay paths so rough calculations and trial and error methods eventually worked.
I have tried the /gps/ion <Z> <A> command and still brought up an incorrect spectra. It seems this command calls on the z63.a155 decay file in the install folders, which has the correct probability of which excited Gd155 state the decay begins at. From there I'm at a loss. I'm not sure how geant4 then takes each photon's fractional decay from each excited state and possibly there belies the problem. I've also looked at the photon evaporation file for Gd155 (z64.a155) and im not sure how to read it to then adjust it to my needs.
Also, /gps/ion command seems to work in rdecay01 example but not my own code. Again, not sure why.
Thanks again all
  • asked a question related to GEANT4
Question
6 answers
Hello Everyone
I'm trying to simulate a LaBr3(Ce) detectors with GEANT4. The dopant (Ce) concentration is 5% (given by the manufacturer). Do I have or have not, when declaring the material components in GEANT4, to include the 5% Cerium??
Thank you
Walid
Relevant answer
Answer
Hi, in my opinion, you shuold declare that you have 5% Cerium, even though it may have little effect by Geant4 simulation.
  • asked a question related to GEANT4
Question
3 answers
Using G4PrimaryVertex and G4PrimaryParticle, i can get the energy at the beginning of an event, but i want to know how much energy each particle loses during an event. I'm simulating particles travelling through a medium.
Relevant answer
Answer
You could use the extended/electromagnetic/TestEm11 example as reference. In the example the use of SteppingAction and EventAction classes is demonstrated by scoring the energy deposited per event.
  • asked a question related to GEANT4
Question
3 answers
Dear All,
I want to simulate Protontherapy machine by using Geant4 Monte Carlo code. I'm asking if there is any document in which I can find all data required to perform a Monte Carlo model of ProtonTherapy.
Thanks,
Best Regards,
Relevant answer
Answer
Every model has different components, materials and their compositions. Paganetti's document contain main idea - that you can use for "ideal" device. If you want real data you must ask manufactures of devices. It unlikely that such data present in open access.
  • asked a question related to GEANT4
Question
6 answers
i have installed geant 4 on my win7 64 bit. after running an example when i want to rotate the geometry, force close happens.what is the problem?
Relevant answer
Answer
As suggestion, you can use valgrind tool to see the line of code that causes this  problem.
  • asked a question related to GEANT4
Question
2 answers
I have simulated Varian 2100, 6MV with Beamnrc Code and now I want to apply driven phase space file to Geant4.
Relevant answer
Answer
Yes you can take it;  only IAEA Phase space type 
  • asked a question related to GEANT4
Question
4 answers
i use MCNPX  code for calculate the neutron and photon dose in BNCT but for GdNCT we have auger and conversion electron and i don't know how can i calculate electron dose.
Relevant answer
Answer
No, because i think i can't use f4 for electron dose in the tissue also i don't have de and df for electron. and i'm not sure i can use f6 for electron dose in tissue or not.
  • asked a question related to GEANT4
Question
2 answers
My system include: Resource, (PMT or MPPC) and analysis system. I would like to know: if i add 1 photodiode in dark box (in dark box include: resource, photodiode), Can i limit the lost of electron when from dynode to anode or increase the PDE measurement?. And i would like to make a dark box, what is the best materials to make it? (I use the optical resource: Co-60, X- ray or Po-210).
My English is not good. I try to show my thinking. I Hope I can receive your suggestion.
Thank you so much.
Relevant answer
Answer
Thank you so much  Mr.SUNIL KUMAR but My project is not supported and I have to make a dark box for it myself . Have a good day :)
  • asked a question related to GEANT4
Question
13 answers
I am working with MCNP. The set-up is simply trying to carry out a radiotherapy simulation where I can use a point source of gamma photons to destroy cancerous cells.
My Problem: I am losing particles so the run is terminated.
Geometry: A cylinder is the skull in it there is a sphere>>>Tumor. I put them into a big rectangular box. My point source is another sphere inside the box.
I need help. Am I going the right way?
Relevant answer
Answer
 Thank you guys for your assistance
I am actually new to MCNP but I am catching up quickly. I think.
I checked my problem on MCNP X and I found out that Cell 3 in my problem is actually not showing and my results on MCNP 6 shows that I am losing particles because it cannot detect that same cell.
Please Check the 1)code 2) the 3d diagram 3) the crossection*
*When i check all crossections: XY XZ YZ and all I dont see cell 3. 
How can I solve it?
  • asked a question related to GEANT4
Question
1 answer
Dear Colleagues;
I am MCNP user since several years. I working with MCNPX version with WinNc32 complier but nowadays i have MCNP5 and i want to use it with WinNc32 complier as my previous studies. Somebody have this experience? I have total folder of MCNP5 but somehow i can't use it with WinNc32. Thank you in Advance...
Relevant answer
Answer
It's a very good question, very direct, and I'm going to follow it.
  • asked a question related to GEANT4
Question
1 answer
Rather than using predefined Geant4 physics reference lists such as FTFP_BERT, I am trying to create a physics list with particles and processes more relevant with the experiment I am simulating. Has anyone tried similar things? Would you mind sharing your experience?
Relevant answer
Answer
I first found the existing physics list that is the closest to my needs, copy them to my developing area, modify them, and use them.
  • asked a question related to GEANT4
Question
5 answers
Dear all,
I tried to simulate Co60 source in Geant4.
I did it in 2 different ways:
A) I simulated two gaussian peaks in the gamma peak position and I get the gamma picture attached
B) after that I have simulated the source with example rdecay02 but I have a different spectrum.
Any of you can help me to solve this problem? I do not understand how is possible that I have something so different.
Thanks in advance
Alessia
Relevant answer
Answer
Dear Alessia
You may talk to my graduate student Mr. Masoud Razimanesh with the  email :  masoud.razimanesh1990@gmail.com
he has ample experience with Geant4 and simulation of Co-60 with it.
Best wishes,
Mostafa Sohrabpour
  • asked a question related to GEANT4
Question
5 answers
I have run a program for detector efficiency simulation. The output file is in root format. Can anyone help me to extract the result of simulation in another file format? txt format is the best one I think
Thank you.
Relevant answer
Answer
Dear Guembou,
You must select CSV output in your analysis manager. The code specific to the output format must be included in your analysis manager declaration. Next, code extracted from B4 example (B4Analysis.hh) is shown where the selection of the output format takes place uncommenting the line corresponding to csv format.
#ifndef B4Analysis_h
#define B4Analysis_h 1
//#include "g4root.hh"
//#include "g4xml.hh"
#include "g4csv.hh"
#endif
Best regards,
Santiago
  • asked a question related to GEANT4
Question
6 answers
Can anyone kindly help me with the geometry construction of Ortec GMX30-70-SV-CW HPGe detector? The bias voltage is +3200V at the N contact.
Relevant answer
I do the same simulation with another type of detector.  I need an existing model that requires debugging, to simulate the HPGe germanium deterctor.
Was there an example of that Geant4 to understand the process before embarking? If yes which on? Can you help me please?
Thanks a lot!
  • asked a question related to GEANT4
Question
3 answers
Hello. I am a complete novice in using Geant4 and I need to build a 2D array of detectors (like 1024x1024, their size in the order of millimeters, with gaps between them). I wish to know exactly the method (exact syntax), and if it can be done using a double for loop, in the source or in a macro. Also I need to know subsequently their indexes (i,j) and/or center position. Your help is greatly appreciated.
Relevant answer
Answer
Hi Iustinian,
Yes, you can iteratively create multiple physical instances of the same logical detector in Geant4 to build your array. The functions for all of this are documented here:
I suggest having a look at the PET example bundled with Geant4, examples/B3, which is a hierarchical example of what you want to do (crystal repeated around a ring, rings repeated along an axis).
  • asked a question related to GEANT4
Question
7 answers
Hello everyone,
I have some troubles with my GEANT4 results.
In my simulation i have some poistrons e+ , so i'm looking for the Gamma ennergies from the annihilation. Normally i have 2 gamma with an energy around 0.511 Mev.
Sometimes i have gamma's energy Egamma >0.511 Mev ,
moreover few times i have Egamma > 1.022 Mev .
There is generally 2 gammas of annihilation, and when the problem appened, the sum of both gamma's energy is more than 1.4 Mev .
exemples : Egamma (Mev) = {1.265 + 0.2071 ; 1.205 + 0.613 ; 0.836 + 0.564 ; 0.910 + 0.451 ; 1.557 + 0.385 }
So do you have any explanation about that ?
Your faithfully ;)
( i have some screenshots if you want to see . ID(e+) = 4  and parentsID(gamma)=4, so we are sure that the 2 gamma come from the annihilation)
Relevant answer
Answer
yes it make sense but the anniohilation append when positron's kineticenergy is null , like on the screen shot i shared 
  • asked a question related to GEANT4
Question
3 answers
I have already played with FTFB_BERT_HP and QGSP_BIC_HP. For DD reactions, neutron emission appears for incident energy above 3 MeV only. But below this limit, nothing! It seems that existing libraries does not allow to simulate DD and DT fusion at low energy. Is there any way to simulate low energy fusion reactions at keV incident energies with existing libraries in GEANT4? Or should I create my own physical process with dedicated cross-sections and fusion products angular distributions? In advance, thank you for your help. Cheers.
Relevant answer
Answer
Talys is used for elements with a mass A>10
  • asked a question related to GEANT4
Question
15 answers
Dear all
We did Monte Carlo-simulations of a fluoroscopy experiment with Geant4 by irradiating XCAT voxel phantoms. The simulation returns a dose per voxel. Together with the organ information we get organ doses etc.
In a first analysis we calculated the effective dose using  ICRP 103 tissue weighting factors. This seems incorrect, since ICRP 103 says: ".. nor should it be used for detailed specific retrospective investigations of individual
exposure and risk".
We now produce dose-volume-histograms to see the dose distribution in each organ and the maximum dose in a voxel.
What do you consider a good value to estimate radiation risk from MC results and to compare it to legal requirements?
Thanks for your input,
  Patrik 
Relevant answer
Answer
Once the dose is expressed as effective dose it is an estimate of detriment, mainly cancer risk. ICRP states that this is for doses lower than deterministic effects, about 0.05 Sv. Consequently, this is in the range of radiation protection. Nevertheless, the risk was calculated from even higher doses and extrapolated to lower doses.
The range of doses in your case should apply as the risk is considered linear. 
Do you plan to give the risk information to patients?
  • asked a question related to GEANT4
Question
4 answers
Need excellence documentations on Geant4, version 10.1. Where could I get the sources?
Relevant answer
Answer
This reference can help:
Geant4 User's Guide for Application Developers
by Geant4 Collaboration
Version: geant4 10.0
Publication date 6 December 2013.
  • asked a question related to GEANT4
Question
3 answers
Recently we have come across some, rather mind-boggling, difficulties concerning the noted Monte-Carlo code. First and foremost, it is of significant importance to us to know what changes are needed to be implemented in the installation, or execution procedures of the code to enable multi-threaded use of all the CPU processing cores. The defined commands are rather complex and demand optimum usage of all available hardware. Secondly, It is extremely vital for us to make sure that the GEANT4 code understands the cross-sections of heavy charged particle interactions with the nanoscale materials apparent in our geometry. Thus, we wanted to know if such directory exists, by default, and if not, wanted guidance on the data, and/or changes which are needed to input the required information. This is an absolute necessity for the accuracy of our results. please inform me of your thoughts and ideas.
Many thanks in advance for all your efforts.
Relevant answer
Answer
Regarding the interaction of heavy charged particles with nanoscale materials, Geant4 does not consider the molecular structure of the medium.  It only considers the relative proportion of atoms and isotopes, and properly accounts for the interaction cross-sections with individual atoms and their electrons and nucleons.  It is up to the user to properly define the materials and elements present in your geometry description.
  • asked a question related to GEANT4
Question
3 answers
Results in experiment every time and computation done in Geant4 of the same experiment  are random, then how we can find E/C ratio.
Relevant answer
Answer
The computation of "E/C" ratio only makes sense in terms of math statistics, where the "RANDOM" values (measured or simulated by Geant4) are always associated with corresponding  probability density functions (or spectra). Thus, using experimental and simulated samples, the "E/C" ratio is transformed into the ratio of averages, <E>/<C>. The statistical error (or tolerance interval) of this ratio, is estimated by the "propagation of error" method (see wiki) for the known or estimated values of the corresponding standard deviations.
  • asked a question related to GEANT4
Question
3 answers
Dear all,
I tried to figure out what Geant4 does to simulate the generation of delta electrons when an energetic ion passes through matter. However, I did not really get it.
Is there someone who has some experience with the delta electron generation in Geant4?
Thank you very much!
Relevant answer
Answer
Dear Guenter,
Why not to ask GEANT4 authors? Why not to look at the code source? Why not to spend some time in a library, reading old (before the *.html invention) textbooks about passage of charged particles through a matter?
  • asked a question related to GEANT4
Question
3 answers
If some example is there similar to this, which  i can refer that will be great.
Relevant answer
Answer
you can set  up two sources at most,for example a neutron sources and a proton source .Besides, you can set up a source with different energy,such as a neutron source that can emission neutron from 1Mev to 14MEv.
for more details you could read the user'sguaid and it can help you a lot 
  • asked a question related to GEANT4
Question
6 answers
52
especially in Geant4 MPI
Relevant answer
Answer
Although you mention Gean4, you haven't really described which results you're trying to merge.  Such merging obviously may depend on physics, rather than the trivial advice to use gather/reduce.  Mostly, it's not really clear what you have done, and want to do.  My impression is that Gean4 has reasonable MPI support built in:
so are you already using G4MPImanager/G4MPIsession ?
  • asked a question related to GEANT4
Question
4 answers
 I need to know the number of residual nuclide in 50 different energies. Is there any way to execute a  GEANT4 program for 50 different energies?
Relevant answer
Answer
55
It is not a clear question, but i can give the following answers:
1- If you want to have results from each energy separately, you need to execute your program separately for 50 energies.!
2- If you want to execute your program for 50 different energies simultaneously, you can define more than one energy in the primary generator action class (it is easier to use GPS class for defining the source). Then, the results from different energies are mixed together. It means that the results are due to particles emitted with different 50 energies.
3- Probably the parallel examples in Geant4 examples help you (examples/extended/parallel)
  • asked a question related to GEANT4
Question
1 answer
51
It seems that the MPI example in Geant4.10.0 is problematic.
Relevant answer
Answer
I would need more information.  You can also search GEANT4 Hypernews for a possible answer.  I have definitely used G4 (version 4) in multi-threaded mode on one machine, but not MPI.  For me, doing it required following the simpler (non-MPI) examples, but my guess is that you have already done this.
However, I will need to do this soon for an up-coming project.  Will keep you posted.
  • asked a question related to GEANT4
Question
4 answers
I Work on the design for medical imaging of the heart ( SPECT) monte carlo simulations( geant4 ) .
Relevant answer
Answer
For a PRISM P2000+P3000 scanner:
  • Number of projections: 120 (3 degrees apart)
  • Radius of rotation: 27 cm
  • Collimator type: parallel-hole
  • Collimator hole width: 0.34 cm
  • Collimator length: 5.84 cm
  • asked a question related to GEANT4
Question
2 answers
Is there are any examples which can give any help in dose calculation in scoring volume.
Relevant answer
Hello Gopalji,
There exist an example of Geant4 that shows you how to compute dose (B1). The reference is here:  http://geant4.web.cern.ch/geant4/UserDocumentation/Doxygen/examples_doc/html/ExampleB1.html
If you look into the detector response section, you'll see that they accumulate the total energy deposited (edep) into a scoring variable and then divide by the mass (which they call dose).  Now that is the standard definition of dose.
To accumulate the energy, you can use the simple function, aStep->GetTotalEnergyDeposit() in your stepping action. The mass is defined by your density you assigned for the material and the volume. 
Hopefully this help
Charles
  • asked a question related to GEANT4
Question
9 answers
A Geant4 application developed for the simulation of the 6-MV-photon mode of a Siemens Primus linac, and bench-marked with results obtained with EGSnrc/BEAMnrc code (a standard, well-validated code in radiotherapy), was adapted to study the performance of a single side silicon strip detector (SSSSD) for dosimetric measurements in radiotherapy based on Intensity Modulated Radiation Treatment (IMRT).
Relevant answer
A method to evaluate the dosimetric accuracy of volumetric modulated arc therapy (VMAT) treatment plans, generated with the MONACO™ (version 3.0) treatment planning system in realistic CT-data with an independent Geant4 based dose calculation algorithm is presented. Therefore a model of an Elekta Synergy linear accelerator treatment head with an MLCi2 multileaf collimator was implemented in Geant4. The time dependent linear accelerator components were modeled by importing either logfiles of an actual plan delivery or a DICOM-RT plan sequence. Absolute dose calibration, depending on a reference measurement, was applied. The MONACO as well as the Geant4 treatment head model was commissioned with lateral profiles and depth dose curves of square fields in water and with film measurements in inhomogeneous phantoms. A VMAT treatment plan for a patient with a thoracic tumor and a VMAT treatment plan of a patient, who received treatment in the thoracic spine region including metallic implants, were used for evaluation. MONACO, as well as Geant4, depth dose curves and lateral profiles of square fields had a mean local gamma (2%, 2mm) tolerance criteria agreement of more than 95% for all fields. Film measurements in inhomogeneous phantoms with a global gamma of (3%, 3mm) showed a pass rate above 95% in all voxels receiving more than 25% of the maximum dose. A dose-volume-histogram comparison of the VMAT patient treatment plans showed mean deviations between Geant4 and MONACO of -0.2% (first patient) and 2.0% (second patient) for the PTVs and (0.5±1.0)% and (1.4±1.1)% for the organs at risk in relation to the prescription dose. The presented method can be used to validate VMAT dose distributions generated by a large number of small segments in regions with high electron density gradients. The MONACO dose distributions showed good agreement with Geant4 and film measurements within the simulation and measurement errors. PMID:22921843
By the authors:- Fleckenstein, Jens; Jahnke, Lennart; Lohr, Frank; Wenz, Frederik; Hesser, Jürgen, 2013-02-01
  • asked a question related to GEANT4
Question
1 answer
I have constructed a calorimeter. I want to apply a uniform magnetic field along Z-direction to identify the different particles. How to do it?
Relevant answer
Answer
  • asked a question related to GEANT4
Question
1 answer
I have been trying to edit the example B2a to output its data in a ROOT format so that I can analyze it. Does anyone have a solution?
Relevant answer
Answer
Dear Mitchell,
I'm not sure I understand your question correctly. Are you going through the user documentation of GEANT4? Then, the easiest would be to hang in there, examples B4 and B5 save output in a root file (histograms and ntuples).
Hope that helps,
Tim
  • asked a question related to GEANT4
Question
1 answer
Dear all,
I am using QGSP_BERT_HP physics list in Geant4 simulation. When thermal neutron interacts with Boron-10. It does not produce 6 % reaction product of alpha (1.78 MeV) and lithium (1.01  MeV). Please can someone tell me why I am not getting the 6% reaction product using this physics list. How can I modify it to show that it also shows the above reaction product?
Relevant answer
Answer
Hi Manoi!
I do a simulation project with thermalized neutrons and B10 inside neutron converter.
I use QGSP_INCLXX_HP physics list and my version of G4 is  `geant4.10.00.p03`.
With this configuration I can confirm that everything is OK with B10. Look at the numbers:
Total 360406 neutrons interacted inelastically with B10(A=10,Z=5) atoms during the run. Out of them 23058 neutrons in reaction n+B10 -> Li + alpha(1.78) and  312670 neutrons in reaction n+B10 -> Li + alpha(1.47) + gamma(0.47). This gives 6.4% for your reaction of interest.
The rest of neutrons interact with B10 in reactions like these 
n+B10 -> (pnn) + 2*alpha + N*gamma
n+B10 ->n+B10 + N*gamma
  • asked a question related to GEANT4
Question
4 answers
Instead of event generator, is it possible in Geant4 that we can make a source of certain activity in our application? Moreover that source will have all its radioactive property. 
Relevant answer
Answer
Well .. this is the easy part of your problem. In pseudo-code I do something like the following fragment in the GeneratePrimaries method:
=== Code ===
r = random(); // equally distributed between 0 and 1
if (r > 0.5){ energy = 1.17*MeV;} else{energy = 1.33*MeV;}
particleGun->SetParticleEnergy(energy);
particleGun->GeneratePrimaryVertex(anEvent);
======
But: This is not the essential part of you problem, you could as well work with a single average energy 1.25 MeV (the linear absorption coefficient does not change much). The essential part is: How do you want to model your detector and how do you want to decide if there is damage?
  • asked a question related to GEANT4
Question
6 answers
Any informations or suggestions are welcome. 
Relevant answer
Answer
Dear Dr. Naima
If you want to detect neutrons (energy, number etc.) in some volume, you should add multifunctional detector with primitive scorers and appropriate filters in the module 'Geometry' and place it in logical volume of your body. Then derive it through Run and RunAcction. Also you can do it using macros. The best examples are  examples/extended/runAndEvent and /examples/extended/hadronic.
  • asked a question related to GEANT4
Question
8 answers
I have recently upgraded to GEANT4.10.01 and I realised that the Coulomb scattering is completely ignored even if I include it in my custom physics list. I double-checked the environmental variables are set as they should be. I tried the built in list QBBC as well. It is running with e- ionisation, MSC but still no sign of Coulomb scattering. I would appreciate it if anyone can throw me a few ideas.
Many thanks, Oznur
Relevant answer
Answer
But: *How* do you see that there is no coulomb scattering? Do you look at the process in in your sensitve detector or stepping action? I check it with
G4Track* track = aStep->GetTrack();
const G4VProcess *creatorProcess = track->GetCreatorProcess(); // may be 0
G4String creatorProcessName = "";
if (creatorProcess != 0){
    creatorProcessName = creatorProcess->GetProcessName();
   G4cout << "creator process is " << creatorProcessName << G4endl;
}
  • asked a question related to GEANT4
Question
2 answers
Please can anyone tell me how to change neutron source to a shower from gun particle in Basic B2 example of Geant4 simulation?
Relevant answer
Answer
But for gun/particle neutron it is not coming as shower instead it comes as single paricle
  • asked a question related to GEANT4
Question
3 answers
Please some one tell me how to generate Parallel neutron sources in Geant4 B2 examples?
Relevant answer
Answer
Dear Manoj Kumar
You keep on asking similar questions without any feedback to the people who make the effort to give an answer.
The tool Geant4 that you are trying to use is very elaborated and just takes time to get used to. Please take this time, read the documentation carefully and play (try out things) with the very well written examples.
Best regards,
  Patrik
  • asked a question related to GEANT4
Question
2 answers
Please some one tell me to how to integrate the geometry made in CADD tool to the Geant4 simulation?
Relevant answer
Answer
One possible way - if your CAD software supports it - is to export the geometry as a GDML (Geometry Description Markup Language) file, then import that into Geant4. Details on GDML are here:
Details about using it with Geant4 are in the GDML user manual, see around page 44.
Here is a talk by Joseph Perl (one of the authors of TOPAS mentioned in another post) where he shows how to convert CAD to GDML for importing into Geant4:
  • asked a question related to GEANT4
Question
6 answers
Please someone tell me why is there a difference in the path  length of alpha particle in Boron-10 using TRIM and SRIM than the Geant4 Simulation?
The path length of alpha particle with energy 1.47 MeV in Boron-10 is found to be 3.6 micron meters using TRIM and SRIM software.
But when I am simulating in Geant4 the path length is found to be 2.82 micron meter.
In Geant4.10.01 I am using Basic B2 example with QGSP_BERT_HP physics list. I am changing Target material to Boron-10 and particle to neutron.
The target material length is 1 micron meter and radius of target material is also 1 micrometer.I am finding that alpha 1.47 MeV is deposited in 2.82 micron meter of Boron-10 itself.
Why there is a difference in the path length?
Relevant answer
Answer
Dimitrios is right when stating that TRIM and GEANT use different methods: SRIM/TRIM applies the semi-empirical model of Ziegler, Biersack and Littmark, whereas GEANT is a Monte-Carlo toolkit using interaction cross-sections that are either directly measured or extrapolated. It is quite usual that the results of the two codes do not fully agree. Typical errors are 10% or even larger.
For your application, the stopping of low energy ions, SRIM/TRIM is usually more accurate than GEANT and less fault-prone. You find details about the SRIM implementation and comparisons to data in the SRIM Textbook by James Ziegler (see first link).
A third method to check your result is the NIST ASTAR webtool that simulates stopping of Alphas in various materials. Just follow the second link.
PS: It don't think you simulated neutrons in GEANT because then the mean range should be much larger than for Alpha-particles.
  • asked a question related to GEANT4
Question
1 answer
Please tell me how to model the Boron-10 (n,alpha) reaction (radiative capture) in Geant 4 simulation. Which physics process is to be used? Please tell me.
Relevant answer
Answer
Is there a point in the documentation that you found needing? You should contact the G4 support list anyway, the present forum is a bit general for such a specific question
  • asked a question related to GEANT4
Question
3 answers
Is is possible to change the geometry of the primary generator? I want to build a cylindrical  generator.
Relevant answer
Answer
That means i can can fix the position of different generator at different point inside the world volume, which will target to the  scoring volume?
  • asked a question related to GEANT4
Question
3 answers
Please help me I want geant4 codes for simulation of neutron detectors? 
Relevant answer
How much G4 experience do you have?  Fundamentally you just want a block of semi-conductor with the relevant physics in your physics list.
  • asked a question related to GEANT4
Question
11 answers
I also want to know why some of the extended examples of Geant4 are  unable to build. Is there something I am missing?
Relevant answer
Answer
There are Geant4 examples in which root files are generated. You can them browse them using ROOT.
Alternatively, you can simply generate data output from Geant4, and then do the analysis using ROOT.
  • asked a question related to GEANT4
Question
3 answers
I am trying to run geant4 simulation for novice 1 example. But I am gettting the error. I am not able to run the program. I have followed the following steps but still I am not getting it.
$ cd
$ mkdir geant4
$ cd geant4
$ cp -r /usr/local/geant4/examples/novice/N01 .
$ ls
$ cd N01
$ ls -l
$ less GNUmakefile
$ make
$ ~/geant4/bin/Linux-g++/exampleN01
After this steps it is showing error like this
GNUmakefile:17: ../../../config/binmake.gmk: No such file or directory
make: *** No rule to make target `../../../config/binmake.gmk'. Stop.
Relevant answer
Answer
You have to run cmake in Order to run the example. Geant has an extensive and well maintained documentation, but it's not click and run - so take your time.
$ cd examples/basic/
$ ls
B1 B2 B3 B4 B5 CMakeLists.txt GNUmakefile History README
$ mkdir B1-build
$ cd B1-build/
$ cmake ../B1
[..]
$ make
Scanning dependencies of target exampleB1
[..]
[100%] Built target exampleB1