From ee92375f06f361df32279ffaaf8595b6130a532f Mon Sep 17 00:00:00 2001
From: Marshall Scott <mbscott@anl.gov>
Date: Wed, 28 Apr 2021 09:23:55 -0400
Subject: [PATCH] plotting charge 2

---
 .../barrel_ecal/scripts/emcal_barrel_pions_analysis.cxx  | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/benchmarks/barrel_ecal/scripts/emcal_barrel_pions_analysis.cxx b/benchmarks/barrel_ecal/scripts/emcal_barrel_pions_analysis.cxx
index b7fadcdd..b14c0799 100644
--- a/benchmarks/barrel_ecal/scripts/emcal_barrel_pions_analysis.cxx
+++ b/benchmarks/barrel_ecal/scripts/emcal_barrel_pions_analysis.cxx
@@ -128,6 +128,13 @@ void emcal_barrel_pions_analysis(const char* input_fname = "sim_output/sim_emcal
     return result;
   };
 
+  // Thrown Energy [GeV]
+  auto Ethr = [](std::vector<dd4pod::Geant4ParticleData> const& input) {
+    std::vector<double> result;
+    result.push_back(input[2].charge);
+  return result;
+  };
+
   // Define variables
   auto d1 = d0.Define("Ethr",  Ethr,  {"mcparticles"})
 	      .Define("nhits",  nhits,      {"EcalBarrelHits"})
@@ -136,7 +143,7 @@ void emcal_barrel_pions_analysis(const char* input_fname = "sim_output/sim_emcal
         .Define("fsam",   fsam2,      {"Esim","Ethr"})
         .Define("dE",     eResol,     {"Esim", "Ethr"})
         .Define("dE_rel", eResol_rel, {"Esim", "Ethr"})
-        .Define("charge", {"charge"})
+        .Define("charge", {"mcparticles"})
 	      ;
 
   // Define Histograms
-- 
GitLab