Skip to content

ChristopherPrainito/WaterTankGeantSim

Repository files navigation

Water Tank Geant4 Simulation

A comprehensive Geant4-based simulation of a water-Cherenkov calibration system designed for large-scale neutrino detectors, such as the IceCube Neutrino Observatory. This simulation models cosmic ray interactions in a cylindrical water tank with Digital Optical Module (DOM) photodetectors.

Project Overview

This simulation recreates the geometry and physics of a water-Cherenkov detector tank used for DOM calibration studies. The system consists of:

  • Cylindrical polypropylene tank (71" diameter × 36" height) filled with ultrapure water
  • Glass DOM photomultiplier sphere for optical photon detection
  • Cosmic ray shower simulation using the CRY (Cosmic Ray Yield) library
  • Comprehensive optical physics including Cherenkov radiation, refraction, and absorption
  • ROOT-based data output for analysis of particle interactions and photon yields

This work serves as a foundation for developing a muon scintillator trigger array system and forms part of an undergraduate thesis project focused on calibration systems for large-scale neutrino detectors.

Physics Features

Particle Physics

  • Complete electromagnetic and hadronic physics via Geant4's QBBC physics list
  • Cosmic ray simulation using CRY library for realistic muon flux
  • Optical physics with detailed Cherenkov radiation modeling
  • Material property modeling for water, glass, and polypropylene

Detector Response

  • Photomultiplier tube simulation with realistic quantum efficiency
  • Optical surface modeling between water and glass interfaces
  • Time-resolved photon detection for pulse shape analysis
  • Energy deposition tracking in both water and DOM volumes

Realistic Geometry

  • Scale-accurate tank dimensions matching existing calibration hardware
  • Wavelength-dependent optical properties (300-620 nm range)
  • DOM positioning optimized for maximum photon collection

Prerequisites

Required Software

  • Geant4 (version 10.7 or later) with Qt/OpenGL visualization
  • ROOT (version 6.0 or later) for data analysis and plotting
  • CMake (version 3.6 or later)
  • CRY (Cosmic Ray Yield) library v1.7 (included in repository)
  • C++17 compatible compiler (GCC 7+, Clang 5+)

System Requirements

  • Linux/macOS/Windows with WSL2
  • Minimum 4 GB RAM (8 GB recommended for large event samples)
  • OpenGL-capable graphics card for visualization

Installation and Setup

1. Clone Repository

git clone https://github.com/ChristopherPrainito/WaterTankGeantSim.git
cd WaterTankGeantSim

2. Verify Required Software

# Check Geant4 environment
echo $G4INSTALL
geant4-config --version

# Verify ROOT installation
root-config --version
which root

3. Build CRY Library (if needed)

cd cry_v1.7
make
cd ..

4. Build Simulation

mkdir build
cd build
cmake ..
make -j4

Usage

Interactive Mode (Visualization)

Launch the simulation with Qt/OpenGL visualization for geometry inspection and event display:

cd build
./exampleWaterTank

In the interactive session:

# Initialize geometry and physics
/run/initialize

# Configure visualization
/vis/open OGL 600x600-0+0
/vis/drawVolume
/vis/viewer/set/viewpointVector -1 0 0
/vis/scene/add/trajectories
/vis/scene/endOfEventAction accumulate

# Run single muon events
/run/beamOn 10

Batch Mode Simulations

Single Muon Test

./exampleWaterTank test.mac

Cosmic Ray Simulation

./exampleWaterTank test_cry.mac

Macro Commands

Primary Generator Control

# Switch between single muon and CRY modes
/watertank/generator/useCRY true/false

# Single muon configuration
/watertank/generator/muon/energy 4 GeV
/watertank/generator/muon/direction 0 0 -1
/watertank/generator/muon/position 0 0 50 cm

Physics Settings

# Optical physics parameters
/process/optical/cerenkov/setMaxPhotons 300
/process/optical/cerenkov/setStackPhotons true

# Verbosity control
/run/verbose 1
/event/verbose 1
/tracking/verbose 1

Output Data Format

The simulation generates ROOT files (output_default.root) with comprehensive event and hit-level data stored in two main trees:

Event Tree (event)

Contains 15 branches with event-level physics data:

  • EventID: Unique event identifier
  • PrimaryEnergy_GeV: Initial particle energy (GeV)
  • PrimaryPDG: Particle type (PDG code)
  • PrimaryPosX/Y/Z_cm: Initial particle position (cm)
  • PrimaryDirX/Y/Z: Initial momentum direction (unit vector)
  • Edep_GeV: Total energy deposited in water (GeV)
  • DOMHitCount: Number of photons detected by DOM
  • PhotonYield_per_GeV: Light yield efficiency (photons/GeV)
  • FirstPhotonTime_ns: Time of first photon detection (ns)
  • LastPhotonTime_ns: Time of last photon detection (ns)
  • AvgPhotonWavelength_nm: Average detected photon wavelength (nm)

DOM Hits Tree (domhits)

