From 702399be8467ce8dd0c58beb763fea930dd61205 Mon Sep 17 00:00:00 2001 From: vsitaraman Date: Sun, 7 Jun 2026 17:18:44 -0400 Subject: [PATCH] modified: Calibration.C corrected the p energy being used to the 241Am peak modified: GainMatchQQQ.C made all output files .dat instead of .txt modified: TrackRecon.C made ome more plots for dissertation modified: qqq_Calib.dat updated with 241Am peak position modified: run_17F.sh modified: run_tr.sh modified: scratch/make_prettyplots.C made change so now we can input multiple runs at once and plots them together --- Calibration.C | 12 +- GainMatchQQQ.C | 4 +- TrackRecon.C | 396 +++++----- qqq_Calib.dat | 1516 ++++++++++++++++++------------------ run_17F.sh | 1 + run_tr.sh | 20 +- scratch/make_prettyplots.C | 171 +++- 7 files changed, 1149 insertions(+), 971 deletions(-) diff --git a/Calibration.C b/Calibration.C index 02f830d..0e46375 100644 --- a/Calibration.C +++ b/Calibration.C @@ -37,7 +37,7 @@ void Calibration::Begin(TTree * /*tree*/) plotter = new HistPlotter("Calib.root", "TFILE"); // ----------------------- Load QQQ Gains { - std::string filename = "qqq_GainMatch.txt"; + std::string filename = "qqq_GainMatch.dat"; std::ifstream infile(filename); if (!infile.is_open()) { @@ -164,10 +164,10 @@ void Calibration::Terminate() double calibArray[MAX_QQQ][MAX_RING][MAX_WEDGE] = {{{0}}}; bool calibValid[MAX_QQQ][MAX_RING][MAX_WEDGE] = {{{false}}}; - std::ofstream outFile("qqq_Calib.txt"); + std::ofstream outFile("qqq_Calib.dat"); if (!outFile.is_open()) { - std::cerr << "Error opening qqq_Calib.txt!" << std::endl; + std::cerr << "Error opening qqq_Calib.dat!" << std::endl; return; } @@ -216,8 +216,8 @@ void Calibration::Terminate() if (adcPeak <= 0) continue; - // double slope_keV = AM241_PEAK / adcPeak; // keV per ADC - double slope_keV = P_PEAK / adcPeak; // keV per ADC + double slope_keV = AM241_PEAK / adcPeak; // keV per ADC + // double slope_keV = P_PEAK / adcPeak; // keV per ADC calibArray[det][ring][wedge] = slope_keV; calibValid[det][ring][wedge] = true; @@ -229,7 +229,7 @@ void Calibration::Terminate() } outFile.close(); - std::cout << "Wrote QQQ calibration file qqq_Calib.txt\n"; + std::cout << "Wrote QQQ calibration file qqq_Calib.dat\n"; //---------------------------------------------------------------------- // 3. Build fully calibrated 2D combined histogram diff --git a/GainMatchQQQ.C b/GainMatchQQQ.C index b428da2..9f0e8a8 100644 --- a/GainMatchQQQ.C +++ b/GainMatchQQQ.C @@ -154,10 +154,10 @@ void GainMatchQQQ::Terminate() bool gainValid[MAX_DET][MAX_RING][MAX_WEDGE] = {{{false}}}; // Output file for the Minimizer - std::ofstream outFile("qqq_GainMatch.txt"); + std::ofstream outFile("qqq_GainMatch.dat"); // Benchmark/Debug file - std::ofstream benchFile("benchmark_diff.txt"); + std::ofstream benchFile("benchmark_diff.dat"); benchFile << "ID Wedge Ring Chi2NDF Slope SlopeErr" << std::endl; if (!outFile.is_open()) { std::cerr << "Error opening output file!" << std::endl; return; } diff --git a/TrackRecon.C b/TrackRecon.C index c91855a..72452c1 100644 --- a/TrackRecon.C +++ b/TrackRecon.C @@ -3,7 +3,7 @@ #define RAW_HISTOS // #define VTX_GATES // #define AL_BEAM -#define F_BEAM +// #define F_BEAM // #define nA_Analysis Int_t colors[40] = { @@ -40,9 +40,9 @@ Int_t colors[40] = { bool process_alpha_proton_scattering = false; bool doMiscHistograms = true; -bool doPCSX3ClusterAnalysis = false; -bool doPCQQQClusterAnalysis = false; -bool doOldAnalysis = true; +bool doPCSX3ClusterAnalysis = true; +bool doPCQQQClusterAnalysis = true; +bool doOldAnalysis = false; bool do27AlapAnalysis = false; double source_vertex = 53; // 53 const double qqq_z = 100.0; @@ -140,8 +140,8 @@ int anodeIndex = -1, cathodeIndex = -1; void protonAlphaHistograms(HistPlotter *plotter, std::vector QQQ_Events, std::vector SX3_Events, std::vector PC_Events); void miscHistograms_oneWire(HistPlotter *plotter, std::vector QQQ_Events, std::vector>> aClusters); -void protonMiscHistograms(HistPlotter* plotter, std::vector QQQ_Events, std::vector SX3_Events, std::vector PC_Events); -void protonMiscHistograms_sx3(HistPlotter* plotter, std::vector QQQ_Events, std::vector SX3_Events, std::vector PC_Events); +void protonMiscHistograms(HistPlotter *plotter, std::vector QQQ_Events, std::vector SX3_Events, std::vector PC_Events); +void protonMiscHistograms_sx3(HistPlotter *plotter, std::vector QQQ_Events, std::vector SX3_Events, std::vector PC_Events); void PCSX3ClusterAnalysis(HistPlotter *plotter, std::vector QQQ_Events, std::vector SX3_Events, std::vector PC_Events); void PCQQQClusterAnalysis(HistPlotter *plotter, std::vector QQQ_Events, std::vector SX3_Events, std::vector PC_Events); @@ -415,11 +415,15 @@ Bool_t TrackRecon::Process(Long64_t entry) { // std::cout << det.frontEL << " " << det.frontEL*sx3RightGain[id][det.stripF] << std::endl; // plotter->Fill2D("be_vs_x_sx3_id_"+std::to_string(id)+"_f"+std::to_string(det.stripF)+"_b"+std::to_string(det.stripB),200,-1,1,800,0,8192,det.frontX,det.backE,"evsx"); + plotter->Fill2D("unmatched_be_vs_x_sx3_id_" + std::to_string(id), 200, -1, 1, 800, 0, 4096, det.frontX, det.backE, "evsx"); + plotter->Fill2D("unmatched_be_vs_x_sx3", 200, -1, 1, 800, 0, 4096, det.frontX, det.backE, "evsx"); + plotter->Fill2D("matched_be_vs_x_sx3", 200, -60, 60, 800, 0, 8192, det.frontX * sx3FrontGain[id][det.stripF] + sx3FrontOffset[id][det.stripF], det.backE * sx3BackGain[id][det.stripF][det.stripB], "evsx"); + plotter->Fill2D("matched_be_vs_x_sx3_id_" + std::to_string(id), 200, -60, 60, 800, 0, 8192, det.frontX * sx3FrontGain[id][det.stripF] + sx3FrontOffset[id][det.stripF], det.backE * sx3BackGain[id][det.stripF][det.stripB], "evsx"); plotter->Fill2D("matched_be_vs_x_sx3_id_" + std::to_string(id) + "_f" + std::to_string(det.stripF), 200, -60, 60, 800, 0, 8192, det.frontX * sx3FrontGain[id][det.stripF] + sx3FrontOffset[id][det.stripF], det.backE * sx3BackGain[id][det.stripF][det.stripB], "evsx_matched"); // plotter->Fill2D("fe_vs_x_sx3_id_"+std::to_string(id)+"_f"+std::to_string(det.stripF)+"_"+std::to_string(det.stripB),200,-1,1,800,0,4096,det.frontX,det.backE,"evsx"); - // plotter->Fill2D("l_vs_r_sx3_id_"+std::to_string(id)+"_f"+std::to_string(det.stripF),800,0,4096,800,0,4096,det.frontEL,det.frontER,"l_vs_r"); + plotter->Fill2D("l_vs_r_sx3_id_" + std::to_string(id) + "_f" + std::to_string(det.stripF), 800, 0, 4096, 800, 0, 4096, det.frontEL, det.frontER, "l_vs_r"); } if (det.valid && (id == 9 || id == 7 || id == 1 || id == 3) && det.stripF != DEFAULT_NULL && det.stripB != DEFAULT_NULL) { @@ -447,6 +451,7 @@ Bool_t TrackRecon::Process(Long64_t entry) Event sx3ev(TVector3(rho_at_strip * TMath::Cos(phi_n), rho_at_strip * TMath::Sin(phi_n), z), backE * 0.001, -1, det.ts, -1, det.stripB + 4 * id, det.stripF + 4 * id); SX3_Events.push_back(sx3ev); plotter->Fill2D("sx3backs_gm", 100, 0, 100, 800, 0, 8192, det.stripB + 4 * id, backE); + plotter->Fill1D("sx3backs_calib", 800, 0, 8192, backE); // plotter->Fill2D("SX3CartesianPlot", 200, -100, 100, 200, -100, 100, 88.0*TMath::Cos(phi_n),88.0*TMath::Sin(phi_n), "hCalSX3"); plotter->Fill2D("SX3CartesianPlot" + std::to_string(id), 200, -100, 100, 200, -100, 100, 88.0 * TMath::Cos(phi_n), 88.0 * TMath::Sin(phi_n), "hCalSX3"); @@ -564,7 +569,6 @@ Bool_t TrackRecon::Process(Long64_t entry) plotter->Fill2D("RingE_vs_Index", 16 * 4, 0, 16 * 4, 1000, 0, 16000, chRing + qqq.id[i] * 16, eRing, "hRawQQQ"); plotter->Fill2D("WedgeE_vs_Index", 16 * 4, 0, 16 * 4, 1000, 0, 16000, chWedge + qqq.id[i] * 16, eWedge, "hRawQQQ"); #endif - plotter->Fill2D("WedgeE_Vs_RingECal", 1000, 0, 10, 1000, 0, 10, eWedgeMeV, eRingMeV, "hCalQQQ"); if (qqqCalibValid[qqq.id[i]][chWedge][chRing]) { @@ -586,6 +590,9 @@ Bool_t TrackRecon::Process(Long64_t entry) QQQ_Events_Raw.push_back(qqqeventr); plotter->Fill2D("WedgeE_Vs_RingECal_selected", 1000, 0, 10, 1000, 0, 10, eWedgeMeV, eRingMeV, "hCalQQQ"); + plotter->Fill1D("QQQECal", 2048, 0, 10, eRingMeV); + plotter->Fill1D("QQQECal", 2048, 0, 10, eWedgeMeV); + const int channelsPerDetector = MAX_RING + MAX_WEDGE; int globalRingChannel = chRing + (qqq.id[i] * channelsPerDetector); int globalWedgeChannel = chWedge + (qqq.id[i] * channelsPerDetector) + MAX_RING; @@ -801,7 +808,7 @@ Bool_t TrackRecon::Process(Long64_t entry) bool found_rf = false; bool found_mcp = false; bool found_needle = false; - bool qqq_inner_ring = (qqqevent.ch1 % 16) < 6; + bool qqq_inner_ring = (qqqevent.ch1 % 16) < 8; for (int j = 0; j < misc.multi; j++) { plotter->Fill1D("channels_misc_qqq", 20, 0, 20, misc.ch[j], "misc"); @@ -816,25 +823,25 @@ Bool_t TrackRecon::Process(Long64_t entry) { // RF ts_rf = static_cast(misc.t[j]) + static_cast(misc.tf[j]); found_rf = 1; - plotter->Fill1D("dt_qqq_rf_innerring"+std::to_string(qqq_inner_ring), 800, -2000, 2000, ts_qqq - ts_rf, "misc"); + plotter->Fill1D("dt_qqq_rf_innerring" + std::to_string(qqq_inner_ring), 800, -2000, 2000, ts_qqq - ts_rf, "misc"); } if (misc.ch[j] == 4) { // mcp ts_mcp = static_cast(misc.t[j]) + static_cast(misc.tf[j]); found_mcp = 1; - plotter->Fill1D("dt_qqq_mcp_innerring"+std::to_string(qqq_inner_ring), 800, -2000, 2000, ts_qqq - ts_mcp, "misc"); + plotter->Fill1D("dt_qqq_mcp_innerring" + std::to_string(qqq_inner_ring), 800, -2000, 2000, ts_qqq - ts_mcp, "misc"); } } if (found_rf && found_mcp) { if (ctr == 0) - plotter->Fill1D("dt_rf_mcp_qqq_innerring"+std::to_string(qqq_inner_ring), 500, -1000, 1000, ts_rf - ts_mcp, "misc"); + plotter->Fill1D("dt_rf_mcp_qqq_innerring" + std::to_string(qqq_inner_ring), 500, -1000, 1000, ts_rf - ts_mcp, "misc"); double dt_rf_mcp = ts_rf - ts_mcp; double dt_qqq_rf = ts_qqq - ts_rf; double dt_qqq_mcp = ts_qqq - ts_mcp; - plotter->Fill2D("dt(qqq,rf)_vs_(rf,mcp)_innerring"+std::to_string(qqq_inner_ring), 640, -2000, 2000, 640, -2000, 2000, dt_qqq_rf, dt_rf_mcp, "misc"); - plotter->Fill2D("dt_(qqq,mcp)_vs_(qqq,rf)_innerring"+std::to_string(qqq_inner_ring), 640, -1400, 2000, 640, -2000, 2000, dt_qqq_mcp, dt_qqq_rf, "misc"); - plotter->Fill2D("dt_(qqq,mcp)_vs_(rf,mcp)_innerring"+std::to_string(qqq_inner_ring), 640, -1400, -600, 640, -2000, 2000, dt_qqq_mcp, dt_rf_mcp, "misc"); + plotter->Fill2D("dt(qqq,rf)_vs_(rf,mcp)_innerring" + std::to_string(qqq_inner_ring), 640, -2000, 2000, 640, -2000, 2000, dt_qqq_rf, dt_rf_mcp, "misc"); + plotter->Fill2D("dt_(qqq,mcp)_vs_(qqq,rf)_innerring" + std::to_string(qqq_inner_ring), 640, -1400, 2000, 640, -2000, 2000, dt_qqq_mcp, dt_qqq_rf, "misc"); + plotter->Fill2D("dt_(qqq,mcp)_vs_(rf,mcp)_innerring" + std::to_string(qqq_inner_ring), 640, -1400, -600, 640, -2000, 2000, dt_qqq_mcp, dt_rf_mcp, "misc"); } ctr += 1; } @@ -896,7 +903,7 @@ Bool_t TrackRecon::Process(Long64_t entry) { miscHistograms_oneWire(plotter, QQQ_Events, aClusters); protonMiscHistograms_sx3(plotter, QQQ_Events, SX3_Events, PC_Events); - protonMiscHistograms(plotter, QQQ_Events, SX3_Events, PC_Events); + protonMiscHistograms(plotter, QQQ_Events, SX3_Events, PC_Events); // return kTRUE; } @@ -1078,16 +1085,21 @@ Bool_t TrackRecon::Process(Long64_t entry) double theta_recon = (sx3event.pos - TVector3(0, 0, vertex_recon)).Theta(); double sinTheta = TMath::Sin(theta_recon); - double Ex_from_proton = apkin_p.getExc(sx3Efix, theta_recon * 180. / M_PI); - double Ex_from_alpha = apkin_a.getExc(sx3Efixalpha, theta_recon * 180. / M_PI); - // Fill standard un-gated plots + plotter->Fill1D(nA_label + "_vertex_recon_SX3", 400, -200, 200, vertex_recon, nA_label); + plotter->Fill1D(nA_label + "_vertex_recon", 400, -200, 200, vertex_recon, nA_label); + plotter->Fill2D(nA_label + "_dE_Ecorr_Anode_SX3", 800, 0, 30, 800, 0, 30000, sx3Efix, apSumE * sinTheta, nA_label); plotter->Fill2D(nA_label + "_dE_Ecorr_Anode_SX3_alpha", 800, 0, 30, 800, 0, 30000, sx3Efixalpha, apSumE * sinTheta, nA_label); plotter->Fill2D(nA_label + "_sx3_E_vs_theta_raw_SX3", 180, 0, 180, 400, 0, 30, theta_recon * 180. / M_PI, sx3event.Energy1, nA_label); plotter->Fill2D(nA_label + "_sx3_E_vs_theta_corr_SX3", 180, 0, 180, 400, 0, 30, theta_recon * 180. / M_PI, sx3Efix, nA_label); + +#if defined(F_BEAM) || defined(AL_BEAM) + double Ex_from_proton = apkin_p.getExc(sx3Efix, theta_recon * 180. / M_PI); + double Ex_from_alpha = apkin_a.getExc(sx3Efixalpha, theta_recon * 180. / M_PI); plotter->Fill1D(nA_label + "_Ex_from_protons_SX3", 1200, -30, 30, Ex_from_proton, nA_label); plotter->Fill1D(nA_label + "_Ex_from_alphas_SX3", 1200, -30, 30, Ex_from_alpha, nA_label); +#endif // Fill Gated Plots // if (vtx_gate != "") @@ -1172,16 +1184,19 @@ Bool_t TrackRecon::Process(Long64_t entry) double theta_recon = (qqqevent.pos - TVector3(0, 0, vertex_recon)).Theta(); double sinTheta = TMath::Sin(theta_recon); - double Ex_from_proton = apkin_p.getExc(qqqEfix, theta_recon * 180. / M_PI); - double Ex_from_alpha = apkin_a.getExc(qqqEfixalpha, theta_recon * 180. / M_PI); - // Fill standard un-gated plots + plotter->Fill1D(nA_label + "_vertex_recon_QQQ", 400, -200, 200, vertex_recon, nA_label); + plotter->Fill1D(nA_label + "_vertex_recon", 400, -200, 200, vertex_recon, nA_label); plotter->Fill2D(nA_label + "_dE_Ecorr_Anode_QQQ", 800, 0, 30, 800, 0, 30000, qqqEfix, apSumE * sinTheta, nA_label); plotter->Fill2D(nA_label + "_dE_Ecorr_Anode_QQQ_alpha", 800, 0, 30, 800, 0, 30000, qqqEfixalpha, apSumE * sinTheta, nA_label); plotter->Fill2D(nA_label + "_qqq_E_vs_theta_raw_QQQ", 180, 0, 180, 400, 0, 30, theta_recon * 180. / M_PI, qqqevent.Energy1, nA_label); plotter->Fill2D(nA_label + "_qqq_E_vs_theta_corr_QQQ", 180, 0, 180, 400, 0, 30, theta_recon * 180. / M_PI, qqqEfix, nA_label); + +#if defined(F_BEAM) || defined(AL_BEAM) + double Ex_from_alpha = apkin_a.getExc(qqqEfixalpha, theta_recon * 180. / M_PI); plotter->Fill1D(nA_label + "_Ex_from_alphas_QQQ", 1200, -30, 30, Ex_from_alpha, nA_label); plotter->Fill1D(nA_label + "_Ex_from_protons_QQQ", 1200, -30, 30, Ex_from_proton, nA_label); +#endif // Fill Gated Plots // if (vtx_gate != "") @@ -1400,6 +1415,7 @@ void PCSX3ClusterAnalysis(HistPlotter *plotter, std::vector QQQ_Events, s double t_minimum = -1.0 * (x1.X() * v.X() + x1.Y() * v.Y()) / (v.X() * v.X() + v.Y() * v.Y()); TVector3 r_rhoMin_fix = x1 + t_minimum * v; plotter->Fill1D("VertexRecon_pczfix_sx3", 800, -300, 300, r_rhoMin_fix.Z()); + plotter->Fill1D("VertexRecon_pczfix", 800, -300, 300, r_rhoMin_fix.Z()); plotter->Fill1D("pczfix_A1C2_1d_sx3", 600, -200, 200, pcz_fix); plotter->Fill2D("pczfix_vs_sx3pczguess_A1C2", 600, -200, 200, 600, -200, 200, pczguess, pcz_fix); plotter->Fill2D("pcz_vs_sx3pczguess_A1C2_strip" + std::to_string(sx3event.ch2), 300, -200, 200, 600, -200, 200, pczguess, pcevent.pos.Z()); @@ -1549,6 +1565,7 @@ void PCQQQClusterAnalysis(HistPlotter *plotter, std::vector QQQ_Events, s plotter->Fill2D("dE3_E_AnodeQQQR_A1C2_TC1_PC" + std::to_string(phicut), 400, 0, 30, 800, 0, 10000, qqqevent.Energy1, pcevent.Energy1 * sinTheta_customV); plotter->Fill1D("VertexRecon_pczfix_qqq", 800, -400, 400, r_rhoMin_fix.Z()); + plotter->Fill1D("VertexRecon_pczfix", 800, -400, 400, r_rhoMin_fix.Z()); plotter->Fill1D("VertexRecon_pczfix_qqq_PC" + std::to_string(phicut) + "_pidlow" + std::to_string(lowercut_cath), 800, -400, 400, r_rhoMin_fix.Z()); if (TMath::Abs(r_rhoMin_fix.Z()) < 200.0) @@ -2098,174 +2115,191 @@ void miscHistograms_oneWire(HistPlotter *plotter, std::vector QQQ_Events, } // end QQQEvents loop } +void protonMiscHistograms(HistPlotter *plotter, std::vector QQQ_Events, std::vector SX3_Events, std::vector PC_Events) +{ + // consider the 'proton-like' QQQ branch seen in a,p data + TRandom3 rand; + rand.SetSeed(); // random seed set + Kinematics apkin_a(1.008664916, 4.002603254, 4.002603254, 1.008664916, 7.1); // 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) + { + if (qqqevent.Energy1 < 0.6) + continue; // coarse gating + // if(qqqevent.Energy1 > 5.0) continue; //coarse gating + for (auto pcevent : PC_Events) + { + if (!(pcevent.multi1 == 1 && pcevent.multi2 <= 2)) + continue; + // if(pcevent.Energy1 > 11000) continue; //coarse gating + bool phicut = qqqevent.pos.Phi() <= pcevent.pos.Phi() + TMath::Pi() / 4. && qqqevent.pos.Phi() >= pcevent.pos.Phi() - TMath::Pi() / 4.; + if (!phicut) + continue; + // if(pcevent.Time1-qqqevent.Time1<-150 || pcevent.Time1-qqqevent.Time1 >850) continue; -void protonMiscHistograms(HistPlotter* plotter, std::vector QQQ_Events, std::vector SX3_Events, std::vector PC_Events) { - //consider the 'proton-like' QQQ branch seen in a,p data - TRandom3 rand; - rand.SetSeed();//random seed set - Kinematics apkin_a(1.008664916,4.002603254,4.002603254,1.008664916,7.1); //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) { - if(qqqevent.Energy1 < 0.6) continue; //coarse gating - //if(qqqevent.Energy1 > 5.0) continue; //coarse gating - for(auto pcevent: PC_Events) { - if(!(pcevent.multi1==1 && pcevent.multi2<=2)) continue; - //if(pcevent.Energy1 > 11000) continue; //coarse gating - bool phicut = qqqevent.pos.Phi() <= pcevent.pos.Phi()+TMath::Pi()/4. && qqqevent.pos.Phi() >= pcevent.pos.Phi()-TMath::Pi()/4.; - if(!phicut) continue; - //if(pcevent.Time1-qqqevent.Time1<-150 || pcevent.Time1-qqqevent.Time1 >850) continue; - - double pcz_fix, pcz_dith=pcevent.pos.Z(); - if(pcevent.multi2==2) - pcz_fix = pcfix_func.Eval(pcevent.pos.Z()); - else { - pcz_fix = rand.Gaus(pcevent.pos.Z(),8.0);//dither for a1c1 events - pcz_dith = pcz_fix; - } - TVector3 x2f(pcevent.pos.X(),pcevent.pos.Y(),pcz_fix); - TVector3 x1(qqqevent.pos); - TVector3 v = x2f-x1; - double t_minimum = -1.0*(x1.X()*v.X()+x1.Y()*v.Y())/(v.X()*v.X()+v.Y()*v.Y()); - TVector3 r_rhoMin_fix = x1 + t_minimum*v; - double vertex_z = r_rhoMin_fix.Z(); - //double theta_q = (qqqevent.pos - TVector3(0,0,vertex_z)).Theta(); - double theta_q = (qqqevent.pos - r_rhoMin_fix).Theta(); - double sinTheta_customV = TMath::Sin(theta_q); - //if(r_rhoMin_fix.Perp()>6) continue; - bool cathode_alpha_select = (pcevent.Energy2 > 1400); - if(vertex_z < -173.6 || vertex_z > 100) continue; + double pcz_fix, pcz_dith = pcevent.pos.Z(); + if (pcevent.multi2 == 2) + pcz_fix = pcfix_func.Eval(pcevent.pos.Z()); + else + { + pcz_fix = rand.Gaus(pcevent.pos.Z(), 8.0); // dither for a1c1 events + pcz_dith = pcz_fix; + } + TVector3 x2f(pcevent.pos.X(), pcevent.pos.Y(), pcz_fix); + TVector3 x1(qqqevent.pos); + TVector3 v = x2f - x1; + double t_minimum = -1.0 * (x1.X() * v.X() + x1.Y() * v.Y()) / (v.X() * v.X() + v.Y() * v.Y()); + TVector3 r_rhoMin_fix = x1 + t_minimum * v; + double vertex_z = r_rhoMin_fix.Z(); + // double theta_q = (qqqevent.pos - TVector3(0,0,vertex_z)).Theta(); + double theta_q = (qqqevent.pos - r_rhoMin_fix).Theta(); + double sinTheta_customV = TMath::Sin(theta_q); + // if(r_rhoMin_fix.Perp()>6) continue; + bool cathode_alpha_select = (pcevent.Energy2 > 1400); + if (vertex_z < -173.6 || vertex_z > 100) + continue; + // What's below: radial cut, time coincident, phi-correlated events with possible energy selection applied to both E_si and dE_Anodes + auto plot_with_tag = [&](std::string tag = "") + { + std::string pmlabel = "proton+misc" + tag; + plotter->Fill2D("pmisc_dE_E_AnodeQQQ" + tag, 400, 0, 10, 800, 0, 40000, qqqevent.Energy1, pcevent.Energy1, pmlabel); + plotter->Fill2D("pmisc_dE_E_CathodeQQQ" + tag, 400, 0, 10, 800, 0, 10000, qqqevent.Energy1, pcevent.Energy2, pmlabel); + plotter->Fill2D("pmisc_dE3_E_AnodeQQQ" + tag, 400, 0, 10, 400, 0, 40000, qqqevent.Energy1, pcevent.Energy1 * sinTheta_customV * 3., pmlabel); + plotter->Fill2D("pmisc_dE3_E_CathodeQQQ" + tag, 400, 0, 10, 400, 0, 10000, qqqevent.Energy1, pcevent.Energy2 * sinTheta_customV, pmlabel); + plotter->Fill2D("pmisc_dPhi_QQQ_PC" + tag, 180, -360, 360, 180, -360, 360, pcevent.pos.Phi() * 180 / M_PI, qqqevent.pos.Phi() * 180 / M_PI, pmlabel); + plotter->Fill1D("pmisc_dt_Anode_QQQ_PC" + std::to_string(phicut) + tag, 600, -2000, 2000, pcevent.Time1 - qqqevent.Time1, pmlabel); + plotter->Fill1D("pmisc_dt_Cathode_QQQ" + tag, 600, -2000, 2000, pcevent.Time2 - qqqevent.Time1, pmlabel); + plotter->Fill2D("pmisc_dt_Anode_E_QQQ_PC" + std::to_string(phicut) + tag, 600, -2000, 2000, 400, 0, 10, pcevent.Time1 - qqqevent.Time1, qqqevent.Energy1, pmlabel); + plotter->Fill2D("pmisc_dt_AnodeQQQ_vsPCPhi" + tag, 600, -2000, 2000, 180, -360, 360, pcevent.Time1 - qqqevent.Time1, pcevent.pos.Phi() * 180. / M_PI, pmlabel); + plotter->Fill2D("pmisc_dt_Cathode_E_QQQ" + tag, 600, -2000, 2000, 400, 0, 10, pcevent.Time2 - qqqevent.Time1, qqqevent.Energy1, pmlabel); + plotter->Fill2D("pmisc_dt_CathodeQQQ_vsPCPhi" + tag, 600, -2000, 2000, 180, -360, 360, pcevent.Time2 - qqqevent.Time1, pcevent.pos.Phi() * 180. / M_PI, pmlabel); + plotter->Fill1D("pmisc_pczfix" + tag, 600, -300, 300, pcz_fix, pmlabel); + if (pcevent.multi2 == 2) + { + plotter->Fill1D("pmisc_pcz" + tag, 600, -300, 300, pcevent.pos.Z(), pmlabel); + plotter->Fill1D("pmisc_pcz2" + tag, 600, -300, 300, pcevent.pos.Z(), pmlabel); + } + if (pcevent.multi2 == 1) + { + plotter->Fill1D("pmisc_pcz" + tag, 600, -300, 300, pcz_fix, pmlabel); + plotter->Fill1D("pmisc_pcz1" + tag, 600, -300, 300, pcevent.pos.Z(), pmlabel); + plotter->Fill1D("pmisc_pcz_dith" + tag, 600, -300, 300, pcz_dith, pmlabel); + } - //What's below: radial cut, time coincident, phi-correlated events with possible energy selection applied to both E_si and dE_Anodes - auto plot_with_tag = [&](std::string tag="") { - std::string pmlabel = "proton+misc"+tag; - plotter->Fill2D("pmisc_dE_E_AnodeQQQ"+tag,400,0,10,800,0,40000,qqqevent.Energy1,pcevent.Energy1,pmlabel); - plotter->Fill2D("pmisc_dE_E_CathodeQQQ"+tag,400,0,10,800,0,10000,qqqevent.Energy1,pcevent.Energy2,pmlabel); - plotter->Fill2D("pmisc_dE3_E_AnodeQQQ"+tag,400,0,10,400,0,40000,qqqevent.Energy1,pcevent.Energy1*sinTheta_customV*3.,pmlabel); - plotter->Fill2D("pmisc_dE3_E_CathodeQQQ"+tag,400,0,10,400,0,10000,qqqevent.Energy1,pcevent.Energy2*sinTheta_customV,pmlabel); - plotter->Fill2D("pmisc_dPhi_QQQ_PC"+tag,180,-360,360,180,-360,360,pcevent.pos.Phi()*180/M_PI,qqqevent.pos.Phi()*180/M_PI,pmlabel); - plotter->Fill1D("pmisc_dt_Anode_QQQ_PC"+std::to_string(phicut)+tag,600,-2000,2000,pcevent.Time1-qqqevent.Time1,pmlabel); - plotter->Fill1D("pmisc_dt_Cathode_QQQ"+tag,600,-2000,2000,pcevent.Time2-qqqevent.Time1,pmlabel); - plotter->Fill2D("pmisc_dt_Anode_E_QQQ_PC"+std::to_string(phicut)+tag,600,-2000,2000,400,0,10,pcevent.Time1-qqqevent.Time1,qqqevent.Energy1,pmlabel); - plotter->Fill2D("pmisc_dt_AnodeQQQ_vsPCPhi"+tag,600,-2000,2000,180,-360,360,pcevent.Time1-qqqevent.Time1,pcevent.pos.Phi()*180./M_PI,pmlabel); - plotter->Fill2D("pmisc_dt_Cathode_E_QQQ"+tag,600,-2000,2000,400,0,10,pcevent.Time2-qqqevent.Time1,qqqevent.Energy1,pmlabel); - plotter->Fill2D("pmisc_dt_CathodeQQQ_vsPCPhi"+tag,600,-2000,2000,180,-360,360,pcevent.Time2-qqqevent.Time1,pcevent.pos.Phi()*180./M_PI,pmlabel); - plotter->Fill1D("pmisc_pczfix"+tag,600,-300,300,pcz_fix,pmlabel); - if(pcevent.multi2==2) { - plotter->Fill1D("pmisc_pcz"+tag,600,-300,300,pcevent.pos.Z(),pmlabel); - plotter->Fill1D("pmisc_pcz2"+tag,600,-300,300,pcevent.pos.Z(),pmlabel); - } - if(pcevent.multi2==1) { - plotter->Fill1D("pmisc_pcz"+tag,600,-300,300,pcz_fix,pmlabel); - plotter->Fill1D("pmisc_pcz1"+tag,600,-300,300,pcevent.pos.Z(),pmlabel); - plotter->Fill1D("pmisc_pcz_dith"+tag,600,-300,300,pcz_dith,pmlabel); - } + // double path_length_q = (qqqevent.pos-TVector3(0,0,vertex_z)).Mag()*0.1; + // double path_length_s = (sx3event.pos-TVector3(0,0,vertex_z)).Mag()*0.1; + double path_length_q = (qqqevent.pos - r_rhoMin_fix).Mag() * 0.1; + double qqqEfix; + if (tag == "_cathode_alphas") + { // satisfied when find succeeds + qqqEfix = cm_to_MeV->Eval(MeV_to_cm->Eval(qqqevent.Energy1) - path_length_q); + plotter->Fill1D("pmisc_Ex_from_alpha", 200, -10, 10, apkin_a.getExc(qqqEfix, theta_q * 180 / M_PI), pmlabel); + } + else + qqqEfix = cm_to_MeVp->Eval(MeV_to_cm_p->Eval(qqqevent.Energy1) - path_length_q); + // plotter->Fill2D("qqqEf_sx3E_matrix_all"+tag,400,0,10,400,0,10,qqqEfix,sx3event.Energy1,pmlabel); + plotter->Fill2D("pmisc_dE3_Ef_AnodeQQQ" + tag, 400, 0, 10, 400, 0, 40000, qqqEfix, pcevent.Energy1 * sinTheta_customV * 3, pmlabel); + plotter->Fill2D("pmisc_dE3_Ef_CathodeQQQ" + tag, 400, 0, 10, 400, 0, 10000, qqqEfix, pcevent.Energy2 * sinTheta_customV, pmlabel); - //double path_length_q = (qqqevent.pos-TVector3(0,0,vertex_z)).Mag()*0.1; - //double path_length_s = (sx3event.pos-TVector3(0,0,vertex_z)).Mag()*0.1; - double path_length_q = (qqqevent.pos-r_rhoMin_fix).Mag()*0.1; - double qqqEfix; - if(tag == "_cathode_alphas") {//satisfied when find succeeds - qqqEfix = cm_to_MeV->Eval(MeV_to_cm->Eval(qqqevent.Energy1)-path_length_q); - plotter->Fill1D("pmisc_Ex_from_alpha",200,-10,10,apkin_a.getExc(qqqEfix,theta_q*180/M_PI),pmlabel); - } - else - qqqEfix = cm_to_MeVp->Eval(MeV_to_cm_p->Eval(qqqevent.Energy1)-path_length_q); - //plotter->Fill2D("qqqEf_sx3E_matrix_all"+tag,400,0,10,400,0,10,qqqEfix,sx3event.Energy1,pmlabel); - plotter->Fill2D("pmisc_dE3_Ef_AnodeQQQ"+tag,400,0,10,400,0,40000,qqqEfix,pcevent.Energy1*sinTheta_customV*3,pmlabel); - plotter->Fill2D("pmisc_dE3_Ef_CathodeQQQ"+tag,400,0,10,400,0,10000,qqqEfix,pcevent.Energy2*sinTheta_customV,pmlabel); - - plotter->Fill1D("pmisc_VertexReconZ"+tag,800,-400,400,vertex_z,pmlabel); - plotter->Fill2D("pmisc_VertexReconXY"+tag,200,-100,100,200,-100,100,r_rhoMin_fix.X(),r_rhoMin_fix.Y(),pmlabel); - plotter->Fill2D("pmisc_VertexReconZ_vs_Ef"+tag,800,-400,400,800,0,20,vertex_z,qqqEfix,pmlabel); - plotter->Fill2D("pmisc_VertexReconZ_vs_Ef"+tag+"_a"+std::to_string(pcevent.multi1),800,-400,400,800,0,20,vertex_z,qqqEfix,pmlabel); - - plotter->Fill2D("pmisc_Ef_vs_theta_qqq"+tag,100,0,180,800,0,20,theta_q*180/M_PI,qqqEfix,pmlabel); - if(pcevent.multi2==1) { - plotter->Fill2D("pmisc_Ef_vs_theta_qqq_a1c1"+tag,100,0,180,800,0,20,theta_q*180/M_PI,qqqEfix,pmlabel); - plotter->Fill2D("pmisc_VertexReconZ_vs_Ef_a1c1"+tag,800,-400,400,800,0,20,vertex_z,qqqEfix,pmlabel); - } - }; - - if(cathode_alpha_select) - plot_with_tag("_cathode_alphas"); - //else - // plot_with_tag("_cathode_protons"); - //plot_with_tag(); - - //plotter->Fill1D("pmisc_Ex_from_protons",200,-10,10,apkin_p.getExc(qqqEfix,theta_s*180/M_PI),pmlabel); + plotter->Fill1D("pmisc_VertexReconZ" + tag, 800, -400, 400, vertex_z, pmlabel); + plotter->Fill2D("pmisc_VertexReconXY" + tag, 200, -100, 100, 200, -100, 100, r_rhoMin_fix.X(), r_rhoMin_fix.Y(), pmlabel); + plotter->Fill2D("pmisc_VertexReconZ_vs_Ef" + tag, 800, -400, 400, 800, 0, 20, vertex_z, qqqEfix, pmlabel); + plotter->Fill2D("pmisc_VertexReconZ_vs_Ef" + tag + "_a" + std::to_string(pcevent.multi1), 800, -400, 400, 800, 0, 20, vertex_z, qqqEfix, pmlabel); - }//end PCEvents loop - }//end QQQEvents loop + plotter->Fill2D("pmisc_Ef_vs_theta_qqq" + tag, 100, 0, 180, 800, 0, 20, theta_q * 180 / M_PI, qqqEfix, pmlabel); + if (pcevent.multi2 == 1) + { + plotter->Fill2D("pmisc_Ef_vs_theta_qqq_a1c1" + tag, 100, 0, 180, 800, 0, 20, theta_q * 180 / M_PI, qqqEfix, pmlabel); + plotter->Fill2D("pmisc_VertexReconZ_vs_Ef_a1c1" + tag, 800, -400, 400, 800, 0, 20, vertex_z, qqqEfix, pmlabel); + } + }; + + if (cathode_alpha_select) + plot_with_tag("_cathode_alphas"); + // else + // plot_with_tag("_cathode_protons"); + // plot_with_tag(); + + // plotter->Fill1D("pmisc_Ex_from_protons",200,-10,10,apkin_p.getExc(qqqEfix,theta_s*180/M_PI),pmlabel); + + } // end PCEvents loop + } // end QQQEvents loop } -void protonMiscHistograms_sx3(HistPlotter* plotter, std::vector QQQ_Events, std::vector SX3_Events, std::vector PC_Events) { - //consider the 'proton-like' QQQ branch seen in a,p data - for(auto sx3event: SX3_Events) { - if(sx3event.Energy1 < 1.2) continue; //coarse gating - //if(sx3event.Energy1 > 5.0) continue; //coarse gating - for(auto pcevent: PC_Events) { - if(!(pcevent.multi1==1 && pcevent.multi2==2)) continue; - //if(pcevent.Energy1 > 11000) continue; //coarse gating - bool phicut = sx3event.pos.Phi() <= pcevent.pos.Phi()+TMath::Pi()/3. && sx3event.pos.Phi() >= pcevent.pos.Phi()-TMath::Pi()/3.; - if(!phicut) continue; - //if(pcevent.Time1-sx3event.Time1<-150 || pcevent.Time1-sx3event.Time1 >850) continue; - - double pcz_fix = pcfix_func.Eval(pcevent.pos.Z()); - TVector3 x2f(pcevent.pos.X(),pcevent.pos.Y(),pcz_fix); - TVector3 x1(sx3event.pos); - TVector3 v = x2f-x1; - double t_minimum = -1.0*(x1.X()*v.X()+x1.Y()*v.Y())/(v.X()*v.X()+v.Y()*v.Y()); - TVector3 r_rhoMin_fix = x1 + t_minimum*v; - double vertex_z = r_rhoMin_fix.Z(); - //double theta_q = (sx3event.pos - TVector3(0,0,vertex_z)).Theta(); +void protonMiscHistograms_sx3(HistPlotter *plotter, std::vector QQQ_Events, std::vector SX3_Events, std::vector PC_Events) +{ + // consider the 'proton-like' QQQ branch seen in a,p data + for (auto sx3event : SX3_Events) + { + if (sx3event.Energy1 < 1.2) + continue; // coarse gating + // if(sx3event.Energy1 > 5.0) continue; //coarse gating + for (auto pcevent : PC_Events) + { + if (!(pcevent.multi1 == 1 && pcevent.multi2 == 2)) + continue; + // if(pcevent.Energy1 > 11000) continue; //coarse gating + bool phicut = sx3event.pos.Phi() <= pcevent.pos.Phi() + TMath::Pi() / 3. && sx3event.pos.Phi() >= pcevent.pos.Phi() - TMath::Pi() / 3.; + if (!phicut) + continue; + // if(pcevent.Time1-sx3event.Time1<-150 || pcevent.Time1-sx3event.Time1 >850) continue; - if(r_rhoMin_fix.Perp()>10.0) continue; - double theta_s = (sx3event.pos - r_rhoMin_fix).Theta(); - double sinTheta_customV = TMath::Sin(theta_s); - bool cathode_alpha_select = (pcevent.Energy2 > 1400); + double pcz_fix = pcfix_func.Eval(pcevent.pos.Z()); + TVector3 x2f(pcevent.pos.X(), pcevent.pos.Y(), pcz_fix); + TVector3 x1(sx3event.pos); + TVector3 v = x2f - x1; + double t_minimum = -1.0 * (x1.X() * v.X() + x1.Y() * v.Y()) / (v.X() * v.X() + v.Y() * v.Y()); + TVector3 r_rhoMin_fix = x1 + t_minimum * v; + double vertex_z = r_rhoMin_fix.Z(); + // double theta_q = (sx3event.pos - TVector3(0,0,vertex_z)).Theta(); - + if (r_rhoMin_fix.Perp() > 10.0) + continue; + double theta_s = (sx3event.pos - r_rhoMin_fix).Theta(); + double sinTheta_customV = TMath::Sin(theta_s); + bool cathode_alpha_select = (pcevent.Energy2 > 1400); - //What's below: radial cut, time coincident, phi-correlated events with possible energy selection applied to both E_si and dE_Anodes - auto plot_with_tag = [&](std::string tag="") { - std::string pmlabel = "proton+miscsx3"+tag; - plotter->Fill2D("pmiscs_dE_E_Anodesx3"+tag,400,0,10,800,0,40000,sx3event.Energy1,pcevent.Energy1,pmlabel); - plotter->Fill2D("pmiscs_dE_E_Cathodesx3"+tag,400,0,10,800,0,10000,sx3event.Energy1,pcevent.Energy2,pmlabel); - plotter->Fill2D("pmiscs_dE3_E_Anodesx3"+tag,400,0,10,400,0,40000,sx3event.Energy1,pcevent.Energy1*sinTheta_customV*3.,pmlabel); - plotter->Fill2D("pmiscs_dE3_E_Cathodesx3"+tag,400,0,10,400,0,10000,sx3event.Energy1,pcevent.Energy2*sinTheta_customV,pmlabel); - plotter->Fill2D("pmiscs_dPhi_sx3_PC"+tag,180,-360,360,180,-360,360,pcevent.pos.Phi()*180/M_PI,sx3event.pos.Phi()*180/M_PI,pmlabel); - plotter->Fill1D("pmiscs_dt_Anode_sx3_PC"+std::to_string(phicut)+tag,600,-2000,2000,pcevent.Time1-sx3event.Time1,pmlabel); - plotter->Fill1D("pmiscs_dt_Cathode_sx3"+tag,600,-2000,2000,pcevent.Time2-sx3event.Time1,pmlabel); - plotter->Fill2D("pmiscs_dt_Anode_E_sx3_PC"+std::to_string(phicut)+tag,600,-2000,2000,400,0,10,pcevent.Time1-sx3event.Time1,sx3event.Energy1,pmlabel); - plotter->Fill2D("pmiscs_dt_Cathode_E_sx3"+tag,600,-2000,2000,400,0,10,pcevent.Time2-sx3event.Time1,sx3event.Energy1,pmlabel); - plotter->Fill2D("pmiscs_dt_Cathodesx3_vsPCPhi"+tag,600,-2000,2000,180,-360,360,pcevent.Time2-sx3event.Time1,pcevent.pos.Phi()*180./M_PI,pmlabel); - plotter->Fill1D("pmiscs_pczfix"+tag,600,-300,300,pcz_fix,pmlabel); - plotter->Fill1D("pmiscs_pcz"+tag,600,-300,300,pcevent.pos.Z(),pmlabel); - - //double path_length_q = (sx3event.pos-TVector3(0,0,vertex_z)).Mag()*0.1; - //double path_length_s = (sx3event.pos-TVector3(0,0,vertex_z)).Mag()*0.1; - double path_length_s = (sx3event.pos-r_rhoMin_fix).Mag()*0.1; - double sx3Efix = cm_to_MeVp->Eval(MeV_to_cm_p->Eval(sx3event.Energy1)-path_length_s); - - //plotter->Fill2D("sx3Ef_sx3E_matrix_all"+tag,400,0,10,400,0,10,sx3Efix,sx3event.Energy1,pmlabel); - plotter->Fill2D("pmiscs_dE3_Ef_Anodesx3"+tag,400,0,10,400,0,40000,sx3Efix,pcevent.Energy1*sinTheta_customV*3,pmlabel); - plotter->Fill2D("pmiscs_dE3_Ef_Cathodesx3"+tag,400,0,10,400,0,10000,sx3Efix,pcevent.Energy2*sinTheta_customV,pmlabel); - - plotter->Fill2D("pmiscs_Ef_vs_theta_sx3"+tag,100,0,180,800,0,20,theta_s*180/M_PI,sx3Efix,pmlabel); - plotter->Fill1D("pmiscs_VertexReconZ"+tag,800,-400,400,vertex_z,pmlabel); - plotter->Fill2D("pmiscs_VertexReconXY"+tag,200,-100,100,200,-100,100,r_rhoMin_fix.X(),r_rhoMin_fix.Y(),pmlabel); - plotter->Fill2D("pmiscs_VertexReconZ_vs_Ef"+tag,800,-400,400,800,0,20,vertex_z,sx3Efix,pmlabel); - plotter->Fill2D("pmiscs_VertexReconZ_vs_Ef"+tag+"_a"+std::to_string(pcevent.multi1),800,-400,400,800,0,20,vertex_z,sx3Efix,pmlabel); - }; - - plot_with_tag(); - if(cathode_alpha_select) - plot_with_tag("_cathode_alphas"); - else - plot_with_tag("_cathode_protons"); - - //plotter->Fill1D("pmisc_Ex_from_protons",200,-10,10,apkin_p.getExc(sx3Efix,theta_s*180/M_PI),pmlabel); + // What's below: radial cut, time coincident, phi-correlated events with possible energy selection applied to both E_si and dE_Anodes + auto plot_with_tag = [&](std::string tag = "") + { + std::string pmlabel = "proton+miscsx3" + tag; + plotter->Fill2D("pmiscs_dE_E_Anodesx3" + tag, 400, 0, 10, 800, 0, 40000, sx3event.Energy1, pcevent.Energy1, pmlabel); + plotter->Fill2D("pmiscs_dE_E_Cathodesx3" + tag, 400, 0, 10, 800, 0, 10000, sx3event.Energy1, pcevent.Energy2, pmlabel); + plotter->Fill2D("pmiscs_dE3_E_Anodesx3" + tag, 400, 0, 10, 400, 0, 40000, sx3event.Energy1, pcevent.Energy1 * sinTheta_customV * 3., pmlabel); + plotter->Fill2D("pmiscs_dE3_E_Cathodesx3" + tag, 400, 0, 10, 400, 0, 10000, sx3event.Energy1, pcevent.Energy2 * sinTheta_customV, pmlabel); + plotter->Fill2D("pmiscs_dPhi_sx3_PC" + tag, 180, -360, 360, 180, -360, 360, pcevent.pos.Phi() * 180 / M_PI, sx3event.pos.Phi() * 180 / M_PI, pmlabel); + plotter->Fill1D("pmiscs_dt_Anode_sx3_PC" + std::to_string(phicut) + tag, 600, -2000, 2000, pcevent.Time1 - sx3event.Time1, pmlabel); + plotter->Fill1D("pmiscs_dt_Cathode_sx3" + tag, 600, -2000, 2000, pcevent.Time2 - sx3event.Time1, pmlabel); + plotter->Fill2D("pmiscs_dt_Anode_E_sx3_PC" + std::to_string(phicut) + tag, 600, -2000, 2000, 400, 0, 10, pcevent.Time1 - sx3event.Time1, sx3event.Energy1, pmlabel); + plotter->Fill2D("pmiscs_dt_Cathode_E_sx3" + tag, 600, -2000, 2000, 400, 0, 10, pcevent.Time2 - sx3event.Time1, sx3event.Energy1, pmlabel); + plotter->Fill2D("pmiscs_dt_Cathodesx3_vsPCPhi" + tag, 600, -2000, 2000, 180, -360, 360, pcevent.Time2 - sx3event.Time1, pcevent.pos.Phi() * 180. / M_PI, pmlabel); + plotter->Fill1D("pmiscs_pczfix" + tag, 600, -300, 300, pcz_fix, pmlabel); + plotter->Fill1D("pmiscs_pcz" + tag, 600, -300, 300, pcevent.pos.Z(), pmlabel); - }//end PCEvents loop - }//end sx3Events loop + // double path_length_q = (sx3event.pos-TVector3(0,0,vertex_z)).Mag()*0.1; + // double path_length_s = (sx3event.pos-TVector3(0,0,vertex_z)).Mag()*0.1; + double path_length_s = (sx3event.pos - r_rhoMin_fix).Mag() * 0.1; + double sx3Efix = cm_to_MeVp->Eval(MeV_to_cm_p->Eval(sx3event.Energy1) - path_length_s); + + // plotter->Fill2D("sx3Ef_sx3E_matrix_all"+tag,400,0,10,400,0,10,sx3Efix,sx3event.Energy1,pmlabel); + plotter->Fill2D("pmiscs_dE3_Ef_Anodesx3" + tag, 400, 0, 10, 400, 0, 40000, sx3Efix, pcevent.Energy1 * sinTheta_customV * 3, pmlabel); + plotter->Fill2D("pmiscs_dE3_Ef_Cathodesx3" + tag, 400, 0, 10, 400, 0, 10000, sx3Efix, pcevent.Energy2 * sinTheta_customV, pmlabel); + + plotter->Fill2D("pmiscs_Ef_vs_theta_sx3" + tag, 100, 0, 180, 800, 0, 20, theta_s * 180 / M_PI, sx3Efix, pmlabel); + plotter->Fill1D("pmiscs_VertexReconZ" + tag, 800, -400, 400, vertex_z, pmlabel); + plotter->Fill2D("pmiscs_VertexReconXY" + tag, 200, -100, 100, 200, -100, 100, r_rhoMin_fix.X(), r_rhoMin_fix.Y(), pmlabel); + plotter->Fill2D("pmiscs_VertexReconZ_vs_Ef" + tag, 800, -400, 400, 800, 0, 20, vertex_z, sx3Efix, pmlabel); + plotter->Fill2D("pmiscs_VertexReconZ_vs_Ef" + tag + "_a" + std::to_string(pcevent.multi1), 800, -400, 400, 800, 0, 20, vertex_z, sx3Efix, pmlabel); + }; + + plot_with_tag(); + if (cathode_alpha_select) + plot_with_tag("_cathode_alphas"); + else + plot_with_tag("_cathode_protons"); + + // plotter->Fill1D("pmisc_Ex_from_protons",200,-10,10,apkin_p.getExc(sx3Efix,theta_s*180/M_PI),pmlabel); + + } // end PCEvents loop + } // end sx3Events loop } diff --git a/qqq_Calib.dat b/qqq_Calib.dat index 99bbc7f..e056930 100644 --- a/qqq_Calib.dat +++ b/qqq_Calib.dat @@ -1,760 +1,756 @@ -0 0 0 3.34288 -0 1 0 3.29257 -0 2 0 3.31126 -0 3 0 3.28022 -0 4 0 3.29877 -0 5 0 3.29877 -0 6 0 3.305 -0 7 0 3.305 -0 8 0 3.26797 -0 9 0 3.32384 -0 10 0 3.31126 -0 11 0 3.32384 -0 12 0 3.29877 -0 13 0 3.31126 -0 14 0 3.28022 -0 15 0 3.27409 -0 0 2 3.44828 -0 1 2 3.53179 -0 2 2 3.53179 -0 3 2 3.44149 -0 4 2 3.48259 -0 5 2 3.47567 -0 6 2 3.48953 -0 7 2 3.45508 -0 8 2 3.46878 -0 9 2 3.46192 -0 10 2 3.45508 -0 11 2 3.46192 -0 12 2 3.48259 -0 13 2 3.5035 -0 14 2 3.4965 -0 15 2 3.46878 -0 0 3 3.2022 -0 1 3 3.20807 -0 2 3 3.23176 -0 3 3 3.23176 -0 4 3 3.23774 -0 5 3 3.20807 -0 6 3 3.19635 -0 7 3 3.21987 -0 8 3 3.18471 -0 9 3 3.21396 -0 10 3 3.19635 -0 11 3 3.20807 -0 12 3 3.18471 -0 13 3 3.22581 -0 14 3 3.19635 -0 15 3 3.19635 -0 0 4 3.33016 -0 1 4 3.32384 -0 2 4 3.32384 -0 3 4 3.37512 -0 4 4 3.39476 -0 5 4 3.305 -0 6 4 3.33016 -0 7 4 3.34928 -0 8 4 3.31126 -0 9 4 3.31754 -0 10 4 3.33651 -0 11 4 3.31126 -0 12 4 3.32384 -0 13 4 3.305 -0 14 4 3.34928 -0 15 4 3.31754 -0 0 5 3.31754 -0 1 5 3.33651 -0 2 5 3.34928 -0 3 5 3.33016 -0 4 5 3.40136 -0 5 5 3.41463 -0 6 5 3.33651 -0 7 5 3.36215 -0 8 5 3.36862 -0 9 5 3.34288 -0 10 5 3.32384 -0 11 5 3.31754 -0 12 5 3.33016 -0 13 5 3.36862 -0 14 5 3.31754 -0 15 5 3.32384 -0 0 6 3.36215 -0 1 6 3.37512 -0 2 6 3.3557 -0 3 6 3.3557 -0 4 6 3.34928 -0 5 6 3.40798 -0 6 6 3.39476 -0 7 6 3.31754 -0 8 6 3.33016 -0 9 6 3.34928 -0 10 6 3.33651 -0 11 6 3.33651 -0 12 6 3.34288 -0 13 6 3.3557 -0 14 6 3.34288 -0 15 6 3.34928 -0 0 7 4.2735 -0 1 7 4.24242 -0 2 7 4.21179 -0 3 7 4.21179 -0 4 7 4.21179 -0 5 7 4.19162 -0 6 7 4.31566 -0 7 7 4.24242 -0 8 7 4.1816 -0 9 7 4.21179 -0 10 7 4.22195 -0 11 7 4.22195 -0 12 7 4.1816 -0 13 7 4.21179 -0 14 7 4.19162 -0 15 7 4.28397 -0 0 8 3.51053 -0 1 8 3.52467 -0 2 8 3.5035 -0 3 8 3.4965 -0 4 8 3.48953 -0 5 8 3.53179 -0 6 8 3.4965 -0 7 8 3.56779 -0 8 8 3.56779 -0 9 8 3.48953 -0 10 8 3.5035 -0 11 8 3.48259 -0 12 8 3.5035 -0 13 8 3.47567 -0 14 8 3.48953 -0 15 8 3.48953 -0 0 9 3.39476 -0 1 9 3.41463 -0 2 9 3.42131 -0 3 9 3.40798 -0 4 9 3.39476 -0 5 9 3.42801 -0 6 9 3.42131 -0 7 9 3.44149 -0 8 9 3.48259 -0 9 9 3.44149 -0 10 9 3.41463 -0 11 9 3.41463 -0 12 9 3.42801 -0 13 9 3.39476 -0 14 9 3.42131 -0 15 9 3.42131 -0 0 10 3.59712 -0 1 10 3.56053 -0 2 10 3.52467 -0 3 10 3.5533 -0 4 10 3.57508 -0 5 10 3.53893 -0 6 10 3.56053 -0 7 10 3.5533 -0 8 10 3.5461 -0 9 10 3.56779 -0 10 10 3.63448 -0 11 10 3.56779 -0 12 10 3.5824 -0 13 10 3.5533 -0 14 10 3.5824 -0 15 10 3.53179 -0 0 11 3.44149 -0 1 11 3.41463 -0 2 11 3.39476 -0 3 11 3.3557 -0 4 11 3.40798 -0 5 11 3.40136 -0 6 11 3.40136 -0 7 11 3.38164 -0 8 11 3.38164 -0 9 11 3.40136 -0 10 11 3.45508 -0 11 11 3.46192 -0 12 11 3.42131 -0 13 11 3.40798 -0 14 11 3.38819 -0 15 11 3.43474 -0 0 12 3.40798 -0 1 12 3.42131 -0 2 12 3.42801 -0 3 12 3.42801 -0 4 12 3.42131 -0 5 12 3.44149 -0 6 12 3.44149 -0 7 12 3.44828 -0 8 12 3.44149 -0 9 12 3.42801 -0 10 12 3.42801 -0 11 12 3.48953 -0 12 12 3.47567 -0 13 12 3.44149 -0 14 12 3.42801 -0 15 12 3.44828 -0 0 13 3.65726 -0 1 13 3.62694 -0 2 13 3.68034 -0 3 13 3.59712 -0 4 13 3.66492 -0 5 13 3.65726 -0 6 13 3.61197 -0 7 13 3.67261 -0 8 13 3.68809 -0 9 13 3.63448 -0 10 13 3.67261 -0 11 13 3.68034 -0 12 13 3.71156 -0 13 13 3.72737 -0 14 13 3.65726 -0 15 13 3.64964 -0 0 14 3.56779 -0 1 14 3.56779 -0 2 14 3.51759 -0 3 14 3.47567 -0 4 14 3.4965 -0 5 14 3.51053 -0 6 14 3.51759 -0 7 14 3.48953 -0 8 14 3.51053 -0 9 14 3.53893 -0 10 14 3.53893 -0 11 14 3.69588 -0 12 14 3.47567 -0 13 14 3.7037 -0 14 14 3.71156 -0 15 14 3.5533 -0 0 15 39.3258 -0 1 15 3.42131 -0 2 15 3.42131 -0 3 15 3.48953 -0 4 15 3.38164 -0 5 15 3.43474 -0 6 15 3.37512 -0 7 15 3.38164 -0 8 15 28 -0 9 15 33.9806 -0 10 15 3.37512 -0 11 15 3.33016 -0 12 15 3.36862 -0 13 15 29.4118 -0 14 15 36.8421 -0 15 15 34.6535 -1 0 0 3.22581 -1 1 0 3.21396 -1 2 0 3.17893 -1 3 0 3.20807 -1 7 0 3.18471 -1 8 0 3.16742 -1 0 1 3.29877 -1 1 1 3.33016 -1 2 1 3.29257 -1 3 1 3.305 -1 7 1 3.29877 -1 8 1 3.305 -1 0 2 3.25581 -1 1 2 3.28022 -1 2 2 3.27409 -1 3 2 3.23774 -1 7 2 3.21396 -1 8 2 3.24374 -1 0 3 3.18471 -1 1 3 3.1617 -1 2 3 3.20807 -1 3 3 3.22581 -1 7 3 3.18471 -1 8 3 3.15032 -1 0 4 3.21987 -1 1 4 3.23176 -1 2 4 3.21987 -1 3 4 3.24977 -1 7 4 3.22581 -1 8 4 3.24977 -1 0 5 3.17893 -1 1 5 3.17893 -1 2 5 3.17316 -1 3 5 3.18471 -1 7 5 3.19052 -1 8 5 3.1617 -1 0 6 3.29257 -1 1 6 3.29257 -1 2 6 3.33016 -1 3 6 3.32384 -1 7 6 3.31754 -1 8 6 3.305 -1 0 7 3.61944 -1 1 7 3.61197 -1 2 7 3.61197 -1 3 7 3.59712 -1 7 7 3.68809 -1 8 7 3.64964 -1 0 8 3.23774 -1 1 8 3.25581 -1 2 8 3.26188 -1 3 8 3.26188 -1 7 8 3.26797 -1 8 8 3.28022 -1 0 9 3.33651 -1 1 9 3.33016 -1 2 9 3.3557 -1 3 9 3.34928 -1 7 9 3.36862 -1 8 9 3.37512 -1 0 10 3.38819 -1 1 10 3.42131 -1 2 10 3.42801 -1 3 10 3.42801 -1 7 10 3.38164 -1 8 10 3.41463 -1 0 11 3.21987 -1 1 11 3.24374 -1 2 11 3.23774 -1 3 11 3.21987 -1 7 11 3.21987 -1 8 11 3.23774 -1 0 12 3.21987 -1 1 12 3.17893 -1 2 12 3.19635 -1 3 12 3.23774 -1 7 12 3.21396 -1 8 12 3.20807 -1 0 13 3.61197 -1 1 13 3.62694 -1 2 13 3.65726 -1 3 13 3.64964 -1 7 13 3.5824 -1 8 13 3.62694 -1 0 14 3.14465 -1 1 14 3.15032 -1 2 14 3.18471 -1 3 14 3.14465 -1 7 14 3.14465 -1 8 14 3.156 -1 0 15 3.51759 -1 1 15 3.53893 -1 2 15 3.48953 -1 3 15 3.43474 -1 7 15 3.52467 -1 8 15 3.62694 -2 0 0 2.83401 -2 1 0 2.75374 -2 2 0 2.76243 -2 3 0 2.75374 -2 4 0 2.77118 -2 5 0 2.78441 -2 6 0 2.7668 -2 7 0 2.77557 -2 8 0 2.7668 -2 9 0 2.76243 -2 10 0 2.7408 -2 11 0 2.7668 -2 12 0 2.7451 -2 13 0 2.75808 -2 14 0 2.74941 -2 0 1 3.01464 -2 1 1 3.04083 -2 2 1 2.9889 -2 3 1 2.97366 -2 4 1 2.97366 -2 5 1 2.96359 -2 6 1 2.97872 -2 7 1 2.93871 -2 8 1 2.96862 -2 9 1 2.9838 -2 10 1 2.96862 -2 11 1 2.97366 -2 12 1 2.9889 -2 13 1 2.94365 -2 14 1 2.9838 -2 0 2 2.83861 -2 1 2 2.90456 -2 2 2 2.89495 -2 3 2 2.82943 -2 4 2 2.83861 -2 5 2 2.84322 -2 6 2 2.84322 -2 7 2 2.84322 -2 8 2 2.83861 -2 9 2 2.82943 -2 10 2 2.83401 -2 11 2 2.82486 -2 12 2 2.81124 -2 13 2 2.82486 -2 14 2 2.80674 -2 0 3 2.67789 -2 1 3 2.68199 -2 2 3 2.71528 -2 3 3 2.72374 -2 4 3 2.67789 -2 5 3 2.6738 -2 6 3 2.65756 -2 7 3 2.66565 -2 8 3 2.66972 -2 9 3 2.69024 -2 10 3 2.68199 -2 11 3 2.63753 -2 12 3 2.67789 -2 13 3 2.68199 -2 14 3 2.69024 -2 0 4 2.78884 -2 1 4 2.81124 -2 2 4 2.81577 -2 3 4 2.86182 -2 4 4 2.87121 -2 5 4 2.81124 -2 6 4 2.77557 -2 7 4 2.80674 -2 8 4 2.80224 -2 9 4 2.78441 -2 10 4 2.77557 -2 11 4 2.80224 -2 12 4 2.80224 -2 13 4 2.7933 -2 14 4 2.80674 -2 0 5 2.77118 -2 1 5 2.7668 -2 2 5 2.77557 -2 3 5 2.77557 -2 4 5 2.81124 -2 5 5 2.84322 -2 6 5 2.76243 -2 7 5 2.78441 -2 8 5 2.7408 -2 9 5 2.76243 -2 10 5 2.77998 -2 11 5 2.77557 -2 12 5 2.78441 -2 13 5 2.77557 -2 14 5 2.7668 -2 0 6 2.91424 -2 1 6 2.91424 -2 2 6 2.9191 -2 3 6 2.90939 -2 4 6 2.89975 -2 5 6 2.96862 -2 6 6 2.97872 -2 7 6 2.9191 -2 8 6 2.89975 -2 9 6 2.91424 -2 10 6 2.92887 -2 11 6 2.9191 -2 12 6 2.89017 -2 13 6 2.90939 -2 14 6 2.90939 -2 0 7 2.83401 -2 1 7 2.81124 -2 2 7 2.78441 -2 3 7 2.83861 -2 4 7 2.83861 -2 5 7 2.82486 -2 6 7 2.89495 -2 7 7 2.88541 -2 8 7 2.84322 -2 9 7 2.81577 -2 10 7 2.83401 -2 11 7 2.81577 -2 12 7 2.82486 -2 13 7 2.82486 -2 14 7 2.82486 -2 0 8 2.92887 -2 1 8 2.92398 -2 2 8 2.90939 -2 3 8 2.9191 -2 4 8 2.89975 -2 5 8 2.92887 -2 6 8 2.91424 -2 7 8 2.96862 -2 8 8 2.96862 -2 9 8 2.92398 -2 10 8 2.90939 -2 11 8 2.9191 -2 12 8 2.87592 -2 13 8 2.9191 -2 14 8 2.91424 -2 0 10 2.91424 -2 1 10 2.93378 -2 2 10 2.92887 -2 3 10 2.94365 -2 4 10 2.93871 -2 5 10 2.93378 -2 6 10 2.93871 -2 7 10 2.92887 -2 8 10 2.90939 -2 9 10 2.97366 -2 10 10 2.97872 -2 11 10 2.92398 -2 12 10 2.92398 -2 13 10 2.90939 -2 14 10 2.93378 -2 0 11 3.01984 -2 1 11 3.01464 -2 2 11 3.01984 -2 3 11 3.00429 -2 4 11 3.00429 -2 5 11 3.03556 -2 6 11 3.02506 -2 7 11 3.02506 -2 8 11 3.0303 -2 9 11 3.00946 -2 10 11 3.07828 -2 11 11 3.07828 -2 12 11 3.00946 -2 13 11 3.0303 -2 14 11 2.99914 -2 0 12 2.90456 -2 1 12 2.92887 -2 2 12 2.89495 -2 3 12 2.92887 -2 4 12 2.90456 -2 5 12 2.91424 -2 6 12 2.92887 -2 7 12 2.89495 -2 8 12 2.93378 -2 9 12 2.90939 -2 10 12 2.92398 -2 11 12 2.97366 -2 12 12 2.96862 -2 13 12 2.90939 -2 14 12 2.89495 -2 0 13 2.83861 -2 1 13 2.81124 -2 2 13 2.80674 -2 3 13 2.80674 -2 4 13 2.83401 -2 5 13 2.84784 -2 6 13 2.83401 -2 7 13 2.82031 -2 8 13 2.81577 -2 9 13 2.81577 -2 10 13 2.81577 -2 11 13 2.82943 -2 12 13 2.89017 -2 13 13 2.90939 -2 14 13 2.82486 -2 0 14 2.93871 -2 1 14 2.9191 -2 2 14 2.93871 -2 3 14 2.9191 -2 4 14 2.93378 -2 5 14 2.94861 -2 6 14 2.90939 -2 7 14 2.92398 -2 8 14 2.90456 -2 9 14 2.91424 -2 10 14 2.90939 -2 11 14 2.90456 -2 12 14 3.00946 -2 13 14 3.04613 -2 14 14 2.96862 -3 0 0 2.80674 -3 1 0 2.76243 -3 2 0 2.75374 -3 3 0 2.73224 -3 4 0 2.7408 -3 5 0 2.72374 -3 7 0 2.72798 -3 8 0 2.7408 -3 9 0 2.73651 -3 10 0 2.7195 -3 11 0 2.7451 -3 12 0 2.71528 -3 13 0 2.72374 -3 14 0 2.69854 -3 15 0 2.72798 -3 0 1 6.4695 -3 5 1 6.37523 -3 7 1 6.35209 -3 15 1 6.32911 -3 0 2 2.89017 -3 1 2 2.95858 -3 2 2 3.00429 -3 3 2 2.91424 -3 4 2 2.92398 -3 5 2 2.89975 -3 7 2 2.91424 -3 8 2 2.88541 -3 9 2 2.91424 -3 10 2 2.91424 -3 11 2 2.87592 -3 12 2 2.90456 -3 13 2 2.89017 -3 14 2 2.9191 -3 15 2 2.90939 -3 0 3 2.9889 -3 1 3 2.9889 -3 2 3 3.01984 -3 3 3 3.03556 -3 4 3 2.97366 -3 5 3 2.97366 -3 7 3 2.9838 -3 8 3 2.9838 -3 9 3 2.97872 -3 10 3 2.95858 -3 11 3 2.95359 -3 12 3 2.96862 -3 13 3 2.97872 -3 14 3 2.96862 -3 15 3 2.96862 -3 0 4 2.96862 -3 1 4 2.93871 -3 2 4 2.94365 -3 3 4 2.99914 -3 4 4 3.0303 -3 5 4 2.95359 -3 7 4 2.93378 -3 8 4 2.92887 -3 9 4 2.92398 -3 10 4 2.97366 -3 11 4 2.93871 -3 12 4 2.95858 -3 13 4 2.95858 -3 14 4 2.96359 -3 15 4 2.96862 -3 0 5 2.88541 -3 1 5 2.88541 -3 2 5 2.88541 -3 3 5 2.88066 -3 4 5 2.96359 -3 5 5 2.95858 -3 7 5 2.89495 -3 8 5 2.89975 -3 9 5 2.90456 -3 10 5 2.88066 -3 11 5 2.90456 -3 12 5 2.90456 -3 13 5 2.90939 -3 14 5 2.88541 -3 15 5 2.89975 -3 0 7 2.95858 -3 1 7 2.9889 -3 2 7 2.96359 -3 3 7 2.94861 -3 4 7 2.95858 -3 5 7 2.9889 -3 7 7 3.04083 -3 8 7 2.96862 -3 9 7 2.9889 -3 10 7 2.9838 -3 11 7 2.95359 -3 12 7 2.96862 -3 13 7 2.97872 -3 14 7 2.96862 -3 15 7 2.96862 -3 0 8 3.12221 -3 1 8 3.11665 -3 2 8 3.14465 -3 3 8 3.13901 -3 4 8 3.12221 -3 5 8 3.13901 -3 7 8 3.16742 -3 8 8 3.19052 -3 9 8 3.13901 -3 10 8 3.11665 -3 11 8 3.13901 -3 12 8 3.13901 -3 13 8 3.16742 -3 14 8 3.09461 -3 15 8 3.14465 -3 0 9 2.96359 -3 1 9 2.9838 -3 2 9 2.93378 -3 3 9 2.9191 -3 4 9 2.94365 -3 5 9 2.94861 -3 7 9 2.97366 -3 8 9 2.99914 -3 9 9 3.0303 -3 10 9 2.9889 -3 11 9 2.95359 -3 12 9 2.97872 -3 13 9 2.95858 -3 14 9 2.95359 -3 15 9 2.94365 -3 0 10 3.34928 -3 1 10 3.38164 -3 2 10 3.38164 -3 3 10 3.39476 -3 4 10 3.37512 -3 5 10 3.37512 -3 7 10 3.38819 -3 8 10 3.3557 -3 9 10 3.42801 -3 10 10 3.39476 -3 11 10 3.40798 -3 12 10 3.36862 -3 13 10 3.38819 -3 14 10 3.36862 -3 15 10 3.39476 -3 0 11 3.19052 -3 1 11 3.19052 -3 2 11 3.16742 -3 3 11 3.156 -3 4 11 3.19052 -3 5 11 3.19635 -3 7 11 3.17316 -3 8 11 3.18471 -3 9 11 3.19052 -3 10 11 3.23176 -3 11 11 3.25581 -3 12 11 3.2022 -3 13 11 3.19635 -3 14 11 3.23774 -3 15 11 3.22581 -3 0 12 3.03556 -3 1 12 3.08914 -3 2 12 3.0303 -3 3 12 3.0837 -3 4 12 3.07828 -3 5 12 3.06748 -3 7 12 3.04083 -3 8 12 3.06212 -3 9 12 3.07828 -3 10 12 3.04613 -3 11 12 3.14465 -3 12 12 3.11665 -3 13 12 3.06748 -3 14 12 3.15032 -3 15 12 3.0837 -3 0 13 3.11111 -3 1 13 3.10559 -3 2 13 3.10009 -3 3 13 3.08914 -3 4 13 3.07828 -3 5 13 3.08914 -3 7 13 3.10009 -3 8 13 3.10559 -3 9 13 3.0837 -3 10 13 3.09461 -3 11 13 3.10559 -3 12 13 3.156 -3 13 13 3.22581 -3 14 13 3.16742 -3 15 13 3.13339 -3 0 14 2.93378 -3 1 14 2.95858 -3 2 14 2.97366 -3 3 14 2.9191 -3 4 14 2.96862 -3 5 14 2.94365 -3 7 14 2.96862 -3 8 14 2.9889 -3 9 14 2.95858 -3 10 14 2.93378 -3 11 14 3.01984 -3 12 14 2.96359 -3 13 14 3.0303 -3 14 14 3.05677 -3 15 14 2.9889 -3 0 15 3.13339 -3 1 15 3.14465 -3 2 15 3.156 -3 3 15 3.18471 -3 4 15 3.17893 -3 5 15 3.15032 -3 7 15 3.1617 -3 8 15 3.16742 -3 9 15 3.19052 -3 10 15 3.1617 -3 11 15 3.156 -3 12 15 3.2022 -3 13 15 3.156 -3 14 15 3.25581 -3 15 15 3.31126 +0 0 0 3.16353 +0 1 0 3.16353 +0 2 0 3.15625 +0 3 0 3.12746 +0 4 0 3.16353 +0 5 0 3.15625 +0 6 0 3.18557 +0 7 0 3.149 +0 8 0 3.17819 +0 9 0 3.149 +0 10 0 3.12034 +0 11 0 3.149 +0 12 0 3.16353 +0 13 0 3.149 +0 14 0 3.12034 +0 15 0 3.12034 +0 0 2 3.24589 +0 1 2 3.35714 +0 2 2 3.36537 +0 3 2 3.32458 +0 4 2 3.33266 +0 5 2 3.30058 +0 6 2 3.26911 +0 7 2 3.28477 +0 8 2 3.27692 +0 9 2 3.25359 +0 10 2 3.31654 +0 11 2 3.26133 +0 12 2 3.27692 +0 13 2 3.26133 +0 14 2 3.28477 +0 15 2 3.30058 +0 0 3 3.01736 +0 1 3 3.05773 +0 2 3 3.08524 +0 3 3 3.12034 +0 4 3 3.06456 +0 5 3 3.04415 +0 6 3 3.03741 +0 7 3 3.07142 +0 8 3 3.0922 +0 9 3 3.0307 +0 10 3 3.05092 +0 11 3 3.03741 +0 12 3 3.04415 +0 13 3 3.03741 +0 14 3 3.04415 +0 15 3 3.01736 +0 0 4 3.15625 +0 1 4 3.14179 +0 2 4 3.20044 +0 3 4 3.17819 +0 4 4 3.19299 +0 5 4 3.17819 +0 6 4 3.15625 +0 7 4 3.18557 +0 8 4 3.17084 +0 9 4 3.149 +0 10 4 3.18557 +0 11 4 3.15625 +0 12 4 3.12746 +0 13 4 3.15625 +0 14 4 3.15625 +0 15 4 3.14179 +0 0 5 3.16353 +0 1 5 3.17819 +0 2 5 3.15625 +0 3 5 3.18557 +0 4 5 3.22301 +0 5 5 3.22301 +0 6 5 3.17819 +0 7 5 3.19299 +0 8 5 3.15625 +0 9 5 3.17819 +0 10 5 3.17819 +0 11 5 3.15625 +0 12 5 3.13461 +0 13 5 3.18557 +0 14 5 3.17819 +0 15 5 3.17084 +0 0 6 3.19299 +0 1 6 3.19299 +0 2 6 3.19299 +0 3 6 3.15625 +0 4 6 3.19299 +0 5 6 3.20793 +0 6 6 3.23823 +0 7 6 3.17084 +0 8 6 3.149 +0 9 6 3.15625 +0 10 6 3.19299 +0 11 6 3.20044 +0 12 6 3.11326 +0 13 6 3.19299 +0 14 6 3.14179 +0 15 6 3.20044 +0 0 7 36.5704 +0 1 7 3.81471 +0 2 7 3.75209 +0 3 7 3.84682 +0 4 7 3.85764 +0 5 7 3.85764 +0 6 7 3.93512 +0 7 7 3.84682 +0 8 7 3.81471 +0 9 7 3.77274 +0 10 7 3.81471 +0 11 7 3.80413 +0 12 7 3.78314 +0 13 7 3.75209 +0 14 7 3.78314 +0 15 7 36.5704 +0 0 8 3.29265 +0 1 8 3.26911 +0 2 8 3.31654 +0 3 8 3.33266 +0 4 8 3.29265 +0 5 8 3.27692 +0 6 8 3.30854 +0 7 8 3.36537 +0 8 8 3.34078 +0 9 8 3.25359 +0 10 8 3.28477 +0 11 8 3.27692 +0 12 8 3.27692 +0 13 8 3.24589 +0 14 8 3.27692 +0 15 8 3.28477 +0 0 9 3.18557 +0 1 9 3.26911 +0 2 9 3.22301 +0 3 9 3.22301 +0 4 9 3.23823 +0 5 9 3.2306 +0 6 9 3.21545 +0 7 9 3.23823 +0 8 9 3.29265 +0 9 9 3.30058 +0 10 9 3.22301 +0 11 9 3.26911 +0 12 9 3.22301 +0 13 9 3.2306 +0 14 9 3.20044 +0 15 9 3.23823 +0 0 10 3.33266 +0 1 10 3.37365 +0 2 10 3.36537 +0 3 10 3.35714 +0 4 10 3.37365 +0 5 10 3.30854 +0 6 10 3.39033 +0 7 10 3.38197 +0 8 10 3.31654 +0 9 10 3.41567 +0 10 10 3.43277 +0 11 10 3.37365 +0 12 10 3.32458 +0 13 10 3.36537 +0 14 10 3.30058 +0 15 10 3.32458 +0 0 11 3.15625 +0 1 11 3.20793 +0 2 11 3.18557 +0 3 11 3.20044 +0 4 11 3.23823 +0 5 11 3.20044 +0 6 11 3.22301 +0 7 11 3.24589 +0 8 11 3.19299 +0 9 11 3.23823 +0 10 11 3.28477 +0 11 11 3.23823 +0 12 11 3.22301 +0 13 11 3.22301 +0 14 11 3.16353 +0 15 11 3.17084 +0 0 12 3.23823 +0 1 12 3.2306 +0 2 12 3.22301 +0 3 12 3.19299 +0 4 12 3.25359 +0 5 12 3.22301 +0 6 12 3.20793 +0 7 12 3.2306 +0 8 12 3.25359 +0 9 12 3.26133 +0 10 12 3.25359 +0 11 12 3.26911 +0 12 12 3.24589 +0 13 12 3.19299 +0 14 12 3.19299 +0 15 12 3.21545 +0 0 13 3.45874 +0 1 13 3.45004 +0 2 13 3.40718 +0 3 13 3.42419 +0 4 13 3.44138 +0 5 13 3.39874 +0 6 13 3.41567 +0 7 13 3.44138 +0 8 13 3.41567 +0 9 13 3.46748 +0 10 13 3.44138 +0 11 13 3.45874 +0 12 13 3.45874 +0 13 13 3.46748 +0 14 13 3.42419 +0 15 13 3.40718 +0 0 14 3.33266 +0 1 14 3.34078 +0 2 14 3.32458 +0 3 14 3.32458 +0 4 14 3.34078 +0 5 14 3.30058 +0 6 14 3.32458 +0 7 14 3.34078 +0 8 14 3.30854 +0 9 14 3.34078 +0 10 14 3.35714 +0 11 14 3.27692 +0 12 14 3.32458 +0 13 14 3.39033 +0 14 14 3.37365 +0 15 14 3.33266 +0 0 15 3.18557 +0 1 15 3.17819 +0 2 15 3.18557 +0 3 15 3.20044 +0 4 15 3.19299 +0 5 15 3.18557 +0 6 15 3.20044 +0 7 15 3.2306 +0 8 15 3.17084 +0 9 15 3.23823 +0 10 15 3.2306 +0 11 15 3.21545 +0 12 15 3.2306 +0 13 15 3.20793 +0 14 15 3.22301 +0 15 15 3.26911 +1 0 0 3.07832 +1 1 0 3.05773 +1 2 0 3.05773 +1 3 0 3.04415 +1 7 0 3.01736 +1 8 0 3.03741 +1 0 1 3.17819 +1 1 1 3.17084 +1 2 1 3.15625 +1 3 1 3.149 +1 7 1 3.149 +1 8 1 3.11326 +1 0 2 3.0922 +1 1 2 3.0922 +1 2 2 3.08524 +1 3 2 3.04415 +1 7 2 3.07832 +1 8 2 3.09919 +1 0 3 3.01074 +1 1 3 3.04415 +1 2 3 3.07142 +1 3 3 3.07142 +1 7 3 2.98453 +1 8 3 3.02401 +1 0 4 3.0922 +1 1 4 3.0922 +1 2 4 3.0922 +1 3 4 3.13461 +1 7 4 3.05773 +1 8 4 3.09919 +1 0 5 3.0307 +1 1 5 2.99757 +1 2 5 3.00414 +1 3 5 3.01074 +1 7 5 3.03741 +1 8 5 3.02401 +1 0 6 3.15625 +1 1 6 3.15625 +1 2 6 3.14179 +1 3 6 3.16353 +1 7 6 3.16353 +1 8 6 3.149 +1 0 7 3.33266 +1 1 7 3.35714 +1 2 7 3.35714 +1 3 7 3.34078 +1 7 7 3.43277 +1 8 7 3.37365 +1 0 8 3.06456 +1 1 8 3.06456 +1 2 8 3.05092 +1 3 8 3.05773 +1 7 8 3.13461 +1 8 8 3.12746 +1 0 9 3.16353 +1 1 9 3.12034 +1 2 9 3.16353 +1 3 9 3.16353 +1 7 9 3.18557 +1 8 9 3.18557 +1 0 10 3.2306 +1 1 10 3.20793 +1 2 10 3.21545 +1 3 10 3.23823 +1 7 10 3.19299 +1 8 10 3.24589 +1 0 11 3.03741 +1 1 11 3.01736 +1 2 11 3.0307 +1 3 11 3.05092 +1 7 11 3.01736 +1 8 11 3.07142 +1 0 12 3.01736 +1 1 12 3.02401 +1 2 12 3.02401 +1 3 12 3.00414 +1 7 12 2.99757 +1 8 12 2.99104 +1 0 13 3.27692 +1 1 13 3.29265 +1 2 13 3.30854 +1 3 13 3.29265 +1 7 13 3.32458 +1 8 13 3.27692 +1 0 14 2.93974 +1 1 14 2.92719 +1 2 14 2.93345 +1 3 14 2.96517 +1 7 14 2.91475 +1 8 14 2.97159 +1 0 15 3.2306 +1 1 15 3.17084 +1 2 15 3.23823 +1 3 15 3.20044 +1 7 15 3.22301 +1 8 15 3.20793 +2 0 0 2.71832 +2 1 0 2.61466 +2 2 0 2.63983 +2 3 0 2.62467 +2 4 0 2.61466 +2 5 0 2.64492 +2 6 0 2.63476 +2 7 0 2.63476 +2 8 0 2.63983 +2 9 0 2.61966 +2 10 0 2.63476 +2 11 0 2.64492 +2 12 0 2.6297 +2 13 0 2.6297 +2 14 0 2.59979 +2 0 1 2.89628 +2 1 1 2.91475 +2 2 1 2.84226 +2 3 1 2.8247 +2 4 1 2.83053 +2 5 1 2.83053 +2 6 1 2.79021 +2 7 1 2.7959 +2 8 1 2.8247 +2 9 1 2.83638 +2 10 1 2.80735 +2 11 1 2.84816 +2 12 1 2.81311 +2 13 1 2.81311 +2 14 1 2.79021 +2 0 2 2.69164 +2 1 2 2.73458 +2 2 2 2.72371 +2 3 2 2.69164 +2 4 2 2.70225 +2 5 2 2.70758 +2 6 2 2.67067 +2 7 2 2.68111 +2 8 2 2.68111 +2 9 2 2.70225 +2 10 2 2.69164 +2 11 2 2.68637 +2 12 2 2.69164 +2 13 2 2.69164 +2 14 2 2.65516 +2 0 3 2.54196 +2 1 3 2.54196 +2 2 3 2.58997 +2 3 3 2.56095 +2 4 3 2.51862 +2 5 3 2.52326 +2 6 3 2.52791 +2 7 3 2.54669 +2 8 3 2.52791 +2 9 3 2.54669 +2 10 3 2.55618 +2 11 3 2.52791 +2 12 3 2.52791 +2 13 3 2.49117 +2 14 3 2.51862 +2 0 4 2.66548 +2 1 4 2.65003 +2 2 4 2.64492 +2 3 4 2.69693 +2 4 4 2.68637 +2 5 4 2.63476 +2 6 4 2.65003 +2 7 4 2.66031 +2 8 4 2.62467 +2 9 4 2.67067 +2 10 4 2.67588 +2 11 4 2.67067 +2 12 4 2.61966 +2 13 4 2.66031 +2 14 4 2.61466 +2 0 5 2.60473 +2 1 5 2.60969 +2 2 5 2.61466 +2 3 5 2.60473 +2 4 5 2.68637 +2 5 5 2.68637 +2 6 5 2.60473 +2 7 5 2.63983 +2 8 5 2.59979 +2 9 5 2.61466 +2 10 5 2.62467 +2 11 5 2.6297 +2 12 5 2.63983 +2 13 5 2.60969 +2 14 5 2.60473 +2 0 6 2.77891 +2 1 6 2.74553 +2 2 6 2.74004 +2 3 6 2.74004 +2 4 6 2.74004 +2 5 6 2.81889 +2 6 6 2.80735 +2 7 6 2.77891 +2 8 6 2.76211 +2 9 6 2.77329 +2 10 6 2.71294 +2 11 6 2.74553 +2 12 6 2.74553 +2 13 6 2.77329 +2 14 6 2.75103 +2 0 7 2.64492 +2 1 7 2.68111 +2 2 7 2.64492 +2 3 7 2.65516 +2 4 7 2.67067 +2 5 7 2.64492 +2 6 7 2.72371 +2 7 7 2.74553 +2 8 7 2.6297 +2 9 7 2.67067 +2 10 7 2.65003 +2 11 7 2.66548 +2 12 7 2.68111 +2 13 7 2.65516 +2 14 7 2.67067 +2 0 8 2.71294 +2 1 8 2.75656 +2 2 8 2.75103 +2 3 8 2.74004 +2 4 8 2.76769 +2 5 8 2.71832 +2 6 8 2.74553 +2 7 8 2.81311 +2 8 8 2.83053 +2 9 8 2.72371 +2 10 8 2.76211 +2 11 8 2.77329 +2 12 8 2.76211 +2 13 8 2.77329 +2 14 8 2.76211 +2 0 10 2.75656 +2 1 10 2.76769 +2 2 10 2.77329 +2 3 10 2.77329 +2 4 10 2.76769 +2 5 10 2.71832 +2 6 10 2.75103 +2 7 10 2.72371 +2 8 10 2.77329 +2 9 10 2.79021 +2 10 10 2.81311 +2 11 10 2.72371 +2 12 10 2.72371 +2 13 10 2.76211 +2 14 10 2.76769 +2 0 11 2.84226 +2 1 11 2.81311 +2 2 11 2.81311 +2 3 11 2.84816 +2 4 11 2.80735 +2 5 11 2.86004 +2 6 11 2.84816 +2 7 11 2.83638 +2 8 11 2.85409 +2 9 11 2.87202 +2 10 11 2.90857 +2 11 11 2.87805 +2 12 11 2.81889 +2 13 11 2.81889 +2 14 11 2.83638 +2 0 12 2.75656 +2 1 12 2.71832 +2 2 12 2.72913 +2 3 12 2.73458 +2 4 12 2.73458 +2 5 12 2.76211 +2 6 12 2.73458 +2 7 12 2.71832 +2 8 12 2.75656 +2 9 12 2.71832 +2 10 12 2.70758 +2 11 12 2.75656 +2 12 12 2.75656 +2 13 12 2.74553 +2 14 12 2.74004 +2 0 13 2.63476 +2 1 13 2.67067 +2 2 13 2.66031 +2 3 13 2.65516 +2 4 13 2.66548 +2 5 13 2.61466 +2 6 13 2.61466 +2 7 13 2.6297 +2 8 13 2.64492 +2 9 13 2.66548 +2 10 13 2.66548 +2 11 13 2.65003 +2 12 13 2.69164 +2 13 13 2.69693 +2 14 13 2.62467 +2 0 14 2.70758 +2 1 14 2.73458 +2 2 14 2.71832 +2 3 14 2.71294 +2 4 14 2.74553 +2 5 14 2.71832 +2 6 14 2.68111 +2 7 14 2.68637 +2 8 14 2.72371 +2 9 14 2.73458 +2 10 14 2.75656 +2 11 14 2.72913 +2 12 14 2.69164 +2 13 14 2.79021 +2 14 14 2.76769 +3 0 0 2.6297 +3 1 0 2.59487 +3 2 0 2.60473 +3 3 0 2.61466 +3 4 0 2.59487 +3 5 0 2.59487 +3 7 0 2.61966 +3 8 0 2.59979 +3 9 0 2.59487 +3 10 0 2.59487 +3 11 0 2.60969 +3 12 0 2.57055 +3 13 0 2.58023 +3 14 0 2.58997 +3 15 0 2.60969 +3 0 2 2.75103 +3 1 2 2.83053 +3 2 2 2.81889 +3 3 2 2.79021 +3 4 2 2.77891 +3 5 2 2.78455 +3 7 2 2.76769 +3 8 2 2.77329 +3 9 2 2.73458 +3 10 2 2.77329 +3 11 2 2.74004 +3 12 2 2.76211 +3 13 2 2.77891 +3 14 2 2.76211 +3 15 2 2.74553 +3 0 3 2.7959 +3 1 3 2.8247 +3 2 3 2.86004 +3 3 3 2.87805 +3 4 3 2.80735 +3 5 3 2.8247 +3 7 3 2.81311 +3 8 3 2.8247 +3 9 3 2.8247 +3 10 3 2.80161 +3 11 3 2.81889 +3 12 3 2.8247 +3 13 3 2.80161 +3 14 3 2.77329 +3 15 3 2.80735 +3 0 4 2.76211 +3 1 4 2.78455 +3 2 4 2.81311 +3 3 4 2.83638 +3 4 4 2.86602 +3 5 4 2.79021 +3 7 4 2.78455 +3 8 4 2.79021 +3 9 4 2.77891 +3 10 4 2.77891 +3 11 4 2.7959 +3 12 4 2.77329 +3 13 4 2.81311 +3 14 4 2.80161 +3 15 4 2.80161 +3 0 5 2.72913 +3 1 5 2.77329 +3 2 5 2.75103 +3 3 5 2.76211 +3 4 5 2.8247 +3 5 5 2.79021 +3 7 5 2.73458 +3 8 5 2.71294 +3 9 5 2.72913 +3 10 5 2.75656 +3 11 5 2.75656 +3 12 5 2.73458 +3 13 5 2.74553 +3 14 5 2.75103 +3 15 5 2.74004 +3 0 7 2.81311 +3 1 7 2.80161 +3 2 7 2.81889 +3 3 7 2.81311 +3 4 7 2.76769 +3 5 7 2.83638 +3 7 7 2.84816 +3 8 7 2.83053 +3 9 7 2.77891 +3 10 7 2.80161 +3 11 7 2.77891 +3 12 7 2.81889 +3 13 7 2.7959 +3 14 7 2.81311 +3 15 7 2.78455 +3 0 8 2.92719 +3 1 8 2.93345 +3 2 8 2.91475 +3 3 8 2.9524 +3 4 8 2.93345 +3 5 8 2.9524 +3 7 8 2.97805 +3 8 8 2.99757 +3 9 8 2.96517 +3 10 8 2.96517 +3 11 8 2.93345 +3 12 8 2.9524 +3 13 8 2.9524 +3 14 8 2.92719 +3 15 8 2.96517 +3 0 9 2.76211 +3 1 9 2.75656 +3 2 9 2.79021 +3 3 9 2.78455 +3 4 9 2.7959 +3 5 9 2.76211 +3 7 9 2.80161 +3 8 9 2.81889 +3 9 9 2.86602 +3 10 9 2.80735 +3 11 9 2.78455 +3 12 9 2.7959 +3 13 9 2.80161 +3 14 9 2.80161 +3 15 9 2.80735 +3 0 10 3.14179 +3 1 10 3.13461 +3 2 10 3.17084 +3 3 10 3.15625 +3 4 10 3.149 +3 5 10 3.12746 +3 7 10 3.17819 +3 8 10 3.19299 +3 9 10 3.22301 +3 10 10 3.2306 +3 11 10 3.20793 +3 12 10 3.16353 +3 13 10 3.17819 +3 14 10 3.19299 +3 15 10 3.19299 +3 0 11 2.99757 +3 1 11 2.97159 +3 2 11 3.01074 +3 3 11 2.99104 +3 4 11 3.00414 +3 5 11 3.00414 +3 7 11 2.9524 +3 8 11 3.00414 +3 9 11 2.96517 +3 10 11 3.0307 +3 11 11 3.06456 +3 12 11 3.01074 +3 13 11 2.99757 +3 14 11 3.02401 +3 15 11 2.96517 +3 0 12 2.87805 +3 1 12 2.90241 +3 2 12 2.84816 +3 3 12 2.87805 +3 4 12 2.85409 +3 5 12 2.87805 +3 7 12 2.87202 +3 8 12 2.86004 +3 9 12 2.87202 +3 10 12 2.90241 +3 11 12 2.9524 +3 12 12 2.92096 +3 13 12 2.90241 +3 14 12 2.90241 +3 15 12 2.89018 +3 0 13 2.92096 +3 1 13 2.92096 +3 2 13 2.90241 +3 3 13 2.91475 +3 4 13 2.92719 +3 5 13 2.92719 +3 7 13 2.89628 +3 8 13 2.89628 +3 9 13 2.90857 +3 10 13 2.92096 +3 11 13 2.89628 +3 12 13 2.93345 +3 13 13 2.99104 +3 14 13 2.90241 +3 15 13 2.92096 +3 0 14 2.77329 +3 1 14 2.74553 +3 2 14 2.75656 +3 3 14 2.78455 +3 4 14 2.78455 +3 5 14 2.77891 +3 7 14 2.77891 +3 8 14 2.79021 +3 9 14 2.77891 +3 10 14 2.76769 +3 11 14 2.7959 +3 12 14 2.78455 +3 13 14 2.84226 +3 14 14 2.84226 +3 15 14 2.7959 +3 0 15 2.91475 +3 1 15 2.90241 +3 2 15 2.93345 +3 3 15 2.93345 +3 4 15 2.92719 +3 5 15 2.90857 +3 7 15 2.95877 +3 8 15 2.90241 +3 9 15 2.93345 +3 10 15 2.94606 +3 11 15 2.90241 +3 12 15 2.97159 +3 13 15 2.90857 +3 14 15 2.93345 +3 15 15 2.99757 diff --git a/run_17F.sh b/run_17F.sh index 82c6469..347a84b 100644 --- a/run_17F.sh +++ b/run_17F.sh @@ -22,6 +22,7 @@ function run_once() { export -f run_once # run_once 350 # parallel -j 6 --ctag run_once {1} ::: {325..400} +parallel -j 6 --ctag run_once {1} ::: {351,353,355,358,359,360,362,367} rm output_17F.root hadd -j 4 -k output_17F.root 17F_output/results_run3*.root diff --git a/run_tr.sh b/run_tr.sh index 8841115..9d02aad 100644 --- a/run_tr.sh +++ b/run_tr.sh @@ -4,7 +4,9 @@ export flipa=0 export anode_offset=0 export DATASET="27Al" if [[ 1 -eq 0 ]]; then +root -b -q -l -x ../ANASEN_analysis/source.root -e 'tree->Process("TrackRecon.C+O")'; mv Analyzer_SX3.root result.root; #root -b -q -l -x ../ANASEN_analysis/data/27Al_Data/Run_009_mapped.root -e 'tree->Process("TrackRecon.C+O")'; mv Analyzer_SX3.root results_run09.root; +# exit root -b -q -l -x ../ANASEN_analysis/data/27Al_Data/Run_001_mapped.root -e 'tree->Process("TrackRecon.C+O")'; mv Analyzer_SX3.root results_run01.root; root -b -q -l -x ../ANASEN_analysis/data/27Al_Data/Run_002_mapped.root -e 'tree->Process("TrackRecon.C+O")'; mv Analyzer_SX3.root results_run02.root; root -b -q -l -x ../ANASEN_analysis/data/27Al_Data/Run_003_mapped.root -e 'tree->Process("TrackRecon.C+O")'; mv Analyzer_SX3.root results_run03.root; @@ -26,7 +28,7 @@ export timecut_low=400.0; #export source_vertex=53.44; root -q -b -x ../ANASEN_analysis/data/27Al_Data/Run_009_mapped.root -e 'tree->Process("TrackRecon.C+O")'; mv Analyzer_SX3.root results_run09.root; #export source_vertex=53.44; root -q -b -x ../ANASEN_analysis/data/27Al_Data/Run_010_mapped.root -e 'tree->Process("TrackRecon.C+O")'; mv Analyzer_SX3.root results_run10.root; #export source_vertex=53.44; root -q -b -x ../ANASEN_analysis/data/27Al_Data/Run_011_mapped.root -e 'tree->Process("TrackRecon.C+O")'; mv Analyzer_SX3.root results_run11.root; -export source_vertex=53.44; root -q -b -x ../ANASEN_analysis/data/27Al_Data/Run_012_mapped.root -e 'tree->Process("TrackRecon.C+O")'; mv Analyzer_SX3.root results_run12.root; +export source_vertex=53.44; root -q -b -x ../ANASEN_analysis/data/27Al_Data/Run_012_mapped.root -e 'tree->Process("TrackRecon.C+O")'; mv Analyzer_SX3.root source_results_run12.root; # exit #export source_vertex=53.44; root -q -b -x ../ANASEN_analysis/data/27Al_Data/Run_013_mapped.root -e 'tree->Process("TrackRecon.C+O")'; mv Analyzer_SX3.root results_run13.root; #exit @@ -36,14 +38,14 @@ unset timecut_low #protons+gas, 27Al #export flip180="1" #export flip180="0" -if [[ 1 -eq 1 ]]; then +if [[ 1 -eq 0 ]]; then export flipa=0 export anode_offset=0 export source_vertex=-200.0; #put the 'source' on the entrance window -root -q -b -x ../ANASEN_analysis/data/27Al_Data/Run_018_mapped.root -e 'tree->Process("TrackRecon.C+O")'; mv Analyzer_SX3.root results_run18.root; -exit -root -q -b -x ../ANASEN_analysis/data/27Al_Data/Run_015_mapped.root -e 'tree->Process("TrackRecon.C+O")'; mv Analyzer_SX3.root results_run15.root; root -q -b -x ../ANASEN_analysis/data/27Al_Data/Run_017_mapped.root -e 'tree->Process("TrackRecon.C+O")'; mv Analyzer_SX3.root results_run17.root; +exit +root -q -b -x ../ANASEN_analysis/data/27Al_Data/Run_018_mapped.root -e 'tree->Process("TrackRecon.C+O")'; mv Analyzer_SX3.root results_run18.root; +root -q -b -x ../ANASEN_analysis/data/27Al_Data/Run_015_mapped.root -e 'tree->Process("TrackRecon.C+O")'; mv Analyzer_SX3.root results_run15.root; root -q -b -x ../ANASEN_analysis/data/27Al_Data/Run_019_mapped.root -e 'tree->Process("TrackRecon.C+O")'; mv Analyzer_SX3.root results_run19.root; root -q -b -x ../ANASEN_analysis/data/27Al_Data/Run_020_mapped.root -e 'tree->Process("TrackRecon.C+O")'; mv Analyzer_SX3.root results_run20.root; root -q -b -x ../ANASEN_analysis/data/27Al_Data/Run_021_mapped.root -e 'tree->Process("TrackRecon.C+O")'; mv Analyzer_SX3.root results_run21.root; @@ -79,10 +81,10 @@ fi #17F alpha run with gas if [[ 1 -eq 1 ]]; then -export source_vertex=53.44; root -q -l -b -x ../ANASEN_analysis/data/17F_Data/SourceRun_018_mapped.root -e 'tree->Process("TrackRecon.C+O")'; mv Analyzer_SX3.root results_run18.root; -export source_vertex=14.24; root -q -l -b -x ../ANASEN_analysis/data/17F_Data/SourceRun_019_mapped.root -e 'tree->Process("TrackRecon.C+O")'; mv Analyzer_SX3.root results_run19.root; -export source_vertex=-24.96; root -q -l -b -x ../ANASEN_analysis/data/17F_Data/SourceRun_020_mapped.root -e 'tree->Process("TrackRecon.C+O")'; mv Analyzer_SX3.root results_run20.root; -export source_vertex=-73.96; root -q -l -b -x ../ANASEN_analysis/data/17F_Data/SourceRun_021_mapped.root -e 'tree->Process("TrackRecon.C+O")'; mv Analyzer_SX3.root results_run21.root; +export source_vertex=53.44; root -q -l -b -x ../ANASEN_analysis/data/17F_Data/SourceRun_018_mapped.root -e 'tree->Process("TrackRecon.C+O")'; mv Analyzer_SX3.root source_results_run18.root; +export source_vertex=14.24; root -q -l -b -x ../ANASEN_analysis/data/17F_Data/SourceRun_019_mapped.root -e 'tree->Process("TrackRecon.C+O")'; mv Analyzer_SX3.root source_results_run19.root; +export source_vertex=-24.96; root -q -l -b -x ../ANASEN_analysis/data/17F_Data/SourceRun_020_mapped.root -e 'tree->Process("TrackRecon.C+O")'; mv Analyzer_SX3.root source_results_run20.root; +export source_vertex=-73.96; root -q -l -b -x ../ANASEN_analysis/data/17F_Data/SourceRun_021_mapped.root -e 'tree->Process("TrackRecon.C+O")'; mv Analyzer_SX3.root source_results_run21.root; fi #17F reaction data #export flip180="0" diff --git a/scratch/make_prettyplots.C b/scratch/make_prettyplots.C index 7bd14db..bf0d63d 100644 --- a/scratch/make_prettyplots.C +++ b/scratch/make_prettyplots.C @@ -3,12 +3,12 @@ // // Feed it a ROOT file and a histogram name, get a publication-quality PNG. // -// Usage: +// Usage (Single File): // root -l -b -q 'make_pretty.C("myfile.root", "histName")' -// root -l -b -q 'make_pretty.C("myfile.root", "histName", "x label", "y label")' // -// Supports TH1F, TH1D, TH2F, TH2D — type is detected automatically. -// Output PNG is written to the same directory as the input file. +// Usage (Multi-File Overlay): +// root -l -b -q 'make_pretty.C("file1.root,file2.root", "Run 1,Run 2", "histName", "X-Axis", "Y-Axis")' +// // ============================================================================= #include "TFile.h" @@ -18,11 +18,15 @@ #include "TStyle.h" #include "TGaxis.h" #include "TLatex.h" +#include "TLegend.h" #include "TSystem.h" #include "TROOT.h" +#include "TObjArray.h" +#include "TObjString.h" #include #include +#include // --------------------------------------------------------------------------- // Style — called once before anything is drawn @@ -63,11 +67,18 @@ void SetStyle() gStyle->SetNumberContours(255); } +// --------------------------------------------------------------------------- +// Single Plot Function +// --------------------------------------------------------------------------- void make_prettyplots(const char *rootFile, const char *histName, const char *xlabel = "", const char *ylabel = "", - double minZ = -9999.0) + double minZ = -9999.0, + double minY = -9999.0, + double minX = -9999.0, + double maxX = -9999.0, + double maxY = -9999.0) { SetStyle(); @@ -121,8 +132,20 @@ void make_prettyplots(const char *rootFile, // --- Apply Minimum Z if provided --- if (minZ != -9999.0) { + h->GetXaxis()->SetRangeUser(minX, h->GetXaxis()->GetXmax()); + h->GetYaxis()->SetRangeUser(minY, h->GetYaxis()->GetXmax()); h->SetMinimum(minZ); } + if (minY != -9999.0) + h->GetYaxis()->SetRangeUser(minY, h->GetYaxis()->GetXmax()); + if (minX != -9999.0) + h->GetXaxis()->SetRangeUser(minX, h->GetXaxis()->GetXmax()); + + if (maxX != -9999.0 && maxY != -9999.0) + { + h->GetXaxis()->SetRangeUser(minX, maxX); + h->GetYaxis()->SetRangeUser(minY, maxY); + } h->GetXaxis()->SetTitle(xlabel); h->GetYaxis()->SetTitle(ylabel); @@ -135,6 +158,11 @@ void make_prettyplots(const char *rootFile, else { TH1 *h = (TH1 *)clone; + if (minX != -9999.0) + h->GetXaxis()->SetRangeUser(minX, h->GetXaxis()->GetXmax()); + if (maxX != -9999.0) + h->GetXaxis()->SetRangeUser(minX, maxX); + h->SetStats(0); h->SetLineColor(kAzure - 5); h->SetLineWidth(3); @@ -148,21 +176,138 @@ void make_prettyplots(const char *rootFile, } // --- Save --------------------------------------------------------------- - // Build output path: same directory as input file, named after the histogram std::string inPath(rootFile); std::string dir = inPath.substr(0, inPath.find_last_of("/\\")); if (dir == inPath) - dir = "."; // no directory component — use cwd + dir = "."; - std::string outPath = dir + "/" + std::string(histName) + ".png"; - // Replace any "/" inside histName (e.g. "folder/hist") with "_" - for (char &ch : outPath) + std::string safeHistName = histName; + for (char &ch : safeHistName) if (ch == '/') ch = '_'; - c.Modified(); - c.Update(); + std::string outPath = dir + "/" + safeHistName + ".png"; c.SaveAs(outPath.c_str()); - std::cout << "Saved: " << outPath << "\n"; +} + +// --------------------------------------------------------------------------- +// Multi-File Overlay Function +// --------------------------------------------------------------------------- +void make_prettyplots(TString filesCSV, TString labelsCSV, TString histName, TString xAxisLabel="", TString yAxisLabel="", double yMin=-9999, double yMax=-9999, double xMin=-9999, double xMax=-9999) +{ + SetStyle(); + + // Parse the comma-separated lists natively using ROOT's TString + TObjArray* fileArr = filesCSV.Tokenize(","); + TObjArray* labelArr = labelsCSV.Tokenize(","); + + if (fileArr->GetEntriesFast() != labelArr->GetEntriesFast()) + { + std::cerr << "ERROR: Number of files does not match number of labels!\n"; + return; + } + + // Array of distinct colors to cycle through + int colors[] = {kBlack, kRed + 1, kAzure + 2, kGreen + 2, kMagenta + 1, kOrange + 7, kTeal - 1, kPink + 2}; + int nColors = 8; + + std::vector hists; + double globalMaxY = -999999.0; + + // Load all histograms and determine the maximum peak + for (int i = 0; i < fileArr->GetEntriesFast(); i++) + { + TString currentFile = ((TObjString*)fileArr->At(i))->GetString(); + TString currentLabel = ((TObjString*)labelArr->At(i))->GetString(); + + TFile *f = TFile::Open(currentFile, "READ"); + if (!f || f->IsZombie()) + continue; + + TH1 *h = (TH1 *)f->Get(histName); + if (!h) + { + std::cerr << "WARNING: '" << histName << "' not found in " << currentFile << ". Skipping...\n"; + f->Close(); + continue; + } + + TH1 *clone = (TH1 *)h->Clone(Form("h_%d", i)); + clone->SetDirectory(0); // Detach from file + f->Close(); + + // Apply X-range BEFORE checking the max Y-height, otherwise peaks + // outside the viewing range might scale the Y-axis unnecessarily! + if (xMin != -9999.0 && xMax != -9999.0) + clone->GetXaxis()->SetRangeUser(xMin, xMax); + else if (xMin != -9999.0) + clone->GetXaxis()->SetRangeUser(xMin, clone->GetXaxis()->GetXmax()); + + if (clone->GetMaximum() > globalMaxY) + { + globalMaxY = clone->GetMaximum(); + } + + hists.push_back(clone); + } + + if (hists.empty()) + { + std::cerr << "ERROR: No valid histograms found to plot.\n"; + return; + } + + // --- Draw --- + TCanvas c("c", "", 0, 0, 2100, 1575); + c.cd(); + + // Create Legend (Positioned top right) + TLegend *leg = new TLegend(0.65, 0.70, 0.92, 0.90); + leg->SetBorderSize(0); + leg->SetFillStyle(0); // Transparent background + + for (size_t i = 0; i < hists.size(); i++) + { + hists[i]->SetStats(0); + hists[i]->SetLineColor(colors[i % nColors]); + hists[i]->SetLineWidth(3); + + if (i == 0) + { + // First histogram dictates the frame layout + if (yMin != -9999.0 && yMax != -9999.0) { + hists[i]->GetYaxis()->SetRangeUser(yMin, yMax); + } else { + hists[i]->SetMaximum(globalMaxY * 1.15); // Add 15% headroom automatically + } + + if (xAxisLabel != "") hists[i]->GetXaxis()->SetTitle(xAxisLabel); + if (yAxisLabel != "") hists[i]->GetYaxis()->SetTitle(yAxisLabel); + + hists[i]->GetXaxis()->SetTitleOffset(1.1); + hists[i]->GetYaxis()->SetTitleOffset(1.4); + hists[i]->GetXaxis()->CenterTitle(true); + hists[i]->GetYaxis()->CenterTitle(true); + hists[i]->Draw("hist"); + } + else + { + // Subsequent histograms stack on top + hists[i]->Draw("hist same"); + } + + TString currentLabel = ((TObjString*)labelArr->At(i))->GetString(); + leg->AddEntry(hists[i], currentLabel.Data(), "l"); + } + + leg->Draw(); + + // --- Save --- + TString safeHistName = histName; + safeHistName.ReplaceAll("/", "_"); + + TString outPath = safeHistName + "_overlay.png"; + c.SaveAs(outPath.Data()); + std::cout << "Saved: " << outPath.Data() << "\n"; } \ No newline at end of file