QQQ punchthrough

This commit is contained in:
James Szalkie 2026-07-15 16:10:37 -04:00
parent 9f39dad3bd
commit f3882bc313
36 changed files with 5233 additions and 295 deletions

View File

@ -51,6 +51,7 @@
/run/verbose 1
/event/verbose 0
/tracking/verbose 0
/anasen/output/includeElectrons false
/run/initialize
/vis/filtering/trajectories/create/particleFilter
/vis/filtering/trajectories/particleFilter-0/add e-
@ -59,5 +60,5 @@
/vis/scene/notifyHandlers scene-0
/vis/filtering/trajectories/particleFilter-0/invert true
/vis/scene/notifyHandlers scene-0
/run/beamOn 100
/run/beamOn 1000
/vis/scene/notifyHandlers scene-0

Binary file not shown.

View File

@ -11,8 +11,12 @@ set(CMAKE_DEPENDS_DEPENDENCY_FILES
"/home/jamesszalkie/anasen/Armory/AnasenG4/src/ActionInitialization.cc" "CMakeFiles/AnasenG4.dir/src/ActionInitialization.cc.o" "gcc" "CMakeFiles/AnasenG4.dir/src/ActionInitialization.cc.o.d"
"/home/jamesszalkie/anasen/Armory/AnasenG4/src/BeamReactionSteppingAction.cc" "CMakeFiles/AnasenG4.dir/src/BeamReactionSteppingAction.cc.o" "gcc" "CMakeFiles/AnasenG4.dir/src/BeamReactionSteppingAction.cc.o.d"
"/home/jamesszalkie/anasen/Armory/AnasenG4/src/DetectorConstruction.cc" "CMakeFiles/AnasenG4.dir/src/DetectorConstruction.cc.o" "gcc" "CMakeFiles/AnasenG4.dir/src/DetectorConstruction.cc.o.d"
"/home/jamesszalkie/anasen/Armory/AnasenG4/src/DetectorSensitiveDetector.cc" "CMakeFiles/AnasenG4.dir/src/DetectorSensitiveDetector.cc.o" "gcc" "CMakeFiles/AnasenG4.dir/src/DetectorSensitiveDetector.cc.o.d"
"/home/jamesszalkie/anasen/Armory/AnasenG4/src/HitOutputManager.cc" "CMakeFiles/AnasenG4.dir/src/HitOutputManager.cc.o" "gcc" "CMakeFiles/AnasenG4.dir/src/HitOutputManager.cc.o.d"
"/home/jamesszalkie/anasen/Armory/AnasenG4/src/PrimaryGeneratorAction.cc" "CMakeFiles/AnasenG4.dir/src/PrimaryGeneratorAction.cc.o" "gcc" "CMakeFiles/AnasenG4.dir/src/PrimaryGeneratorAction.cc.o.d"
"/home/jamesszalkie/anasen/Armory/AnasenG4/src/ReactionGenerator.cc" "CMakeFiles/AnasenG4.dir/src/ReactionGenerator.cc.o" "gcc" "CMakeFiles/AnasenG4.dir/src/ReactionGenerator.cc.o.d"
"/home/jamesszalkie/anasen/Armory/AnasenG4/src/RunAction.cc" "CMakeFiles/AnasenG4.dir/src/RunAction.cc.o" "gcc" "CMakeFiles/AnasenG4.dir/src/RunAction.cc.o.d"
"/home/jamesszalkie/anasen/Armory/AnasenG4/src/WireTrackingManager.cc" "CMakeFiles/AnasenG4.dir/src/WireTrackingManager.cc.o" "gcc" "CMakeFiles/AnasenG4.dir/src/WireTrackingManager.cc.o.d"
"/home/jamesszalkie/anasen/Armory/AnasenG4/src/main.cc" "CMakeFiles/AnasenG4.dir/src/main.cc.o" "gcc" "CMakeFiles/AnasenG4.dir/src/main.cc.o.d"
)

View File