Contains 12 branches with individual photon hit data:

  • EventID: Associated event identifier
  • Time_ns: Photon arrival time (ns)
  • Energy_eV: Photon energy (eV)
  • Wavelength_nm: Photon wavelength (nm)
  • PosX/Y/Z_cm: Hit position on DOM surface (cm)
  • DirX/Y/Z: Photon direction at detection (unit vector)
  • TrackID: Geant4 track identifier
  • ParentID: Parent track identifier

Analysis Tools

ROOT Analysis Macro

The simulation includes a comprehensive ROOT analysis script (analyze_watertank.C) that automatically generates detailed physics plots and statistics.

Running the Analysis

# From the build directory
root -l -b -q "../analyze_watertank.C(\"output_default.root\")"

# Or interactively in ROOT
root
.x analyze_watertank.C

Generated Output

The analysis creates three detailed plot sets:

  1. Event Analysis (water_tank_event_analysis.png) - 6-panel event-level physics
  2. Photon Analysis (water_tank_photon_analysis.png) - 6-panel detector response
  3. Physics Analysis (water_tank_physics_analysis.png) - 2-panel efficiency/yield plots

Plot Descriptions

Event Analysis Plots

  1. Primary Particle Energy - Distribution of incident muon energies showing beam characteristics
  2. Energy Deposition in Water - Energy lost by muons through ionization and electromagnetic processes
  3. DOM Hit Multiplicity - Number of Cherenkov photons detected per event, indicating light collection efficiency
  4. Photon Yield vs Primary Energy - 2D correlation showing relationship between muon energy and light production
  5. First Photon Arrival Time - Timing distribution of earliest detected photons, crucial for trigger studies
  6. Average Photon Wavelength - Spectral characteristics of detected Cherenkov light (should peak ~400-450nm)

Photon Analysis Plots

  1. Photon Energy Spectrum - Energy distribution of individual detected photons (1.5-4.5 eV range)
  2. Photon Wavelength Spectrum - Detailed wavelength distribution showing Cherenkov 1/λ² spectrum
  3. Photon Arrival Times - Temporal spread of photon hits (log scale), reveals scattering and detector response
  4. DOM Hit Positions (X-Y View) - Spatial distribution of photon hits on DOM hemisphere
  5. DOM Hit Positions (Z-R View) - Cylindrical view showing hit pattern vs depth and radius
  6. Photon Direction Distribution - Angular distribution of detected photons in azimuth/polar coordinates

Physics Analysis Plots

  1. Cherenkov Light Yield - Light production efficiency vs muon energy, fundamental physics validation
  2. Detection Efficiency - Fraction of events producing detectable light, critical for trigger design

Analysis Statistics

The macro automatically calculates and displays:

  • Mean primary energy and energy deposition
  • Average photon detection rates
  • Overall detection efficiency
  • Light yield in photons per GeV
  • Event processing statistics

Complete Analysis Workflow

1. Run Simulation

cd build
./exampleWaterTank test_cry.mac        # Cosmic ray simulation
# or
./exampleWaterTank test.mac            # Single muon test

2. Analyze Results

# Generate comprehensive analysis plots
root -l -b -q "../analyze_watertank.C(\"output_default.root\")"

3. View Output

The analysis generates three PNG files with detailed physics plots:

  • water_tank_event_analysis.png: Event-level distributions and correlations
  • water_tank_photon_analysis.png: Individual photon characteristics and detector response
  • water_tank_physics_analysis.png: Light yield efficiency and detection performance

4. Interpret Results

Expected Physics Signatures

  • Cherenkov Light Yield: ~200-300 photons/GeV for high-energy muons
  • First Photon Time: ~9-10 ns (speed of light propagation + detector response)
  • Wavelength Spectrum: Peak at 400-450 nm with 1/λ² falloff toward UV
  • Detection Efficiency: >90% for muons crossing full detector volume
  • Energy Deposition: ~100-200 MeV for 4 GeV muons (minimum ionizing)

Quality Checks

  • Energy conservation: Primary energy >> Energy deposition
  • Timing consistency: First photon < Last photon times
  • Spectral range: Detected wavelengths within 300-700 nm window
  • Spatial distribution: Hits concentrated on DOM hemisphere facing muon track

Configuration Files

CRY Setup (cry_setup.file)

Controls cosmic ray generation:

returnMuons 1          # Generate muons
returnElectrons 0      # Disable electrons
returnGammas 0         # Disable gammas
latitude 42.36         # Latitude (degrees)
altitude 0             # Sea level (meters)
subboxLength 3         # Generation box size (meters)
date 1-1-2024          # Cosmic ray flux date

Visualization (vis.mac)

/vis/open OGL 800x600-0+0
/vis/drawVolume worlds
/vis/scene/add/trajectories smooth
/vis/modeling/trajectories/create/drawByCharge
/vis/viewer/set/autoRefresh false

References and Related Work

IceCube Collaboration

Geant4 Documentation

CRY Cosmic Ray Library

Contact and Support

Author: Christopher Prainito Institution: Harvard College

For questions or bug reports, please open an issue on GitHub.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published