CORSIKA  @c8_version@
The framework to simulate particle cascades for astroparticle physics
ShowerAxis.hpp
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/media/Environment.hpp>
12 #include <corsika/framework/geometry/Point.hpp>
13 #include <corsika/framework/geometry/Vector.hpp>
15 
16 #include <cassert>
17 #include <cstdlib>
18 #include <fstream>
19 #include <functional>
20 #include <iterator>
21 #include <memory>
22 #include <stdexcept>
23 #include <vector>
24 
25 #include <iostream>
26 
27 #include <boost/math/quadrature/gauss_kronrod.hpp>
28 
29 namespace corsika {
30 
43  class ShowerAxis {
45  public:
46  template <typename TEnvModel>
47  ShowerAxis(Point const& pStart, Vector<length_d> const& length,
48  Environment<TEnvModel> const& env, bool const doThrow = false,
49  int const steps = 10'000);
50 
51  LengthType getSteplength() const;
52 
53  GrammageType getMaximumX() const;
54 
55  GrammageType getMinimumX() const;
56 
57  GrammageType getProjectedX(Point const& p) const;
58 
59  GrammageType getX(LengthType) const;
60 
61  DirectionVector const& getDirection() const;
62 
63  Point const& getStart() const;
64 
65  private:
66  Point const pointStart_;
67  Vector<length_d> const length_;
68  bool throw_ = false;
69  LengthType const max_length_, steplength_;
70  DirectionVector const axis_normalized_;
71  std::vector<GrammageType> X_;
72 
73  // for storing the lengths corresponding to equidistant X values
74  GrammageType const X_binning_ = 1_g / 1_cm / 1_cm;
75  std::vector<LengthType> d_;
76  };
77 } // namespace corsika
78 
79 #include <corsika/detail/media/ShowerAxis.inl>
Import and extend the phys::units package.
returns a pointer to the sub-VolumeTreeNode which is "responsible" for the given , or nullptr iff p is not contained in this volume.
`, since they are used everywhere as integral part of the framework.