modified: TrackRecon.C made variables to account for variable energy loss in 27Al and 17F runs due to beamline components

modified:   run_17F.sh made all outputs direct to specific folders for clarity and to avoid overwriting results from different datasets
	modified:   run_27Al.sh made output folder format consitent across datasets
	modified:   run_tr.sh made output folder format consitent across datasets
This commit is contained in:
Vignesh Sitaraman 2026-06-08 11:32:39 -04:00
parent 20dc8fef22
commit 5824fa7148
4 changed files with 64 additions and 55 deletions

View File

@ -49,6 +49,7 @@ const double qqq_z = 100.0;
double z_entrance = -174.3 - 9.7 - 100.0; double z_entrance = -174.3 - 9.7 - 100.0;
const double anode_gain = 1.5146e-5; // channels --> MeV const double anode_gain = 1.5146e-5; // channels --> MeV
std::string dataset; std::string dataset;
int CO2percent;
bool reactiondata = false; bool reactiondata = false;
TF1 pcfix_func("func", model_invert, -200, 200); TF1 pcfix_func("func", model_invert, -200, 200);
@ -264,25 +265,25 @@ void TrackRecon::Begin(TTree * /*tree*/)
} }
// ------------- ELOSS Correction read in from tables ------------- // ------------- ELOSS Correction read in from tables -------------
if (CO2percent == 3.0) {
MeV_to_cm = new TGraph("eloss_calculations/alpha_lookup_20MeV_3pc.dat", "%lf %*lf %lf");
MeV_to_cm_p = new TGraph("eloss_calculations/proton_lookup_20MeV_3pc.dat", "%lf %*lf %lf");
MeV_to_cm_27Al = new TGraph("eloss_calculations/aluminum_lookup_80MeV_3pc.dat", "%lf %*lf %lf");
MeV_to_cm_17F = new TGraph("eloss_calculations/fluorine_lookup_70MeV_3pc.dat", "%lf %*lf %lf");
}
if (CO2percent == 4.0) { if (CO2percent == 4)
{
MeV_to_cm = new TGraph("eloss_calculations/alpha_lookup_20MeV_4pc.dat", "%lf %*lf %lf"); MeV_to_cm = new TGraph("eloss_calculations/alpha_lookup_20MeV_4pc.dat", "%lf %*lf %lf");
MeV_to_cm_p = new TGraph("eloss_calculations/proton_lookup_20MeV_4pc.dat", "%lf %*lf %lf"); MeV_to_cm_p = new TGraph("eloss_calculations/proton_lookup_20MeV_4pc.dat", "%lf %*lf %lf");
MeV_to_cm_27Al = new TGraph("eloss_calculations/aluminum_lookup_80MeV_4pc.dat", "%lf %*lf %lf"); MeV_to_cm_27Al = new TGraph("eloss_calculations/aluminum_lookup_80MeV_4pc.dat", "%lf %*lf %lf");
MeV_to_cm_17F = new TGraph("eloss_calculations/fluorine_lookup_70MeV_4pc.dat", "%lf %*lf %lf"); MeV_to_cm_17F = new TGraph("eloss_calculations/fluorine_lookup_70MeV_4pc.dat", "%lf %*lf %lf");
} }
else
{
MeV_to_cm = new TGraph("eloss_calculations/alpha_lookup_20MeV_3pc.dat", "%lf %*lf %lf");
MeV_to_cm_p = new TGraph("eloss_calculations/proton_lookup_20MeV_3pc.dat", "%lf %*lf %lf");
MeV_to_cm_27Al = new TGraph("eloss_calculations/aluminum_lookup_80MeV_3pc.dat", "%lf %*lf %lf");
MeV_to_cm_17F = new TGraph("eloss_calculations/fluorine_lookup_70MeV_3pc.dat", "%lf %*lf %lf");
}
cm_to_MeV = new TGraph(MeV_to_cm->GetN(), MeV_to_cm->GetY(), MeV_to_cm->GetX()); cm_to_MeV = new TGraph(MeV_to_cm->GetN(), MeV_to_cm->GetY(), MeV_to_cm->GetX());
cm_to_MeVp = new TGraph(MeV_to_cm_p->GetN(), MeV_to_cm_p->GetY(), MeV_to_cm_p->GetX()); cm_to_MeVp = new TGraph(MeV_to_cm_p->GetN(), MeV_to_cm_p->GetY(), MeV_to_cm_p->GetX());
cm_to_MeV_27Al = new TGraph(MeV_to_cm_27Al->GetN(), MeV_to_cm_27Al->GetY(), MeV_to_cm_27Al->GetX()); cm_to_MeV_27Al = new TGraph(MeV_to_cm_27Al->GetN(), MeV_to_cm_27Al->GetY(), MeV_to_cm_27Al->GetX());
cm_to_MeV_17F = new TGraph(MeV_to_cm_17F->GetN(), MeV_to_cm_17F->GetY(), MeV_to_cm_17F->GetX()); cm_to_MeV_17F = new TGraph(MeV_to_cm_17F->GetN(), MeV_to_cm_17F->GetY(), MeV_to_cm_17F->GetX());
} }
Bool_t TrackRecon::Process(Long64_t entry) Bool_t TrackRecon::Process(Long64_t entry)
@ -2034,8 +2035,8 @@ void miscHistograms_oneWire(HistPlotter *plotter, std::vector<Event> QQQ_Events,
// consider the 'proton-like' QQQ branch seen in a,p data // consider the 'proton-like' QQQ branch seen in a,p data
TRandom3 rand; TRandom3 rand;
rand.SetSeed(); // random seed set rand.SetSeed(); // random seed set
Kinematics apkin_a(1.008664916, 4.002603254, 4.002603254, 1.008664916, 6.34); // m3 is alpha, 6.411 MeV is 7.0 MeV proton energy after havar+kapton+100mm 4He gas (molar mass 5.2, 250 torr) // Kinematics apkin_a(1.008664916, 4.002603254, 4.002603254, 1.008664916, 6.34); // m3 is alpha, 6.411 MeV is 7.0 MeV proton energy after havar+mylar+kapton+100mm 4He gas (molar mass 5.3, 250 torr)
// Kinematics apkin_a(1.008664916, 4.002603254, 4.002603254, 1.008664916, 6.79); // m3 is alpha, 6.79 MeV is 7.0 MeV proton energy after kapton+100mm 4He gas (molar mass 5.2, 250 torr) Kinematics apkin_a(1.008664916, 4.002603254, 4.002603254, 1.008664916, 6.79); // m3 is alpha, 6.79 MeV is 7.0 MeV proton energy after kapton+100mm 4He gas (molar mass 5.2, 250 torr)
for (auto qqqevent : QQQ_Events) for (auto qqqevent : QQQ_Events)
{ {
if (qqqevent.Energy1 < 0.6) if (qqqevent.Energy1 < 0.6)
@ -2121,8 +2122,15 @@ void protonMiscHistograms(HistPlotter *plotter, std::vector<Event> QQQ_Events, s
// consider the 'proton-like' QQQ branch seen in a,p data // consider the 'proton-like' QQQ branch seen in a,p data
TRandom3 rand; TRandom3 rand;
rand.SetSeed(); // random seed set rand.SetSeed(); // random seed set
Kinematics apkin_a(1.008664916, 4.002603254, 4.002603254, 1.008664916, 6.34); // m3 is alpha, 6.411 MeV is 7.0 MeV proton energy after Havar+kapton+100mm 4He gas (molar mass 5.2, 250 torr) double initial_energy = 7.0;
// Kinematics apkin_a(1.008664916, 4.002603254, 4.002603254, 1.008664916, 6.79); // m3 is alpha, 6.79 MeV is 7.0 MeV proton energy after kapton+100mm 4He gas (molar mass 5.2, 250 torr) if (dataset == "27Al")
initial_energy = 6.79; // m3 is alpha, 6.79 MeV is 7.0 MeV proton energy after kapton+100mm 4He gas (molar mass 5.2, 250 torr)
if (dataset == "17F")
initial_energy = 6.34; // m3 is alpha, 6.411 MeV is 7.0 MeV proton energy after Havar+kapton+100mm 4He gas (molar mass 5.2, 250 torr)
Kinematics apkin_a(1.008664916, 4.002603254, 4.002603254, 1.008664916, initial_energy); // m3 is alpha
TF1 pcfix_func("pcfix_func", "pol2", -200, 200);
for (auto qqqevent : QQQ_Events) for (auto qqqevent : QQQ_Events)
{ {
if (qqqevent.Energy1 < 0.6) if (qqqevent.Energy1 < 0.6)

View File

@ -16,7 +16,7 @@ function run_once() {
wrun=$(printf "%03d" $1) wrun=$(printf "%03d" $1)
file_exists=$(test -f ../ANASEN_analysis/data/17F_Data/Run_"$wrun"_mapped.root) file_exists=$(test -f ../ANASEN_analysis/data/17F_Data/Run_"$wrun"_mapped.root)
if [[ $file_exists -ne 0 ]]; then continue; fi if [[ $file_exists -ne 0 ]]; then continue; fi
root -q -l -b -x ../ANASEN_analysis/data/17F_Data/Run_"$wrun"_mapped.root -e 'tree->Process("TrackRecon.C+O","Analyzer_17F.root")'; mv Analyzer_17F.root 17F_output/results_run$wrun.root; root -q -l -b -x ../ANASEN_analysis/data/17F_Data/Run_"$wrun"_mapped.root -e 'tree->Process("TrackRecon.C+O","Analyzer_17F.root")'; mv Analyzer_17F.root Output_17F/results_run$wrun.root;
} }
export -f run_once export -f run_once
@ -24,7 +24,7 @@ export -f run_once
# parallel -j 6 --ctag run_once {1} ::: {325..400} # parallel -j 6 --ctag run_once {1} ::: {325..400}
parallel -j 6 --ctag run_once {1} ::: {351,353,355,358,359,360,362,367} parallel -j 6 --ctag run_once {1} ::: {351,353,355,358,359,360,362,367}
rm output_17F.root rm output_17F.root
hadd -j 4 -k output_17F.root 17F_output/results_run3*.root hadd -j 4 -k output_17F.root Output_17F/results_run3*.root
unset souce_vertex unset souce_vertex
unset DATASET unset DATASET

View File

@ -10,7 +10,7 @@ root -q -l -b -e '.L TrackRecon.C++O'
process_run() { process_run() {
local wrun=$(printf "%03d" $1) local wrun=$(printf "%03d" $1)
local out="27Al_output/results_run${wrun}.root" local out="Output_27Al/results_run${wrun}.root"
root -q -l -b -x "../ANASEN_analysis/data/27Al_Data/Run_${wrun}_mapped.root" \ root -q -l -b -x "../ANASEN_analysis/data/27Al_Data/Run_${wrun}_mapped.root" \
-e "tree->Process(\"TrackRecon.C+\", \"${out}\")" > /dev/null 2>&1 -e "tree->Process(\"TrackRecon.C+\", \"${out}\")" > /dev/null 2>&1
@ -28,6 +28,6 @@ echo "Starting parallel processing..."
parallel --bar -j 4 process_run ::: {50..52} parallel --bar -j 4 process_run ::: {50..52}
echo "Merging files..." echo "Merging files..."
hadd -k -j 4 output_27Al.root 27Al_output/results_run*.root hadd -k -j 4 output_27Al.root Output_27Al/results_run*.root
unset DATASET unset DATASET

View File

@ -10,27 +10,31 @@ root -q -l -b -e '.L TrackRecon.C++O'
# Function to process a single run # Function to process a single run
process_run() { process_run() {
local wrun=$(printf "%03d" "$1") local wrun=$(printf "%03d" "$1")
# Use PREFIX if set, otherwise default to "Run_"
local prefix="${PREFIX:-Run_}" local prefix="${PREFIX:-Run_}"
local out="source_run${wrun}.root" local outdir="${OUT_DIR:-output}" # Defaults to 'output' if OUT_DIR is not set
local out="$Output_{outdir}/results_run${wrun}.root"
root -q -l -b -x "../ANASEN_analysis/data/${DATASET}/${prefix}${wrun}_mapped.root" \ # Ensure the directory exists so ROOT doesn't fail silently
mkdir -p "$outdir"
root -q -l -b -x "../ANASEN_analysis/data/${DATASET}_Data/${prefix}${wrun}_mapped.root" \
-e "tree->Process(\"TrackRecon.C+\", \"${out}\")" > /dev/null 2>&1 -e "tree->Process(\"TrackRecon.C+\", \"${out}\")" > /dev/null 2>&1
if [ -f "$out" ]; then if [ -f "$out" ]; then
echo "Run $wrun completed successfully." echo "Run $wrun completed successfully in $outdir."
else else
echo "ERROR: Run $wrun failed to generate $out" echo "ERROR: Run $wrun failed to generate $out"
fi fi
} }
export -f process_run export -f process_run
export -f process_run
export CO2percent=3
# --- Block 1: 27Al Source Runs No Gas (1-8) --- # --- Block 1: 27Al Source Runs No Gas (1-8) ---
if [[ 1 -eq 0 ]]; then if [[ 1 -eq 0 ]]; then
export DATASET="27Al_Data" export DATASET="27Al"
export PREFIX="Run_" export PREFIX="Run_"
export CO2percent=3.0 export OUT_DIR="av"
echo "Starting parallel processing for 27Al runs..." echo "Starting parallel processing for 27Al runs..."
rm -f p_output/all.root rm -f p_output/all.root
@ -39,12 +43,11 @@ fi
# --- Block 2: 27Al Alpha+Gas Runs (9, 12) --- # --- Block 2: 27Al Alpha+Gas Runs (9, 12) ---
if [[ 1 -eq 0 ]]; then if [[ 1 -eq 0 ]]; then
export DATASET="27Al_Data" export DATASET="27Al"
export PREFIX="Run_" export PREFIX="Run_"
export timecut_low=400.0 export timecut_low=400.0
export source_vertex=53.44 export source_vertex=53.44
export CO2percent=3.0 export OUT_DIR="a"
echo "Processing 27Al alpha+gas runs..." echo "Processing 27Al alpha+gas runs..."
parallel --bar -j 6 process_run ::: 9 12 parallel --bar -j 6 process_run ::: 9 12
@ -52,36 +55,34 @@ if [[ 1 -eq 0 ]]; then
fi fi
# --- Block 3: 27Al Protons+Gas Runs (15, 17-22) --- # --- Block 3: 27Al Protons+Gas Runs (15, 17-22) ---
if [[ 1 -eq 0 ]]; then if [[ 1 -eq 1 ]]; then
export DATASET="27Al_Data" export DATASET="27Al"
export PREFIX="Run_" export PREFIX="Run_"
export OUT_DIR="p"
export source_vertex=-200.0 # Source on the entrance window export source_vertex=-200.0 # Source on the entrance window
export CO2percent=3.0
echo "Starting parallel processing for 27Al proton runs..." echo "Starting parallel processing for 27Al proton runs..."
rm -f p_output/all.root # rm -f p_output/all.root
parallel --bar -j 6 process_run ::: 15 {17..22} parallel --bar -j 6 process_run ::: 15 {17..22}
hadd -j 4 -k p_output/Al_protons.root p_output/results_run0{17..22}.root
# Uncomment to merge via hadd when ready
# hadd -j 4 -k p_output/all.root p_output/results_run*.root
exit
fi fi
# --- Block 4: 17F Source Runs (5-14) --- # --- Block 4: 17F Source Runs (5-14) ---
if [[ 1 -eq 0 ]]; then if [[ 1 -eq 0 ]]; then
export DATASET="17F_Data" export DATASET="17F"
export PREFIX="Source_" export PREFIX="Source_"
export OUT_DIR="av"
echo "Starting parallel processing for 17F source runs..." echo "Starting parallel processing for 17F source runs..."
rm -f p_output/all.root # rm -f p_output/all.root
parallel --bar -j 6 process_run ::: {5..13} parallel --bar -j 6 process_run ::: {5..13}
fi fi
# --- Block 5: 17F Alpha Run with Gas (18-21) --- # --- Block 5: 17F Alpha Run with Gas (18-21) ---
if [[ 1 -eq 0 ]]; then if [[ 1 -eq 0 ]]; then
export DATASET="17F_Data" export DATASET="17F"
export PREFIX="SourceRun_" export PREFIX="SourceRun_"
export CO2percent=3.0 export OUT_DIR="a"
echo "Processing 17F alpha runs with dynamic source vertices..." echo "Processing 17F alpha runs with dynamic source vertices..."
# Running sequentially since the source_vertex variable changes per run # Running sequentially since the source_vertex variable changes per run
@ -93,17 +94,16 @@ fi
# --- Block 6: 17F Proton Data --- # --- Block 6: 17F Proton Data ---
if [[ 1 -eq 1 ]]; then if [[ 1 -eq 1 ]]; then
export DATASET="17F_Data" export DATASET="17F"
export PREFIX="ProtonRun_" export PREFIX="ProtonRun_"
export OUT_DIR="p"
export source_vertex=-57.28 export source_vertex=-57.28
export CO2percent=4.0
# parallel --bar -j 6 process_run ::: {38..42} #4% CO2
export CO2percent=3.0
parallel --bar -j 6 process_run ::: {44..48} #3CO2 parallel --bar -j 6 process_run ::: {44..48} #3CO2
# hadd -j 4 -k p_output/all.root p_output/results_run*.root hadd -j 4 -k p_output/3pc.root p_output/results_run0{44..48}.root
export CO2percent=4
parallel --bar -j 6 process_run ::: {38..42} #4% CO2
hadd -j 4 -k p_output/4pc.root p_output/results_run0{38..42}.root
exit exit
fi fi
# ========================================== # ==========================================
@ -115,6 +115,7 @@ unset anode_offset
unset cathode_offset unset cathode_offset
unset source_vertex # Fixed typo here unset source_vertex # Fixed typo here
unset DATASET unset DATASET
unset OUT_DIR
unset PREFIX unset PREFIX
unset flip180 unset flip180
unset timecut_low unset timecut_low