IAP GITLAB

Skip to content
Snippets Groups Projects
Commit b4b0978b authored by Remy Prechelt's avatar Remy Prechelt Committed by ralfulrich
Browse files

Changes in nuclear composition API.

parent 1dbb9245
No related branches found
No related tags found
No related merge requests found
...@@ -161,7 +161,7 @@ namespace corsika::energy_loss { ...@@ -161,7 +161,7 @@ namespace corsika::energy_loss {
if (p.GetChargeNumber() == 0) return corsika::EProcessReturn::eOk; if (p.GetChargeNumber() == 0) return corsika::EProcessReturn::eOk;
GrammageType const dX = 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() std::cout << "BetheBlochPDG " << p.GetPID() << ", z=" << p.GetChargeNumber()
<< ", dX=" << dX / 1_g * square(1_cm) << "g/cm2" << std::endl; << ", dX=" << dX / 1_g * square(1_cm) << "g/cm2" << std::endl;
HEPEnergyType dE = TotalEnergyLoss(p, dX); HEPEnergyType dE = TotalEnergyLoss(p, dX);
...@@ -196,7 +196,7 @@ namespace corsika::energy_loss { ...@@ -196,7 +196,7 @@ namespace corsika::energy_loss {
auto const maxLoss = 0.01 * vParticle.GetEnergy(); auto const maxLoss = 0.01 * vParticle.GetEnergy();
auto const maxGrammage = maxLoss / dE * dX; auto const maxGrammage = maxLoss / dE * dX;
return vParticle.GetNode()->GetModelProperties().ArclengthFromGrammage(vTrack, return vParticle.GetNode()->GetModelProperties().arclengthFromGrammage(vTrack,
maxGrammage) * maxGrammage) *
1.0001; // to make sure particle gets absorbed when DoContinuous() is called 1.0001; // to make sure particle gets absorbed when DoContinuous() is called
} }
...@@ -223,10 +223,10 @@ namespace corsika::energy_loss { ...@@ -223,10 +223,10 @@ namespace corsika::energy_loss {
SetupTrack const trajToEndBin(lineToEndBin, 1_s); SetupTrack const trajToEndBin(lineToEndBin, 1_s);
GrammageType const grammageStart = GrammageType const grammageStart =
vP.GetNode()->GetModelProperties().IntegratedGrammage(trajToStartBin, vP.GetNode()->GetModelProperties().integratedGrammage(trajToStartBin,
trajToStartBin.GetLength()); trajToStartBin.GetLength());
GrammageType const grammageEnd = GrammageType const grammageEnd =
vP.GetNode()->GetModelProperties().IntegratedGrammage(trajToEndBin, vP.GetNode()->GetModelProperties().integratedGrammage(trajToEndBin,
trajToEndBin.GetLength()); trajToEndBin.GetLength());
const int binStart = grammageStart / dX_; const int binStart = grammageStart / dX_;
......
...@@ -197,7 +197,7 @@ namespace corsika::pythia8 { ...@@ -197,7 +197,7 @@ namespace corsika::pythia8 {
*/ */
const auto* currentNode = p.GetNode(); const auto* currentNode = p.GetNode();
const auto mediumComposition = const auto mediumComposition =
currentNode->GetModelProperties().GetNuclearComposition(); currentNode->GetModelProperties().getNuclearComposition();
// determine average interaction length // determine average interaction length
auto const weightedProdCrossSection = auto const weightedProdCrossSection =
...@@ -302,7 +302,7 @@ namespace corsika::pythia8 { ...@@ -302,7 +302,7 @@ namespace corsika::pythia8 {
// sample target mass number // sample target mass number
const auto* currentNode = vP.GetNode(); const auto* currentNode = vP.GetNode();
const auto& mediumComposition = const auto& mediumComposition =
currentNode->GetModelProperties().GetNuclearComposition(); currentNode->GetModelProperties().getNuclearComposition();
// get cross sections for target materials // get cross sections for target materials
/* /*
Here we read the cross section from the interaction model again, Here we read the cross section from the interaction model again,
......
...@@ -129,7 +129,7 @@ namespace corsika::qgsjetII { ...@@ -129,7 +129,7 @@ namespace corsika::qgsjetII {
auto const* currentNode = vP.GetNode(); auto const* currentNode = vP.GetNode();
const auto& mediumComposition = const auto& mediumComposition =
currentNode->GetModelProperties().GetNuclearComposition(); currentNode->GetModelProperties().getNuclearComposition();
CrossSectionType weightedProdCrossSection = CrossSectionType weightedProdCrossSection =
mediumComposition.WeightedSum([=](corsika::Code targetID) -> CrossSectionType { mediumComposition.WeightedSum([=](corsika::Code targetID) -> CrossSectionType {
...@@ -205,7 +205,7 @@ namespace corsika::qgsjetII { ...@@ -205,7 +205,7 @@ namespace corsika::qgsjetII {
// sample target mass number // sample target mass number
auto const* currentNode = vP.GetNode(); auto const* currentNode = vP.GetNode();
auto const& mediumComposition = auto const& mediumComposition =
currentNode->GetModelProperties().GetNuclearComposition(); currentNode->GetModelProperties().getNuclearComposition();
// get cross sections for target materials // get cross sections for target materials
/* /*
Here we read the cross section from the interaction model again, Here we read the cross section from the interaction model again,
......
...@@ -146,7 +146,7 @@ namespace corsika::sibyll { ...@@ -146,7 +146,7 @@ namespace corsika::sibyll {
auto const* currentNode = vP.GetNode(); auto const* currentNode = vP.GetNode();
const auto& mediumComposition = const auto& mediumComposition =
currentNode->GetModelProperties().GetNuclearComposition(); currentNode->GetModelProperties().getNuclearComposition();
si::CrossSectionType weightedProdCrossSection = mediumComposition.WeightedSum( si::CrossSectionType weightedProdCrossSection = mediumComposition.WeightedSum(
[=](corsika::Code targetID) -> si::CrossSectionType { [=](corsika::Code targetID) -> si::CrossSectionType {
...@@ -249,7 +249,7 @@ namespace corsika::sibyll { ...@@ -249,7 +249,7 @@ namespace corsika::sibyll {
// sample target mass number // sample target mass number
auto const* currentNode = vP.GetNode(); auto const* currentNode = vP.GetNode();
auto const& mediumComposition = auto const& mediumComposition =
currentNode->GetModelProperties().GetNuclearComposition(); currentNode->GetModelProperties().getNuclearComposition();
// get cross sections for target materials // get cross sections for target materials
/* /*
Here we read the cross section from the interaction model again, Here we read the cross section from the interaction model again,
......
...@@ -69,7 +69,7 @@ namespace corsika::sibyll { ...@@ -69,7 +69,7 @@ namespace corsika::sibyll {
auto collectElements = [&](auto& vtn) { auto collectElements = [&](auto& vtn) {
if (vtn.HasModelProperties()) { if (vtn.HasModelProperties()) {
auto const& comp = auto const& comp =
vtn.GetModelProperties().GetNuclearComposition().GetComponents(); vtn.GetModelProperties().getNuclearComposition().GetComponents();
for (auto const c : comp) allElementsInUniverse.insert(c); for (auto const c : comp) allElementsInUniverse.insert(c);
} }
}; };
...@@ -267,7 +267,7 @@ namespace corsika::sibyll { ...@@ -267,7 +267,7 @@ namespace corsika::sibyll {
*/ */
auto const* const currentNode = vP.GetNode(); auto const* const currentNode = vP.GetNode();
auto const& mediumComposition = auto const& mediumComposition =
currentNode->GetModelProperties().GetNuclearComposition(); currentNode->GetModelProperties().getNuclearComposition();
// determine average interaction length // determine average interaction length
// weighted sum // weighted sum
int i = -1; int i = -1;
...@@ -415,7 +415,7 @@ namespace corsika::sibyll { ...@@ -415,7 +415,7 @@ namespace corsika::sibyll {
const auto beamId = corsika::Code::Proton; const auto beamId = corsika::Code::Proton;
auto const* const currentNode = vP.GetNode(); auto const* const currentNode = vP.GetNode();
const auto& mediumComposition = const auto& mediumComposition =
currentNode->GetModelProperties().GetNuclearComposition(); currentNode->GetModelProperties().getNuclearComposition();
std::cout << "get nucleon-nucleus cross sections for target materials.." << std::endl; std::cout << "get nucleon-nucleus cross sections for target materials.." << std::endl;
// get cross sections for target materials // get cross sections for target materials
// using nucleon-target-nucleus cross section!!! // using nucleon-target-nucleus cross section!!!
......
...@@ -113,7 +113,7 @@ namespace corsika::urqmd { ...@@ -113,7 +113,7 @@ namespace corsika::urqmd {
} }
auto const& mediumComposition = auto const& mediumComposition =
vParticle.GetNode()->GetModelProperties().GetNuclearComposition(); vParticle.GetNode()->GetModelProperties().getNuclearComposition();
using namespace std::placeholders; using namespace std::placeholders;
CrossSectionType const weightedProdCrossSection = mediumComposition.WeightedSum( CrossSectionType const weightedProdCrossSection = mediumComposition.WeightedSum(
...@@ -133,7 +133,7 @@ namespace corsika::urqmd { ...@@ -133,7 +133,7 @@ namespace corsika::urqmd {
// sample target particle // sample target particle
auto const& mediumComposition = auto const& mediumComposition =
vProjectile.GetNode()->GetModelProperties().GetNuclearComposition(); vProjectile.GetNode()->GetModelProperties().getNuclearComposition();
auto const componentCrossSections = std::invoke([&]() { auto const componentCrossSections = std::invoke([&]() {
auto const& components = mediumComposition.GetComponents(); auto const& components = mediumComposition.GetComponents();
std::vector<CrossSectionType> crossSections; std::vector<CrossSectionType> crossSections;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment