diff --git a/Environment/ShowerAxis.h b/Environment/ShowerAxis.h index 6279c36b80b6e63d950d8768c24ff8add4898cd3..bfc6f1212022535a3e727c6ce8afef1a6ee771e6 100644 --- a/Environment/ShowerAxis.h +++ b/Environment/ShowerAxis.h @@ -26,7 +26,6 @@ #include <boost/math/quadrature/gauss_kronrod.hpp> - namespace corsika::environment { /** diff --git a/Framework/Analytics/ClassTimer.h b/Framework/Analytics/ClassTimer.h index 5d99b37070393fc8cd8dfcaee42136e40ecba0f6..cb867a56f226227d2c09582d3fde57627b5254cc 100644 --- a/Framework/Analytics/ClassTimer.h +++ b/Framework/Analytics/ClassTimer.h @@ -20,23 +20,25 @@ namespace corsika::analytics { /// Measure the runtime of a single class function - /** + /** * @tparam TClassFunc Type of the member function pointer that should be wrapped * @tparam TFunc Actual function of the type defined in TClass */ template <typename TClassFunc, TClassFunc TFunc> class ClassTimer; - /// Measure the runtime of a single class function - /** Specialisation to capture exact information about the composition of the member function pointer used. - * - * This class wrapes a single function and allowes the measureing of its runtime if it called via the "call(...)" function - * + /** Specialisation to capture exact information about the composition of the member + * function pointer used. + * + * This class wrapes a single function and allowes the measureing of its runtime if it + * called via the "call(...)" function + * * @tparam TClass Class of the function that should be wrapped * @tparam TRet Return value of the wrapped function * @tparam TArgs Arguments passed to the wrapped function - * @tparam TFuncPtr Actual function of the type defined by TRet TClass::TFuncPtr(TArgs...) + * @tparam TFuncPtr Actual function of the type defined by TRet + * TClass::TFuncPtr(TArgs...) */ template <typename TClass, typename TRet, typename... TArgs, TRet (TClass::*TFuncPtr)(TArgs...)> @@ -54,11 +56,13 @@ namespace corsika::analytics { ClassTimer(TClass& obj) : vObj(obj) {} - /// Executes the wrapped function - /** This function executes and measure the runtime of the wrapped function with the highest precision available (high_resolution_clock). - * + /// Executes the wrapped function + /** This function executes and measure the runtime of the wrapped function with the + * highest precision available (high_resolution_clock). + * * @param args Arguments are perfect forwarded to the wrapped function. - * @return Returns the return value of the wrapped function. This value get copied during the process and therefore must be copie constructible! + * @return Returns the return value of the wrapped function. This value get copied + * during the process and therefore must be copie constructible! */ TRet call(TArgs... args) { vStart = TClock::now(); @@ -97,7 +101,6 @@ namespace corsika::analytics { inline TDuration getTime() const { return vDiff; } }; - /// Specialisation for const member functions template <typename TClass, typename TRet, typename... TArgs, TRet (TClass::*TFuncPtr)(TArgs...) const> @@ -125,7 +128,6 @@ namespace corsika::analytics { inline TDuration getTime() const { return vDiff; } }; - /// Specialisation for const member functions without return value template <typename TClass, typename... TArgs, void (TClass::*TFuncPtr)(TArgs...) const> class ClassTimer<void (TClass::*)(TArgs...) const, TFuncPtr> { diff --git a/Framework/Analytics/FunctionTimer.h b/Framework/Analytics/FunctionTimer.h index ce4585ff40bc644e35ff256bdc497e5925cc55af..4dfe066b6b9a2b6b976bd67d8cf95845b0dcd87d 100644 --- a/Framework/Analytics/FunctionTimer.h +++ b/Framework/Analytics/FunctionTimer.h @@ -13,12 +13,12 @@ namespace corsika::analytics { /// Wraps and measures the runtime of a single function type object - /** - * - * @tparam TFunc funtion pointer that should be wrapped - * @tparam TClock type of the clock that should be used for measurements - * @tparam TDuration type of std::duration to measure the elapsed time - */ + /** + * + * @tparam TFunc funtion pointer that should be wrapped + * @tparam TClock type of the clock that should be used for measurements + * @tparam TDuration type of std::duration to measure the elapsed time + */ template <typename TFunc, typename TClock = std::chrono::high_resolution_clock, typename TDuration = std::chrono::microseconds> class FunctionTimer { @@ -29,7 +29,6 @@ namespace corsika::analytics { TFunc function_; public: - /// Constructs the wrapper with the given functionpointer FunctionTimer(TFunc f) : function_(f) {} diff --git a/Framework/Analytics/testFunctionTimer.cc b/Framework/Analytics/testFunctionTimer.cc index fcdb08d0b043a144bac4a062029d3ae40281709c..f703d7cd47226f157bc03e447619127223c02d13 100644 --- a/Framework/Analytics/testFunctionTimer.cc +++ b/Framework/Analytics/testFunctionTimer.cc @@ -23,7 +23,6 @@ int testFunc() { class TestClass { public: - int operator()() { std::this_thread::sleep_for(std::chrono::milliseconds(100)); return 31415; @@ -46,5 +45,4 @@ TEST_CASE("Analytics", "[Timer]") { std::cout << test() << std::endl; std::cout << test.getTime().count() << std::endl; } - } diff --git a/Framework/ProcessSequence/BaseProcess.h b/Framework/ProcessSequence/BaseProcess.h index d839305939729bb2ef822b6ebbdbf1046d7cfce7..42934bbe9f6309ab437f16843ccddd696e1a3e46 100644 --- a/Framework/ProcessSequence/BaseProcess.h +++ b/Framework/ProcessSequence/BaseProcess.h @@ -22,7 +22,7 @@ namespace corsika::process { are of type BaseProcess<T> */ - class _BaseProcess{}; + class _BaseProcess {}; template <typename TDerived> class BaseProcess : _BaseProcess { @@ -36,9 +36,9 @@ namespace corsika::process { TDerived& GetRef() { return static_cast<TDerived&>(*this); } const TDerived& GetRef() const { return static_cast<const TDerived&>(*this); } - public: - // Base processor type for use in other template classes - using TProcessType = TDerived; + public: + // Base processor type for use in other template classes + using TProcessType = TDerived; }; } // namespace corsika::process diff --git a/Framework/ProcessSequence/BoundaryCrossingProcess.h b/Framework/ProcessSequence/BoundaryCrossingProcess.h index 3aeb9ab3a50d62602235ab621ae179d47c7f0713..6526648a8fc36f422ec22ebdea529e572c42ef95 100644 --- a/Framework/ProcessSequence/BoundaryCrossingProcess.h +++ b/Framework/ProcessSequence/BoundaryCrossingProcess.h @@ -19,8 +19,7 @@ namespace corsika::process { class BoundaryCrossingProcess : public BaseProcess<TDerived> { private: protected: - public: - + public: /** * This method is called when a particle crosses the boundary between the nodes * \p from and \p to. diff --git a/Framework/ProcessSequence/ContinuousProcess.h b/Framework/ProcessSequence/ContinuousProcess.h index 6c45a07a77ed921ae8e9a89f1f6e4c05472ab0b6..2c9e7bbc854b6000ec2e41f93c75a8aa509b771f 100644 --- a/Framework/ProcessSequence/ContinuousProcess.h +++ b/Framework/ProcessSequence/ContinuousProcess.h @@ -27,8 +27,7 @@ namespace corsika::process { class ContinuousProcess : public BaseProcess<TDerived> { private: protected: - public: - + public: // here starts the interface part // -> enforce TDerived to implement DoContinuous... template <typename TParticle, typename TTrack> diff --git a/Framework/ProcessSequence/DecayProcess.h b/Framework/ProcessSequence/DecayProcess.h index 24a9c455c3346a9561661328b45a040074143b04..eb0cf982f08a166948becba132ab6346baa60365 100644 --- a/Framework/ProcessSequence/DecayProcess.h +++ b/Framework/ProcessSequence/DecayProcess.h @@ -26,8 +26,7 @@ namespace corsika::process { template <typename TDerived> struct DecayProcess : BaseProcess<TDerived> { - public: - + public: using BaseProcess<TDerived>::GetRef; /// here starts the interface-definition part diff --git a/Framework/ProcessSequence/InteractionProcess.h b/Framework/ProcessSequence/InteractionProcess.h index ba12d030476fd6926af6c962aa7059725f0f8cc5..cfecccc8156d3b4519209ba5efe9c965f1f89b93 100644 --- a/Framework/ProcessSequence/InteractionProcess.h +++ b/Framework/ProcessSequence/InteractionProcess.h @@ -26,11 +26,9 @@ namespace corsika::process { template <typename TDerived> class InteractionProcess : public BaseProcess<TDerived> { - public: - + public: using BaseProcess<TDerived>::GetRef; - /// here starts the interface-definition part // -> enforce TDerived to implement DoInteraction... template <typename TParticle> diff --git a/Framework/ProcessSequence/SecondariesProcess.h b/Framework/ProcessSequence/SecondariesProcess.h index 03b2ca82b57049d64d4e4b270946df88345241d8..355a465c78bbdf4008b63f18e091a58321b4a949 100644 --- a/Framework/ProcessSequence/SecondariesProcess.h +++ b/Framework/ProcessSequence/SecondariesProcess.h @@ -26,8 +26,7 @@ namespace corsika::process { template <typename TDerived> class SecondariesProcess : public BaseProcess<TDerived> { - public: - + public: /// here starts the interface-definition part // -> enforce TDerived to implement DoSecondaries... template <typename TSecondaries> diff --git a/Framework/ProcessSequence/StackProcess.h b/Framework/ProcessSequence/StackProcess.h index f5713ff675e45f2b3b66eda4b80344b13315a1cb..64a5dff97b6d2df4df5837b3bcc0e2b3052938e6 100644 --- a/Framework/ProcessSequence/StackProcess.h +++ b/Framework/ProcessSequence/StackProcess.h @@ -25,11 +25,10 @@ namespace corsika::process { */ template <typename TDerived> - class StackProcess : public BaseProcess<TDerived>{ + class StackProcess : public BaseProcess<TDerived> { private: protected: public: - StackProcess() = delete; StackProcess(const unsigned int nStep) : fNStep(nStep) {} diff --git a/Processes/AnalyticProcessors/ExecTime.h b/Processes/AnalyticProcessors/ExecTime.h index b03252918551cbb2790fee461d84e3b7de2e61bd..e80513ccc7d9299df0f10202c1018d32cbd0d01b 100644 --- a/Processes/AnalyticProcessors/ExecTime.h +++ b/Processes/AnalyticProcessors/ExecTime.h @@ -30,34 +30,36 @@ namespace corsika::process { namespace analytic_processors { /// Time measurement of individual processes - /** This class allowes to log the runtime spend in all default calls to the process. - * No distinction is made between individual function calls of the process, the runtime is accumulated - * and or avaraged without differentiation. - * - * The class is currently only implemented for BoundaryProcess, ContinuousProcess, DecayProcess, InteractionProcess and SecondariesProcess and captures only the according functions of the base class given as template parameter. Trying to access BoundaryProcess functions with a DecayProcess as template parameter will currently give long errormessages. - * - * Inherits all functionality of the class that should be measured, this includes functions like getters and setters + /** This class allowes to log the runtime spend in all default calls to the process. + * No distinction is made between individual function calls of the process, the + * runtime is accumulated and or avaraged without differentiation. + * + * The class is currently only implemented for BoundaryProcess, ContinuousProcess, + * DecayProcess, InteractionProcess and SecondariesProcess and captures only the + * according functions of the base class given as template parameter. Trying to access + * BoundaryProcess functions with a DecayProcess as template parameter will currently + * give long errormessages. + * + * Inherits all functionality of the class that should be measured, this includes + * functions like getters and setters */ template <typename T> class ExecTime : public Boundary<T, std::is_base_of<corsika::process::BoundaryCrossingProcess< typename T::TProcessType>, T>::value>, - public Continuous< - T, - std::is_base_of<corsika::process::ContinuousProcess<typename T::TProcessType>, - T>::value>, + public Continuous<T, std::is_base_of<corsika::process::ContinuousProcess< + typename T::TProcessType>, + T>::value>, public Decay< T, std::is_base_of<corsika::process::DecayProcess<typename T::TProcessType>, T>::value>, - public Interaction< - T, - std::is_base_of<corsika::process::InteractionProcess<typename T::TProcessType>, - T>::value>, - public Secondaries< - T, - std::is_base_of<corsika::process::SecondariesProcess<typename T::TProcessType>, - T>::value> { + public Interaction<T, std::is_base_of<corsika::process::InteractionProcess< + typename T::TProcessType>, + T>::value>, + public Secondaries<T, std::is_base_of<corsika::process::SecondariesProcess< + typename T::TProcessType>, + T>::value> { static_assert(std::is_base_of<corsika::process::_BaseProcess, T>::value, "error message"); diff --git a/Processes/AnalyticProcessors/ExecTimeImpl.h b/Processes/AnalyticProcessors/ExecTimeImpl.h index 31596b08d89fb8fc7806826218fd56daad6bd5e9..1dffcf1fa03608645394c51eea2d26be12a7a3a9 100644 --- a/Processes/AnalyticProcessors/ExecTimeImpl.h +++ b/Processes/AnalyticProcessors/ExecTimeImpl.h @@ -31,11 +31,13 @@ namespace corsika::process { namespace detail { - /// Process type independent functionality of the Process runtime measurement class ExecTime - /** Inherits all functionality of the class that should be sampled, this includes special functions for getters and setters - * - * - * + /// Process type independent functionality of the Process runtime measurement class + /// ExecTime + /** Inherits all functionality of the class that should be sampled, this includes + * special functions for getters and setters + * + * + * */ template <typename T> class ExecTimeImpl : public T { @@ -74,7 +76,8 @@ namespace corsika::process { this->update(timeDiv); } - /// Updates the floating mean and variance as well as the global min and max of the sampled runtimes + /// Updates the floating mean and variance as well as the global min and max of + /// the sampled runtimes void update(std::chrono::duration<double, std::micro> timeDif) { cumulatedTime_ += timeDif; diff --git a/Processes/AnalyticProcessors/ImplBoundary.h b/Processes/AnalyticProcessors/ImplBoundary.h index 1c825e340994c3f7f293d2a785a9b825f93e2ea9..681c7048f91c448ffb067d5870d2bce291c99bc1 100644 --- a/Processes/AnalyticProcessors/ImplBoundary.h +++ b/Processes/AnalyticProcessors/ImplBoundary.h @@ -36,11 +36,12 @@ namespace corsika::process { EProcessReturn DoBoundaryCrossing(Particle& p, VTNType const& from, VTNType const& to) { - // Use of the ClassTimer function -> see ClassTimer for documentation + // Use of the ClassTimer function -> see ClassTimer for documentation auto tc = corsika::analytics::ClassTimer< EProcessReturn (detail::ExecTimeImpl<T>::_T::*)(Particle&, VTNType const&, - VTNType const&), - &detail::ExecTimeImpl<T>::_T::template DoBoundaryCrossing<Particle, VTNType>>(*this); + VTNType const&), + &detail::ExecTimeImpl<T>::_T::template DoBoundaryCrossing<Particle, VTNType>>( + *this); EProcessReturn r = tc.call(p, from, to); this->update( diff --git a/Processes/AnalyticProcessors/testExecTime.cc b/Processes/AnalyticProcessors/testExecTime.cc index 52518ddfe25043a04a415dfc58b219c3900fc4fc..dbda248c889279e58a0feb4be6650e02eb02bb7a 100644 --- a/Processes/AnalyticProcessors/testExecTime.cc +++ b/Processes/AnalyticProcessors/testExecTime.cc @@ -18,9 +18,9 @@ #include <corsika/process/example_processors/DummyInteractionProcess.h> #include <corsika/process/example_processors/DummySecondariesProcess.h> +#include <cmath> #include <random> #include <vector> -#include <cmath> using namespace corsika::process; using namespace corsika::process::analytic_processors; diff --git a/Processes/ExampleProcessors/DummyBoundaryCrossingProcess.h b/Processes/ExampleProcessors/DummyBoundaryCrossingProcess.h index 936a65a5130dbdea0b0ec83ceaacbb947f73929d..235b86996daa32fbf763766f287f9936f8097a1b 100644 --- a/Processes/ExampleProcessors/DummyBoundaryCrossingProcess.h +++ b/Processes/ExampleProcessors/DummyBoundaryCrossingProcess.h @@ -21,13 +21,12 @@ namespace corsika::process { : public BoundaryCrossingProcess<DummyBoundaryCrossingProcess<ISleep>> { private: protected: - public: template <typename Particle, typename VTNType> EProcessReturn DoBoundaryCrossing(Particle&, VTNType const&, VTNType const&) { std::this_thread::sleep_for(std::chrono::milliseconds(ISleep)); return EProcessReturn::eOk; - } + } }; } // namespace example_processors diff --git a/Processes/ExampleProcessors/DummyInteractionProcess.h b/Processes/ExampleProcessors/DummyInteractionProcess.h index 51e9bfbe837ed1d14e3c7668f7245ba6e597ba9e..3bda555d7aa5336b60caa18de6683bdaac3b84bc 100644 --- a/Processes/ExampleProcessors/DummyInteractionProcess.h +++ b/Processes/ExampleProcessors/DummyInteractionProcess.h @@ -17,7 +17,8 @@ namespace corsika::process { namespace example_processors { template <int ISleep> - class DummyInteractionProcess : public InteractionProcess<DummyInteractionProcess<ISleep> > { + class DummyInteractionProcess + : public InteractionProcess<DummyInteractionProcess<ISleep> > { private: public: template <typename Particle> diff --git a/Processes/ExampleProcessors/DummySecondariesProcess.h b/Processes/ExampleProcessors/DummySecondariesProcess.h index 848e88411ec4941b604dff80bf5401e3fd654ba3..30cdab881fad98c891368f795dba9c15d347328f 100644 --- a/Processes/ExampleProcessors/DummySecondariesProcess.h +++ b/Processes/ExampleProcessors/DummySecondariesProcess.h @@ -17,7 +17,8 @@ namespace corsika::process { namespace example_processors { template <int ISleep> - class DummySecondariesProcess : public SecondariesProcess<DummySecondariesProcess<ISleep>> { + class DummySecondariesProcess + : public SecondariesProcess<DummySecondariesProcess<ISleep>> { private: public: template <typename TSecondaries> diff --git a/Processes/ExampleProcessors/TestDummy.cc b/Processes/ExampleProcessors/TestDummy.cc index 1cbddbb6c4c3a4caa056a26c9fd73807e2e95c54..0781310d0b48d851eb2538f00521005118af53df 100644 --- a/Processes/ExampleProcessors/TestDummy.cc +++ b/Processes/ExampleProcessors/TestDummy.cc @@ -48,13 +48,14 @@ TEST_CASE("Dummy Processes") { Approx(1000).margin(1)); start = std::chrono::steady_clock::now(); - REQUIRE(dc.MaxStepLength(nullptr, nullptr) == units::si::meter * std::numeric_limits<double>::infinity()); + REQUIRE(dc.MaxStepLength(nullptr, nullptr) == + units::si::meter * std::numeric_limits<double>::infinity()); end = std::chrono::steady_clock::now(); REQUIRE(std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count() == Approx(1000).margin(1)); } - SECTION("Decay") { + SECTION("Decay") { auto start = std::chrono::steady_clock::now(); REQUIRE(dd.DoDecay(tmp) == EProcessReturn::eOk); auto end = std::chrono::steady_clock::now(); @@ -62,13 +63,14 @@ TEST_CASE("Dummy Processes") { Approx(1000).margin(1)); start = std::chrono::steady_clock::now(); - REQUIRE(dd.GetLifetime(tmp) == units::si::second * std::numeric_limits<double>::infinity()); + REQUIRE(dd.GetLifetime(tmp) == + units::si::second * std::numeric_limits<double>::infinity()); end = std::chrono::steady_clock::now(); REQUIRE(std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count() == Approx(1000).margin(1)); } - SECTION("Interaction") { + SECTION("Interaction") { auto start = std::chrono::steady_clock::now(); REQUIRE(di.DoInteraction(tmp) == EProcessReturn::eOk); auto end = std::chrono::steady_clock::now(); @@ -76,18 +78,18 @@ TEST_CASE("Dummy Processes") { Approx(1000).margin(1)); start = std::chrono::steady_clock::now(); - REQUIRE(di.GetInteractionLength(tmp) == (units::si::gram / 1_cm / 1_cm) * std::numeric_limits<double>::infinity()); + REQUIRE(di.GetInteractionLength(tmp) == + (units::si::gram / 1_cm / 1_cm) * std::numeric_limits<double>::infinity()); end = std::chrono::steady_clock::now(); REQUIRE(std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count() == Approx(1000).margin(1)); } - SECTION("Secondaries") { + SECTION("Secondaries") { auto start = std::chrono::steady_clock::now(); REQUIRE(dse.DoSecondaries(tmp) == EProcessReturn::eOk); auto end = std::chrono::steady_clock::now(); REQUIRE(std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count() == Approx(1000).margin(1)); - } } diff --git a/Processes/LongitudinalProfile/LongitudinalProfile.h b/Processes/LongitudinalProfile/LongitudinalProfile.h index a9a1cfa0d481f1e93254d14bd1ef6c558c842367..c4d2bf0c6e6461d89f66fc53dcd41810a6f7dd7f 100644 --- a/Processes/LongitudinalProfile/LongitudinalProfile.h +++ b/Processes/LongitudinalProfile/LongitudinalProfile.h @@ -23,9 +23,9 @@ namespace corsika::process::longitudinal_profile { /** * \class LongitudinalProfile * - * is a ContinuousProcess, which is constructed from an environment::ShowerAxis + * is a ContinuousProcess, which is constructed from an environment::ShowerAxis * object, and a dX in units of g/cm2 - * (corsika::units::si::GrammageType). + * (corsika::units::si::GrammageType). * * LongitudinalProfile does then convert each single Track of the * simulation into a projected grammage range and counts for