diff --git a/Documentation/Examples/cascade_example.cc b/Documentation/Examples/cascade_example.cc index f9d1e95a83aa38ed0475c06850698d2b867f6f99..b9e5990eed25f92452baa56b5591aeede384fe3d 100644 --- a/Documentation/Examples/cascade_example.cc +++ b/Documentation/Examples/cascade_example.cc @@ -36,9 +36,6 @@ #include <corsika/utl/CorsikaFenv.h> -#include <boost/type_index.hpp> -using boost::typeindex::type_id_with_cvr; - #include <iostream> #include <limits> #include <typeinfo> @@ -267,9 +264,6 @@ int main() { // auto sequence = p0 << sibyll << decay << hadronicElastic << 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::Stack stack; stack.Clear(); diff --git a/Framework/Cascade/Cascade.h b/Framework/Cascade/Cascade.h index 3880fba0d7413228c89c927a375e35463ffafdf2..e2cc4ef6d76fc2992c13558e4f9c6ba45459e6d3 100644 --- a/Framework/Cascade/Cascade.h +++ b/Framework/Cascade/Cascade.h @@ -77,12 +77,28 @@ namespace corsika::cascade { fProcessSequence.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 * particles from the Stack until the Stack is empty. */ void Run() { + SetNodes(); + while (!fStack.IsEmpty()) { while (!fStack.IsEmpty()) { auto pNext = fStack.GetNextParticle();