diff --git a/corsika/detail/framework/process/SwitchProcessSequence.inl b/corsika/detail/framework/process/SwitchProcessSequence.inl index 5a3bb704b38f025813f97dae39f1d26847b46d94..494a8395b506fb97cf4d00982dedf71db861050c 100644 --- a/corsika/detail/framework/process/SwitchProcessSequence.inl +++ b/corsika/detail/framework/process/SwitchProcessSequence.inl @@ -47,10 +47,11 @@ namespace corsika { static_assert( has_method_doBoundaryCrossing_v<TProcess1, ProcessReturn, TParticle&>, - // typename TParticle::node_type const&, - // typename TParticle::node_type const&>, + // typename TParticle::node_type const&, + // typename TParticle::node_type const&>, "TDerived has no method with correct signature \"ProcessReturn " - "doBoundaryCrossing(TParticle&, VolumeNode const&, VolumeNode const&)\" required for " + "doBoundaryCrossing(TParticle&, VolumeNode const&, VolumeNode const&)\" " + "required for " "BoundaryCrossingProcess<TDerived>. "); } @@ -69,10 +70,11 @@ namespace corsika { static_assert( has_method_doBoundaryCrossing_v<TProcess2, ProcessReturn, TParticle&>, - //typename TParticle::node_type const&, - // typename TParticle::node_type const&>, + // typename TParticle::node_type const&, + // typename TParticle::node_type const&>, "TDerived has no method with correct signature \"ProcessReturn " - "doBoundaryCrossing(TParticle&, VolumeNode const&, VolumeNode const&)\" required for " + "doBoundaryCrossing(TParticle&, VolumeNode const&, VolumeNode const&)\" " + "required for " "BoundaryCrossingProcess<TDerived>. "); } @@ -98,8 +100,10 @@ namespace corsika { static_assert( has_method_doContinuous_v<TProcess1, ProcessReturn, TParticle&, TTrack&> || - has_method_doContinuous_v<TProcess1, ProcessReturn, TParticle&, TTrack const&> || - has_method_doContinuous_v<TProcess1, ProcessReturn, TParticle const&, TTrack const&>, + has_method_doContinuous_v<TProcess1, ProcessReturn, TParticle&, + TTrack const&> || + has_method_doContinuous_v<TProcess1, ProcessReturn, TParticle const&, + TTrack const&>, "TDerived has no method with correct signature \"ProcessReturn " "doContinuous(TParticle[const]&,TTrack[const]&,bool)\" required for " "ContinuousProcess<TDerived>. "); @@ -116,8 +120,10 @@ namespace corsika { // interface checking on TProcess2 static_assert( has_method_doContinuous_v<TProcess2, ProcessReturn, TParticle&, TTrack&> || - has_method_doContinuous_v<TProcess2, ProcessReturn, TParticle&, TTrack const&> || - has_method_doContinuous_v<TProcess2, ProcessReturn, TParticle const&, TTrack const&>, + has_method_doContinuous_v<TProcess2, ProcessReturn, TParticle&, + TTrack const&> || + has_method_doContinuous_v<TProcess2, ProcessReturn, TParticle const&, + TTrack const&>, "TDerived has no method with correct signature \"ProcessReturn " "doContinuous(TParticle [const]&,TTrack[const]&,bool)\" required for " "ContinuousProcess<TDerived>. "); @@ -190,7 +196,8 @@ namespace corsika { // interface checking on TProcess1 static_assert( - has_method_getMaxStepLength_v<TProcess1, LengthType, TParticle const&, TTrack const&>, + has_method_getMaxStepLength_v<TProcess1, LengthType, TParticle const&, + TTrack const&>, "TDerived has no method with correct signature \"LengthType " "getMaxStepLength(TParticle const&, TTrack const&)\" required for " "ContinuousProcess<TDerived>. "); @@ -206,7 +213,8 @@ namespace corsika { // interface checking on TProcess2 static_assert( - has_method_getMaxStepLength_v<TProcess2, LengthType, TParticle const&, TTrack const&>, + has_method_getMaxStepLength_v<TProcess2, LengthType, TParticle const&, + TTrack const&>, "TDerived has no method with correct signature \"LengthType " "getMaxStepLength(TParticle const&, TTrack const&)\" required for " "ContinuousProcess<TDerived>. "); diff --git a/corsika/framework/process/InteractionCounter.hpp b/corsika/framework/process/InteractionCounter.hpp index e4e84b051c8ae57519ca9baa32a490a4976f17d1..e38722049eaa0b00c62a4c231000821a4960120f 100644 --- a/corsika/framework/process/InteractionCounter.hpp +++ b/corsika/framework/process/InteractionCounter.hpp @@ -18,8 +18,15 @@ namespace corsika { @{ * Wrapper around an InteractionProcess that fills histograms of the number - * of calls to DoInteraction() binned in projectile energy (both in + * of calls to `doInteraction()` binned in projectile energy (both in * lab and center-of-mass frame) and species + * + * Use by wrapping a normal InteractionProcess + * @code{.cpp} + * InteractionProcess collision1; + * InteractionClounter<collision1> counted_collision1; + * @endcode + * */ template <class TCountedProcess> class InteractionCounter @@ -28,16 +35,19 @@ namespace corsika { public: InteractionCounter(TCountedProcess& process); + //! wrapper around internall process doInteraction template <typename TSecondaryView> void doInteraction(TSecondaryView& view); + ///! returns internal process getInteractionLength template <typename TParticle> GrammageType getInteractionLength(TParticle const& particle) const; + /** returns the filles histograms + @return InteractionHistogram, which contains the histogram data + */ InteractionHistogram const& getHistogram() const; - void blob(int) {} - private: TCountedProcess& process_; InteractionHistogram histogram_; diff --git a/corsika/framework/process/InteractionHistogram.hpp b/corsika/framework/process/InteractionHistogram.hpp index 77e402d55f6777e2955d066e1060e2540a35a67d..78796f609e3a83316a52d818cf045425af7c507a 100644 --- a/corsika/framework/process/InteractionHistogram.hpp +++ b/corsika/framework/process/InteractionHistogram.hpp @@ -25,6 +25,13 @@ namespace corsika { /** @ingroup Processes @{ + + Class that creates and stores histograms of collisions + @f$dN/dE_{lab}@f$, @f$dN/d\sqrt{s}@f$ which is used by class + InteractionCounter + + Histograms are of type boost::histogram + */ class InteractionHistogram { @@ -32,6 +39,11 @@ namespace corsika { static double constexpr lower_edge_lab = 1e3, upper_edge_lab = 1e21; // eV lab static unsigned int constexpr num_bins_lab = 18 * 10, num_bins_cms = 14 * 10; + /** + hist_type is a boost::histogram with two axes + - a growing PDG id axis + - a fixed logarithmic energy axis as configured by the user + */ using hist_type = decltype(detail::hist_factory(num_bins_lab, lower_edge_lab, upper_edge_lab)); @@ -40,11 +52,20 @@ namespace corsika { public: InteractionHistogram(); - //! fill both CMS and lab histograms at the same time + /** + fill both CMS and lab histograms at the same time + @param projectile_id corsika::Code of particle + @param lab_energy Energy in lab. frame + @param mass_target Mass of target particle + @param A if projectile_id is corsika::Nucleus : Mass of nucleus + @param Z if projectile_id is corsika::Nucleus : Charge of nucleus + */ void fill(Code projectile_id, HEPEnergyType lab_energy, HEPEnergyType mass_target, int A = 0, int Z = 0); + //! return histogram in c.m.s. frame hist_type const& CMSHist() const { return inthist_cms_; } + /// return histogram in laboratory frame hist_type const& labHist() const { return inthist_lab_; } InteractionHistogram& operator+=(InteractionHistogram const& other); diff --git a/corsika/framework/process/ProcessSequence.hpp b/corsika/framework/process/ProcessSequence.hpp index df6f50a56a6cdb5d20240d770dccebbabe7d54ed..d4f2f12601a9fc2f4a5efcb22263393fe5b078ba 100644 --- a/corsika/framework/process/ProcessSequence.hpp +++ b/corsika/framework/process/ProcessSequence.hpp @@ -115,9 +115,8 @@ namespace corsika { function. - + @class ProcessSequence @ingroup Processes - @{ Definition of a static process list/sequence @@ -141,10 +140,10 @@ namespace corsika { ProcessSequence @tparam TProcess2 is of type BaseProcess, either a dedicatd process, or a ProcessSequence - @tparam ProcessIndexOffset to count and index each ContinuousProcess in the entire - process-chain - @tparam IndexOfProcess1 - @tparam IndexOfProcess2 + @tparam IndexFirstProcess to count and index each Process in the entire + process-chain. The offset is the starting value for this ProcessSequence + @tparam IndexOfProcess1 index of TProcess1 (counting of Process) + @tparam IndexOfProcess2 index of TProcess2 (counting of Process) */ template <typename TProcess1, typename TProcess2 = NullModel, @@ -228,7 +227,7 @@ namespace corsika { * The maximum allowed step length is the minimum of the allowed track lenght over all * ContinuousProcess-es in the ProcessSequence. * - * \return: ContinuousProcessStepLength which contains the step length itself in + * @return ContinuousProcessStepLength which contains the step length itself in * LengthType, and a unique identifier of the related ContinuousProcess. **/ @@ -277,6 +276,7 @@ namespace corsika { /** @fn make_sequence + @ingroup Processes Factory function to create a ProcessSequence @@ -315,6 +315,7 @@ namespace corsika { /** @fn make_sequence + @ingroup Processes Factory function to create ProcessSequence @@ -335,6 +336,7 @@ namespace corsika { /** @fn make_sequence + @ingroup Processes Factory function to create ProcessSequence from a single BaseProcess @@ -352,6 +354,8 @@ namespace corsika { } /** + @struct + @ingroup Processes traits marker to identify objectas ProcessSequence @tparam TProcess1 another BaseProcess @@ -365,8 +369,6 @@ namespace corsika { is_process_sequence() {} }; - /** @} */ - } // namespace corsika #include <corsika/detail/framework/process/ProcessSequence.inl> diff --git a/corsika/framework/process/SwitchProcessSequence.hpp b/corsika/framework/process/SwitchProcessSequence.hpp index 2a29cd710b61fca0cba81073ba2e5579f5415148..0e60eba5d834b116e5a2cde4dc6a39402714aa96 100644 --- a/corsika/framework/process/SwitchProcessSequence.hpp +++ b/corsika/framework/process/SwitchProcessSequence.hpp @@ -72,10 +72,10 @@ namespace corsika { @tparam TProcess2 is of type BaseProcess, either a dedicatd process, or a ProcessSequence @tparam TSelect selector functor/function - @tparam IndexFirstProcess to count and index each ContinuousProcess in the entire + @tparam IndexFirstProcess to count and index each Process in the entire process-chain - @tparam IndexOfProcess1 index of TProcess1 (counting of ContinuousProcess) - @tparam IndexOfProcess2 index of TProcess2 (counting of ContinuousProcess) + @tparam IndexOfProcess1 index of TProcess1 (counting of Process) + @tparam IndexOfProcess2 index of TProcess2 (counting of Process) See also class ProcessSequence. **/