Compare commits

...

2 Commits

Author SHA1 Message Date
Vignesh Sitaraman 19262299ba modified: run_27Al.sh
modified:   run_tr.sh
2026-09-18 17:48:37 -04:00
Vignesh Sitaraman f30e244d27 modified: TrackRecon.C the code was NOT dead 2026-09-18 17:48:06 -04:00
3 changed files with 53 additions and 24 deletions

View File

@ -63,6 +63,9 @@ double source_vertex = 53.0,
z_entrance = -174.3 - 9.7 - 270.0,
dither_sigma = 8.0,
cathode_gain = 1.0,
// Low-band split controls, read by a1c1_solve() in Armory/PCZRecon.h.
// cfrac_split and lowband_rfactor are set per-dataset in Begin();
// missing_fmax is the dead-neighbour cell f-limit in solve_cell().
a1c1_cfrac_split = 0.0,
a1c1_missing_fmax = 2.0,
a1c1_lowband_rfactor = 0.0,
@ -79,7 +82,7 @@ double source_vertex = 53.0,
alpha_source_mev = 5.486;
// --- Immutable Constants ---
const double qqq_z = 100.0,
const double qqq_z = 105.0,
sx3_phi_pitch = 6.5 * (M_PI / 180.0),
qqq_wedge_pitch = (87.0 / 16.0) * (M_PI / 180.0),
qqq_ring_pitch = 48.0 / 16.0;
@ -271,25 +274,26 @@ struct AAEjectileMasses
const double a1c1_zg[8] = {147.998, 101.946, 59.7634, 19.6965, -19.6965, -59.7634, -101.946, -147.998};
static const double a1c1_cfmin_17F[7] = {0.20, 0.20, 0.20, 0.20, 0.20, 0.20, 0.20};
static const double a1c1_k_17F[7] = {0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25};
static const double a1c1_cfmin_27Al[7] = {0.42, 0.42, 0.42, 0.40, 0.42, 0.43, 0.43};
static const double a1c1_k_27Al[7] = {0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06};
static const double a1c1_cfmin_17F[7] = {0.410, 0.420, 0.400, 0.410, 0.410, 0.420, 0.410};
static const double a1c1_k_17F[7] = {0.060, 0.060, 0.052, 0.059, 0.065, 0.060, 0.060};
static const double a1c1_cfmin_27Al[7] = {0.410, 0.420, 0.400, 0.420, 0.400, 0.420, 0.410};
static const double a1c1_k_27Al[7] = {0.075, 0.099, 0.066, 0.062, 0.067, 0.099, 0.075};
// low band for 17F data
static const double a1c1_cfmin2_17F[7] = {0.10, 0.10, 0.10, 0.10, 0.10, 0.10, 0.10};
static const double a1c1_k2_17F[7] = {0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05};
static const double a1c1_cfmin2_27Al[7] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; // no low band
static const double a1c1_k2_27Al[7] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
// active per-cell set, populated by dataset in Begin()
double a1c1_cfmin_cell[7] = {0.410, 0.420, 0.400, 0.410, 0.410, 0.420, 0.410};
double a1c1_k_cell[7] = {0.060, 0.060, 0.052, 0.059, 0.065, 0.060, 0.060};
// Low-band split cells, read by a1c1_solve() in Armory/PCZRecon.h; populated
// per-dataset in Begin() from the a1c1_cfmin2_*/a1c1_k2_* sets above.
double a1c1_cfmin2_cell[7] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
double a1c1_k2_cell[7] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
// active per-cell set, populated by dataset in Begin()
double a1c1_cfmin_cell[7] = {0.20, 0.20, 0.20, 0.20, 0.20, 0.20, 0.20};
double a1c1_k_cell[7] = {0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25};
static std::vector<int> a1c1_dead_anode_17F = {9, 12}; // 1 can be recovered
static std::vector<int> a1c1_dead_cathode_17F = {}; // 0,13,15 can be recovered
static std::vector<int> a1c1_dead_anode_27Al = {0, 12, 19};
@ -2005,7 +2009,17 @@ Bool_t TrackRecon::Process(Long64_t entry)
// siPcCoincident(): this used to be the one Si-PC match in the file with a phi
// window but no time gate, so "withPC" included phi-aligned but time-accidental
// pairs.
auto hasPCCoincidence = [&](const Event &sievent, bool isQQQ)
// Per-track PC topology class of the first phi/time-coincident PC hit. The
// anode multiplicity (multi1) is split out because a 2-wire anode cluster
// interpolates between wires (charge-weighted pseudowire) and so resolves z
// better than the wire-pitch-quantized single wire:
// 0 = no PC coincidence
// 1 = A1C0 2 = A2C0 (multi2==0, anode-only)
// 3 = A1C1 4 = A2C1 (multi2==1)
// 5 = A1C2 6 = A2C2 (multi2==2)
// 7 = other (multi2>=3)
// (class>0 reproduces the old hasPCCoincidence bool exactly.)
auto pcTopoClass = [&](const Event &sievent, bool isQQQ) -> int
{
double phi_win = isQQQ ? TMath::Pi() / 4.0 : TMath::Pi() / 3.0;
for (const auto &pcevent : PC_Events)
@ -2015,21 +2029,35 @@ Bool_t TrackRecon::Process(Long64_t entry)
if (!siPcCoincident(sievent.Time1, pcevent.Time1))
continue;
if (TMath::Abs(sievent.pos.DeltaPhi(pcevent.pos)) <= phi_win)
return true;
{
int c = pcevent.multi2;
if (c > 3)
return 7;
return 1 + 2 * c + (pcevent.multi1 >= 2 ? 1 : 0); // A1C0..A2C2
}
return false;
}
return 0;
};
for (const auto &qqqevent : QQQ_Events)
{
plotter->Fill1D("siE_qqq_calibrated_all", 800, 0, 15, qqqevent.Energy1, "siE");
bool coinc = hasPCCoincidence(qqqevent, true);
plotter->Fill1D(coinc ? "siE_qqq_calibrated_withPC" : "siE_qqq_calibrated_noPC", 800, 0, 15, qqqevent.Energy1, "siE");
int topo = pcTopoClass(qqqevent, true);
plotter->Fill1D(topo > 0 ? "siE_qqq_calibrated_withPC" : "siE_qqq_calibrated_noPC", 800, 0, 15, qqqevent.Energy1, "siE");
// PC acceptance / z-quality mix vs track angle (species compared across files):
// class 0=noPC 1=A1C0 2=A1C1 3=A1C2 4=multi2>=3. theta rel. to source_vertex
// (exact for the point source; a lab-angle proxy for reaction protons).
double th = (qqqevent.pos - beamAxisPoint(source_vertex)).Theta() * 180.0 / M_PI;
plotter->Fill1D("PCtopo_class_qqq", 8, 0, 8, topo + 0.5, "PCtopo");
plotter->Fill2D("PCtopo_class_vs_theta_qqq", 180, 0, 180, 8, 0, 8, th, topo + 0.5, "PCtopo");
}
for (const auto &sx3event : SX3_Events)
{
plotter->Fill1D("siE_sx3_calibrated_all", 800, 0, 15, sx3event.Energy1, "siE");
bool coinc = hasPCCoincidence(sx3event, false);
plotter->Fill1D(coinc ? "siE_sx3_calibrated_withPC" : "siE_sx3_calibrated_noPC", 800, 0, 15, sx3event.Energy1, "siE");
int topo = pcTopoClass(sx3event, false);
plotter->Fill1D(topo > 0 ? "siE_sx3_calibrated_withPC" : "siE_sx3_calibrated_noPC", 800, 0, 15, sx3event.Energy1, "siE");
double th = (sx3event.pos - beamAxisPoint(source_vertex)).Theta() * 180.0 / M_PI;
plotter->Fill1D("PCtopo_class_sx3", 8, 0, 8, topo + 0.5, "PCtopo");
plotter->Fill2D("PCtopo_class_vs_theta_sx3", 180, 0, 180, 8, 0, 8, th, topo + 0.5, "PCtopo");
}
if (doMiscHistograms && ta_foil_run)

