Empty Histograms in Modified XrayFluorescence Example

Geant4 Version: 11.3.2
Operating System: Ubuntu
Compiler/Version: g++ 13.3.0
CMake Version: 3.28.3

Problem Statement:
I am using the Geant4 advanced example XrayFluo to simulate X-ray fluorescence, but output histograms h1, 5, 6, 8, and 9 are empty, even though the simulation appears to run normally and completes without runtime errors and populates histograms 2, 3, 4, and 7.

Steps to Reproduce:

  1. Build the XrayFluo example with the vis.mac and initInter.mac execution lines of XrayFluoSimulation.cc commented out (executing livermore.mac with the stock .cc file ran into batch interruptions at /addPhysics.
  2. Launch interactive mode and execute livermore.mac.
  3. After running the simulation, check the output histogram files (ROOT or text).

What I Have Tried:

  • Confirmed that physics setup commands are executed before initialization (the vis.mac and initInter.mac calls in XrayFluorSimulation.cc have been commented out; they were causing interruption errors when livermore.mac tried to add physics packages).
  • Verified that XrayFluoPhysicsList and related messengers are properly included and initialized.
  • Ran beamOn for various event counts and primary configurations.
  • Checked output analysis files in both single and multiple run settings.
  • Searched the code to confirm correct calls to G4AnalysisManager’s FillH1 and Write/CloseFile functions.
  • Reviewed Qt3D visualization, which appears normal and shows expected geometry.

Related Information:

  • The code builds and runs fine, but there is simply no data being recorded or histogrammed.
  • Using a completely clean build with no modifications, the executable still operates, and a visual (using Qt3D) can be produced, a beam can be run, and an event can be viewed. But, running livermore.mac fails at /phys/addPhysics emlivermore and would also fail at /cuts/setLowEdge.

Questions:

  • Are there known issues (or required fixes) affecting histogram output in the XrayFluo example when using the Livermore physics list?
  • What are the most likely causes for empty histograms in this example, despite apparently correct event and hit occurrence?
  • Are there debugging strategies or specific analysis manager calls in this example where failures are common (e.g., missed initialization or incorrect FillH1 placement)?

I would greatly appreciate advice on where to look next or suggested modifications.

Thank you in advance!


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