IAP GITLAB

Skip to content
Snippets Groups Projects
Commit b4025210 authored by Maximilian Sackel's avatar Maximilian Sackel Committed by Ralf Ulrich
Browse files

enable continuous losses for gammas

parent 0de8f965
No related branches found
No related tags found
1 merge request!245Include proposal process rebase
...@@ -32,9 +32,8 @@ namespace corsika::process::proposal { ...@@ -32,9 +32,8 @@ namespace corsika::process::proposal {
, fRNG(corsika::random::RNGManager::GetInstance().GetRandomStream("proposal")) { , fRNG(corsika::random::RNGManager::GetInstance().GetRandomStream("proposal")) {
auto all_compositions = std::vector<const NuclearComposition*>(); auto all_compositions = std::vector<const NuclearComposition*>();
_env.GetUniverse()->walk([&](auto& vtn) { _env.GetUniverse()->walk([&](auto& vtn) {
if (vtn.HasModelProperties()) { if (vtn.HasModelProperties())
all_compositions.push_back(&vtn.GetModelProperties().GetNuclearComposition()); all_compositions.push_back(&vtn.GetModelProperties().GetNuclearComposition());
}
}); });
for (auto& ncarg : all_compositions) { for (auto& ncarg : all_compositions) {
auto comp_vec = std::vector<PROPOSAL::Components::Component>(); auto comp_vec = std::vector<PROPOSAL::Components::Component>();
...@@ -63,7 +62,7 @@ namespace corsika::process::proposal { ...@@ -63,7 +62,7 @@ namespace corsika::process::proposal {
template <> template <>
void ContinuousProcess::Scatter(SetupParticle& vP, HEPEnergyType const& loss, void ContinuousProcess::Scatter(SetupParticle& vP, HEPEnergyType const& loss,
GrammageType const& grammage) { GrammageType const& grammage) {
auto calc = GetCalculator(vP); auto calc = GetCalculator(vP);
auto d = vP.GetDirection().GetComponents(); auto d = vP.GetDirection().GetComponents();
auto direction = PROPOSAL::Vector3D(d.GetX().magnitude(), d.GetY().magnitude(), auto direction = PROPOSAL::Vector3D(d.GetX().magnitude(), d.GetY().magnitude(),
...@@ -86,10 +85,10 @@ namespace corsika::process::proposal { ...@@ -86,10 +85,10 @@ namespace corsika::process::proposal {
template <> template <>
EProcessReturn ContinuousProcess::DoContinuous(SetupParticle& vP, EProcessReturn ContinuousProcess::DoContinuous(SetupParticle& vP,
SetupTrack const& vT) { SetupTrack const& vT) {
if (vP.GetChargeNumber() == 0) return process::EProcessReturn::eOk; if (!CanInteract(vP.GetPID())) return process::EProcessReturn::eOk;
auto dX = vP.GetNode()->GetModelProperties().IntegratedGrammage(vT, vT.GetLength()); auto dX = vP.GetNode()->GetModelProperties().IntegratedGrammage(vT, vT.GetLength());
auto energy_loss = TotalEnergyLoss(vP, dX); auto energy_loss = TotalEnergyLoss(vP, dX);
Scatter(vP, energy_loss, dX); if (vP.GetChargeNumber() != 0) Scatter(vP, energy_loss, dX);
vP.SetEnergy(vP.GetEnergy() - energy_loss); vP.SetEnergy(vP.GetEnergy() - energy_loss);
if (vP.GetEnergy() < cut.GetECut()) return process::EProcessReturn::eParticleAbsorbed; if (vP.GetEnergy() < cut.GetECut()) return process::EProcessReturn::eParticleAbsorbed;
vP.SetMomentum(vP.GetMomentum() * vP.GetEnergy() / vP.GetMomentum().GetNorm()); vP.SetMomentum(vP.GetMomentum() * vP.GetEnergy() / vP.GetMomentum().GetNorm());
......
...@@ -32,9 +32,8 @@ namespace corsika::process::proposal { ...@@ -32,9 +32,8 @@ namespace corsika::process::proposal {
, fRNG(corsika::random::RNGManager::GetInstance().GetRandomStream("proposal")) { , fRNG(corsika::random::RNGManager::GetInstance().GetRandomStream("proposal")) {
auto all_compositions = std::vector<const NuclearComposition*>(); auto all_compositions = std::vector<const NuclearComposition*>();
_env.GetUniverse()->walk([&](auto& vtn) { _env.GetUniverse()->walk([&](auto& vtn) {
if (vtn.HasModelProperties()) { if (vtn.HasModelProperties())
all_compositions.push_back(&vtn.GetModelProperties().GetNuclearComposition()); all_compositions.push_back(&vtn.GetModelProperties().GetNuclearComposition());
}
}); });
for (auto& ncarg : all_compositions) { for (auto& ncarg : all_compositions) {
auto comp_vec = std::vector<Component_PROPOSAL>(); auto comp_vec = std::vector<Component_PROPOSAL>();
......
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