From c5ff59a2426b8cc22c873d62f1528d39b3427942 Mon Sep 17 00:00:00 2001 From: Gordon McCann Date: Tue, 24 Aug 2021 15:41:09 -0400 Subject: [PATCH] Added a modifier option to the plotter to allow for separation of identical particles --- include/Plotter.h | 2 +- src/Kinematics.cpp | 42 +++++++++++++++++++++--------------------- src/Plotter.cpp | 10 +++++----- 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/include/Plotter.h b/include/Plotter.h index cbc159c..5e4bb16 100644 --- a/include/Plotter.h +++ b/include/Plotter.h @@ -27,7 +27,7 @@ public: GenerateGraphs(); return table; }; - void FillData(const Nucleus& nuc); + void FillData(const Nucleus& nuc, const std::string& modifier = ""); private: THashTable* table; diff --git a/src/Kinematics.cpp b/src/Kinematics.cpp index b6d4997..50d25a6 100644 --- a/src/Kinematics.cpp +++ b/src/Kinematics.cpp @@ -267,10 +267,10 @@ void Kinematics::RunOneStepRxn() { tree->Fill(); } if(do_plotter_flag) { - plotman.FillData(this_sys->GetTarget()); - plotman.FillData(this_sys->GetProjectile()); - plotman.FillData(this_sys->GetEjectile()); - plotman.FillData(this_sys->GetResidual()); + plotman.FillData(this_sys->GetTarget(), "targ"); + plotman.FillData(this_sys->GetProjectile(), "proj"); + plotman.FillData(this_sys->GetEjectile(), "eject"); + plotman.FillData(this_sys->GetResidual(), "resid"); } } @@ -322,9 +322,9 @@ void Kinematics::RunOneStepDecay() { tree->Fill(); } if(do_plotter_flag) { - plotman.FillData(this_sys->GetTarget()); - plotman.FillData(this_sys->GetEjectile()); - plotman.FillData(this_sys->GetResidual()); + plotman.FillData(this_sys->GetTarget(), "targ"); + plotman.FillData(this_sys->GetEjectile(), "eject"); + plotman.FillData(this_sys->GetResidual(), "resid"); } } @@ -384,12 +384,12 @@ void Kinematics::RunTwoStep() { tree->Fill(); } if(do_plotter_flag) { - plotman.FillData(this_sys->GetTarget()); - plotman.FillData(this_sys->GetProjectile()); - plotman.FillData(this_sys->GetEjectile()); - plotman.FillData(this_sys->GetResidual()); - plotman.FillData(this_sys->GetBreakup1()); - plotman.FillData(this_sys->GetBreakup2()); + plotman.FillData(this_sys->GetTarget(), "targ"); + plotman.FillData(this_sys->GetProjectile(), "proj"); + plotman.FillData(this_sys->GetEjectile(), "eject"); + plotman.FillData(this_sys->GetResidual(), "resid"); + plotman.FillData(this_sys->GetBreakup1(), "break1"); + plotman.FillData(this_sys->GetBreakup2(), "break2"); } } @@ -452,14 +452,14 @@ void Kinematics::RunThreeStep() { tree->Fill(); } if(do_plotter_flag) { - plotman.FillData(this_sys->GetTarget()); - plotman.FillData(this_sys->GetProjectile()); - plotman.FillData(this_sys->GetEjectile()); - plotman.FillData(this_sys->GetResidual()); - plotman.FillData(this_sys->GetBreakup1()); - plotman.FillData(this_sys->GetBreakup2()); - plotman.FillData(this_sys->GetBreakup3()); - plotman.FillData(this_sys->GetBreakup4()); + plotman.FillData(this_sys->GetTarget(), "targ"); + plotman.FillData(this_sys->GetProjectile(), "proj"); + plotman.FillData(this_sys->GetEjectile(), "eject"); + plotman.FillData(this_sys->GetResidual(), "resid"); + plotman.FillData(this_sys->GetBreakup1(), "break1"); + plotman.FillData(this_sys->GetBreakup2(), "break2"); + plotman.FillData(this_sys->GetBreakup3(), "break3"); + plotman.FillData(this_sys->GetBreakup4(), "break4"); } } diff --git a/src/Plotter.cpp b/src/Plotter.cpp index f0b233f..f9a5753 100644 --- a/src/Plotter.cpp +++ b/src/Plotter.cpp @@ -16,15 +16,15 @@ Plotter::~Plotter() { delete table; } -void Plotter::FillData(const Nucleus& nuc) { +void Plotter::FillData(const Nucleus& nuc, const std::string& modifier) { std::string sym = nuc.GetIsotopicSymbol(); - std::string ke_vs_th_name = sym + "_ke_vs_theta"; + std::string ke_vs_th_name = sym + modifier + "_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 + "_ke_vs_phi"; + std::string ke_vs_ph_name = sym + modifier + "_ke_vs_phi"; std::string ke_vs_ph_title = ke_vs_ph_name + ";#phi_{lab} (degrees);Kinetic Energy (MeV)"; - std::string ex_name = sym + "_ex"; + std::string ex_name = sym + modifier + "_ex"; std::string ex_title = ex_name + ";E_{ex} (MeV);counts"; - std::string angdist_name = sym+"_angDist"; + std::string angdist_name = sym + modifier +"_angDist"; std::string angdist_title = angdist_name+";cos#right(#theta_{CM}#left);counts"; MyFill(ke_vs_th_name.c_str(), ke_vs_th_title.c_str(), nuc.GetTheta()*rad2deg, nuc.GetKE(), 2);