From da5d757ea63f49c22e8b99221c187e3e7358c6ca Mon Sep 17 00:00:00 2001
From: ralfulrich <ralf.ulrich@kit.edu>
Date: Sat, 24 Oct 2020 07:56:12 +0200
Subject: [PATCH] conex, better PDG

---
 Documentation/Examples/hybrid_MC.cc            | 3 ++-
 Processes/CONEXSourceCut/CONEXSourceCut.cc     | 4 ++--
 Processes/CONEXSourceCut/CONEXSourceCut.h      | 2 +-
 Processes/CONEXSourceCut/testCONEXSourceCut.cc | 3 ++-
 4 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/Documentation/Examples/hybrid_MC.cc b/Documentation/Examples/hybrid_MC.cc
index 4edfa022e..c6647209b 100644
--- a/Documentation/Examples/hybrid_MC.cc
+++ b/Documentation/Examples/hybrid_MC.cc
@@ -208,7 +208,8 @@ int main(int argc, char** argv) {
   process::energy_loss::EnergyLoss eLoss{showerAxis, cut.GetECut()};
 
   corsika::process::conex_source_cut::CONEXSourceCut conex(
-      center, showerAxis, t, injectionHeight, E0, particles::Code::Proton);
+      center, showerAxis, t, injectionHeight, E0,
+      particles::GetPDG(particles::Code::Proton));
 
   process::on_shell_check::OnShellCheck reset_particle_mass(1.e-3, 1.e-1, false);
 
diff --git a/Processes/CONEXSourceCut/CONEXSourceCut.cc b/Processes/CONEXSourceCut/CONEXSourceCut.cc
index 1d3903e92..d6c6e7e28 100644
--- a/Processes/CONEXSourceCut/CONEXSourceCut.cc
+++ b/Processes/CONEXSourceCut/CONEXSourceCut.cc
@@ -191,7 +191,7 @@ CONEXSourceCut::CONEXSourceCut(geometry::Point center,
                                units::si::LengthType groundDist,
                                units::si::LengthType injectionHeight,
                                units::si::HEPEnergyType primaryEnergy,
-                               particles::Code primaryPID)
+                               particles::PDGCode primaryPDG)
     : center_{center}
     , showerAxis_{showerAxis}
     , groundDist_{groundDist}
@@ -283,7 +283,7 @@ CONEXSourceCut::CONEXSourceCut(geometry::Point center,
 
   std::cout << "theta (deg) = " << theta << "; phi (deg) = " << phi << std::endl;
 
-  int ipart = static_cast<int>(particles::GetPDG(primaryPID));
+  int ipart = static_cast<int>(primaryPDG);
   auto rng = corsika::random::RNGManager::GetInstance().GetRandomStream("cascade");
 
   double dimpact = 0.; // valid only if shower core is fixed on the observation plane; for
diff --git a/Processes/CONEXSourceCut/CONEXSourceCut.h b/Processes/CONEXSourceCut/CONEXSourceCut.h
index 5923cdbf0..b8a714666 100644
--- a/Processes/CONEXSourceCut/CONEXSourceCut.h
+++ b/Processes/CONEXSourceCut/CONEXSourceCut.h
@@ -31,7 +31,7 @@ namespace corsika::process {
       CONEXSourceCut(geometry::Point center, environment::ShowerAxis const& showerAxis,
                      units::si::LengthType groundDist,
                      units::si::LengthType injectionHeight,
-                     units::si::HEPEnergyType primaryEnergy, particles::Code pid);
+                     units::si::HEPEnergyType primaryEnergy, particles::PDGCode pdg);
       corsika::process::EProcessReturn DoSecondaries(corsika::setup::StackView&);
 
       void SolveCE();
diff --git a/Processes/CONEXSourceCut/testCONEXSourceCut.cc b/Processes/CONEXSourceCut/testCONEXSourceCut.cc
index 5ee19f4bf..c6b0b556d 100644
--- a/Processes/CONEXSourceCut/testCONEXSourceCut.cc
+++ b/Processes/CONEXSourceCut/testCONEXSourceCut.cc
@@ -90,7 +90,8 @@ TEST_CASE("CONEXSourceCut") {
   [[maybe_unused]] process::sibyll::NuclearInteraction sibyllNuc(sibyll, env);
 
   corsika::process::conex_source_cut::CONEXSourceCut conex(
-      center, showerAxis, t, injectionHeight, E0, particles::Code::Proton);
+      center, showerAxis, t, injectionHeight, E0,
+      particles::GetPDG(particles::Code::Proton));
 
   HEPEnergyType const Eem{1_PeV};
   auto const momentum = showerAxis.GetDirection() * Eem;
-- 
GitLab