CORSIKA  @c8_version@
The framework to simulate particle cascades for astroparticle physics
CONEXhybrid.hpp
Go to the documentation of this file.
1 /*
2  * (c) Copyright 2020 CORSIKA Project, corsika-project@lists.kit.edu
3  *
4  * This software is distributed under the terms of the GNU General Public
5  * Licence version 3 (GPL Version 3). See file LICENSE for a full version of
6  * the license.
7  */
8 
9 #pragma once
10 
11 #include <corsika/framework/process/SecondariesProcess.hpp>
12 #include <corsika/framework/process/CascadeEquationsProcess.hpp>
13 
16 #include <corsika/framework/geometry/Point.hpp>
17 #include <corsika/framework/geometry/Vector.hpp>
18 #include <corsika/media/ShowerAxis.hpp>
19 
20 #include <corsika/modules/writers/SubWriter.hpp>
23 
24 #include <corsika/modules/conex/CONEX_f.hpp>
25 
30 namespace corsika {
31 
32  namespace conex {
33  LengthType constexpr earthRadius{6371315 * meter};
34  } // namespace conex
35 
52  template <typename TOutputE, typename TOutputN>
53  class CONEXhybrid : public CascadeEquationsProcess<CONEXhybrid<TOutputE, TOutputN>>,
54  public SecondariesProcess<CONEXhybrid<TOutputE, TOutputN>>,
55  public SubWriter<TOutputE>,
56  public SubWriter<TOutputN> {
57 
58  public:
73  CONEXhybrid(Point const& center, ShowerAxis const& showerAxis, LengthType groundDist,
74  LengthType injectionHeight, HEPEnergyType primaryEnergy, PDGCode pdg,
75  TOutputE& outputE, TOutputN& outputN);
76 
77  template <typename TStackView>
78  void doSecondaries(TStackView&);
79 
84  void initCascadeEquations();
85 
89  template <typename TStack>
90  void doCascadeEquations(TStack& stack);
91 
96  bool addParticle(Code pid, HEPEnergyType energy, HEPEnergyType mass,
97  Point const& position, Vector<dimensionless_d> const& direction,
98  TimeType t, double weight = 1);
99 
100  CoordinateSystemPtr const& getObserverCS() const { return conexObservationCS_; }
101 
102  YAML::Node getConfig() const final override;
103 
104  private:
105  // data members
107  static std::array<std::pair<Code, int>, 3> constexpr egs_em_codes_{
108  {{Code::Photon, 0}, {Code::Electron, -1}, {Code::Positron, -1}}};
109 
110  Point const center_;
111  ShowerAxis const& showerAxis_;
112  LengthType groundDist_;
113  LengthType injectionHeight_;
114  HEPEnergyType primaryEnergy_;
115  PDGCode primaryPDG_;
116  Point const showerCore_;
117  CoordinateSystemPtr const conexObservationCS_;
118  DirectionVector const x_sf_,
119  y_sf_;
120  };
121 } // namespace corsika
122 
123 #include <corsika/detail/modules/conex/CONEXhybrid.inl>
The environment::ShowerAxis is created from a Point and a Vector and inside an Environment.
Definition: ShowerAxis.hpp:44
Processes executing cascade-equations calculations.
Import and extend the phys::units package.
Access to the CONEX model.
Definition: CONEXhybrid.hpp:53
`, since they are used everywhere as integral part of the framework.
Processes acting on the secondaries produced by other processes.
std::shared_ptr< CoordinateSystem const > CoordinateSystemPtr
To refer to CoordinateSystems, only the CoordinateSystemPtr must be used.
Interface to particle properties.