Example microyz

Dear forum members,

I’m testing the standard example Geant4 - microyz

The following data is output to the yz.root file:
// fill ntuple including weighting
analysisManager->FillNtupleDColumn(0, radius/nm);
analysisManager->FillNtupleDColumn(2, nofHits);
analysisManager->FillNtupleDColumn(3, nbEdep);
analysisManager->FillNtupleDColumn(4, (epsilon/eV)/(chord/nm));
analysisManager->FillNtupleDColumn(5, (epsilon/mass)/gray);
analysisManager->FillNtupleDColumn(6, Einc/eV);

Some of the data I do not understand what they means?
radius/nm - is radius of the detector, nm
nofHits - ?
nbEdep - ?
(epsilon/eV)/(chord/nm)) - Linear energy, eV/nm
epsilon/eV - energy transmitted to the detector volume (5nm), eV ?
(epsilon/mass)/gray) - Dose, gray
Einc/eV - ?

I would be grateful for any help!

Hi Anatoly,

nofHits is the number of events per track
nbEdep is the number of events per shpere
epsilon is the energy deposited in the sphere
Einc is your primary energy

best,
Ioanna

Hello! Thanks for your answer.
In this example (microyz), the source is electrons (PrimaryGeneration):
->FindParticle(“e-”).

If I indicate photons as a source. It will be right? ->FindParticle(“gamma”).
Should I specify something else for the code to work correctly for photons?

I am confused by another line in the PhysicsList.cc file:
if (particleName == “e-”)
ph->RegisterProcess(new G4UserSpecialCuts(), particle());

Should “gamma” be specified here?

Thanks, sorry for stupid questions!

Hi! You can try using gammas. Make sure in the physics list the interactions of gammas are included. The example should then follow the secondaries created by the photon’s interactions.

Hello!
I want to cmake microyz, please?
‘’’
sarahabdelaziz@Sarahs-MacBook-Pro g4test % ls microyz
CMakeLists.txt History include microyz.cc microyz.out src
GNUmakefile README init_vis.mac microyz.in plot.C vis.mac
sarahabdelaziz@Sarahs-MacBook-Pro g4test % mkdir microyz-build
sarahabdelaziz@Sarahs-MacBook-Pro g4test % cd microyz-build
sarahabdelaziz@Sarahs-MacBook-Pro microyz-build % cmake …
CMake Warning:
Ignoring extra path from command line:

“…”
CMake Error: The source directory “/Users/sarahabdelaziz/g4test” does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
sarahabdelaziz@Sarahs-MacBook-Pro microyz-build % cmake …/microyz
– The C compiler identification is AppleClang 16.0.0.16000026
– The CXX compiler identification is AppleClang 16.0.0.16000026
– Detecting C compiler ABI info
– Detecting C compiler ABI info - done
– Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
– Detecting C compile features
– Detecting C compile features - done
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
– Detecting CXX compile features
– Detecting CXX compile features - done
– Found EXPAT: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/lib/libexpat.tbd (Required is at least version “2.6.1”)
– Performing Test CMAKE_HAVE_LIBC_PTHREAD
– Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
– Found Threads: TRUE
– Found XercesC: /opt/homebrew/lib/libxerces-c.dylib (found suitable version “3.2.5”, minimum required is “3.2.5”)
– Found OpenGL: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/System/Library/Frameworks/OpenGL.framework
– Found X11: /opt/homebrew/include
– Looking for XOpenDisplay in /opt/homebrew/lib/libX11.dylib;/opt/homebrew/lib/libXext.dylib
– Looking for XOpenDisplay in /opt/homebrew/lib/libX11.dylib;/opt/homebrew/lib/libXext.dylib - found
– Looking for gethostbyname
– Looking for gethostbyname - found
– Looking for connect
– Looking for connect - found
– Looking for remove
– Looking for remove - found
– Looking for shmat
– Looking for shmat - found
– Looking for IceConnectionNumber in ICE
– Looking for IceConnectionNumber in ICE - found
– Found XQuartzGL: /usr/X11R6/include
– Found Geant4: /usr/local/lib/cmake/Geant4/Geant4Config.cmake (found version “11.2.2”)
– Configuring done (1.4s)
CMake Error in CMakeLists.txt:
Imported target “Geant4::G4Tree” includes non-existent path

