Compare commits

..

No commits in common. "c0c49be0c9cef37e4c332549f0bfe2cef504012b" and "0a7dd1bcf692cc3fdb4fbe2dc70898cc60527884" have entirely different histories.

3 changed files with 209 additions and 312 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,9 +1,5 @@
import pycatima as catima
import numpy as np
import os
DEDX_SCALE = float(os.environ.get("DEDX_SCALE", "1.0"))
print(f"Using dEdX scale factor: {DEDX_SCALE}")
# --- 1. Constants ---
P_TORR = 250
@ -36,7 +32,7 @@ fine_step_cm = 0.03 # row spacing near the Bragg peak
fine_zone_frac = 0.085 # fraction of the *total* range treated as "near the peak"
def generate_lookup(z, mass_u, e_start_mev, label):
filename = f"/home/vsitaraman/ANASEN_analysis/eloss_calculations/{label}_lookup_{e_start_mev}MeV_{P_TORR}torr_{P_CO2}pc.dat"
filename = f"{label}_lookup_{e_start_mev}MeV_{P_TORR}torr_{P_CO2}pc.dat"
header = f"Energy(MeV) \tmg/cm2 \tcm\nStarting Energy: {e_start_mev} MeV"
# Pass 1: integrate at full precision just to find the total range (needed
@ -82,7 +78,7 @@ def generate_lookup(z, mass_u, e_start_mev, label):
projectile.T(e_u)
# dedx returns MeV / (g/cm2)
if(mass_u >=10.0):
loss_mev = catima.dedx(projectile, gas_mix) * step_g_cm2 * DEDX_SCALE
loss_mev = catima.dedx(projectile, gas_mix) * step_g_cm2 * 0.89
else:
loss_mev = catima.dedx(projectile, gas_mix) * step_g_cm2

View File

@ -6,15 +6,14 @@ export OUT_DIR="Output_27Al"
export reactiondata=1
export CO2percent=3
export pressure_in_torr=250
export CATHODE_GAIN=3.0
export CATHODE_GAIN=4.0
export source_vertex=-200.0
export DEDX_SCALE=0.90
# export BEAM_AXIS_X=-15
# export BEAM_AXIS_Y=-5
export BEAM_AXIS_X=-15
export BEAM_AXIS_Y=-5
export CUTLIST=cuts_list.txt
# Clean up previous runs
rm -f Output_27Al_$DEDX/*.root
rm -f Output_27Al/*.root
echo "Pre-compiling TrackRecon.C safely on a single core..."
root -q -l -b -e '.L TrackRecon.C++O'
@ -23,9 +22,9 @@ process_run() {
local wrun=$(printf "%03d" "$1")
local prefix="${PREFIX:-Run_}"
local infile="../ANASEN_analysis/data/${DATASET}_Data/${prefix}${wrun}_mapped.root"
local out="Output_27Al_$DEDX_SCALE/results_run${wrun}.root"
local out="Output_27Al/results_run${wrun}.root"
mkdir -p Output_27Al_$DEDX_SCALE
mkdir -p Output_27Al
root -q -l -b -x "$infile" \
-e "tree->Process(\"TrackRecon.C+\", \"${out}\")" > /dev/null 2>&1
@ -39,11 +38,9 @@ process_run() {
export -f process_run
echo "Running Eloss.py with a scaling parameter of $DEDX_SCALE"
python3 eloss_calculations/Eloss.py
echo "Starting parallel processing..."
time parallel --bar -j 8 process_run ::: {24..41}
# time parallel --bar -j 8 process_run ::: {24..41}
time parallel --bar -j 3 process_run ::: 44 45 46
time parallel --bar -j 8 process_run ::: {50..59}
# time parallel --bar -j 4 process_run ::: 62 63 66 67 68
@ -52,7 +49,7 @@ time parallel --bar -j 8 process_run ::: {50..59}
# time parallel --bar -j 4 process_run ::: {78..89}
echo "Merging files..."
hadd -k -j 4 Output_27Al_$DEDX_SCALE/output_27Al.root Output_27Al_$DEDX_SCALE/results_run*.root
hadd -k -j 4 Output_27Al/output_27Al.root Output_27Al/results_run*.root
# rootbrowse Output_27Al/output_27Al.root
@ -71,5 +68,4 @@ unset A1C1_Z_OFF_SX3
unset BEAM_AXIS_X
unset BEAM_AXIS_Y
unset CUTLIST
unset DEDX_SCALE
echo "Script execution finished."