From 172594a90aaaf7c610c8827d18ab5d0c118c4109 Mon Sep 17 00:00:00 2001 From: James Szalkie Date: Mon, 28 Sep 2026 12:03:46 -0400 Subject: [PATCH] removed playing god --- Armory/Kinematics.h | 4 ++-- Armory/anasenMS.cpp | 13 ++++++++----- Armory/testMacro.C | 12 ++++++++++-- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/Armory/Kinematics.h b/Armory/Kinematics.h index 5d47d28..e2cb1c0 100644 --- a/Armory/Kinematics.h +++ b/Armory/Kinematics.h @@ -50,7 +50,7 @@ public: return E_beam*(m_d/(m_A+m_d)); } - double getEbeam_givenQ(double e3, double Ex, double angle3_deg) { + double getEbeam_givenQ(double e3, double Ex, double angle3_deg) { // e3 is detected particle energy, Ex is excitation energy, angle3_deg is detected particle angle in degrees double angle = angle3_deg*TMath::Pi()/180.0; double m1 = m_A * u_MeV; //double m2 = m_d * u_MeV; @@ -64,7 +64,7 @@ public: double result_sq1 = (BB - TMath::Sqrt(BB*BB-AA*CC))/(AA); return result_sq1*result_sq1; - } + } // to use in anasenMS.cpp, call like: apkin_27Al.getEbeam_givenQ(Esx3, 0.0, thetab); void setValues(double m1, double m2, double m3, double m4, double ebeam) { /* diff --git a/Armory/anasenMS.cpp b/Armory/anasenMS.cpp index 98625e5..0eb6ff0 100644 --- a/Armory/anasenMS.cpp +++ b/Armory/anasenMS.cpp @@ -168,7 +168,8 @@ int main(int argc, char **argv){ // Excited state lists (projectile and heavy-product excitation states) std::vector ExAList = {0}; // Beam excited energy - std::vector ExList = {0, 2.235, 3.498, 4.809, 5.614, 6.550}; // Heavy product excited energy + //std::vector ExList = {0, 2.235, 3.498, 3.774, 4.831, 4.809, 5.279, 5.614, 5.951, 6.550}; // Heavy product excited energy + std::vector ExList = {2.235}; const int kMBeam = reactionConfig.beamA; // mass number of beam const int kMTarget = reactionConfig.targetA; // mass number of target @@ -725,7 +726,7 @@ int main(int argc, char **argv){ AutoHist2D::Fill("EPC x sin(theta) vs Esx3", Esx3, EPC * sin(thetab * TMath::DegToRad()), "Esx3 (MeV)", "EPC x sin(theta) (MeV)"); //tree1->Fill(); - Kinematics apkin_27Al(26.981538408,4.00260325413,1.00782503224,29.973770136,beamEnergy/26.981538408); //m3 is proton + if (!std::isnan(aX) && !std::isnan(aY) && !std::isnan(aZ) && aZ != 54321 && (aX != 0 || aY != 0 || aZ != 0)) { //reconstruct theta using anode and sx3 positions, apply a sigma to the anode locations //calulate vertex like in experiment @@ -739,7 +740,7 @@ int main(int argc, char **argv){ vY_track = r_rhoMin_fix.Y(); vZ_track = r_rhoMin_fix.Z(); - EBeam_track = elossBeam->Eval((vZ_track + 450) / 10); + EBeam_track = elossBeam->Eval((vZ_track + 454.3) / 10); Tb_recon = CalculateOriginalEnergy(hitX, hitY, hitZ, vX_track, vY_track, vZ_track, @@ -747,13 +748,15 @@ int main(int argc, char **argv){ //0, 0, vertexZ, b, "He", Esx3, distance_sx3); + + Kinematics apkin_27Al(26.981538408,4.00260325413,1.00782503224,29.973770136,EBeam_track/26.981538408); //m3 is proton //kinematic reconstruction theta_recon = TVector3(hitX - aX_sigma, hitY - aY_sigma, hitZ - aZ_sigma).Theta() * 180.0 / TMath::Pi(); - Ex_kin = apkin_27Al.getExc(Tb_recon, theta_recon); EBeam_kin = apkin_27Al.getEbeam_givenQ(Tb_recon, Ex, theta_recon); //args are (reaction energy, Ex, thetab) still tracking - vZ_kin = elossBeamInverse->Eval(EBeam_kin) * 10 - 450; + vZ_kin = elossBeamInverse->Eval(EBeam_kin) * 10 - 454.3; + Ex_kin = apkin_27Al.getExc(Tb_recon, theta_recon); /*Checklist: anode smudge, sx3 smudge, beam position off axis, beam angle*/ diff --git a/Armory/testMacro.C b/Armory/testMacro.C index 1b4e454..b8afd07 100644 --- a/Armory/testMacro.C +++ b/Armory/testMacro.C @@ -33,14 +33,15 @@ tree1->Draw("Ex_recon:vZ >> hExReconVsVZ", "sx3ID >= 0", "colz"); tree1->Draw("Ex:vZ >> h5", "sx3ID >= 0 && EPC >= 0.03", "same"); */ + new TCanvas("c1", "Canvas", 900, 600); tree1->Draw("Ex_kin:vZ_kin>>h2(800,-500,300,110,-1,10)", "sx3ID >=0 && !TMath::IsNaN(vZ_kin)", "colz"); tree1->Draw("Ex:vZ", "sx3ID >=0 && !TMath::IsNaN(vZ)", "same"); - c1->SaveAs("Ex_kin.png"); + c1->SaveAs("Ex_kin_vz.png"); /* new TCanvas("c2", "Canvas", 900, 600); tree1->Draw("theta_recon:thetab", "sx3ID >=0 && Esx3 > 0", ""); - c2->SaveAs("theta_recon_vs_thetab.png");*/ + c2->SaveAs("theta_recon_vs_thetab.png"); new TCanvas("c3", "Canvas", 900, 600); tree1->Draw("vZ_track:vZ", "sx3ID >=0 && !TMath::IsNaN(vZ_track)", ""); @@ -65,6 +66,13 @@ TF1 *line_kin_kin = new TF1("line_beam_kin", "x", gPad->GetUxmin(), gPad->GetUxmax()); line_kin_kin->SetLineColor(kRed); line_kin_kin->Draw("SAME"); c6->SaveAs("Ebeam_kin_vs_beamEnergy.png"); +*/ + new TCanvas("c7", "Canvas", 900, 600); + //c7->SetLogy(); + tree1->Draw("Ex_kin", "sx3ID >= 0"); + tree1->Draw("Ex", "sx3ID >= 0", "same"); + tree1->GetHistogram()->SetLineColor(kRed); + c7->SaveAs("Ex_kin.png"); }