This repository contains the code and documentation developed for the final degree project titled "Study on the Efficiency Improvement of Cherenkov Detectors Using Colloids". The project focuses on analyzing and improving the efficiency of Cherenkov detectors used in cosmic ray detection, with a particular emphasis on the use of colloids to enhance detector performance.
The project is divided into several folders, each addressing a specific aspect of the simulation and analysis process.
To install the necessary dependencies, follow these steps:
-
Python Dependencies: Install the required Python packages using the following command:
pip install -r requirements.txt
-
ROOT Framework: This project requires ROOT (version 6.32.08 or higher) for data analysis and visualization.
-
Geant4: This project requires Geant4 (version 10.7.4) and CLHEP (version 2.4.7.1) to simulate the Cherenkov detector.
-
CORSIKA: This project requires CORSIKA (version 7.7500) and ARTI Framework to simulate the cosmic ray flux.
To run the main simulation of the Cherenkov detector, follow these steps:
-
Navigate to the
wcd/builddirectory:cd wcd/build -
Create a folder named rootFiles to store the simulation output:
mkdir rootFiles
-
Compile the code using cmake and make:
cmake .. && make
This will generate an executable named wcd.
-
Run the simulation using the wcd executable with the following command:
./wcd -time <timeSeconds> -output <outputROOTfile> -seed <seedNumber>
timeSeconds: The exposure time to cosmic rays (in seconds).
outputROOTfile: The name of the output ROOT file where the simulation results will be saved.
seedNumber: The seed for the random number generator used in the simulation.
Example:
./wcd -time 3600 -output simulation_output.root -seed 12345This will run the simulation for 1 hour (3600 seconds), save the results in rootFiles/simulation_output.root, and use 12345 as the random seed.
Annotations: To change between the two different media, water and the colloid, you should modify the DetectorConstruction.cc uncommenting the desired refractiveIndex_TiO2 values for the different concentrations after the line 286, and modify the wcd_tank_log variable, here you can use TiO2_colloid or water. Future versions of the code will include this selection in the execution command.
-
G4Analysis/:- Purpose: This folder contains a Python script for analyzing and visualizing data from ROOT files generated by the Cherenkov detector simulation.
- Key Features:
- Compares the spectral flux of photons detected in water versus TiO₂ colloids at different concentrations.
- Generates histograms and ratio plots for comparison.
- Files:
compare_multiple_concentration.py: The main script for analysis.
- Output:
WavelengthHist_Comparison_All.png: Histogram comparing spectral flux.Ratio_Water_Colloid_All.png: Scatter plot showing the ratio of spectral flux between TiO₂ colloids and water.
-
refractiveIndex/:- Purpose: This folder contains a script to calculate and visualize the effective refractive index of a water-based medium with varying concentrations of TiO₂ nanoparticles.
- Key Features:
- Uses the Maxwell-Garnett effective medium approximation.
- Plots the refractive index as a function of photon energy.
- Files:
script.py: The main script for refractive index calculations.n_ti_dioxide.csv,k_ti_dioxide.csv: Refractive index and extinction coefficient data for TiO₂.n_water.csv,k_water.csv: Refractive index and extinction coefficient data for water.
- Output:
refractive_index_concentrations.png: Plot showing the refractive index for different TiO₂ concentrations.
-
CorsikaAnalysis/:- Purpose: This folder contains scripts and code for analyzing CORSIKA simulation data, focusing on extracting and visualizing kinetic variables of muons and other secondary cosmic ray particles.
- Subdirectories:
kineticVariablesFromMomentum/:- Purpose: Extracts and plots kinetic variables (energy, theta, phi) from the momentum components of muons generated by CORSIKA simulations.
- Files:
extract_kinetic_variables.cpp: C++ script to extract kinetic variables from CORSIKA output.plot_kinetic_variables.py: Python script to plot and save kinetic variable distributions.
- Output:
kinetic_variables.txt: Text file containing computed kinetic variables.normalized_angle_energy_distributions_radians.png: Plot of kinetic variable distributions.theta_distribution_radians.csv,phi_distribution_radians.csv,energy_distribution.csv: CSV files with normalized distributions.
CRdistributionsPlots/:- Purpose: Analyzes the energy spectrum of secondary cosmic ray particles (muons, electrons, pions, protons, neutrons, photons) from CORSIKA simulation data.
- Files:
plot_energy_spectrum.py: Python script to plot the energy spectrum of secondary particles.calculate_muon_flux.py: Python script to calculate and save muon flux data.
- Output:
energy_spectrum_all_particles.png: Energy spectrum plot for all secondary particles.energy_spectrum_muons.png: Energy spectrum plot for muons.muon_flux_histogram.csv: CSV file containing muon flux histogram data.
-
CondorScripts:- Purpose: This folder contains scripts and instructions for running cosmic ray simulations using CORSIKA and Geant4 in an HTCondor environment through the LXPLUS service.
- Subdirectories:
simCorsika/:- Purpose: Contains instructions and files for running CORSIKA simulations in an HTCondor environment.
- Files:
Instructions.pdf: Detailed guide on setting up and running CORSIKA simulations.
simG4/:- Purpose: Contains scripts and files for running Geant4 simulations in an HTCondor environment.
- Files:
submitGenerator.py: Python script to automate the submission of Geant4 simulation jobs.wcd/: Directory containing Geant4 simulation scripts.
- Usage:
- Modify paths in
submitGenerator.pyto match your environment. - Run the script to generate
.shand.subfiles for each simulation:python submitGenerator.py
- Submit all jobs to HTCondor using the generated master script:
./submit/submit_all_jobs.sh
- Modify paths in
- Key Parameters:
- Simulates different mediums (e.g., water, colloid_5, colloid_10).
- Configures HTCondor jobs with specific resource requests (e.g., 4 CPUs, 20GB memory, 5GB disk).
- Output:
- Log files (
test.log.txt,test.out.txt,test.error.txt) for job status and debugging.
- Log files (