IAP GITLAB

Skip to content
Snippets Groups Projects
Commit 3a907033 authored by Maximilian Reininghaus's avatar Maximilian Reininghaus :vulcan: Committed by ralfulrich
Browse files

set nodes at beginning of cascade

parent 8284f24a
No related branches found
No related tags found
No related merge requests found
...@@ -36,9 +36,6 @@ ...@@ -36,9 +36,6 @@
#include <corsika/utl/CorsikaFenv.h> #include <corsika/utl/CorsikaFenv.h>
#include <boost/type_index.hpp>
using boost::typeindex::type_id_with_cvr;
#include <iostream> #include <iostream>
#include <limits> #include <limits>
#include <typeinfo> #include <typeinfo>
...@@ -267,9 +264,6 @@ int main() { ...@@ -267,9 +264,6 @@ int main() {
// auto sequence = p0 << sibyll << decay << hadronicElastic << cut << trackWriter; // auto sequence = p0 << sibyll << decay << hadronicElastic << cut << trackWriter;
auto sequence = p0 << sibyll << sibyllNuc << decay << cut << trackWriter; auto sequence = p0 << sibyll << sibyllNuc << decay << cut << trackWriter;
// cout << "decltype(sequence)=" << type_id_with_cvr<decltype(sequence)>().pretty_name()
// << "\n";
// setup particle stack, and add primary particle // setup particle stack, and add primary particle
setup::Stack stack; setup::Stack stack;
stack.Clear(); stack.Clear();
......
...@@ -77,12 +77,28 @@ namespace corsika::cascade { ...@@ -77,12 +77,28 @@ namespace corsika::cascade {
fProcessSequence.Init(); fProcessSequence.Init();
fStack.Init(); fStack.Init();
} }
/**
* set the nodes for all particles on the stack according to their numerical
* position
*/
void SetNodes() {
std::for_each(fStack.begin(), fStack.end(), [&](auto& p) {
auto const* numericalNode =
fEnvironment.GetUniverse()->GetContainingNode(p.GetPosition());
p.SetNode(numericalNode);
std::cout << "initial node " << p.GetNode() << std::endl;
});
}
/** /**
* The Run function is the main simulation loop, which processes * The Run function is the main simulation loop, which processes
* particles from the Stack until the Stack is empty. * particles from the Stack until the Stack is empty.
*/ */
void Run() { void Run() {
SetNodes();
while (!fStack.IsEmpty()) { while (!fStack.IsEmpty()) {
while (!fStack.IsEmpty()) { while (!fStack.IsEmpty()) {
auto pNext = fStack.GetNextParticle(); auto pNext = fStack.GetNextParticle();
......
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