"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/include"

in its INTERFACE_INCLUDE_DIRECTORIES. Possible reasons include:

  • The path was deleted, renamed, or moved to another location.

  • An install or uninstall procedure did not complete successfully.

  • The installation package was faulty and references files it does not
    provide.

CMake Error in CMakeLists.txt:
Imported target “Geant4::G4Tree” includes non-existent path

"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/include"

in its INTERFACE_INCLUDE_DIRECTORIES. Possible reasons include:

  • The path was deleted, renamed, or moved to another location.

  • An install or uninstall procedure did not complete successfully.

  • The installation package was faulty and references files it does not
    provide.

– Generating done (0.0s)
CMake Generate step failed. Build files cannot be regenerated correctly.
sarahabdelaziz@Sarahs-MacBook-Pro microyz-build % cmake …/microyz
– Configuring done (0.2s)
‘’’
@bmorgan

@bmorgan
I try again to look to build directory of geant4 to see where is the problem? But this is what I find.

sarahabdelaziz@Sarahs-MacBook-Pro ~ % cd  Downloads/geant4-v11.2.2/build
sarahabdelaziz@Sarahs-MacBook-Pro build % make
make: /opt/homebrew/Cellar/cmake/3.30.3/bin/cmake: No such file or directory
make: *** [cmake_check_build_system] Error 1
sarahabdelaziz@Sarahs-MacBook-Pro build % cmake ..
CMake Warning at /opt/homebrew/share/cmake/Modules/Platform/Darwin-Initialize.cmake:311 (message):
  Ignoring CMAKE_OSX_SYSROOT value:

   /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk

  because the directory does not exist.
Call Stack (most recent call first):
  /opt/homebrew/share/cmake/Modules/CMakeSystemSpecificInitialize.cmake:34 (include)
  CMakeLists.txt:29 (project)


-- The C compiler identification is AppleClang 16.0.0.16000026
-- The CXX compiler identification is AppleClang 16.0.0.16000026
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - broken
CMake Error at /opt/homebrew/share/cmake/Modules/CMakeTestCCompiler.cmake:67 (message):
  The C compiler

    "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: '/Users/sarahabdelaziz/Downloads/geant4-v11.2.2/build/CMakeFiles/CMakeScratch/TryCompile-szBXD0'
    
    Run Build Command(s): /opt/homebrew/bin/cmake -E env VERBOSE=1 /usr/bin/make -f Makefile cmTC_ce7ed/fast
    /Applications/Xcode.app/Contents/Developer/usr/bin/make  -f CMakeFiles/cmTC_ce7ed.dir/build.make CMakeFiles/cmTC_ce7ed.dir/build
    Building C object CMakeFiles/cmTC_ce7ed.dir/testCCompiler.c.o
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc   -arch arm64 -mmacosx-version-min=15.0 -MD -MT CMakeFiles/cmTC_ce7ed.dir/testCCompiler.c.o -MF CMakeFiles/cmTC_ce7ed.dir/testCCompiler.c.o.d -o CMakeFiles/cmTC_ce7ed.dir/testCCompiler.c.o -c /Users/sarahabdelaziz/Downloads/geant4-v11.2.2/build/CMakeFiles/CMakeScratch/TryCompile-szBXD0/testCCompiler.c
    Linking C executable cmTC_ce7ed
    /opt/homebrew/bin/cmake -E cmake_link_script CMakeFiles/cmTC_ce7ed.dir/link.txt --verbose=1
    ld: library 'System' not found
    cc: error: linker command failed with exit code 1 (use -v to see invocation)
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc  -arch arm64 -mmacosx-version-min=15.0 -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTC_ce7ed.dir/testCCompiler.c.o -o cmTC_ce7ed
    make[1]: *** [cmTC_ce7ed] Error 1
    make: *** [cmTC_ce7ed/fast] Error 2
    
    

  

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:29 (project)


-- Configuring incomplete, errors occurred!
sarahabdelaziz@Sarahs-MacBook-Pro build % 

It is failed. Could you help me, please?

Please do not revive old threads, especially with questions that are completely unrelated. It’s absolutely fine, and preferred, that you start new threads.