From bc449f78e593d05dde3e5f112e3f4256f2c42ea4 Mon Sep 17 00:00:00 2001
From: Maximilian Sackel <maximilian.sackel@tu-dortmund.de>
Date: Wed, 30 Sep 2020 17:27:03 +0000
Subject: [PATCH] extension of longitudinal shower profile with electro
 magnetic component

---
 Processes/LongitudinalProfile/LongitudinalProfile.cc | 10 ++++++++--
 Processes/LongitudinalProfile/LongitudinalProfile.h  | 11 +++++++++--
 2 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/Processes/LongitudinalProfile/LongitudinalProfile.cc b/Processes/LongitudinalProfile/LongitudinalProfile.cc
index a02e6e621..08d7e3076 100644
--- a/Processes/LongitudinalProfile/LongitudinalProfile.cc
+++ b/Processes/LongitudinalProfile/LongitudinalProfile.cc
@@ -41,7 +41,13 @@ corsika::process::EProcessReturn LongitudinalProfile::DoContinuous(Particle cons
   const int binEnd = std::floor(grammageEnd / dX_);
 
   for (int b = binStart; b <= binEnd; ++b) {
-    if (pid == particles::Code::MuPlus) {
+    if (pid == particles::Code::Gamma) {
+      profiles_.at(b)[ProfileIndex::Gamma]++;
+    } else if (pid == particles::Code::Positron) {
+      profiles_.at(b)[ProfileIndex::Positron]++;
+    } else if (pid == particles::Code::Electron) {
+      profiles_.at(b)[ProfileIndex::Electron]++;
+    } else if (pid == particles::Code::MuPlus) {
       profiles_.at(b)[ProfileIndex::MuPlus]++;
     } else if (pid == particles::Code::MuMinus) {
       profiles_.at(b)[ProfileIndex::MuMinus]++;
@@ -55,7 +61,7 @@ corsika::process::EProcessReturn LongitudinalProfile::DoContinuous(Particle cons
 
 void LongitudinalProfile::save(std::string const& filename) {
   std::ofstream f{filename};
-  f << "# X / g·cm¯², mu+, mu-, all hadrons" << std::endl;
+  f << "# X / g·cm¯², gamma, e+, e-, mu+, mu-, all hadrons" << std::endl;
   for (size_t b = 0; b < profiles_.size(); ++b) {
     f << std::setprecision(5) << std::setw(11) << b * (dX_ / (1_g / 1_cm / 1_cm));
     for (auto const& N : profiles_.at(b)) {
diff --git a/Processes/LongitudinalProfile/LongitudinalProfile.h b/Processes/LongitudinalProfile/LongitudinalProfile.h
index 457175731..0e155a70c 100644
--- a/Processes/LongitudinalProfile/LongitudinalProfile.h
+++ b/Processes/LongitudinalProfile/LongitudinalProfile.h
@@ -43,8 +43,15 @@ namespace corsika::process::longitudinal_profile {
     }); // profile binning
 
     environment::ShowerAxis const& shower_axis_;
-    using ProfileEntry = std::array<uint32_t, 3>;
-    enum ProfileIndex { MuPlus = 0, MuMinus = 1, Hadron = 2 };
+    using ProfileEntry = std::array<uint32_t, 6>;
+    enum ProfileIndex {
+      Gamma = 0,
+      Positron = 1,
+      Electron = 2,
+      MuPlus = 3,
+      MuMinus = 4,
+      Hadron = 5
+    };
     std::vector<ProfileEntry> profiles_; // longitudinal profile
 
     static int const width_ = 14;
-- 
GitLab