View File

@ -12,8 +12,8 @@ export source_vertex=-200.0
export DEDX_SCALE=0.87
# export BEAM_AXIS_Z0=-200
export BEAM_AXIS_X=0.0
export BEAM_AXIS_Y=0.0
export BEAM_AXIS_X=0
export BEAM_AXIS_Y=0
# export BEAM_TILT_X=-0.00083798
# export BEAM_TILT_Y=0.00191377

View File

@ -56,7 +56,7 @@ if [[ 1 -eq 0 ]]; then
fi
# --- Block 3: 27Al Alpha+Gas Runs (9, 12) ---
if [[ 1 -eq 1 ]]; then
if [[ 1 -eq 0 ]]; then
export DATASET="27Al"
export PREFIX="Run_"
export OUT_DIR="Output_a"
@ -64,8 +64,8 @@ if [[ 1 -eq 1 ]]; then
export pressure_in_torr=350
rm -f ${OUT_DIR}/all.root
echo "Processing 27Al alpha+gas runs..."
export source_vertex=-5.36; export timecut_low=12.0; export timecut_high=119.0; process_run 9 "$slope"
unset timecut_high
# export source_vertex=-5.36; export timecut_low=12.0; export timecut_high=119.0; process_run 9 "$slope"
# unset timecut_high
export source_vertex=53.44; export timecut_low=400.0; process_run 12 "$slope"
unset Gain
unset CATHODE_GAIN
@ -86,7 +86,8 @@ if [[ 1 -eq 1 ]]; then
export source_vertex=14.24; process_run 19
export source_vertex=-24.96; process_run 20
export source_vertex=-73.96; process_run 21
hadd -j 4 -k ${OUT_DIR}/all.root ${OUT_DIR}/results_run*.root
hadd -j 4 -f -k ${OUT_DIR}/F_alpha.root ${OUT_DIR}/results_run0{18,19,20,21}.root
hadd -j 4 -f -k ${OUT_DIR}/all.root ${OUT_DIR}/results_run*.root
exit
fi
@ -111,7 +112,7 @@ if [[ 1 -eq 1 ]]; then
fi
# --- Block 6: 17F Proton Data ---
if [[ 1 -eq 1 ]]; then
if [[ 1 -eq 0 ]]; then
export DATASET="17F"
export PREFIX="ProtonRun_"
export OUT_DIR="Output_p"