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/
In file included from /emph/app/ydeniz/EMPHATIC/DetectorSim/EMPHATICSim/
/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/  .../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.

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.


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.