From b4b0978bd3bedbf08dd643ec75e9a9ee42a0cc53 Mon Sep 17 00:00:00 2001
From: Remy Prechelt <prechelt@hawaii.edu>
Date: Mon, 16 Nov 2020 23:18:37 -1000
Subject: [PATCH] Changes in nuclear composition API.

---
 corsika/detail/modules/energy_loss/BetheBlochPDG.inl | 8 ++++----
 corsika/detail/modules/pythia8/Interaction.inl       | 4 ++--
 corsika/detail/modules/qgsjetII/Interaction.inl      | 4 ++--
 corsika/detail/modules/sibyll/Interaction.inl        | 4 ++--
 corsika/detail/modules/sibyll/NuclearInteraction.inl | 6 +++---
 corsika/detail/modules/urqmd/UrQMD.inl               | 4 ++--
 6 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/corsika/detail/modules/energy_loss/BetheBlochPDG.inl b/corsika/detail/modules/energy_loss/BetheBlochPDG.inl
index add5d8bcd..28ed8be58 100644
--- a/corsika/detail/modules/energy_loss/BetheBlochPDG.inl
+++ b/corsika/detail/modules/energy_loss/BetheBlochPDG.inl
@@ -161,7 +161,7 @@ namespace corsika::energy_loss {
     if (p.GetChargeNumber() == 0) return corsika::EProcessReturn::eOk;
 
     GrammageType const dX =
-        p.GetNode()->GetModelProperties().IntegratedGrammage(t, t.GetLength());
+        p.GetNode()->GetModelProperties().integratedGrammage(t, t.GetLength());
     std::cout << "BetheBlochPDG " << p.GetPID() << ", z=" << p.GetChargeNumber()
               << ", dX=" << dX / 1_g * square(1_cm) << "g/cm2" << std::endl;
     HEPEnergyType dE = TotalEnergyLoss(p, dX);
@@ -196,7 +196,7 @@ namespace corsika::energy_loss {
     auto const maxLoss = 0.01 * vParticle.GetEnergy();
     auto const maxGrammage = maxLoss / dE * dX;
 
-    return vParticle.GetNode()->GetModelProperties().ArclengthFromGrammage(vTrack,
+    return vParticle.GetNode()->GetModelProperties().arclengthFromGrammage(vTrack,
                                                                            maxGrammage) *
            1.0001; // to make sure particle gets absorbed when DoContinuous() is called
   }
@@ -223,10 +223,10 @@ namespace corsika::energy_loss {
     SetupTrack const trajToEndBin(lineToEndBin, 1_s);
 
     GrammageType const grammageStart =
-        vP.GetNode()->GetModelProperties().IntegratedGrammage(trajToStartBin,
+        vP.GetNode()->GetModelProperties().integratedGrammage(trajToStartBin,
                                                               trajToStartBin.GetLength());
     GrammageType const grammageEnd =
-        vP.GetNode()->GetModelProperties().IntegratedGrammage(trajToEndBin,
+        vP.GetNode()->GetModelProperties().integratedGrammage(trajToEndBin,
                                                               trajToEndBin.GetLength());
 
     const int binStart = grammageStart / dX_;
diff --git a/corsika/detail/modules/pythia8/Interaction.inl b/corsika/detail/modules/pythia8/Interaction.inl
index dd92d06a6..c0f3ab72f 100644
--- a/corsika/detail/modules/pythia8/Interaction.inl
+++ b/corsika/detail/modules/pythia8/Interaction.inl
@@ -197,7 +197,7 @@ namespace corsika::pythia8 {
       */
       const auto* currentNode = p.GetNode();
       const auto mediumComposition =
-          currentNode->GetModelProperties().GetNuclearComposition();
+          currentNode->GetModelProperties().getNuclearComposition();
       // determine average interaction length
 
       auto const weightedProdCrossSection =
@@ -302,7 +302,7 @@ namespace corsika::pythia8 {
       // sample target mass number
       const auto* currentNode = vP.GetNode();
       const auto& mediumComposition =
-          currentNode->GetModelProperties().GetNuclearComposition();
+          currentNode->GetModelProperties().getNuclearComposition();
       // get cross sections for target materials
       /*
         Here we read the cross section from the interaction model again,
diff --git a/corsika/detail/modules/qgsjetII/Interaction.inl b/corsika/detail/modules/qgsjetII/Interaction.inl
index 8ae1e0f8b..029d43a38 100644
--- a/corsika/detail/modules/qgsjetII/Interaction.inl
+++ b/corsika/detail/modules/qgsjetII/Interaction.inl
@@ -129,7 +129,7 @@ namespace corsika::qgsjetII {
 
       auto const* currentNode = vP.GetNode();
       const auto& mediumComposition =
-          currentNode->GetModelProperties().GetNuclearComposition();
+          currentNode->GetModelProperties().getNuclearComposition();
 
       CrossSectionType weightedProdCrossSection =
           mediumComposition.WeightedSum([=](corsika::Code targetID) -> CrossSectionType {
@@ -205,7 +205,7 @@ namespace corsika::qgsjetII {
       // sample target mass number
       auto const* currentNode = vP.GetNode();
       auto const& mediumComposition =
-          currentNode->GetModelProperties().GetNuclearComposition();
+          currentNode->GetModelProperties().getNuclearComposition();
       // get cross sections for target materials
       /*
         Here we read the cross section from the interaction model again,
diff --git a/corsika/detail/modules/sibyll/Interaction.inl b/corsika/detail/modules/sibyll/Interaction.inl
index d6ce573d3..ec2e39f0e 100644
--- a/corsika/detail/modules/sibyll/Interaction.inl
+++ b/corsika/detail/modules/sibyll/Interaction.inl
@@ -146,7 +146,7 @@ namespace corsika::sibyll {
 
       auto const* currentNode = vP.GetNode();
       const auto& mediumComposition =
-          currentNode->GetModelProperties().GetNuclearComposition();
+          currentNode->GetModelProperties().getNuclearComposition();
 
       si::CrossSectionType weightedProdCrossSection = mediumComposition.WeightedSum(
           [=](corsika::Code targetID) -> si::CrossSectionType {
@@ -249,7 +249,7 @@ namespace corsika::sibyll {
       // sample target mass number
       auto const* currentNode = vP.GetNode();
       auto const& mediumComposition =
-          currentNode->GetModelProperties().GetNuclearComposition();
+          currentNode->GetModelProperties().getNuclearComposition();
       // get cross sections for target materials
       /*
         Here we read the cross section from the interaction model again,
diff --git a/corsika/detail/modules/sibyll/NuclearInteraction.inl b/corsika/detail/modules/sibyll/NuclearInteraction.inl
index 7c9e74b5a..69125e4f7 100644
--- a/corsika/detail/modules/sibyll/NuclearInteraction.inl
+++ b/corsika/detail/modules/sibyll/NuclearInteraction.inl
@@ -69,7 +69,7 @@ namespace corsika::sibyll {
       auto collectElements = [&](auto& vtn) {
         if (vtn.HasModelProperties()) {
           auto const& comp =
-              vtn.GetModelProperties().GetNuclearComposition().GetComponents();
+              vtn.GetModelProperties().getNuclearComposition().GetComponents();
           for (auto const c : comp) allElementsInUniverse.insert(c);
         }
       };
@@ -267,7 +267,7 @@ namespace corsika::sibyll {
       */
       auto const* const currentNode = vP.GetNode();
       auto const& mediumComposition =
-          currentNode->GetModelProperties().GetNuclearComposition();
+          currentNode->GetModelProperties().getNuclearComposition();
       // determine average interaction length
       // weighted sum
       int i = -1;
@@ -415,7 +415,7 @@ namespace corsika::sibyll {
     const auto beamId = corsika::Code::Proton;
     auto const* const currentNode = vP.GetNode();
     const auto& mediumComposition =
-        currentNode->GetModelProperties().GetNuclearComposition();
+        currentNode->GetModelProperties().getNuclearComposition();
     std::cout << "get nucleon-nucleus cross sections for target materials.." << std::endl;
     // get cross sections for target materials
     // using nucleon-target-nucleus cross section!!!
diff --git a/corsika/detail/modules/urqmd/UrQMD.inl b/corsika/detail/modules/urqmd/UrQMD.inl
index d5ced9b50..30b495096 100644
--- a/corsika/detail/modules/urqmd/UrQMD.inl
+++ b/corsika/detail/modules/urqmd/UrQMD.inl
@@ -113,7 +113,7 @@ namespace corsika::urqmd {
     }
 
     auto const& mediumComposition =
-        vParticle.GetNode()->GetModelProperties().GetNuclearComposition();
+        vParticle.GetNode()->GetModelProperties().getNuclearComposition();
     using namespace std::placeholders;
 
     CrossSectionType const weightedProdCrossSection = mediumComposition.WeightedSum(
@@ -133,7 +133,7 @@ namespace corsika::urqmd {
 
     // sample target particle
     auto const& mediumComposition =
-        vProjectile.GetNode()->GetModelProperties().GetNuclearComposition();
+        vProjectile.GetNode()->GetModelProperties().getNuclearComposition();
     auto const componentCrossSections = std::invoke([&]() {
       auto const& components = mediumComposition.GetComponents();
       std::vector<CrossSectionType> crossSections;
-- 
GitLab