diff --git a/Framework/Cascade/Cascade.h b/Framework/Cascade/Cascade.h index e2cc4ef6d76fc2992c13558e4f9c6ba45459e6d3..2d55e9030859e1dd624269ed1d55f4e3277aa00e 100644 --- a/Framework/Cascade/Cascade.h +++ b/Framework/Cascade/Cascade.h @@ -138,16 +138,24 @@ namespace corsika::cascade { std::cout << "total_inv_lambda=" << total_inv_lambda << ", next_interact=" << next_interact << std::endl; - // convert next_step from grammage to length - auto const* currentNode = - fEnvironment.GetUniverse()->GetContainingNode(particle.GetPosition()); + auto const* currentLogicalNode = particle.GetNode(); + + auto const* currentNumericalNode = + fEnvironment.GetUniverse()->GetContainingNode(particle.GetPosition()); + + std::cout << "nodes: " << currentLogicalNode << " " << currentNumericalNode << std::endl; + + if (currentNumericalNode != currentLogicalNode) { + throw std::runtime_error("numerical and logical nodes don't match"); + } - if (currentNode == &*fEnvironment.GetUniverse()) { - throw std::runtime_error("particle entered void universe"); + if (currentNumericalNode == &*fEnvironment.GetUniverse()) { + throw std::runtime_error("particle entered void Universe"); } + // convert next_step from grammage to length LengthType const distance_interact = - currentNode->GetModelProperties().ArclengthFromGrammage(step, next_interact); + currentLogicalNode->GetModelProperties().ArclengthFromGrammage(step, next_interact); // determine the maximum geometric step length LengthType const distance_max = fProcessSequence.MaxStepLength(particle, step); @@ -182,8 +190,8 @@ namespace corsika::cascade { step.LimitEndTo(min_distance); // particle.GetNode(); // previous VolumeNode - particle.SetNode( - currentNode); // NOTE @Max : here we need to distinguish: IF particle step is + //~ particle.SetNode( + //~ currentLogicalNode); // NOTE @Max : here we need to distinguish: IF particle step is // limited by tracking (via fTracking.GetTrack()), THEN we need // to check/update VolumeNodes. In all other cases it is // guaranteed that we are still in the same volume