I wish to set up a Geant4 simulation that does the following. I want to have gamma rays, the number and energy of which I can specify and vary, strike a very thin layer of a high-Z material, such as a lead or a gold foil. For my output, I am interested in the following. First, I would like to have a visual display of the events. I want this visual display to feature a tracker-like detector that shows the tracks of the secondary particles produced by the gamma ray interactions with the thin layer of high-Z material. Second, I would like to have the energy and momentum (magnitude and azimuthal direction) of the secondary particles outputted into histograms that I can see in a .root file.
I first posted a question about this under the title Adding Secondary Particle Data Output and Root Histograms to Basic Example B2a, but have not received an answer yet. Example B2a has the setup I need, but has no data output for secondary particles produced in the simulation in the form of Root histograms. Extended Example->Electromagentic->TestEm1 has this type of output, but not setup I need.
Since then, I have tried the following. I copied the files HistoManager.hh and StackingAction.hh from /electromagnetic/TestEm1/include to B2/B2a/include. I then copied the files HistoManager.cc and StackingAction.cc from /electromagnetic/TestEm1/src to B2/B2a/src. I also copied the file plotHisto.C from electromagnetic/TestEm1 to B2/B2a. I then switched to my B2a-build directory, and executed the following commands that are needed after modifying the GEANT4 simulations:
‘’’
cmake -DCMAKE_PREFIX_PATH=/Users/jamesbowen/geant4-v11.0.0-install /Users/jamesbowen/B2/B2a
‘’’
‘’’
make-j4
‘’’
After this, I ran the simulation, and it worked. However, when I tried to create the histograms, this is what happened:
‘’’
Jamess-MBP:B2a jamesbowen$ root -l plotHisto.C
error: invalid version number in ‘-mmacosx-version-min=11.1’
root [0]
Processing plotHisto.C…
Error in TFile::TFile: file run1.root does not exist
[/usr/local/Cellar/root/6.10.08/lib/root/libCling.so] cling_runtime_internal_throwIfInvalidPointer (no debug info)
[] (no debug info)
[] (no debug info)
[] (no debug info)
[/usr/local/Cellar/root/6.10.08/lib/root/libCling.so] cling::IncrementalExecutor::runStaticInitializersOnce(cling::Transaction const&) (no debug info)
[/usr/local/Cellar/root/6.10.08/lib/root/libCling.so] cling::Interpreter::executeTransaction(cling::Transaction&) (no debug info)
[/usr/local/Cellar/root/6.10.08/lib/root/libCling.so] cling::IncrementalParser::commitTransaction(llvm::PointerIntPair<cling::Transaction*, 2u, cling::IncrementalParser::EParseResult, llvm::PointerLikeTypeTraitscling::Transaction*, llvm::PointerIntPairInfo<cling::Transaction*, 2u, llvm::PointerLikeTypeTraitscling::Transaction* > >&, bool) (no debug info)
[/usr/local/Cellar/root/6.10.08/lib/root/libCling.so] cling::IncrementalParser::Compile(llvm::StringRef, cling::CompilationOptions const&) (no debug info)
[/usr/local/Cellar/root/6.10.08/lib/root/libCling.so] cling::Interpreter::EvaluateInternal(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, cling::CompilationOptions, cling::Value*, cling::Transaction**, unsigned long) (no debug info)
[/usr/local/Cellar/root/6.10.08/lib/root/libCling.so] cling::Interpreter::process(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, cling::Value*, cling::Transaction**, bool) (no debug info)
[/usr/local/Cellar/root/6.10.08/lib/root/libCling.so] cling::MetaProcessor::readInputFromFile(llvm::StringRef, cling::Value*, unsigned long, bool) (no debug info)
[/usr/local/Cellar/root/6.10.08/lib/root/libCling.so] TCling::ProcessLine(char const*, TInterpreter::EErrorCode*) (no debug info)
[/usr/local/Cellar/root/6.10.08/lib/root/libCling.so] TCling::ProcessLineSynch(char const*, TInterpreter::EErrorCode*) (no debug info)
[/usr/local/Cellar/root/6.10.08/lib/root/libCore.so] TApplication::ExecuteFile(char const*, int*, bool) (no debug info)
[/usr/local/Cellar/root/6.10.08/lib/root/libRint.so] TRint::ProcessLineNr(char const*, char const*, int*) (no debug info)
[/usr/local/Cellar/root/6.10.08/lib/root/libRint.so] TRint::Run(bool) (no debug info)
[/usr/local/Cellar/root/6.10.08/bin/root.exe] main (no debug info)
[/usr/lib/system/libdyld.dylib] start (no debug info)
[] (no debug info)
libc++abi.dylib: terminating with uncaught exception of type cling::InvalidDerefException: Trying to dereference null pointer or trying to call routine taking non-null arguments
Jamess-MBP:B2a jamesbowen$
‘’’
It looks like no run1.root file was produced when I ran the simulation. I used the following command to run the simulation:
‘’’
Jamess-MBP:B2a jamesbowen$ ./exampleB2a run2.mac
‘’’
What have I missed? What else do I need to do to run produce the run1.root file so I can create the histograms?