CORSIKA  @c8_version@
The framework to simulate particle cascades for astroparticle physics
InteractionHistogram.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 <boost/histogram.hpp>
12 
13 namespace corsika {
14 
15  namespace detail {
16  inline auto hist_factory(unsigned int const bin_number, double const e_low,
17  double const e_high) {
18  namespace bh = boost::histogram;
19  namespace bha = bh::axis;
20 
21  auto h = bh::make_histogram(
22  bha::category<int, bh::use_default, bha::option::growth_t>{{2212, 2112},
23  "projectile PDG"},
24  bha::regular<float, bha::transform::log>{bin_number, (float)e_low,
25  (float)e_high, "energy/eV"});
26  return h;
27  }
28  } // namespace detail
29 } // namespace corsika
`, since they are used everywhere as integral part of the framework.