Geant4 11 on cvmf


up to now I was using Geant4 10.7 …in particular, I was using the Geant4 on cvmf using the sources (that’s because if the simulation needs many time to run, I don’t need to use my computer…I run the simulation by ssh connection)

source /cvmfs/
source /cvmfs/

I was trying to add the scintillation to my simulation, but according to @weller Scintillation light - #38 by weller , the code works only by Geant4

I looked for Geant4 11 on cvmfs and I found the source
source /cvmfs/

but, as you can see in the print screen

THERE ISN’T the source for CMake
source /cvmfs/

then I found Geant411.00_cand01 having both the required sources

source /cvmfs/ 
source /cvmfs/

I tried to compile my simulation (that up to now I used on Geant4 10.7) by this version of Geant4 11.0_cand01 but it says that it can’t find g4analysis.hh that is required to save on root files

looking on the B5 example of the Geant4 11 I see that it use

#include "G4AnalysisManager.hh"

then I substituted

#include "g4analysis.hh"


``#include “G4AnalysisManager.hh”`

but it doesn’t work, because I get the error:

@bmorgan maybe, do you know other version of Geant4?

this should work:

G4RootAnalysisManager* analysisManager = G4RootAnalysisManager::Instance();

and apropriate include statements.

Thank you @weller
I substituted
auto analysisManager = G4Analysis::ManagerInstance("root");

G4RootAnalysisManager* analysisManager = G4RootAnalysisManager::Instance();

I don’t get errors during building and compilation, but when I run

  1. It doesn’t create the ROOT file

  2. I get this error and the simulation doesn’t continue

PS. Truly, the B5 example of Geant4 11.00 uses the line
auto analysisManager = G4Analysis::ManagerInstance("root");
as used in previous versions…

well, the error message in this case is quite specific, and luckily there is marvellous documentation for geant4 :slight_smile:

It’s a mistake that the *-setup.(c)sh scripts are missing for 11.0 in cvmfs. I’ll fix this in the next few days.

Hello @weller
in the documentation it uses
auto analysisManager = G4AnalysisManager::Instance();
that doesn’t work in my case…
anyway, I also tried to specify the .root extension

but I get the same error

Hello, regarding the mistake do you mean only about the missing scripts? Or the error about

is related to it too??? is it a problem of Geant4 11.0_cand??? would it work in Geant4 11 (i.e. no the cand version)?
What is the difference between Geant4 11 and Geant4 11.0_cand?

Hello, I see that the CMake file is now on the cvmf for Geant11…
but also using Gean4 11 I get the same errors as Geant4 11_cand

try building your code in a fresh directory (that is a nice feature of using cmake and a build directory), and check that your environment variables are not containing references to the wrong version.

did you set the filename, e.g. as in example B5?

not sure what error you mean, if it is related to the ManagerInstance:


Finally I can run on G4 11!

1 Like

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