From a1d53f400355d51a1cac16ec938ea994e31a4117 Mon Sep 17 00:00:00 2001 From: Maximilian Reininghaus <maximilian.reininghaus@tu-dortmund.de> Date: Wed, 29 Apr 2020 17:10:36 +0200 Subject: [PATCH] some documentation --- .../InteractionCounter/InteractionCounter.h | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/Processes/InteractionCounter/InteractionCounter.h b/Processes/InteractionCounter/InteractionCounter.h index 6f833f4ce..7c4989c02 100644 --- a/Processes/InteractionCounter/InteractionCounter.h +++ b/Processes/InteractionCounter/InteractionCounter.h @@ -24,7 +24,11 @@ #include <utility> namespace corsika::process::interaction_counter { - + /*! + * Wrapper around an InteractionProcess that fills histograms of the number + * of calls to DoInteraction() binned in projectile energy (both in + * lab and center-of-mass frame) and species + */ template <class TCountedProcess> class InteractionCounter : public InteractionProcess<InteractionCounter<TCountedProcess>> { @@ -55,6 +59,9 @@ namespace corsika::process::interaction_counter { hist_type_count_cms interaction_histogram_cms_; hist_type_count_lab interaction_histogram_lab_; + /*! + * These maps map PDG nucei codes to their corresponding interaction histograms + */ std::map<int32_t, nucl_hist_type> nuclIntHistLab, nuclIntHistCMS; public: @@ -134,6 +141,11 @@ namespace corsika::process::interaction_counter { } }; + /*! Save a histogram into a text file. The \arg comment string is written + * into the header of the text file. + * This method is static so that you can sum the histograms of multiple + * InteractionProcesses before saving them into the same file. + */ template <typename T1> static void saveHist(T1 const& hist, std::string const& filename, std::string const& comment = "") { @@ -178,6 +190,11 @@ namespace corsika::process::interaction_counter { } } + /*! + * save both the "normal" particle histograms as well as the "nuclear" histograms + * into the same file + */ + template <typename T1, typename T2> static void saveHist(T1 const& hist, T2 const& histMap, std::string const& filename, std::string const& comment = "") { -- GitLab