I have just installed geant4 and root using the “fink” program in my MAC OS X 10.5 laptop.
I have tested the examples from G4 and they work fine, and I am also able to visualize them. I have also tested root and it works fine on its own: when I type “root” I can plot canvas and all the rest without problems.
The problem comes when I compile my simulation, which is done in Geant4 but gives as output a root file with root trees inside.
Usually one has to set the environment variables: #export ROOTSYS=/Users/suarez/InstalledPrograms/root #export PATH=$ROOTSYS/bin:$PATH #export LD_LIBRARY_PATH=$ROOTSYS/lib:$LD_LIBRARY_PATH
and it should work… but it doesn’t.
I get errors on compilation of the kind:
src/PrimaryGeneratorAction.cc:34:19: error: TFile.h: No such file or directory
src/PrimaryGeneratorAction.cc:35:19: error: TTree.h: No such file or directory
src/PrimaryGeneratorAction.cc:36:20: error: TNamed.h: No such file or directory
src/PrimaryGeneratorAction.cc:37:17: error: TF1.h: No such file or directory
src/PrimaryGeneratorAction.cc:38:18: error: TH1F.h: No such file or directory
Like if the system would now know where to find this variables, or would not understand the environment variables that I had set before.
Any clues why is it so? In my linux compter it always worked.
When compiling with G4 code using ROOT classes, you must specify the -I$ROOTSYS/include in your include path.
We recommend using the following script in $ROOTSYS/bin to generate a string
that you can insert in your compiler directives, eg
It does work like this. Now I can run my code. The only issue is that it is terribly slow (compared with when I run it under my Linux machine). But I think that this is a completely different problem.