IAP GITLAB

Skip to content
Snippets Groups Projects
Cascade.cc 1.28 KiB
Newer Older

/**
 * (c) Copyright 2018 CORSIKA Project, corsika-project@lists.kit.edu
 *
 * See file AUTHORS for a list of contributors.
 *
 * This software is distributed under the terms of the GNU General Public
 * Licence version 3 (GPL Version 3). See file LICENSE for a full version of
 * the license.
 */

#include <corsika/cascade/Cascade.h>
using namespace corsika::cascade;
template <typename ProcessList, typename Stack> //, typename Trajectory>
ralfulrich's avatar
ralfulrich committed
void Cascade::Init() {
ralfulrich's avatar
ralfulrich committed
  fStack.Init();
  fProcesseList.Init();
}
template <typename ProcessList, typename Stack> //, typename Trajectory>
ralfulrich's avatar
ralfulrich committed
void Cascade::Run() {
ralfulrich's avatar
ralfulrich committed
  if (!fStack.IsEmpty()) {
    if (!fStack.IsEmpty()) {
      Particle& p = fStack.GetNextParticle();
      Step(p);
    }
    // do cascade equations, which can put new particles on Stack,
    // thus, the double loop
    // DoCascadeEquations(); //
template <typename ProcessList, typename Stack> //, typename Trajectory>
ralfulrich's avatar
ralfulrich committed
void Cascade::Step(Particle& particle) {
ralfulrich's avatar
ralfulrich committed
  double nextStep = fProcesseList.MinStepLength(particle);
  corsika::geometry::LineTrajectory trajectory =
      fProcesseList.Transport(particle, nextStep);
  sequence.DoContinuous(particle, trajectory);
Felix Riehn's avatar
Felix Riehn committed
  // whats going on here? Everywhere else DoDiscrete is passed a Stack reference as well
  sequence.DoDiscrete(particle);
}