IAP GITLAB

Skip to content
Snippets Groups Projects
StackInspector.h 1.6 KiB
Newer Older
ralfulrich's avatar
ralfulrich committed
 * (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.
 */
#ifndef _Physics_StackInspector_StackInspector_h_
#define _Physics_StackInspector_StackInspector_h_

#include <corsika/process/StackProcess.h>
#include <corsika/setup/SetupTrajectory.h>
Maximilian Reininghaus's avatar
Maximilian Reininghaus committed
#include <corsika/units/PhysicalUnits.h>
#include <chrono>

namespace corsika::process {

  namespace stack_inspector {

ralfulrich's avatar
ralfulrich committed
    template <typename TStack>
    class StackInspector : public corsika::process::StackProcess<StackInspector<TStack>> {
ralfulrich's avatar
ralfulrich committed
      typedef typename TStack::ParticleType Particle;
      using corsika::process::StackProcess<StackInspector<TStack>>::GetStep;

    public:
      StackInspector(const int vNStep, const bool vReportStack,
                     const corsika::units::si::HEPEnergyType vE0);
      ~StackInspector();

      EProcessReturn DoStack(const TStack&);

      /**
       * To set a new E0, for example when a new shower event is started
       */
      void SetE0(const corsika::units::si::HEPEnergyType vE0) { E0_ = vE0; }
      bool ReportStack_;
      corsika::units::si::HEPEnergyType E0_;
      const corsika::units::si::HEPEnergyType dE_threshold_ = std::invoke([]() {
        using namespace units::si;
        return 1_eV;
      });
      decltype(std::chrono::system_clock::now()) StartTime_;
ralfulrich's avatar
ralfulrich committed
  } // namespace stack_inspector

} // namespace corsika::process

#endif