CORSIKA  @c8_version@
The framework to simulate particle cascades for astroparticle physics
EMThinning.hpp
1 /*
2  * (c) Copyright 2022 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 <random>
12 
14 #include <corsika/framework/random/RNGManager.hpp>
15 #include <corsika/framework/process/SecondariesProcess.hpp>
16 
17 namespace corsika {
18 
23  class EMThinning : public SecondariesProcess<EMThinning> {
24  public:
31  EMThinning(HEPEnergyType threshold, double maxWeight,
32  bool const eraseParticles = true);
33 
46  template <typename TStackView>
47  void doSecondaries(TStackView&);
48 
49  private:
50  default_prng_type& rng_ = RNGManager<>::getInstance().getRandomStream("thinning");
51  std::uniform_real_distribution<double> uniform_{};
52  HEPEnergyType const threshold_;
53  double const maxWeight_;
54  bool const eraseParticles_;
55  };
56 } // namespace corsika
57 
58 #include <corsika/detail/modules/thinning/EMThinning.inl>
Import and extend the phys::units package.
EMThinning(HEPEnergyType threshold, double maxWeight, bool const eraseParticles=true)
Construct a new EMThinning process.
`, since they are used everywhere as integral part of the framework.
Processes acting on the secondaries produced by other processes.
void doSecondaries(TStackView &)
Apply thinning to secondaries.
This process implements thinning for EM splitting processes (1 -> 2).
Definition: EMThinning.hpp:23
prng_type & getRandomStream(string_type const &streamName)