@ -97,10 +97,24 @@ CMakeFiles/AnasenG4.dir/src/ActionInitialization.cc.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/AnasenG4.dir/src/ActionInitialization.cc.s"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/jamesszalkie/anasen/Armory/AnasenG4/src/ActionInitialization.cc -o CMakeFiles/AnasenG4.dir/src/ActionInitialization.cc.s
CMakeFiles/AnasenG4.dir/src/RunAction.cc.o: CMakeFiles/AnasenG4.dir/flags.make
CMakeFiles/AnasenG4.dir/src/RunAction.cc.o: ../src/RunAction.cc
CMakeFiles/AnasenG4.dir/src/RunAction.cc.o: CMakeFiles/AnasenG4.dir/compiler_depend.ts
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_3) "Building CXX object CMakeFiles/AnasenG4.dir/src/RunAction.cc.o"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/AnasenG4.dir/src/RunAction.cc.o -MF CMakeFiles/AnasenG4.dir/src/RunAction.cc.o.d -o CMakeFiles/AnasenG4.dir/src/RunAction.cc.o -c /home/jamesszalkie/anasen/Armory/AnasenG4/src/RunAction.cc
CMakeFiles/AnasenG4.dir/src/RunAction.cc.i: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/AnasenG4.dir/src/RunAction.cc.i"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/jamesszalkie/anasen/Armory/AnasenG4/src/RunAction.cc > CMakeFiles/AnasenG4.dir/src/RunAction.cc.i
CMakeFiles/AnasenG4.dir/src/RunAction.cc.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/AnasenG4.dir/src/RunAction.cc.s"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/jamesszalkie/anasen/Armory/AnasenG4/src/RunAction.cc -o CMakeFiles/AnasenG4.dir/src/RunAction.cc.s
CMakeFiles/AnasenG4.dir/src/PrimaryGeneratorAction.cc.o: CMakeFiles/AnasenG4.dir/flags.make
CMakeFiles/AnasenG4.dir/src/PrimaryGeneratorAction.cc.o: ../src/PrimaryGeneratorAction.cc
CMakeFiles/AnasenG4.dir/src/PrimaryGeneratorAction.cc.o: CMakeFiles/AnasenG4.dir/compiler_depend.ts
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_3) "Building CXX object CMakeFiles/AnasenG4.dir/src/PrimaryGeneratorAction.cc.o"
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_4) "Building CXX object CMakeFiles/AnasenG4.dir/src/PrimaryGeneratorAction.cc.o"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/AnasenG4.dir/src/PrimaryGeneratorAction.cc.o -MF CMakeFiles/AnasenG4.dir/src/PrimaryGeneratorAction.cc.o.d -o CMakeFiles/AnasenG4.dir/src/PrimaryGeneratorAction.cc.o -c /home/jamesszalkie/anasen/Armory/AnasenG4/src/PrimaryGeneratorAction.cc
CMakeFiles/AnasenG4.dir/src/PrimaryGeneratorAction.cc.i: cmake_force
@ -114,7 +128,7 @@ CMakeFiles/AnasenG4.dir/src/PrimaryGeneratorAction.cc.s: cmake_force
CMakeFiles/AnasenG4.dir/src/BeamReactionSteppingAction.cc.o: CMakeFiles/AnasenG4.dir/flags.make
CMakeFiles/AnasenG4.dir/src/BeamReactionSteppingAction.cc.o: ../src/BeamReactionSteppingAction.cc
CMakeFiles/AnasenG4.dir/src/BeamReactionSteppingAction.cc.o: CMakeFiles/AnasenG4.dir/compiler_depend.ts
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_4) "Building CXX object CMakeFiles/AnasenG4.dir/src/BeamReactionSteppingAction.cc.o"
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_5) "Building CXX object CMakeFiles/AnasenG4.dir/src/BeamReactionSteppingAction.cc.o"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/AnasenG4.dir/src/BeamReactionSteppingAction.cc.o -MF CMakeFiles/AnasenG4.dir/src/BeamReactionSteppingAction.cc.o.d -o CMakeFiles/AnasenG4.dir/src/BeamReactionSteppingAction.cc.o -c /home/jamesszalkie/anasen/Armory/AnasenG4/src/BeamReactionSteppingAction.cc
CMakeFiles/AnasenG4.dir/src/BeamReactionSteppingAction.cc.i: cmake_force
@ -125,10 +139,52 @@ CMakeFiles/AnasenG4.dir/src/BeamReactionSteppingAction.cc.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/AnasenG4.dir/src/BeamReactionSteppingAction.cc.s"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/jamesszalkie/anasen/Armory/AnasenG4/src/BeamReactionSteppingAction.cc -o CMakeFiles/AnasenG4.dir/src/BeamReactionSteppingAction.cc.s
CMakeFiles/AnasenG4.dir/src/DetectorSensitiveDetector.cc.o: CMakeFiles/AnasenG4.dir/flags.make
CMakeFiles/AnasenG4.dir/src/DetectorSensitiveDetector.cc.o: ../src/DetectorSensitiveDetector.cc
CMakeFiles/AnasenG4.dir/src/DetectorSensitiveDetector.cc.o: CMakeFiles/AnasenG4.dir/compiler_depend.ts
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_6) "Building CXX object CMakeFiles/AnasenG4.dir/src/DetectorSensitiveDetector.cc.o"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/AnasenG4.dir/src/DetectorSensitiveDetector.cc.o -MF CMakeFiles/AnasenG4.dir/src/DetectorSensitiveDetector.cc.o.d -o CMakeFiles/AnasenG4.dir/src/DetectorSensitiveDetector.cc.o -c /home/jamesszalkie/anasen/Armory/AnasenG4/src/DetectorSensitiveDetector.cc
CMakeFiles/AnasenG4.dir/src/DetectorSensitiveDetector.cc.i: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/AnasenG4.dir/src/DetectorSensitiveDetector.cc.i"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/jamesszalkie/anasen/Armory/AnasenG4/src/DetectorSensitiveDetector.cc > CMakeFiles/AnasenG4.dir/src/DetectorSensitiveDetector.cc.i
CMakeFiles/AnasenG4.dir/src/DetectorSensitiveDetector.cc.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/AnasenG4.dir/src/DetectorSensitiveDetector.cc.s"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/jamesszalkie/anasen/Armory/AnasenG4/src/DetectorSensitiveDetector.cc -o CMakeFiles/AnasenG4.dir/src/DetectorSensitiveDetector.cc.s
CMakeFiles/AnasenG4.dir/src/HitOutputManager.cc.o: CMakeFiles/AnasenG4.dir/flags.make
CMakeFiles/AnasenG4.dir/src/HitOutputManager.cc.o: ../src/HitOutputManager.cc
CMakeFiles/AnasenG4.dir/src/HitOutputManager.cc.o: CMakeFiles/AnasenG4.dir/compiler_depend.ts
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_7) "Building CXX object CMakeFiles/AnasenG4.dir/src/HitOutputManager.cc.o"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/AnasenG4.dir/src/HitOutputManager.cc.o -MF CMakeFiles/AnasenG4.dir/src/HitOutputManager.cc.o.d -o CMakeFiles/AnasenG4.dir/src/HitOutputManager.cc.o -c /home/jamesszalkie/anasen/Armory/AnasenG4/src/HitOutputManager.cc
CMakeFiles/AnasenG4.dir/src/HitOutputManager.cc.i: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/AnasenG4.dir/src/HitOutputManager.cc.i"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/jamesszalkie/anasen/Armory/AnasenG4/src/HitOutputManager.cc > CMakeFiles/AnasenG4.dir/src/HitOutputManager.cc.i
CMakeFiles/AnasenG4.dir/src/HitOutputManager.cc.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/AnasenG4.dir/src/HitOutputManager.cc.s"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/jamesszalkie/anasen/Armory/AnasenG4/src/HitOutputManager.cc -o CMakeFiles/AnasenG4.dir/src/HitOutputManager.cc.s
CMakeFiles/AnasenG4.dir/src/WireTrackingManager.cc.o: CMakeFiles/AnasenG4.dir/flags.make
CMakeFiles/AnasenG4.dir/src/WireTrackingManager.cc.o: ../src/WireTrackingManager.cc
CMakeFiles/AnasenG4.dir/src/WireTrackingManager.cc.o: CMakeFiles/AnasenG4.dir/compiler_depend.ts
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_8) "Building CXX object CMakeFiles/AnasenG4.dir/src/WireTrackingManager.cc.o"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/AnasenG4.dir/src/WireTrackingManager.cc.o -MF CMakeFiles/AnasenG4.dir/src/WireTrackingManager.cc.o.d -o CMakeFiles/AnasenG4.dir/src/WireTrackingManager.cc.o -c /home/jamesszalkie/anasen/Armory/AnasenG4/src/WireTrackingManager.cc
CMakeFiles/AnasenG4.dir/src/WireTrackingManager.cc.i: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/AnasenG4.dir/src/WireTrackingManager.cc.i"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/jamesszalkie/anasen/Armory/AnasenG4/src/WireTrackingManager.cc > CMakeFiles/AnasenG4.dir/src/WireTrackingManager.cc.i
CMakeFiles/AnasenG4.dir/src/WireTrackingManager.cc.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/AnasenG4.dir/src/WireTrackingManager.cc.s"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/jamesszalkie/anasen/Armory/AnasenG4/src/WireTrackingManager.cc -o CMakeFiles/AnasenG4.dir/src/WireTrackingManager.cc.s
CMakeFiles/AnasenG4.dir/src/ReactionGenerator.cc.o: CMakeFiles/AnasenG4.dir/flags.make
CMakeFiles/AnasenG4.dir/src/ReactionGenerator.cc.o: ../src/ReactionGenerator.cc
CMakeFiles/AnasenG4.dir/src/ReactionGenerator.cc.o: CMakeFiles/AnasenG4.dir/compiler_depend.ts
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_5) "Building CXX object CMakeFiles/AnasenG4.dir/src/ReactionGenerator.cc.o"
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_9) "Building CXX object CMakeFiles/AnasenG4.dir/src/ReactionGenerator.cc.o"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/AnasenG4.dir/src/ReactionGenerator.cc.o -MF CMakeFiles/AnasenG4.dir/src/ReactionGenerator.cc.o.d -o CMakeFiles/AnasenG4.dir/src/ReactionGenerator.cc.o -c /home/jamesszalkie/anasen/Armory/AnasenG4/src/ReactionGenerator.cc
CMakeFiles/AnasenG4.dir/src/ReactionGenerator.cc.i: cmake_force
@ -142,7 +198,7 @@ CMakeFiles/AnasenG4.dir/src/ReactionGenerator.cc.s: cmake_force
CMakeFiles/AnasenG4.dir/src/DetectorConstruction.cc.o: CMakeFiles/AnasenG4.dir/flags.make
CMakeFiles/AnasenG4.dir/src/DetectorConstruction.cc.o: ../src/DetectorConstruction.cc
CMakeFiles/AnasenG4.dir/src/DetectorConstruction.cc.o: CMakeFiles/AnasenG4.dir/compiler_depend.ts
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_6) "Building CXX object CMakeFiles/AnasenG4.dir/src/DetectorConstruction.cc.o"
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_10) "Building CXX object CMakeFiles/AnasenG4.dir/src/DetectorConstruction.cc.o"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/AnasenG4.dir/src/DetectorConstruction.cc.o -MF CMakeFiles/AnasenG4.dir/src/DetectorConstruction.cc.o.d -o CMakeFiles/AnasenG4.dir/src/DetectorConstruction.cc.o -c /home/jamesszalkie/anasen/Armory/AnasenG4/src/DetectorConstruction.cc
CMakeFiles/AnasenG4.dir/src/DetectorConstruction.cc.i: cmake_force
@ -157,8 +213,12 @@ CMakeFiles/AnasenG4.dir/src/DetectorConstruction.cc.s: cmake_force
AnasenG4_OBJECTS = \
"CMakeFiles/AnasenG4.dir/src/main.cc.o" \
"CMakeFiles/AnasenG4.dir/src/ActionInitialization.cc.o" \
"CMakeFiles/AnasenG4.dir/src/RunAction.cc.o" \
"CMakeFiles/AnasenG4.dir/src/PrimaryGeneratorAction.cc.o" \
"CMakeFiles/AnasenG4.dir/src/BeamReactionSteppingAction.cc.o" \
"CMakeFiles/AnasenG4.dir/src/DetectorSensitiveDetector.cc.o" \
"CMakeFiles/AnasenG4.dir/src/HitOutputManager.cc.o" \
"CMakeFiles/AnasenG4.dir/src/WireTrackingManager.cc.o" \
"CMakeFiles/AnasenG4.dir/src/ReactionGenerator.cc.o" \
"CMakeFiles/AnasenG4.dir/src/DetectorConstruction.cc.o"
@ -167,8 +227,12 @@ AnasenG4_EXTERNAL_OBJECTS =
AnasenG4: CMakeFiles/AnasenG4.dir/src/main.cc.o
AnasenG4: CMakeFiles/AnasenG4.dir/src/ActionInitialization.cc.o
AnasenG4: CMakeFiles/AnasenG4.dir/src/RunAction.cc.o
AnasenG4: CMakeFiles/AnasenG4.dir/src/PrimaryGeneratorAction.cc.o
AnasenG4: CMakeFiles/AnasenG4.dir/src/BeamReactionSteppingAction.cc.o
AnasenG4: CMakeFiles/AnasenG4.dir/src/DetectorSensitiveDetector.cc.o
AnasenG4: CMakeFiles/AnasenG4.dir/src/HitOutputManager.cc.o
AnasenG4: CMakeFiles/AnasenG4.dir/src/WireTrackingManager.cc.o
AnasenG4: CMakeFiles/AnasenG4.dir/src/ReactionGenerator.cc.o
AnasenG4: CMakeFiles/AnasenG4.dir/src/DetectorConstruction.cc.o
AnasenG4: CMakeFiles/AnasenG4.dir/build.make
@ -209,7 +273,7 @@ AnasenG4: /home/jamesszalkie/geant4_installation/geant4-install/lib/libG4global.
AnasenG4: /home/jamesszalkie/geant4_installation/geant4-install/lib/libG4clhep.so
AnasenG4: /home/jamesszalkie/geant4_installation/geant4-install/lib/libG4ptl.so.2.3.3
AnasenG4: CMakeFiles/AnasenG4.dir/link.txt
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --bold --progress-dir=/home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_7) "Linking CXX executable AnasenG4"
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --bold --progress-dir=/home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_11) "Linking CXX executable AnasenG4"
$(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/AnasenG4.dir/link.txt --verbose=$(VERBOSE)
# Rule to build all files generated by this target.

View File

@ -7,10 +7,18 @@ file(REMOVE_RECURSE
"CMakeFiles/AnasenG4.dir/src/BeamReactionSteppingAction.cc.o.d"
"CMakeFiles/AnasenG4.dir/src/DetectorConstruction.cc.o"
"CMakeFiles/AnasenG4.dir/src/DetectorConstruction.cc.o.d"
"CMakeFiles/AnasenG4.dir/src/DetectorSensitiveDetector.cc.o"
"CMakeFiles/AnasenG4.dir/src/DetectorSensitiveDetector.cc.o.d"
"CMakeFiles/AnasenG4.dir/src/HitOutputManager.cc.o"
"CMakeFiles/AnasenG4.dir/src/HitOutputManager.cc.o.d"
"CMakeFiles/AnasenG4.dir/src/PrimaryGeneratorAction.cc.o"
"CMakeFiles/AnasenG4.dir/src/PrimaryGeneratorAction.cc.o.d"
"CMakeFiles/AnasenG4.dir/src/ReactionGenerator.cc.o"
"CMakeFiles/AnasenG4.dir/src/ReactionGenerator.cc.o.d"
"CMakeFiles/AnasenG4.dir/src/RunAction.cc.o"
"CMakeFiles/AnasenG4.dir/src/RunAction.cc.o.d"
"CMakeFiles/AnasenG4.dir/src/WireTrackingManager.cc.o"
"CMakeFiles/AnasenG4.dir/src/WireTrackingManager.cc.o.d"
"CMakeFiles/AnasenG4.dir/src/main.cc.o"
"CMakeFiles/AnasenG4.dir/src/main.cc.o.d"
)

View File

@ -2,7 +2,7 @@
# Generated by "Unix Makefiles" Generator, CMake Version 3.22
# compile CXX with /usr/bin/c++
CXX_DEFINES = -DG4LIB_BUILD_DLL -DG4UI_USE_QT -DG4VIS_USE -DG4VIS_USE_TOOLSSG_QT_GLES -DG4VIS_USE_TOOLSSG_QT_ZB -DG4VIS_USE_TOOLSSG_X11_GLES -DPTL_BUILD_DLL -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NO_DEBUG -DQT_WIDGETS_LIB
CXX_DEFINES = -DANASENG4_DATA_DIR=\"/home/jamesszalkie/anasen/Armory/AnasenG4\" -DG4LIB_BUILD_DLL -DG4UI_USE_QT -DG4VIS_USE -DG4VIS_USE_TOOLSSG_QT_GLES -DG4VIS_USE_TOOLSSG_QT_ZB -DG4VIS_USE_TOOLSSG_X11_GLES -DPTL_BUILD_DLL -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NO_DEBUG -DQT_WIDGETS_LIB
CXX_INCLUDES = -I/home/jamesszalkie/anasen/Armory/AnasenG4/include -I/home/jamesszalkie/anasen/Armory -isystem /home/jamesszalkie/geant4_installation/geant4-install/include/Geant4 -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -isystem /usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets

View File

@ -5,4 +5,8 @@ CMAKE_PROGRESS_4 = 4
CMAKE_PROGRESS_5 = 5
CMAKE_PROGRESS_6 = 6
CMAKE_PROGRESS_7 = 7
CMAKE_PROGRESS_8 = 8
CMAKE_PROGRESS_9 = 9
CMAKE_PROGRESS_10 = 10
CMAKE_PROGRESS_11 = 11

View File

@ -81,12 +81,12 @@ clean: CMakeFiles/AnasenG4.dir/clean
CMakeFiles/AnasenG4.dir/all:
$(MAKE) $(MAKESILENT) -f CMakeFiles/AnasenG4.dir/build.make CMakeFiles/AnasenG4.dir/depend
$(MAKE) $(MAKESILENT) -f CMakeFiles/AnasenG4.dir/build.make CMakeFiles/AnasenG4.dir/build
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir=/home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles --progress-num=1,2,3,4,5,6,7 "Built target AnasenG4"
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir=/home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles --progress-num=1,2,3,4,5,6,7,8,9,10,11 "Built target AnasenG4"
.PHONY : CMakeFiles/AnasenG4.dir/all
# Build rule for subdir invocation for target.
CMakeFiles/AnasenG4.dir/rule: cmake_check_build_system
$(CMAKE_COMMAND) -E cmake_progress_start /home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles 7
$(CMAKE_COMMAND) -E cmake_progress_start /home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles 11
$(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 CMakeFiles/AnasenG4.dir/all
$(CMAKE_COMMAND) -E cmake_progress_start /home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles 0
.PHONY : CMakeFiles/AnasenG4.dir/rule

View File

@ -201,6 +201,54 @@ src/DetectorConstruction.cc.s:
$(MAKE) $(MAKESILENT) -f CMakeFiles/AnasenG4.dir/build.make CMakeFiles/AnasenG4.dir/src/DetectorConstruction.cc.s
.PHONY : src/DetectorConstruction.cc.s
src/DetectorSensitiveDetector.o: src/DetectorSensitiveDetector.cc.o
.PHONY : src/DetectorSensitiveDetector.o
# target to build an object file
src/DetectorSensitiveDetector.cc.o:
$(MAKE) $(MAKESILENT) -f CMakeFiles/AnasenG4.dir/build.make CMakeFiles/AnasenG4.dir/src/DetectorSensitiveDetector.cc.o
.PHONY : src/DetectorSensitiveDetector.cc.o
src/DetectorSensitiveDetector.i: src/DetectorSensitiveDetector.cc.i
.PHONY : src/DetectorSensitiveDetector.i
# target to preprocess a source file
src/DetectorSensitiveDetector.cc.i:
$(MAKE) $(MAKESILENT) -f CMakeFiles/AnasenG4.dir/build.make CMakeFiles/AnasenG4.dir/src/DetectorSensitiveDetector.cc.i
.PHONY : src/DetectorSensitiveDetector.cc.i
src/DetectorSensitiveDetector.s: src/DetectorSensitiveDetector.cc.s
.PHONY : src/DetectorSensitiveDetector.s
# target to generate assembly for a file
src/DetectorSensitiveDetector.cc.s:
$(MAKE) $(MAKESILENT) -f CMakeFiles/AnasenG4.dir/build.make CMakeFiles/AnasenG4.dir/src/DetectorSensitiveDetector.cc.s
.PHONY : src/DetectorSensitiveDetector.cc.s
src/HitOutputManager.o: src/HitOutputManager.cc.o
.PHONY : src/HitOutputManager.o
# target to build an object file
src/HitOutputManager.cc.o:
$(MAKE) $(MAKESILENT) -f CMakeFiles/AnasenG4.dir/build.make CMakeFiles/AnasenG4.dir/src/HitOutputManager.cc.o
.PHONY : src/HitOutputManager.cc.o
src/HitOutputManager.i: src/HitOutputManager.cc.i
.PHONY : src/HitOutputManager.i
# target to preprocess a source file
src/HitOutputManager.cc.i:
$(MAKE) $(MAKESILENT) -f CMakeFiles/AnasenG4.dir/build.make CMakeFiles/AnasenG4.dir/src/HitOutputManager.cc.i
.PHONY : src/HitOutputManager.cc.i
src/HitOutputManager.s: src/HitOutputManager.cc.s
.PHONY : src/HitOutputManager.s
# target to generate assembly for a file
src/HitOutputManager.cc.s:
$(MAKE) $(MAKESILENT) -f CMakeFiles/AnasenG4.dir/build.make CMakeFiles/AnasenG4.dir/src/HitOutputManager.cc.s
.PHONY : src/HitOutputManager.cc.s
src/PrimaryGeneratorAction.o: src/PrimaryGeneratorAction.cc.o
.PHONY : src/PrimaryGeneratorAction.o
@ -249,6 +297,54 @@ src/ReactionGenerator.cc.s:
$(MAKE) $(MAKESILENT) -f CMakeFiles/AnasenG4.dir/build.make CMakeFiles/AnasenG4.dir/src/ReactionGenerator.cc.s
.PHONY : src/ReactionGenerator.cc.s
src/RunAction.o: src/RunAction.cc.o
.PHONY : src/RunAction.o
# target to build an object file
src/RunAction.cc.o:
$(MAKE) $(MAKESILENT) -f CMakeFiles/AnasenG4.dir/build.make CMakeFiles/AnasenG4.dir/src/RunAction.cc.o
.PHONY : src/RunAction.cc.o
src/RunAction.i: src/RunAction.cc.i
.PHONY : src/RunAction.i
# target to preprocess a source file
src/RunAction.cc.i:
$(MAKE) $(MAKESILENT) -f CMakeFiles/AnasenG4.dir/build.make CMakeFiles/AnasenG4.dir/src/RunAction.cc.i
.PHONY : src/RunAction.cc.i
src/RunAction.s: src/RunAction.cc.s
.PHONY : src/RunAction.s
# target to generate assembly for a file
src/RunAction.cc.s:
$(MAKE) $(MAKESILENT) -f CMakeFiles/AnasenG4.dir/build.make CMakeFiles/AnasenG4.dir/src/RunAction.cc.s
.PHONY : src/RunAction.cc.s
src/WireTrackingManager.o: src/WireTrackingManager.cc.o
.PHONY : src/WireTrackingManager.o
# target to build an object file
src/WireTrackingManager.cc.o:
$(MAKE) $(MAKESILENT) -f CMakeFiles/AnasenG4.dir/build.make CMakeFiles/AnasenG4.dir/src/WireTrackingManager.cc.o
.PHONY : src/WireTrackingManager.cc.o
src/WireTrackingManager.i: src/WireTrackingManager.cc.i
.PHONY : src/WireTrackingManager.i
# target to preprocess a source file
src/WireTrackingManager.cc.i:
$(MAKE) $(MAKESILENT) -f CMakeFiles/AnasenG4.dir/build.make CMakeFiles/AnasenG4.dir/src/WireTrackingManager.cc.i
.PHONY : src/WireTrackingManager.cc.i
src/WireTrackingManager.s: src/WireTrackingManager.cc.s
.PHONY : src/WireTrackingManager.s
# target to generate assembly for a file
src/WireTrackingManager.cc.s:
$(MAKE) $(MAKESILENT) -f CMakeFiles/AnasenG4.dir/build.make CMakeFiles/AnasenG4.dir/src/WireTrackingManager.cc.s
.PHONY : src/WireTrackingManager.cc.s
src/main.o: src/main.cc.o
.PHONY : src/main.o
@ -291,12 +387,24 @@ help:
@echo "... src/DetectorConstruction.o"
@echo "... src/DetectorConstruction.i"
@echo "... src/DetectorConstruction.s"
@echo "... src/DetectorSensitiveDetector.o"
@echo "... src/DetectorSensitiveDetector.i"
@echo "... src/DetectorSensitiveDetector.s"
@echo "... src/HitOutputManager.o"
@echo "... src/HitOutputManager.i"
@echo "... src/HitOutputManager.s"
@echo "... src/PrimaryGeneratorAction.o"
@echo "... src/PrimaryGeneratorAction.i"
@echo "... src/PrimaryGeneratorAction.s"
@echo "... src/ReactionGenerator.o"
@echo "... src/ReactionGenerator.i"
@echo "... src/ReactionGenerator.s"
@echo "... src/RunAction.o"
@echo "... src/RunAction.i"
@echo "... src/RunAction.s"
@echo "... src/WireTrackingManager.o"
@echo "... src/WireTrackingManager.i"
@echo "... src/WireTrackingManager.s"
@echo "... src/main.o"
@echo "... src/main.i"
@echo "... src/main.s"

View File

@ -3,18 +3,25 @@
#include "G4VUserDetectorConstruction.hh"
class G4LogicalVolume;
class DetectorConstruction : public G4VUserDetectorConstruction
{
public:
DetectorConstruction();
virtual ~DetectorConstruction();
virtual G4VPhysicalVolume* Construct();
virtual G4VPhysicalVolume* Construct() override;
virtual void ConstructSDandField() override;
G4LogicalVolume* GetScoringVolume() const { return fScoringVolume; }
private:
G4LogicalVolume* fScoringVolume;
G4LogicalVolume* fAnodeLogical;
G4LogicalVolume* fCathodeLogical;
G4LogicalVolume* fSX3Logical;
G4LogicalVolume* fQQQLogical;
};
#endif

View File

@ -0,0 +1,18 @@
#ifndef DetectorSensitiveDetector_h
#define DetectorSensitiveDetector_h 1
#include "G4VSensitiveDetector.hh"
class G4Step;
class G4TouchableHistory;
class DetectorSensitiveDetector : public G4VSensitiveDetector
{
public:
explicit DetectorSensitiveDetector(const G4String& name);
virtual ~DetectorSensitiveDetector();
virtual G4bool ProcessHits(G4Step* step, G4TouchableHistory* history) override;
};
#endif

View File

@ -0,0 +1,80 @@
#ifndef HitOutputManager_h
#define HitOutputManager_h 1
#include "G4ThreeVector.hh"
#include <fstream>
#include <string>
class TFile;
class TTree;
class TH1D;
class TH2D;
class HitOutputManager
{
public:
static HitOutputManager& Instance();
void Open();
void Close();
void SetIncludeElectrons(bool includeElectrons);
bool GetIncludeElectrons() const;
bool ShouldRecordParticle(const std::string& particleType) const;
void RecordHit(int eventId,
const std::string& particleType,
double kineticEnergy,
double energyDeposit,
const std::string& detectorType,
int detectorId,
int anodeId,
int cathodeId,
double anodeEnergy,
double cathodeEnergy,
double wireDeltaE,
const std::string& volumeName,
const G4ThreeVector& position,
const G4ThreeVector& vertexPosition);
private:
HitOutputManager();
~HitOutputManager();
HitOutputManager(const HitOutputManager&) = delete;
HitOutputManager& operator=(const HitOutputManager&) = delete;
void ResetBuffers();
TFile* fRootFile;
TTree* fTree;
std::ofstream fTextFile;
int fEventId;
int fDetectorId;
int fAnodeId;
int fCathodeId;
double fKineticEnergy;
double fEnergyDeposit;
double fAnodeEnergy;
double fCathodeEnergy;
double fWireDeltaE;
double fX;
double fY;
double fZ;
double fVertexX;
double fVertexY;
double fVertexZ;
char fParticleType[64];
char fDetectorType[32];
char fVolumeName[32];
TH1D* fKineticEnergyHist;
TH1D* fEnergyDepositHist;
TH1D* fWireDeltaEHist;
TH1D* fHitZHist;
TH1D* fVertexZHist;
TH1D* fDetectorIdHist;
TH2D* fHitXYHist;
TH2D* fVertexXYHist;
bool fIncludeElectrons;
};
#endif

View File

@ -0,0 +1,25 @@
#ifndef RunAction_h
#define RunAction_h 1
#include "G4UserRunAction.hh"
class G4Run;
class G4GenericMessenger;
class RunAction : public G4UserRunAction
{
public:
RunAction();
virtual ~RunAction();
virtual void BeginOfRunAction(const G4Run* run) override;
virtual void EndOfRunAction(const G4Run* run) override;
private:
void DefineCommands();
G4GenericMessenger* fMessenger;
bool fIncludeElectrons;
};
#endif

View File

@ -0,0 +1,45 @@
#ifndef WireTrackingManager_h
#define WireTrackingManager_h 1
#include "G4ThreeVector.hh"
#include <unordered_map>
class G4Step;
class G4Track;
class G4StepPoint;
struct WireCrossingInfo
{
int anodeId = -1;
int cathodeId = -1;
double anodeEnergy = 0.0;
double cathodeEnergy = 0.0;
double deltaE = 0.0;
bool sawAnode = false;
bool sawCathode = false;
};
class WireTrackingManager
{
public:
static WireTrackingManager& Instance();
void UpdateForStep(const G4Step* step);
bool GetInfo(int eventId, int trackId, WireCrossingInfo& info);
WireCrossingInfo InferFromTrackGeometry(const G4Track* track, const G4StepPoint* hitPoint);
private:
WireTrackingManager();
~WireTrackingManager();
WireTrackingManager(const WireTrackingManager&) = delete;
WireTrackingManager& operator=(const WireTrackingManager&) = delete;
void EnsureEvent(int eventId);
int fCurrentEventId;
std::unordered_map<int, WireCrossingInfo> fTrackInfo;
};
#endif

View File

@ -2,6 +2,7 @@
/run/verbose 1
/event/verbose 0
/tracking/verbose 0
/anasen/output/includeElectrons false
/run/initialize
/vis/filtering/trajectories/create/particleFilter
@ -9,4 +10,4 @@
/vis/filtering/trajectories/particleFilter-0/add e+
/vis/filtering/trajectories/particleFilter-0/invert true
/run/beamOn 100
/run/beamOn 1000

View File

@ -1,6 +1,7 @@
#include "ActionInitialization.hh"
#include "PrimaryGeneratorAction.hh"
#include "BeamReactionSteppingAction.hh"
#include "RunAction.hh"
ActionInitialization::ActionInitialization()
: G4VUserActionInitialization()
@ -10,6 +11,7 @@ ActionInitialization::~ActionInitialization() {}
void ActionInitialization::Build() const
{
SetUserAction(new RunAction());
SetUserAction(new PrimaryGeneratorAction());
SetUserAction(new BeamReactionSteppingAction());
}

View File

@ -1,6 +1,7 @@
#include "BeamReactionSteppingAction.hh"
#include "ReactionGenerator.hh"
#include "WireTrackingManager.hh"
#include "G4Step.hh"
#include "G4Track.hh"
@ -30,6 +31,8 @@ BeamReactionSteppingAction::~BeamReactionSteppingAction()
void BeamReactionSteppingAction::UserSteppingAction(const G4Step* step)
{
WireTrackingManager::Instance().UpdateForStep(step);
const G4Track* track = step->GetTrack();
if (track->GetTrackStatus() != fAlive) {
return;

View File

@ -1,6 +1,9 @@
#include "DetectorConstruction.hh"
#include "DetectorSensitiveDetector.hh"
#include "G4RunManager.hh"
#include "G4SDManager.hh"
#include "G4NistManager.hh"
#include "G4Box.hh"
#include "G4Tubs.hh"
@ -13,7 +16,11 @@
DetectorConstruction::DetectorConstruction()
: G4VUserDetectorConstruction(),
fScoringVolume(nullptr)
fScoringVolume(nullptr),
fAnodeLogical(nullptr),
fCathodeLogical(nullptr),
fSX3Logical(nullptr),
fQQQLogical(nullptr)
{}
DetectorConstruction::~DetectorConstruction()
@ -51,9 +58,7 @@ G4VPhysicalVolume* DetectorConstruction::Construct()
pressure);
HeGas->AddElement(nist->FindOrBuildElement("He"), 1);
G4Material* he = nist->FindOrBuildMaterial("G4_He");
const G4double targetRadius = 200.*mm;
const G4double targetRadius = 37.0*mm;
const G4double targetHalfLength = 175.*mm;
G4Tubs* solidTarget = new G4Tubs("Target", 0, targetRadius, targetHalfLength, 0, 360*deg);
G4LogicalVolume* logicTarget =
@ -93,6 +98,7 @@ G4VPhysicalVolume* DetectorConstruction::Construct()
G4Tubs* solidPC_A = new G4Tubs("PC_A", 0, .1*mm, wireALength/2., 0, 360*deg);
G4LogicalVolume* logicPC_A = new G4LogicalVolume(solidPC_A, al, "PC_A");
fAnodeLogical = logicPC_A;
for(int i = 0; i < nWire; i++){
G4double phi = 2 * CLHEP::pi / nWire * i + dAngle / 2.;
@ -111,6 +117,7 @@ G4VPhysicalVolume* DetectorConstruction::Construct()
G4Tubs* solidPC_C = new G4Tubs("PC_C", 0, .1*mm, wireCLength/2., 0, 360*deg);
G4LogicalVolume* logicPC_C = new G4LogicalVolume(solidPC_C, al, "PC_C");
fCathodeLogical = logicPC_C;
for(int i = 0; i < nWire; i++){
G4double phi = 2 * CLHEP::pi / nWire * i - dAngle/2.;
@ -131,6 +138,7 @@ G4VPhysicalVolume* DetectorConstruction::Construct()
G4Box* solidSX3 = new G4Box("SX3", 0.1*mm, sx3Width/2., sx3Length/2.);
G4LogicalVolume* logicSX3 = new G4LogicalVolume(solidSX3, al, "SX3");
fSX3Logical = logicSX3;
fScoringVolume = logicSX3;
for(int i = 0; i < nSX3; i++){
@ -150,6 +158,7 @@ G4VPhysicalVolume* DetectorConstruction::Construct()
const G4double qqqR2 = 100.*mm;
G4Tubs* solidQQQ = new G4Tubs("QQQ", qqqR1, qqqR2, 0.5*mm, 5*deg, 85*deg);
G4LogicalVolume* logicQQQ = new G4LogicalVolume(solidQQQ, al, "QQQ");
fQQQLogical = logicQQQ;
for(int i = 0; i < 4; i++){
G4ThreeVector pos(0, 0, 100.*mm);
@ -161,3 +170,16 @@ G4VPhysicalVolume* DetectorConstruction::Construct()
return physWorld;
}
void DetectorConstruction::ConstructSDandField()
{
auto* detectorSD = new DetectorSensitiveDetector("AnasenSensitiveDetector");
G4SDManager::GetSDMpointer()->AddNewDetector(detectorSD);
if (fSX3Logical != nullptr) {
SetSensitiveDetector(fSX3Logical, detectorSD);
}
if (fQQQLogical != nullptr) {
SetSensitiveDetector(fQQQLogical, detectorSD);
}
}

View File

@ -0,0 +1,99 @@
#include "DetectorSensitiveDetector.hh"
#include "HitOutputManager.hh"
#include "WireTrackingManager.hh"
#include "G4RunManager.hh"
#include "G4Step.hh"
#include "G4Track.hh"
#include "G4TouchableHistory.hh"
#include "G4VPhysicalVolume.hh"
#include "G4StepPoint.hh"
#include <string>
namespace {
std::string ClassifyDetectorType(const std::string& volumeName)
{
if (volumeName == "PC_A") {
return "Anode";
}
if (volumeName == "PC_C") {
return "Cathode";
}
if (volumeName == "QQQ") {
return "QQQ";
}
if (volumeName.rfind("SX3", 0) == 0) {
return "SX3";
}
return volumeName;
}
}
DetectorSensitiveDetector::DetectorSensitiveDetector(const G4String& name)
: G4VSensitiveDetector(name)
{}
DetectorSensitiveDetector::~DetectorSensitiveDetector() {}
G4bool DetectorSensitiveDetector::ProcessHits(G4Step* step, G4TouchableHistory*)
{
if (step == nullptr) {
return false;
}
G4StepPoint* preStepPoint = step->GetPreStepPoint();
if (preStepPoint == nullptr) {
return false;
}
G4VPhysicalVolume* volume = preStepPoint->GetPhysicalVolume();
if (volume == nullptr) {
return false;
}
const G4double kineticEnergy = preStepPoint->GetKineticEnergy();
const G4double energyDeposit = step->GetTotalEnergyDeposit();
if (kineticEnergy <= 0.0 && energyDeposit <= 0.0) {
return false;
}
const G4Event* currentEvent = G4RunManager::GetRunManager()->GetCurrentEvent();
if (currentEvent == nullptr) {
return false;
}
const std::string particleName = step->GetTrack()->GetParticleDefinition()->GetParticleName();
if (!HitOutputManager::Instance().ShouldRecordParticle(particleName)) {
return false;
}
const std::string volumeName = volume->GetName();
const std::string detectorType = ClassifyDetectorType(volumeName);
if (detectorType != "SX3" && detectorType != "QQQ") {
return false;
}
WireCrossingInfo wireInfo;
WireTrackingManager::Instance().GetInfo(currentEvent->GetEventID(), step->GetTrack()->GetTrackID(), wireInfo);
if (wireInfo.anodeId < 0 || wireInfo.cathodeId < 0) {
wireInfo = WireTrackingManager::Instance().InferFromTrackGeometry(step->GetTrack(), preStepPoint);
}
HitOutputManager::Instance().RecordHit(currentEvent->GetEventID(),
particleName,
kineticEnergy,
energyDeposit,
detectorType,
volume->GetCopyNo(),
wireInfo.anodeId,
wireInfo.cathodeId,
wireInfo.anodeEnergy,
wireInfo.cathodeEnergy,
wireInfo.deltaE,
volumeName,
preStepPoint->GetPosition(),
step->GetTrack()->GetVertexPosition());
return true;
}

View File

@ -0,0 +1,257 @@
#include "HitOutputManager.hh"
#include "TFile.h"
#include "TH1D.h"
#include "TH2D.h"
#include "TTree.h"
#include <cstring>
#include <iomanip>
namespace {
const char* kRootOutputName = ANASENG4_DATA_DIR "/hits.root";
const char* kTextOutputName = ANASENG4_DATA_DIR "/hits.txt";
}
HitOutputManager& HitOutputManager::Instance()
{
static HitOutputManager instance;
return instance;
}
HitOutputManager::HitOutputManager()
: fRootFile(nullptr),
fTree(nullptr),
fEventId(0),
fDetectorId(0),
fAnodeId(-1),
fCathodeId(-1),
fKineticEnergy(0.0),
fEnergyDeposit(0.0),
fAnodeEnergy(0.0),
fCathodeEnergy(0.0),
fWireDeltaE(0.0),
fX(0.0),
fY(0.0),
fZ(0.0),
fVertexX(0.0),
fVertexY(0.0),
fVertexZ(0.0),
fKineticEnergyHist(nullptr),
fEnergyDepositHist(nullptr),
fWireDeltaEHist(nullptr),
fHitZHist(nullptr),
fVertexZHist(nullptr),
fDetectorIdHist(nullptr),
fHitXYHist(nullptr),
fVertexXYHist(nullptr),
fIncludeElectrons(true)
{
ResetBuffers();
}
HitOutputManager::~HitOutputManager()
{
Close();
}
void HitOutputManager::Open()
{
Close();
fRootFile = TFile::Open(kRootOutputName, "RECREATE");
fTree = new TTree("hits", "Sensitive detector hits");
fTree->Branch("eventID", &fEventId, "eventID/I");
fTree->Branch("particleType", fParticleType, "particleType/C");
fTree->Branch("kineticEnergy", &fKineticEnergy, "kineticEnergy/D");
fTree->Branch("energyDeposit", &fEnergyDeposit, "energyDeposit/D");
fTree->Branch("detectorType", fDetectorType, "detectorType/C");
fTree->Branch("detectorID", &fDetectorId, "detectorID/I");
fTree->Branch("anodeID", &fAnodeId, "anodeID/I");
fTree->Branch("cathodeID", &fCathodeId, "cathodeID/I");
fTree->Branch("anodeEnergy", &fAnodeEnergy, "anodeEnergy/D");
fTree->Branch("cathodeEnergy", &fCathodeEnergy, "cathodeEnergy/D");
fTree->Branch("wireDeltaE", &fWireDeltaE, "wireDeltaE/D");
fTree->Branch("volumeName", fVolumeName, "volumeName/C");
fTree->Branch("x", &fX, "x/D");
fTree->Branch("y", &fY, "y/D");
fTree->Branch("z", &fZ, "z/D");
fTree->Branch("vertexX", &fVertexX, "vertexX/D");
fTree->Branch("vertexY", &fVertexY, "vertexY/D");
fTree->Branch("vertexZ", &fVertexZ, "vertexZ/D");
fKineticEnergyHist = new TH1D("hKineticEnergy", "Hit kinetic energy;Kinetic energy [MeV];Counts", 200, 0.0, 200.0);
fEnergyDepositHist = new TH1D("hEnergyDeposit", "Step energy deposit;Energy deposit [MeV];Counts", 200, 0.0, 50.0);
fWireDeltaEHist = new TH1D("hWireDeltaE", "Energy loss between anode and cathode crossings;#DeltaE [MeV];Counts", 200, 0.0, 20.0);
fHitZHist = new TH1D("hHitZ", "Hit z position;z [mm];Counts", 200, -200.0, 200.0);
fVertexZHist = new TH1D("hVertexZ", "Track vertex z position;z_{vertex} [mm];Counts", 200, -250.0, 250.0);
fDetectorIdHist = new TH1D("hDetectorID", "Detector ID occupancy;Detector ID;Counts", 64, -0.5, 63.5);
fHitXYHist = new TH2D("hHitXY", "Hit position;x [mm];y [mm]", 200, -200.0, 200.0, 200, -200.0, 200.0);
fVertexXYHist = new TH2D("hVertexXY", "Track vertex position;x_{vertex} [mm];y_{vertex} [mm]", 200, -200.0, 200.0, 200, -200.0, 200.0);
fTextFile.open(kTextOutputName, std::ios::out | std::ios::trunc);
fTextFile << "eventID,particleType,kineticEnergy,energyDeposit,detectorType,detectorID,anodeID,cathodeID,anodeEnergy,cathodeEnergy,wireDeltaE,volumeName,x,y,z,vertexX,vertexY,vertexZ\n";
}
void HitOutputManager::Close()
{
if (fRootFile != nullptr) {
fRootFile->cd();
if (fTree != nullptr) {
fTree->Write("", TObject::kOverwrite);
}
if (fKineticEnergyHist != nullptr) {
fKineticEnergyHist->Write("", TObject::kOverwrite);
}
if (fEnergyDepositHist != nullptr) {
fEnergyDepositHist->Write("", TObject::kOverwrite);
}
if (fWireDeltaEHist != nullptr) {
fWireDeltaEHist->Write("", TObject::kOverwrite);
}
if (fHitZHist != nullptr) {
fHitZHist->Write("", TObject::kOverwrite);
}
if (fVertexZHist != nullptr) {
fVertexZHist->Write("", TObject::kOverwrite);
}
if (fDetectorIdHist != nullptr) {
fDetectorIdHist->Write("", TObject::kOverwrite);
}
if (fHitXYHist != nullptr) {
fHitXYHist->Write("", TObject::kOverwrite);
}
if (fVertexXYHist != nullptr) {
fVertexXYHist->Write("", TObject::kOverwrite);
}
fRootFile->Close();
delete fRootFile;
fRootFile = nullptr;
fTree = nullptr;
fKineticEnergyHist = nullptr;
fEnergyDepositHist = nullptr;
fWireDeltaEHist = nullptr;
fHitZHist = nullptr;
fVertexZHist = nullptr;
fDetectorIdHist = nullptr;
fHitXYHist = nullptr;
fVertexXYHist = nullptr;
}
if (fTextFile.is_open()) {
fTextFile.close();
}
}
void HitOutputManager::SetIncludeElectrons(bool includeElectrons)
{
fIncludeElectrons = includeElectrons;
}
bool HitOutputManager::GetIncludeElectrons() const
{
return fIncludeElectrons;
}
bool HitOutputManager::ShouldRecordParticle(const std::string& particleType) const
{
if (fIncludeElectrons) {
return true;
}
return particleType != "e-" && particleType != "e+";
}
void HitOutputManager::RecordHit(int eventId,
const std::string& particleType,
double kineticEnergy,
double energyDeposit,
const std::string& detectorType,
int detectorId,
int anodeId,
int cathodeId,
double anodeEnergy,
double cathodeEnergy,
double wireDeltaE,
const std::string& volumeName,
const G4ThreeVector& position,
const G4ThreeVector& vertexPosition)
{
if (fRootFile == nullptr || fTree == nullptr || !fTextFile.is_open()) {
return;
}
ResetBuffers();
fEventId = eventId;
fDetectorId = detectorId;
fAnodeId = anodeId;
fCathodeId = cathodeId;
fKineticEnergy = kineticEnergy;
fEnergyDeposit = energyDeposit;
fAnodeEnergy = anodeEnergy;
fCathodeEnergy = cathodeEnergy;
fWireDeltaE = wireDeltaE;
fX = position.x();
fY = position.y();
fZ = position.z();
fVertexX = vertexPosition.x();
fVertexY = vertexPosition.y();
fVertexZ = vertexPosition.z();
std::strncpy(fParticleType, particleType.c_str(), sizeof(fParticleType) - 1);
std::strncpy(fDetectorType, detectorType.c_str(), sizeof(fDetectorType) - 1);
std::strncpy(fVolumeName, volumeName.c_str(), sizeof(fVolumeName) - 1);
fTree->Fill();
if (fKineticEnergyHist != nullptr) {
fKineticEnergyHist->Fill(fKineticEnergy);
}
if (fEnergyDepositHist != nullptr) {
fEnergyDepositHist->Fill(fEnergyDeposit);
}
if (fWireDeltaEHist != nullptr && fAnodeId >= 0 && fCathodeId >= 0) {
fWireDeltaEHist->Fill(fWireDeltaE);
}
if (fHitZHist != nullptr) {
fHitZHist->Fill(fZ);
}
if (fVertexZHist != nullptr) {
fVertexZHist->Fill(fVertexZ);
}
if (fDetectorIdHist != nullptr) {
fDetectorIdHist->Fill(fDetectorId);
}
if (fHitXYHist != nullptr) {
fHitXYHist->Fill(fX, fY);
}
if (fVertexXYHist != nullptr) {
fVertexXYHist->Fill(fVertexX, fVertexY);
}
fTextFile << fEventId << ','
<< fParticleType << ','
<< std::setprecision(12) << fKineticEnergy << ','
<< fEnergyDeposit << ','
<< fDetectorType << ','
<< fDetectorId << ','
<< fAnodeId << ','
<< fCathodeId << ','
<< fAnodeEnergy << ','
<< fCathodeEnergy << ','
<< fWireDeltaE << ','
<< fVolumeName << ','
<< fX << ','
<< fY << ','
<< fZ << ','
<< fVertexX << ','
<< fVertexY << ','
<< fVertexZ << '\n';
}
void HitOutputManager::ResetBuffers()
{
fParticleType[0] = '\0';
fDetectorType[0] = '\0';
fVolumeName[0] = '\0';
}

View File

@ -22,7 +22,7 @@ PrimaryGeneratorAction::PrimaryGeneratorAction()
fParticleGun = new G4ParticleGun(nParticle);
fParticleGun->SetParticleDefinition(G4Proton::ProtonDefinition());
fParticleGun->SetParticleMomentumDirection(G4ThreeVector(0., 0., 1.));
fParticleGun->SetParticleEnergy(27.0 * fBeamEnergyPerU);
fParticleGun->SetParticleEnergy(2.6 * fBeamEnergyPerU);
}
PrimaryGeneratorAction::~PrimaryGeneratorAction()
@ -45,6 +45,6 @@ void PrimaryGeneratorAction::GeneratePrimaries(G4Event* event)
fParticleGun->SetParticlePosition(G4ThreeVector(x, y, z));
fParticleGun->SetParticleMomentumDirection(G4ThreeVector(0., 0., 1.));
fParticleGun->SetParticleEnergy(27.0 * fBeamEnergyPerU);
fParticleGun->SetParticleEnergy(2.6 * fBeamEnergyPerU);
fParticleGun->GeneratePrimaryVertex(event);
}

View File

@ -0,0 +1,40 @@
#include "RunAction.hh"
#include "HitOutputManager.hh"
#include "G4GenericMessenger.hh"
RunAction::RunAction()
: G4UserRunAction(),
fMessenger(nullptr),
fIncludeElectrons(false)
{
DefineCommands();
}
RunAction::~RunAction()
{
delete fMessenger;
}
void RunAction::DefineCommands()
{
fMessenger = new G4GenericMessenger(this, "/anasen/output/", "ANASEN output controls");
auto& includeElectronsCmd =
fMessenger->DeclareProperty("includeElectrons",
fIncludeElectrons,
"Enable or disable recording electron and positron hits.");
includeElectronsCmd.SetParameterName("includeElectrons", false);
includeElectronsCmd.SetDefaultValue("false");
}
void RunAction::BeginOfRunAction(const G4Run*)
{
HitOutputManager::Instance().SetIncludeElectrons(fIncludeElectrons);
HitOutputManager::Instance().Open();
}
void RunAction::EndOfRunAction(const G4Run*)
{
HitOutputManager::Instance().Close();
}

View File

@ -0,0 +1,205 @@
#include "WireTrackingManager.hh"
#include "ClassPW.h"
#include "G4Event.hh"
#include "G4RunManager.hh"
#include "G4Step.hh"
#include "G4StepPoint.hh"
#include "G4Track.hh"
#include "G4SystemOfUnits.hh"
#include <algorithm>
#include <cmath>
namespace {
constexpr double kAnodeRadius = 37.0 * mm;
constexpr double kCathodeRadius = 43.0 * mm;
bool CrossesRadius(double preR, double postR, double targetR)
{
return (preR - targetR) * (postR - targetR) <= 0.0 && std::abs(postR - preR) > 1e-12;
}
TVector3 ToTVector3(const G4ThreeVector& value)
{
return TVector3(value.x(), value.y(), value.z());
}
bool SolveRadiusIntersection(const G4ThreeVector& origin,
const G4ThreeVector& direction,
double radius,
double& distance)
{
const double a = direction.x() * direction.x() + direction.y() * direction.y();
if (a <= 0.0) {
return false;
}
const double b = 2.0 * (origin.x() * direction.x() + origin.y() * direction.y());
const double c = origin.x() * origin.x() + origin.y() * origin.y() - radius * radius;
const double discriminant = b * b - 4.0 * a * c;
if (discriminant < 0.0) {
return false;
}
const double sqrtDiscriminant = std::sqrt(discriminant);
const double t1 = (-b - sqrtDiscriminant) / (2.0 * a);
const double t2 = (-b + sqrtDiscriminant) / (2.0 * a);
distance = -1.0;
if (t1 >= 0.0 && t2 >= 0.0) {
distance = std::min(t1, t2);
} else if (t1 >= 0.0) {
distance = t1;
} else if (t2 >= 0.0) {
distance = t2;
}
return distance >= 0.0;
}
}
WireTrackingManager& WireTrackingManager::Instance()
{
static WireTrackingManager instance;
return instance;
}
WireTrackingManager::WireTrackingManager()
: fCurrentEventId(-1)
{}
WireTrackingManager::~WireTrackingManager() {}
void WireTrackingManager::EnsureEvent(int eventId)
{
if (eventId != fCurrentEventId) {
fCurrentEventId = eventId;
fTrackInfo.clear();
}
}
void WireTrackingManager::UpdateForStep(const G4Step* step)
{
if (step == nullptr) {
return;
}
const G4Track* track = step->GetTrack();
if (track == nullptr) {
return;
}
const G4Event* event = G4RunManager::GetRunManager()->GetCurrentEvent();
if (event == nullptr) {
return;
}
EnsureEvent(event->GetEventID());
const G4StepPoint* prePoint = step->GetPreStepPoint();
const G4StepPoint* postPoint = step->GetPostStepPoint();
if (prePoint == nullptr || postPoint == nullptr) {
return;
}
if (prePoint->GetPhysicalVolume() == nullptr || prePoint->GetPhysicalVolume()->GetName() != "Target") {
return;
}
if (track->GetDefinition()->GetParticleType() == "nucleus") {
return;
}
const G4ThreeVector& prePos = prePoint->GetPosition();
const G4ThreeVector& postPos = postPoint->GetPosition();
const double preR = prePos.perp();
const double postR = postPos.perp();
if (!CrossesRadius(preR, postR, kAnodeRadius) && !CrossesRadius(preR, postR, kCathodeRadius)) {
return;
}
PW pw;
pw.ConstructGeo();
pw.FindWireID(ToTVector3(track->GetVertexPosition()), ToTVector3(track->GetMomentumDirection()), false);
auto& info = fTrackInfo[track->GetTrackID()];
auto interpolateEnergy = [&](double targetR) {
const double fraction = (targetR - preR) / (postR - preR);
return prePoint->GetKineticEnergy() + fraction * (postPoint->GetKineticEnergy() - prePoint->GetKineticEnergy());
};
if (!info.sawAnode && CrossesRadius(preR, postR, kAnodeRadius)) {
info.sawAnode = true;
info.anodeId = pw.GetNearestID().first;
info.anodeEnergy = interpolateEnergy(kAnodeRadius);
}
if (!info.sawCathode && CrossesRadius(preR, postR, kCathodeRadius)) {
info.sawCathode = true;
info.cathodeId = pw.GetNearestID().second;
info.cathodeEnergy = interpolateEnergy(kCathodeRadius);
}
if (info.sawAnode && info.sawCathode) {
info.deltaE = std::abs(info.anodeEnergy - info.cathodeEnergy);
}
}
bool WireTrackingManager::GetInfo(int eventId, int trackId, WireCrossingInfo& info)
{
EnsureEvent(eventId);
auto iterator = fTrackInfo.find(trackId);
if (iterator == fTrackInfo.end()) {
return false;
}
info = iterator->second;
return true;
}
WireCrossingInfo WireTrackingManager::InferFromTrackGeometry(const G4Track* track, const G4StepPoint* hitPoint)
{
WireCrossingInfo info;
if (track == nullptr || hitPoint == nullptr) {
return info;
}
const G4ThreeVector origin = track->GetVertexPosition();
G4ThreeVector direction = hitPoint->GetPosition() - origin;
const double totalPath = direction.mag();
if (totalPath <= 0.0) {
return info;
}
direction = direction.unit();
PW pw;
pw.ConstructGeo();
pw.FindWireID(ToTVector3(origin), ToTVector3(direction), false);
info.anodeId = pw.GetNearestID().first;
info.cathodeId = pw.GetNearestID().second;
const double vertexEnergy = track->GetVertexKineticEnergy();
const double hitEnergy = hitPoint->GetKineticEnergy();
double anodeDistance = 0.0;
double cathodeDistance = 0.0;
if (SolveRadiusIntersection(origin, direction, 37.0 * mm, anodeDistance)) {
const double fraction = std::clamp(anodeDistance / totalPath, 0.0, 1.0);
info.anodeEnergy = vertexEnergy + fraction * (hitEnergy - vertexEnergy);
info.sawAnode = true;
}
if (SolveRadiusIntersection(origin, direction, 43.0 * mm, cathodeDistance)) {
const double fraction = std::clamp(cathodeDistance / totalPath, 0.0, 1.0);
info.cathodeEnergy = vertexEnergy + fraction * (hitEnergy - vertexEnergy);
info.sawCathode = true;
}
if (info.sawAnode && info.sawCathode) {
info.deltaE = std::abs(info.anodeEnergy - info.cathodeEnergy);
}
return info;
}

View File

@ -316,10 +316,7 @@ def calculate_distance_tree2(vz, theta, z_max=34.86):
def calculate_sx3_thickness_path(theta, phi, sx3x, sx3y, thickness_cm=0.1):
"""Path length through SX3 silicon using incidence angle to detector normal.
SX3 detectors are arranged on a barrel, so the local normal is radial in x-y.
"""
"""Path length through SX3 silicon using incidence angle to detector normal."""
rxy = np.sqrt(sx3x * sx3x + sx3y * sx3y)
nx = np.where(rxy > 1e-12, sx3x / rxy, 0.0)
ny = np.where(rxy > 1e-12, sx3y / rxy, 0.0)
@ -332,6 +329,13 @@ def calculate_sx3_thickness_path(theta, phi, sx3x, sx3y, thickness_cm=0.1):
return thickness_cm / cos_incidence
def calculate_qqq_thickness_path(theta, thickness_cm=0.1, min_abs_cos=0.2):
"""Path length through planar QQQ silicon using incidence to z-normal."""
cos_incidence = np.abs(np.cos(theta))
cos_incidence = np.clip(cos_incidence, min_abs_cos, 1.0)
return thickness_cm / cos_incidence
def load_tree_arrays(tree, treename, max_events=None):
branches = tree.keys(recursive=False)
return tree.arrays(branches, library="np", entry_stop=max_events)
@ -358,15 +362,17 @@ def prepare_tree_data(tree, treename, particle, max_events=None, z_max=34.86):
qqqX = data["qqqX"]
qqqY = data["qqqY"]
qqqZ = data["qqqZ"]
qqq_valid_mask = ~np.isnan(qqqX) & ~np.isnan(qqqY) & ~np.isnan(qqqZ) & ~np.isnan(Ei)
qqqnan = np.isnan(qqqZ).sum()
print(f"qqq NaN entries: {qqqnan}")
print(f"Total: {Einan + qqqnan}")
mask2 = angle_mask & ~np.isnan(qqqX) & ~np.isnan(qqqY) & ~np.isnan(qqqZ)
mask2 = qqq_valid_mask
#else:
# sx3Z = np.full_like(vZ, z_max) # Assume sx3Z is at z_max for tree2
# mask = ~np.isnan(Ei) & ~np.isnan(theta) & ~np.isnan(vZ)
Eisx3 = Ei[mask]
thetaQ = theta[mask2]
theta = theta[mask]
phi = phi[mask]
vXsx3 = vX[mask]
@ -391,10 +397,15 @@ def prepare_tree_data(tree, treename, particle, max_events=None, z_max=34.86):
sin_theta = np.sin(theta)
sin_theta = np.where(sin_theta != 0, sin_theta, 1e-10)
sin_theta_q = np.sin(thetaQ)
sin_theta_q = np.where(sin_theta_q != 0, sin_theta_q, 1e-10)
radii = np.array([3.7, 4.3])
dA = (radii[0] - np.sqrt((vXsx3/10)**2 + (vYsx3/10)**2))/ sin_theta
dC = (radii[1] - np.sqrt((vXsx3/10)**2 + (vYsx3/10)**2))/ sin_theta
dAq = (radii[0] - np.sqrt((vXqqq/10)**2 + (vYqqq/10)**2))/ sin_theta_q
dCq = (radii[1] - np.sqrt((vXqqq/10)**2 + (vYqqq/10)**2))/ sin_theta_q
lsx3 = calculate_sx3_thickness_path(theta, phi, sx3X, sx3Y, thickness_cm=0.1)
lqqq = calculate_qqq_thickness_path(thetaQ, thickness_cm=0.1, min_abs_cos=0.2)
# Filter out unphysical distances (negative or unreasonably small)
@ -419,19 +430,24 @@ def prepare_tree_data(tree, treename, particle, max_events=None, z_max=34.86):
clear_interpolator_cache()
EA = energy_loss(particle, "He", Eisx3, dA)
EC = energy_loss(particle, "He", Eisx3, dC)
EAq = energy_loss(particle, "He", Eiqqq, dAq)
ECq = energy_loss(particle, "He", Eiqqq, dCq)
Esx3 = energy_loss(particle, "He", Eisx3, dsx3)
Eqqq = energy_loss(particle, "He", Eiqqq, dqqq)
Prange = energy_distance("proton", "Si", Esx3, 0)
clear_interpolator_cache()
Efinal = energy_loss(particle, "Si", Esx3, lsx3)
EfinalQ = energy_loss(particle, "Si", Eqqq, lqqq)
Edet = (Esx3 - Efinal)
EdetQ = Eqqq - EfinalQ
#Edet = np.where(Prange > lsx3, Efinal + Esx3, Esx3)
Elost = Eisx3 - Esx3
Elostqqq = Eiqqq - Eqqq
Eprop = EA - EC
EpropQ = EAq - ECq
return {
"particle": particle,
@ -445,6 +461,7 @@ def prepare_tree_data(tree, treename, particle, max_events=None, z_max=34.86):
"Elost": Elost,
"Elostqqq": Elostqqq,
"Eprop": Eprop,
"EpropQ": EpropQ,
"dA": dA,
"dC": dC,
"thetab": np.degrees(theta),
@ -456,7 +473,8 @@ def prepare_tree_data(tree, treename, particle, max_events=None, z_max=34.86):
"Eqqq": Eqqq,
"Edet": Edet,
"Efinal": Efinal,
"lsx3": lsx3
"lsx3": lsx3,
"EdetQ": EdetQ
}
def infer_particle_from_filename(filename):
@ -1071,6 +1089,7 @@ class MyInteractiveApp(cmd.Cmd):
Efinal = data["Efinal"]
Elost = data["Elost"]
Eprop = data["Eprop"]
EpropQ = data["EpropQ"]
dA = data["dA"]
dC = data["dC"]
qqqX = data["qqqX"]
@ -1079,6 +1098,7 @@ class MyInteractiveApp(cmd.Cmd):
qqqE = data["Eqqq"]
Elostqqq = data["Elostqqq"]
Edet = data["Edet"]
EdetQ = data["EdetQ"]
update_plot_data(f"{particle}_{treename}_Ei", Ei)
update_plot_data(f"{particle}_{treename}_sx3Z", sx3Z)
@ -1174,21 +1194,24 @@ class MyInteractiveApp(cmd.Cmd):
plt.xlabel("Esx3")
plt.ylabel("Edet")
plt.title("Esx3 vs Edet")
plt.yscale("log")
plt.xscale("log")
#plt.yscale("log")
#plt.xscale("log")
plt.colorbar(label="counts")
plt.tight_layout()
plt.savefig(f"{base}/Esx3_vs_Edet.png")
plt.show()
mask1 = ~np.isnan(qqqE) & ~np.isnan(EdetQ)
plt.figure(figsize=(7,6))
plt.hist2d(Esx3, Efinal, bins=300)
plt.xlabel("Esx3")
plt.hist2d(qqqE[mask1], EdetQ[mask1], bins=300)
plt.xlabel("Eqqq")
plt.ylabel("Edet")
plt.title("Esx3 vs Efinal")
plt.title("Eqqq vs Edet")
plt.yscale("log")
plt.xscale("log")
plt.colorbar(label="counts")
plt.tight_layout()
plt.savefig(f"{base}/Esx3_vs_Efinal.png")
plt.savefig(f"{base}/Eqqq_vs_Edet.png")
plt.show()
mask1 = ~np.isnan(qqqE) & ~np.isnan(thetabqqq)
@ -1369,6 +1392,26 @@ class MyInteractiveApp(cmd.Cmd):
except ValueError:
print("Value error")
mask1 = (
~np.isnan(EdetQ)
& (EdetQ > 0)
& ~np.isnan(EpropQ)
& ~np.isnan(thetabqqq)
)
plt.figure(figsize=(7,6))
plt.hist2d(EdetQ[mask1], (np.sin(np.deg2rad(thetabqqq[mask1])) * EpropQ[mask1]), bins=200)
plt.ylabel("PCEnergy x sin(theta)")
plt.xlabel("Eqqq detected (MeV)")
plt.title(f"{particle} ({treename}) EDet QQQ vs PCEnergy * sin(theta)")
plt.colorbar(label="Counts")
#plt.xlim(0,30)
#plt.ylim(0,0.45)
plt.tight_layout()
plt.savefig(f"{base}/Eprop_vs_EdetQ.png", dpi=300)
plt.show()
branch_names = []
for key in self.tree.keys():
if isinstance(key, bytes):