Problem with Root and Geant4


Please read tips for efficient and successful posting and posting code

Hi guys!!!
i’m learning how to run simulation into Geant4 but in my attempt, while bulding the application i got this error:

[  4%] Building CXX object CMakeFiles/emphaticSim.dir/emphaticSim.cc.o
In file included from /emph/app/ydeniz/EMPHATIC/DetectorSim/EMPHATICSim/emphaticSim.cc:3:0:
/emph/app/ydeniz/EMPHATIC/DetectorSim/EMPHATICSim/include/EMPHATICSimAnalysisManager.hh:6:19: fatal error: TTree.h: No such file or directory
 #include <TTree.h>

The cmake flags i’m using are:

cmake -DGeant4_DIR=.../lib64/Geant4-10.xxx  .../DetectorSim/EMPHATICSim  

I don’t know where it came from… I did not set up ROOT from source when installing it, and use the just binaries as suggested here instead (installation without make && cmake)

Any suggestion would be appreciated, thanks for your time guys :slight_smile:

i just attache the cmakelist of my application for more reference.
MYCMAKELIST.txt (2.9 KB)

ROOT Version: 6.22/02
Platform: SLF 7.8

Hi @DENIZ0499,
it seems that your application, EMPHATICSim, includes TTree.h in EMPHATICSimAnalysisManager.hh, but the compiler does not know where to find that header.

You can check whether or not the right -I include path flag is passed to the compiler by running a verbose build, e.g. with make VERBOSE=1.

Most probably, in the CMakeLists.txt corresponding to EMPHATICSimAnalysisManager.hh you need to add ${ROOT_INCLUDE_DIRS} as a target_include_directory (and make sure that ROOT is found during cmake configuration).

Geant4 does not seem to be in the picture.

Cheers,
Enrico

1 Like

Hey @eguiraud, i really appreciate it. i modified the CMakeList as you suggest, Just changing ${ROOT_INCLUDE_DIRS} by /path/to/root/include. I overcome this issue the reason was that Root was not install a the default location. Now i’m facing something different :slight_smile:

Best, Yael

1 Like

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