From 29a136a14b1ab80fdad95901e67d4ee8870c6077 Mon Sep 17 00:00:00 2001 From: gwm17 Date: Wed, 19 Apr 2023 09:39:06 -0400 Subject: [PATCH] Fix some bugs in plotter, clean up a few debug statements. --- src/Detectors/DetectorApp.cpp | 1 + src/Detectors/SabreArray.h | 2 +- src/Mask/Nucleus.h | 3 +++ src/Mask/Reaction.cpp | 1 - src/Plotters/RootPlotter.cpp | 39 +++++++++++++++++++++++------------ 5 files changed, 31 insertions(+), 15 deletions(-) diff --git a/src/Detectors/DetectorApp.cpp b/src/Detectors/DetectorApp.cpp index 83e3f74..6499d50 100644 --- a/src/Detectors/DetectorApp.cpp +++ b/src/Detectors/DetectorApp.cpp @@ -110,6 +110,7 @@ void DetectorApp::Run() nucleus.detectedKE = result.energy_deposited; nucleus.detectedTheta = result.direction.Theta(); nucleus.detectedPhi = result.direction.Phi(); + nucleus.detectedPos = result.direction; } } m_fileWriter.PushData(data); diff --git a/src/Detectors/SabreArray.h b/src/Detectors/SabreArray.h index 24cac47..b32ca6c 100644 --- a/src/Detectors/SabreArray.h +++ b/src/Detectors/SabreArray.h @@ -39,7 +39,7 @@ private: static constexpr double s_detectorThickness = 500 * 1e-4 * 2.3926 * 1e6; // ug/cm^2 (500 um thick * density) static constexpr double s_degraderThickness = 70.0 * 1.0e-4 * 16.69 * 1e6; //tantalum degrader (70 um thick) - static constexpr double s_energyThreshold = 0.2; //in MeV + static constexpr double s_energyThreshold = 0.25; //in MeV }; diff --git a/src/Mask/Nucleus.h b/src/Mask/Nucleus.h index 2769cf6..c820051 100644 --- a/src/Mask/Nucleus.h +++ b/src/Mask/Nucleus.h @@ -12,6 +12,7 @@ #include #include #include "Math/Vector4D.h" +#include "Math/Point3D.h" #include "MassLookup.h" namespace Mask { @@ -48,6 +49,8 @@ namespace Mask { double detectedKE = 0.0; double detectedTheta = 0.0; double detectedPhi = 0.0; + + ROOT::Math::XYZPoint detectedPos = ROOT::Math::XYZPoint(0., 0., 0.); }; Nucleus CreateNucleus(uint32_t z, uint32_t a); diff --git a/src/Mask/Reaction.cpp b/src/Mask/Reaction.cpp index 751dfa7..2a1a7f8 100644 --- a/src/Mask/Reaction.cpp +++ b/src/Mask/Reaction.cpp @@ -229,7 +229,6 @@ namespace Mask { m_residual->vec4 = m_target->vec4 - m_ejectile->vec4; //energy loss for the *light* break up nucleus - double keorig = m_ejectile->GetKE(); double ejectKE = m_ejectile->GetKE() - m_layeredTarget->GetEjectileEnergyLoss(m_ejectile->Z, m_ejectile->A, m_ejectile->GetKE(), m_rxnLayer, m_ejectile->vec4.Theta(), m_rxnDepth); if(ejectKE > 0.0) diff --git a/src/Plotters/RootPlotter.cpp b/src/Plotters/RootPlotter.cpp index 83809e0..a07287e 100644 --- a/src/Plotters/RootPlotter.cpp +++ b/src/Plotters/RootPlotter.cpp @@ -59,21 +59,33 @@ void RootPlotter::Run(const std::string& inputname, const std::string& outputnam void RootPlotter::FillData(const Mask::Nucleus& nuc) { - std::string modifier = ""; - if(nuc.isDetected) - modifier = "detected"; + std::string mod = "detected"; std::string sym = nuc.isotopicSymbol; - std::string ke_vs_th_name = sym + modifier + "_ke_vs_theta"; + std::string ke_vs_th_name = sym + "_ke_vs_theta"; std::string ke_vs_th_title = ke_vs_th_name + ";#theta_{lab} (degrees);Kinetic Energy (MeV)"; - std::string ke_vs_ph_name = sym + modifier + "_ke_vs_phi"; + std::string ke_vs_th_name_det = sym + mod + "_ke_vs_theta"; + std::string ke_vs_th_title_det = ke_vs_th_name + ";#theta_{lab} (degrees);Kinetic Energy (MeV)"; + std::string ke_vs_ph_name = sym + "_ke_vs_phi"; std::string ke_vs_ph_title = ke_vs_ph_name + ";#phi_{lab} (degrees);Kinetic Energy (MeV)"; - std::string th_vs_ph_name = sym + modifier + "_theta_vs_phi"; + std::string ke_vs_ph_name_det = sym + mod + "_ke_vs_phi"; + std::string ke_vs_ph_title_det = ke_vs_ph_name + ";#phi_{lab} (degrees);Kinetic Energy (MeV)"; + std::string th_vs_ph_name = sym + "_theta_vs_phi"; std::string th_vs_ph_title = th_vs_ph_name + ";#theta_{lab};#phi_{lab}"; - std::string ex_name = sym + modifier + "_ex"; + std::string th_vs_ph_name_det = sym + mod + "_theta_vs_phi"; + std::string th_vs_ph_title_det = th_vs_ph_name + ";#theta_{lab};#phi_{lab}"; + std::string ex_name = sym + "_ex"; std::string ex_title = ex_name + ";E_{ex} (MeV);counts"; - std::string angdist_name = sym + modifier +"_angDist"; + std::string ex_name_det = sym + mod + "_ex"; + std::string ex_title_det = ex_name + ";E_{ex} (MeV);counts"; + std::string angdist_name = sym +"_angDist"; std::string angdist_title = angdist_name+";cos#right(#theta_{CM}#left);counts"; + std::string angdist_name_det = sym + mod +"_angDist"; + std::string angdist_title_det = angdist_name+";cos#right(#theta_{CM}#left);counts"; + std::string hist_ke_th_name = sym + "_hist_ke_vs_theta"; + std::string hist_ke_th_title = hist_ke_th_name + ";#theta_{lab};Kinetic Energy (MeV)"; + std::string hist_ke_th_name_det = sym + mod + "_hist_ke_vs_theta"; + std::string hist_ke_th_title_det = hist_ke_th_name + ";#theta_{lab};Kinetic Energy (MeV)"; MyFill(ke_vs_th_name, ke_vs_th_title, nuc.vec4.Theta()*s_rad2deg, nuc.GetKE(), 2); MyFill(ke_vs_ph_name, ke_vs_ph_title, FullPhi(nuc.vec4.Phi())*s_rad2deg, nuc.GetKE(), 4); @@ -82,11 +94,12 @@ void RootPlotter::FillData(const Mask::Nucleus& nuc) MyFill(angdist_name, angdist_title, 20, -1.0, 1.0, std::cos(nuc.thetaCM)); if(nuc.isDetected) { - MyFill(ke_vs_th_name, ke_vs_th_title, nuc.vec4.Theta()*s_rad2deg, nuc.detectedKE, 2); - MyFill(ke_vs_ph_name, ke_vs_ph_title, FullPhi(nuc.vec4.Phi())*s_rad2deg, nuc.detectedKE, 4); - MyFill(th_vs_ph_name, th_vs_ph_title, nuc.vec4.Theta()*s_rad2deg, FullPhi(nuc.vec4.Phi())*s_rad2deg, 2); - MyFill(ex_name, ex_title, 260, -1.0, 25, nuc.GetExcitationEnergy()); - MyFill(angdist_name, angdist_title, 20, -1.0, 1.0, std::cos(nuc.thetaCM)); + MyFill(ke_vs_th_name_det, ke_vs_th_title_det, nuc.vec4.Theta()*s_rad2deg, nuc.detectedKE, 2); + MyFill(ke_vs_ph_name_det, ke_vs_ph_title_det, FullPhi(nuc.vec4.Phi())*s_rad2deg, nuc.detectedKE, 4); + MyFill(th_vs_ph_name_det, th_vs_ph_title_det, nuc.vec4.Theta()*s_rad2deg, FullPhi(nuc.vec4.Phi())*s_rad2deg, 2); + MyFill(ex_name_det, ex_title_det, 260, -1.0, 25, nuc.GetExcitationEnergy()); + MyFill(angdist_name_det, angdist_title_det, 20, -1.0, 1.0, std::cos(nuc.thetaCM)); + MyFill(hist_ke_th_name_det, hist_ke_th_title_det, 180, 0.0, 180.0, 400, 0.0, 20.0, nuc.vec4.Theta()*s_rad2deg, nuc.detectedKE); } }