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 
14 
15 #include <boost/histogram.hpp>
16 
17 #include <fstream>
18 #include <functional>
19 #include <map>
20 #include <utility>
21 
22 #include <corsika/detail/framework/process/InteractionHistogram.hpp> // for detail namespace
23 
24 namespace corsika {
25 
38  static double constexpr lower_edge_cms = 1e3, upper_edge_cms = 1e17; // eV sqrt s
39  static double constexpr lower_edge_lab = 1e3, upper_edge_lab = 1e21; // eV lab
40  static unsigned int constexpr num_bins_lab = 18 * 10, num_bins_cms = 14 * 10;
41 
47  using hist_type =
48  decltype(detail::hist_factory(num_bins_lab, lower_edge_lab, upper_edge_lab));
49 
50  hist_type inthist_cms_, inthist_lab_;
51 
52  public:
54 
63  void fill(Code const projectile_id, HEPEnergyType const lab_energy,
64  HEPEnergyType const mass_target);
65 
67  hist_type const& CMSHist() const { return inthist_cms_; }
69  hist_type const& labHist() const { return inthist_lab_; }
70 
71  InteractionHistogram& operator+=(InteractionHistogram const& other);
72  InteractionHistogram operator+(InteractionHistogram other) const;
73  };
74 
77 } // namespace corsika
78 
79 #include <corsika/detail/framework/process/InteractionHistogram.inl> // for implementation
Import and extend the phys::units package.
This functions saves a boost::histogram into a numpy file.
hist_type const & CMSHist() const
return histogram in c.m.s. frame
`, since they are used everywhere as integral part of the framework.
hist_type const & labHist() const
return histogram in laboratory frame
void fill(Code const projectile_id, HEPEnergyType const lab_energy, HEPEnergyType const mass_target)
fill both CMS and lab histograms at the same time
Interface to particle properties.
Class that creates and stores histograms of collisions , which is used by class InteractionCounter.