After playing with an example successfully, you can understand the GEANT4 structure and then you can start producing your own examples. Trying to write a whole example is non-trivial. I strongly recommend you to pick an example closest to your case and start changing it to best represent your case. To compile and run an example, on your terminal application,
1 - you should go into the folder where the example lives
2 - Make a new folder called "build" in the example folder
3 - cd build
4 - now, inside the build folder type "cmake .."
5 - then, if it happily runs, type "make"
6 - If it compiles the example without error, and creates an executable, type "./example_name" using the name of the executable created for your particular example.
If it is not compiling and returning some error messages. Could you please tell us what exactly you are typing on command line and which error you are receiving as a result?
I'll be happy to help, but you'll need to be a bit more specific regarding the errors - cut and paste the text showing the problem and attach it here.
Did Geant4 itself compile and install successfully? If not, it is probably due to some missing library or headers. What Linux platform are you using? Ubuntu? Fedora?
If it is compiled/installed properly, then maybe you didn't run the environment variable setup script (geant4.sh) before trying to build/execute the examples.
After playing with an example successfully, you can understand the GEANT4 structure and then you can start producing your own examples. Trying to write a whole example is non-trivial. I strongly recommend you to pick an example closest to your case and start changing it to best represent your case. To compile and run an example, on your terminal application,
1 - you should go into the folder where the example lives
2 - Make a new folder called "build" in the example folder
3 - cd build
4 - now, inside the build folder type "cmake .."
5 - then, if it happily runs, type "make"
6 - If it compiles the example without error, and creates an executable, type "./example_name" using the name of the executable created for your particular example.
If it is not compiling and returning some error messages. Could you please tell us what exactly you are typing on command line and which error you are receiving as a result?
If you are novice in Geant4 I suggest you to use a easy available method, using virtual machine
The CNBG of Bordeaux (FR) provide free of charge and licensing to Geant4 users a Geant4 virtual machine, that is a set of files that can be used with a virtualization software
Containing the latest version of Geant4 with Scientific Linux as well as several utility packages (visualisation, analysis, development, ...) already installed in a fully operational environment for your system.
If you simulations are in the field of clinical scans in Emission Tomography, Transmission Tomography or Radiation Therapy, I recommend you to use GATE interface. This interface allows you to describe your simulation via scripts much easier than geant4 C++ code. Here is the webpage of GATE:
Sorry if this isn't much help, but I have put together a very easy to install (on any OS) GEANT4 package. There is a rudimentary example in there which is already working. And it is set up to make use of the GEANT4 python environment found within the source code. Which so far for me has been a great way to learn GEANT4.
In order to download and install it is only a few basic steps which can be found here:
After reading focused conversation on GEANT4, I get encouraged and would like to ask a question to all the experts and comanions.?
I am very new to GEANt. I successfully installed geant in my machine and infact I able to compile the given examples using ccmake .. command.
My task is to see the electron trajectory in the magnetic field. The field is in the x direction i.e. B_x= 0.0125T, the motion of the electron is in the z direction i.e. p_z= 1.76 keV/c.
I want to see the exact trajectory of the electron. and would like to know the value of the trajectory i.e. radius.
I will appreciate your valuable comments and suggestions to help me in this direction. I will more appreciate if the guidance be provided to me in steps.
If your code is crashing just after you run it then make sure first you have downloaded all the data files along with the examples and check for the file names in your basrc if the versions of all the data files are the same or not. If not then correct them and it will hopefully work.
1.Install synaptic with writing "sudo apt-get install synaptic" and inter your password,then open synaptic and search "SDK" in synaptic and install "SDK" .
2. Open your Ubuntu software center and search about "qtcreator" and install qtcreator, you can open some examples in Geant4 with qtcreator.