From 13460451df36dcc994b9123e57513191ea3fd80b Mon Sep 17 00:00:00 2001 From: ralfulrich <ralf.ulrich@kit.edu> Date: Mon, 10 Sep 2018 12:19:45 +0200 Subject: [PATCH] run ./do-clang-format.sh --- Documentation/Examples/logger_example.cc | 35 +++++++------- Documentation/Examples/stack_example.cc | 3 +- Framework/Cascade/Cascade.cc | 27 +++-------- Framework/Cascade/Cascade.h | 9 ++-- Framework/Cascade/Step.cc | 6 +-- Framework/Geometry/CoordinateSystem.h | 4 +- Framework/Geometry/Helix.h | 14 +++--- Framework/Geometry/LineTrajectory.h | 26 +++++----- Framework/Geometry/Point.h | 6 +-- Framework/Geometry/Vector.h | 2 +- Framework/Logging/BufferedSink.h | 59 ++++++++++++----------- Framework/Logging/Logger.h | 44 ++++++++--------- Framework/Logging/MessageOff.h | 5 +- Framework/Logging/MessageOn.h | 40 ++++++++------- Framework/Logging/NoSink.h | 6 +-- Framework/Logging/Sink.h | 34 ++++++------- Framework/Particles/testParticles.cc | 5 +- Framework/StackInterface/StackIterator.h | 2 +- Framework/Units/PhysicalConstants.h | 41 ++++++++-------- Framework/Units/PhysicalUnits.h | 13 ++--- Main/shower.cc | 9 +--- Processes/NullModel/NullModel.h | 4 +- Processes/NullModel/testNullModel.cc | 1 - Processes/Sibyll/ParticleConversion.cc | 4 +- Processes/Sibyll/ParticleConversion.h | 20 ++++---- Stack/SuperStupidStack/SuperStupidStack.h | 9 ++-- 26 files changed, 203 insertions(+), 225 deletions(-) diff --git a/Documentation/Examples/logger_example.cc b/Documentation/Examples/logger_example.cc index fdb8e4a0..94fcb588 100644 --- a/Documentation/Examples/logger_example.cc +++ b/Documentation/Examples/logger_example.cc @@ -1,16 +1,13 @@ #include <corsika/logging/Logger.h> #include <boost/format.hpp> -#include <string> -#include <iostream> #include <fstream> - +#include <iostream> +#include <string> using namespace std; using namespace corsika::logging; -int -main() -{ +int main() { { cout << "writing to \"another.log\"" << endl; ofstream logfile("another.log"); @@ -18,28 +15,32 @@ main() sink::BufferedSinkStream sink(logfile, sink::StdBuffer(10000)); Logger<MessageOn, sink::BufferedSinkStream> info("\033[32m", "info", sink); Logger<MessageOn, sink::BufferedSinkStream> err("\033[31m", "error", sink); - //logger<ostream,messageconst,StdBuffer> info(std::cout, StdBuffer(10000)); - + // logger<ostream,messageconst,StdBuffer> info(std::cout, StdBuffer(10000)); + /* Logging& logs = Logging::GetInstance(); logs.AddLogger<>("info", info); - auto& log_1 = logs.GetLogger("info"); // no so useful, since type of log_1 is std::any + auto& log_1 = logs.GetLogger("info"); // no so useful, since type of log_1 is + std::any */ - - for (int i=0; i<100000; ++i) { - LOG(info, "irgendwas"," ", string("and more")," ", boost::format("error: %i message: %s. done."), i, "stupido"); + + for (int i = 0; i < 100000; ++i) { + LOG(info, "irgendwas", " ", string("and more"), " ", + boost::format("error: %i message: %s. done."), i, "stupido"); LOG(err, "Fehler"); } } - + { sink::NoSink off; Logger<MessageOff> info("", "", off); - - for (int i=0; i<100000; ++i) { - LOG(info, "irgendwas", string("and more"), boost::format("error: %i message: %s. done."), i, "stupido", "a-number:", 8.99, "ENDE" ); + + for (int i = 0; i < 100000; ++i) { + LOG(info, "irgendwas", string("and more"), + boost::format("error: %i message: %s. done."), i, "stupido", "a-number:", 8.99, + "ENDE"); } } - + return 0; } diff --git a/Documentation/Examples/stack_example.cc b/Documentation/Examples/stack_example.cc index 8f65dbe7..d54f2043 100644 --- a/Documentation/Examples/stack_example.cc +++ b/Documentation/Examples/stack_example.cc @@ -1,5 +1,5 @@ -#include <corsika/stack/super_stupid/SuperStupidStack.h> #include <corsika/particles/ParticleProperties.h> +#include <corsika/stack/super_stupid/SuperStupidStack.h> #include <iomanip> #include <iostream> @@ -10,7 +10,6 @@ using namespace std; using namespace corsika::units; using namespace corsika::stack; - void fill(corsika::stack::super_stupid::SuperStupidStack& s) { for (int i = 0; i < 11; ++i) { auto p = s.NewParticle(); diff --git a/Framework/Cascade/Cascade.cc b/Framework/Cascade/Cascade.cc index d4e1320a..f4496f53 100644 --- a/Framework/Cascade/Cascade.cc +++ b/Framework/Cascade/Cascade.cc @@ -2,27 +2,20 @@ namespace cascade; -template<typename Sequence, typename Trajectory> -void -Cascade::Cascade() { +template <typename Sequence, typename Trajectory> +void Cascade::Cascade() { kkk; kk; } - -template<typename Sequence, typename Trajectory> -void -Cascade::Init() -{ +template <typename Sequence, typename Trajectory> +void Cascade::Init() { fStack.Init(); fProcesseList.Init(); } - -template<typename Sequence, typename Trajectory> -void -Cascade::Run() -{ +template <typename Sequence, typename Trajectory> +void Cascade::Run() { if (!fStack.IsEmpty()) { if (!fStack.IsEmpty()) { Particle& p = fStack.GetNextParticle(); @@ -34,14 +27,10 @@ Cascade::Run() } } - -template<typename Sequence, typename Trajectory> -void -Cascade::Step(Particle& particle) -{ +template <typename Sequence, typename Trajectory> +void Cascade::Step(Particle& particle) { double nextStep = fProcesseList.MinStepLength(particle); Trajectory trajectory = fProcesseList.Transport(particle, nextStep); sequence.DoContinuous(particle, trajectory); sequence.DoDiscrete(particle); } - diff --git a/Framework/Cascade/Cascade.h b/Framework/Cascade/Cascade.h index 8513a95f..a8af260b 100644 --- a/Framework/Cascade/Cascade.h +++ b/Framework/Cascade/Cascade.h @@ -3,9 +3,9 @@ namespace cascade { - template<typename Processes, typename Trajectory, typename Stack> + template <typename Processes, typename Trajectory, typename Stack> class Cascade { - + public: Cascade(); @@ -16,9 +16,8 @@ namespace cascade { private: Stack fStack; Processes fProcesseList; - }; - -} + +} // namespace cascade #endif diff --git a/Framework/Cascade/Step.cc b/Framework/Cascade/Step.cc index 5a04f06a..60349c74 100644 --- a/Framework/Cascade/Step.cc +++ b/Framework/Cascade/Step.cc @@ -2,13 +2,9 @@ namespace cascade; - -void -Cascade::Step(auto& sequence, Particle& particle) -{ +void Cascade::Step(auto& sequence, Particle& particle) { double nextStep = sequence.MinStepLength(particle); Trajectory trajectory = sequence.Transport(particle, nextStep); sequence.DoContinuous(particle, trajectory); sequence.DoDiscrete(particle); } - diff --git a/Framework/Geometry/CoordinateSystem.h b/Framework/Geometry/CoordinateSystem.h index 695ae502..b8a7afc2 100644 --- a/Framework/Geometry/CoordinateSystem.h +++ b/Framework/Geometry/CoordinateSystem.h @@ -11,7 +11,7 @@ typedef Eigen::Translation<double, 3> EigenTranslation; namespace corsika::geometry { using corsika::units::length_d; - + class CoordinateSystem { CoordinateSystem const* reference = nullptr; EigenTransform transf; @@ -59,6 +59,6 @@ namespace corsika::geometry { auto const& GetTransform() const { return transf; } }; -} // namespace corsika +} // namespace corsika::geometry #endif diff --git a/Framework/Geometry/Helix.h b/Framework/Geometry/Helix.h index fe123e26..c392356d 100644 --- a/Framework/Geometry/Helix.h +++ b/Framework/Geometry/Helix.h @@ -8,12 +8,12 @@ namespace corsika::geometry { - using corsika::units::SpeedType; - using corsika::units::TimeType; + using corsika::units::frequency_d; using corsika::units::FrequencyType; using corsika::units::quantity; - using corsika::units::frequency_d; - + using corsika::units::SpeedType; + using corsika::units::TimeType; + class Helix // TODO: inherit from to-be-implemented "Trajectory" { using SpeedVec = Vector<SpeedType::dimension_type>; @@ -26,8 +26,8 @@ namespace corsika::geometry { LengthType const radius; public: - Helix(Point const& pR0, quantity<frequency_d> pOmegaC, - SpeedVec const& pvPar, SpeedVec const& pvPerp) + Helix(Point const& pR0, quantity<frequency_d> pOmegaC, SpeedVec const& pvPar, + SpeedVec const& pvPerp) : r0(pR0) , omegaC(pOmegaC) , vPar(pvPar) @@ -43,6 +43,6 @@ namespace corsika::geometry { auto GetRadius() const { return radius; } }; -} // namespace corsika +} // namespace corsika::geometry #endif diff --git a/Framework/Geometry/LineTrajectory.h b/Framework/Geometry/LineTrajectory.h index 1e899269..4d56a598 100644 --- a/Framework/Geometry/LineTrajectory.h +++ b/Framework/Geometry/LineTrajectory.h @@ -1,29 +1,25 @@ #ifndef _include_LINETRAJECTORY_H #define _include_LINETRAJECTORY_H +#include <Units/PhysicalUnits.h> #include <corsika/Point.h> #include <corsika/Vector.h> -#include <Units/PhysicalUnits.h> namesapce corsika { -class LineTrajectory // TODO: inherit from Trajectory -{ + class LineTrajectory // TODO: inherit from Trajectory + { using SpeedVec = Vector<Speed::dimension_type>; - + Point const r0; SpeedVec const v0; - - LineTrajectory(Point const& pR0, SpeedVec const& pV0) : - r0(r0), v0(pV0) - { - } - - auto GetPosition(Time t) const - { - return r0 + v0 * t; - } -}; + + LineTrajectory(Point const& pR0, SpeedVec const& pV0) + : r0(r0) + , v0(pV0) {} + + auto GetPosition(Time t) const { return r0 + v0 * t; } + }; } // end namesapce diff --git a/Framework/Geometry/Point.h b/Framework/Geometry/Point.h index 8de3e1bd..108fe87f 100644 --- a/Framework/Geometry/Point.h +++ b/Framework/Geometry/Point.h @@ -8,9 +8,9 @@ namespace corsika::geometry { - using corsika::units::LengthType; using corsika::units::length_d; - + using corsika::units::LengthType; + /*! * A Point represents a point in position space. It is defined by its * coordinates with respect to some CoordinateSystem. @@ -60,6 +60,6 @@ namespace corsika::geometry { } }; -} // namespace corsika +} // namespace corsika::geometry #endif diff --git a/Framework/Geometry/Vector.h b/Framework/Geometry/Vector.h index e8be6bea..fcebc10f 100644 --- a/Framework/Geometry/Vector.h +++ b/Framework/Geometry/Vector.h @@ -172,6 +172,6 @@ namespace corsika::geometry { } }; -} // namespace corsika +} // namespace corsika::geometry #endif diff --git a/Framework/Logging/BufferedSink.h b/Framework/Logging/BufferedSink.h index c082cad6..7ad36927 100644 --- a/Framework/Logging/BufferedSink.h +++ b/Framework/Logging/BufferedSink.h @@ -4,7 +4,6 @@ namespace corsika::logging { namespace sink { - /** Output buffer template. NoBuffer does nothingk. @@ -19,47 +18,53 @@ namespace corsika::logging { */ /** Output buffer template. StdBuffer records fSize characters in - local memeory before passing it on to further output stages. + local memeory before passing it on to further output stages. */ - + struct StdBuffer { - StdBuffer(const int size) : fSize(size) {} - inline bool Test(const std::string& s) { return int(fBuffer.tellp())+s.length() < fSize; } + StdBuffer(const int size) + : fSize(size) {} + inline bool Test(const std::string& s) { + return int(fBuffer.tellp()) + s.length() < fSize; + } inline std::string GetString() const { return fBuffer.str(); } inline void Clear() { fBuffer.str(""); } inline void Add(const std::string& s) { fBuffer << s; } + private: int fSize; std::ostringstream fBuffer; }; - - + /** - Definition of Sink for log output. - */ - template<typename TStream, typename TBuffer=StdBuffer> + Definition of Sink for log output. + */ + template <typename TStream, typename TBuffer = StdBuffer> class BufferedSink { public: - BufferedSink(TStream& out, TBuffer buffer = {} ) : fOutput(out), fBuffer(std::move(buffer)) {} - void operator<<(const std::string& msg) { - if (!fBuffer.Test(msg)) { - fOutput << fBuffer.GetString(); - fBuffer.Clear(); + BufferedSink(TStream& out, TBuffer buffer = {}) + : fOutput(out) + , fBuffer(std::move(buffer)) {} + void operator<<(const std::string& msg) { + if (!fBuffer.Test(msg)) { + fOutput << fBuffer.GetString(); + fBuffer.Clear(); + } + if (!fBuffer.Test(msg)) + fOutput << msg; + else + fBuffer.Add(msg); } - if (!fBuffer.Test(msg)) - fOutput << msg; - else - fBuffer.Add(msg); - } - void Close() { fOutput << fBuffer.GetString(); } + void Close() { fOutput << fBuffer.GetString(); } + private: - TStream& fOutput; - TBuffer fBuffer; + TStream& fOutput; + TBuffer fBuffer; }; - + typedef BufferedSink<std::ostream, StdBuffer> BufferedSinkStream; - }// end namespace -} // end namespace - + } // namespace sink +} // namespace corsika::logging + #endif diff --git a/Framework/Logging/Logger.h b/Framework/Logging/Logger.h index 351282b5..fca23d70 100644 --- a/Framework/Logging/Logger.h +++ b/Framework/Logging/Logger.h @@ -8,25 +8,22 @@ #define _include_logger_h_ #include <iosfwd> -#include <string> #include <sstream> +#include <string> #include <typeinfo> #include <boost/format.hpp> -#include <corsika/logging/MessageOn.h> +#include <corsika/logging/BufferedSink.h> #include <corsika/logging/MessageOff.h> -#include <corsika/logging/Sink.h> +#include <corsika/logging/MessageOn.h> #include <corsika/logging/NoSink.h> -#include <corsika/logging/BufferedSink.h> - +#include <corsika/logging/Sink.h> using namespace std; using namespace boost; - namespace corsika::logging { - /** @class Logger @@ -36,50 +33,51 @@ namespace corsika::logging { compile-time into message strings. The helper class MessageOff, will just do nothing and will be optimized away at compile time. */ - template<typename MSG=MessageOn, typename TSink=sink::NoSink> + template <typename MSG = MessageOn, typename TSink = sink::NoSink> class Logger : private MSG { - + using MSG::Message; - + public: // Logger() : fName("") {} - Logger(const std::string color, const std::string name, TSink& sink) : fSink(sink), fName(color+"["+name+"]\033[39m ") {} - ~Logger() { fSink.Close(); } + Logger(const std::string color, const std::string name, TSink& sink) + : fSink(sink) + , fName(color + "[" + name + "]\033[39m ") {} + ~Logger() { fSink.Close(); } // Logger(const Logger&) = delete; /** Function to add string-concatenation of all inputs to output sink. */ - template<typename ... Strings> + template <typename... Strings> void Log(const Strings&... inputs) { fSink << MSG::Message(inputs...); } - + const std::string& GetName() const { return fName; } - + private: TSink& fSink; std::string fName; }; -} // end namesapce - +} // namespace corsika::logging /** * @def LOG(...) - * + * * This is the main interface to the logging facilities. If Logger - * object are defined (e.g. log1) use as - * @example LOG(log1, "var1=", variable1int, "var2=", variabl2double) + * object are defined (e.g. log1) use as + * @example LOG(log1, "var1=", variable1int, "var2=", variabl2double) * for arbitrary long sequence * of arguments. This may also include boost::format objects the * output is concatenated, if log1 is switched off at compile time, * the whole LOG command is optimized away by the compiler. */ -#define LOG(__LOGGER,...) \ - __LOGGER.Log(__LOGGER.GetName(), __FILE__,":", __LINE__, " (", __func__, ") -> ", ##__VA_ARGS__); +#define LOG(__LOGGER, ...) \ + __LOGGER.Log(__LOGGER.GetName(), __FILE__, ":", __LINE__, " (", __func__, ") -> ", \ + ##__VA_ARGS__); #endif - diff --git a/Framework/Logging/MessageOff.h b/Framework/Logging/MessageOff.h index 87b49ef5..d6007000 100644 --- a/Framework/Logging/MessageOff.h +++ b/Framework/Logging/MessageOff.h @@ -9,11 +9,12 @@ namespace corsika::logging { */ class MessageOff { protected: - template<typename First, typename ... Strings> std::string Message(const First& arg, const Strings&... rest) { + template <typename First, typename... Strings> + std::string Message(const First& arg, const Strings&... rest) { return ""; } }; -} // end namespace +} // namespace corsika::logging #endif diff --git a/Framework/Logging/MessageOn.h b/Framework/Logging/MessageOn.h index bcab9845..a2592867 100644 --- a/Framework/Logging/MessageOn.h +++ b/Framework/Logging/MessageOn.h @@ -1,7 +1,6 @@ #ifndef _include_MessageOn_h_ #define _include_MessageOn_h_ - namespace corsika::logging { /** @@ -11,44 +10,51 @@ namespace corsika::logging { class MessageOn { protected: std::string Message() { return "\n"; } - - template<typename First, typename ... Strings> std::string Message(const First& arg, const Strings&... rest) { + + template <typename First, typename... Strings> + std::string Message(const First& arg, const Strings&... rest) { std::ostringstream ss; ss << arg << Message(rest...); return ss.str(); } - - template<typename ... Strings> std::string Message(const int& arg, const Strings&... rest) { + + template <typename... Strings> + std::string Message(const int& arg, const Strings&... rest) { return std::to_string(arg) + Message(rest...); } - - template<typename ... Strings> std::string Message(const double& arg, const Strings&... rest) { + + template <typename... Strings> + std::string Message(const double& arg, const Strings&... rest) { return std::to_string(arg) + Message(rest...); } - - template<typename ... Strings> std::string Message(char const * arg, const Strings&... rest) { + + template <typename... Strings> + std::string Message(char const* arg, const Strings&... rest) { return std::string(arg) + Message(rest...); } - - template<typename ... Strings> std::string Message(const std::string& arg, const Strings&... rest) { + + template <typename... Strings> + std::string Message(const std::string& arg, const Strings&... rest) { return arg + Message(rest...); } - + // ---------------------- // boost format - template<typename ... Strings> std::string Message(const boost::format& fmt, const Strings&... rest) { + template <typename... Strings> + std::string Message(const boost::format& fmt, const Strings&... rest) { boost::format FMT(fmt); return bformat(FMT, rest...); } - - template<typename Arg, typename ... Strings> std::string bformat(boost::format& fmt, const Arg& arg, const Strings&... rest) { + + template <typename Arg, typename... Strings> + std::string bformat(boost::format& fmt, const Arg& arg, const Strings&... rest) { fmt % arg; return bformat(fmt, rest...); } - + std::string bformat(boost::format& fmt) { return fmt.str() + "\n"; } }; -}// end namesapce +} // namespace corsika::logging #endif diff --git a/Framework/Logging/NoSink.h b/Framework/Logging/NoSink.h index 96cebd60..d0ba5364 100644 --- a/Framework/Logging/NoSink.h +++ b/Framework/Logging/NoSink.h @@ -10,7 +10,7 @@ namespace corsika::logging { inline void Close() {} }; - }// end namespace -} // end namespace - + } // namespace sink +} // namespace corsika::logging + #endif diff --git a/Framework/Logging/Sink.h b/Framework/Logging/Sink.h index 5b6c64b0..f51b7029 100644 --- a/Framework/Logging/Sink.h +++ b/Framework/Logging/Sink.h @@ -5,33 +5,33 @@ namespace corsika::logging { /** a sink for the logger must implement the two functions - operator<<(const std::string&) + operator<<(const std::string&) and Close() - + See example: NoSink */ - + namespace sink { - + /** - Definition of Sink for log output. - */ - template<typename TStream> + Definition of Sink for log output. + */ + template <typename TStream> class Sink { public: - Sink(TStream& out) : fOutput(out) {} - void operator<<(const std::string& msg) { - fOutput << msg; - } - void Close() {} + Sink(TStream& out) + : fOutput(out) {} + void operator<<(const std::string& msg) { fOutput << msg; } + void Close() {} + private: - TStream& fOutput; + TStream& fOutput; }; - + typedef Sink<std::ostream> SinkStream; - }// end namespace -} // end namespace - + } // namespace sink +} // namespace corsika::logging + #endif diff --git a/Framework/Particles/testParticles.cc b/Framework/Particles/testParticles.cc index 61697314..47626417 100644 --- a/Framework/Particles/testParticles.cc +++ b/Framework/Particles/testParticles.cc @@ -1,6 +1,6 @@ -#include <corsika/units/PhysicalUnits.h> #include <corsika/particles/ParticleProperties.h> +#include <corsika/units/PhysicalUnits.h> #define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one // cpp file @@ -18,8 +18,7 @@ TEST_CASE("Particles", "[Particles]") { REQUIRE(Electron::GetMass() / GetMass(Code::Electron) == Approx(1)); REQUIRE(Electron::GetCharge() / constants::e == Approx(-1)); REQUIRE(Positron::GetCharge() / constants::e == Approx(+1)); - REQUIRE(GetElectricCharge(Positron::GetAntiParticle()) / constants::e == - Approx(-1)); + REQUIRE(GetElectricCharge(Positron::GetAntiParticle()) / constants::e == Approx(-1)); REQUIRE(Electron::GetName() == "e-"); } } diff --git a/Framework/StackInterface/StackIterator.h b/Framework/StackInterface/StackIterator.h index d7491867..4a951f00 100644 --- a/Framework/StackInterface/StackIterator.h +++ b/Framework/StackInterface/StackIterator.h @@ -111,6 +111,6 @@ namespace corsika::stack { } }; -} // end namespace stack +} // namespace corsika::stack #endif diff --git a/Framework/Units/PhysicalConstants.h b/Framework/Units/PhysicalConstants.h index e8be8197..a666f15e 100644 --- a/Framework/Units/PhysicalConstants.h +++ b/Framework/Units/PhysicalConstants.h @@ -27,37 +27,34 @@ #include <phys/units/quantity.hpp> - - namespace corsika::units::constants { using namespace phys::units; - - // acceleration of free-fall, standard - constexpr phys::units::quantity<phys::units::acceleration_d> g_sub_n{phys::units::Rep(9.80665L) * phys::units::meter / phys::units::square(phys::units::second)}; - // Avogadro constant - constexpr quantity<dimensions<0, 0, 0, 0, 0, -1> > N_sub_A{Rep(6.02214199e+23L) / - mole}; - // electronvolt - constexpr quantity<energy_d> eV{Rep(1.60217733e-19L) * joule}; + // acceleration of free-fall, standard + constexpr phys::units::quantity<phys::units::acceleration_d> g_sub_n{ + phys::units::Rep(9.80665L) * phys::units::meter / + phys::units::square(phys::units::second)}; - // elementary charge - constexpr quantity<electric_charge_d> e{Rep(1.602176462e-19L) * coulomb}; + // Avogadro constant + constexpr quantity<dimensions<0, 0, 0, 0, 0, -1> > N_sub_A{Rep(6.02214199e+23L) / mole}; + // electronvolt + constexpr quantity<energy_d> eV{Rep(1.60217733e-19L) * joule}; - // Planck constant - constexpr quantity<dimensions<2, 1, -1> > h{Rep(6.62606876e-34L) * joule * second}; + // elementary charge + constexpr quantity<electric_charge_d> e{Rep(1.602176462e-19L) * coulomb}; - // speed of light in a vacuum - constexpr quantity<speed_d> c{Rep(299792458L) * meter / second}; + // Planck constant + constexpr quantity<dimensions<2, 1, -1> > h{Rep(6.62606876e-34L) * joule * second}; - // unified atomic mass unit - constexpr quantity<mass_d> u{Rep(1.6605402e-27L) * kilogram}; + // speed of light in a vacuum + constexpr quantity<speed_d> c{Rep(299792458L) * meter / second}; - // etc. + // unified atomic mass unit + constexpr quantity<mass_d> u{Rep(1.6605402e-27L) * kilogram}; - -} // namespace corsika + // etc. -#endif // PHYS_UNITS_PHYSICAL_CONSTANTS_HPP_INCLUDED +} // namespace corsika::units::constants +#endif // PHYS_UNITS_PHYSICAL_CONSTANTS_HPP_INCLUDED diff --git a/Framework/Units/PhysicalUnits.h b/Framework/Units/PhysicalUnits.h index 71858e36..9aeefb15 100644 --- a/Framework/Units/PhysicalUnits.h +++ b/Framework/Units/PhysicalUnits.h @@ -15,23 +15,24 @@ namespace phys { namespace units { namespace literals { - QUANTITY_DEFINE_SCALING_LITERALS(eV, energy_d, magnitude(corsika::units::constants::eV)) + QUANTITY_DEFINE_SCALING_LITERALS(eV, energy_d, + magnitude(corsika::units::constants::eV)) } } // namespace units } // namespace phys - namespace corsika::units { - + using namespace phys::units; using namespace phys::units::literals; - //namespace literals = phys::units::literals; - + // namespace literals = phys::units::literals; + using LengthType = phys::units::quantity<phys::units::length_d, double>; using TimeType = phys::units::quantity<phys::units::time_interval_d, double>; using SpeedType = phys::units::quantity<phys::units::speed_d, double>; using FrequencyType = phys::units::quantity<phys::units::frequency_d, double>; - using ElectricChargeType = phys::units::quantity<phys::units::electric_charge_d, double>; + using ElectricChargeType = + phys::units::quantity<phys::units::electric_charge_d, double>; using EnergyType = phys::units::quantity<phys::units::energy_d, double>; } // end namespace corsika::units diff --git a/Main/shower.cc b/Main/shower.cc index a0f78b5a..7bc09673 100644 --- a/Main/shower.cc +++ b/Main/shower.cc @@ -1,10 +1,3 @@ #include <utl/Stack.h> -int -main(int argc, char** argv) -{ - - - - return 0; -} +int main(int argc, char** argv) { return 0; } diff --git a/Processes/NullModel/NullModel.h b/Processes/NullModel/NullModel.h index 6cbee61a..98782765 100644 --- a/Processes/NullModel/NullModel.h +++ b/Processes/NullModel/NullModel.h @@ -17,7 +17,7 @@ namespace corsika::process { }; } // namespace null_model - -} // namespace process + +} // namespace corsika::process #endif diff --git a/Processes/NullModel/testNullModel.cc b/Processes/NullModel/testNullModel.cc index 469f35c3..311c732c 100644 --- a/Processes/NullModel/testNullModel.cc +++ b/Processes/NullModel/testNullModel.cc @@ -9,5 +9,4 @@ TEST_CASE("NullModel", "[processes]") { SECTION("bla") {} SECTION("blubb") {} - } diff --git a/Processes/Sibyll/ParticleConversion.cc b/Processes/Sibyll/ParticleConversion.cc index 2e8cbdfa..6aca2fcf 100644 --- a/Processes/Sibyll/ParticleConversion.cc +++ b/Processes/Sibyll/ParticleConversion.cc @@ -1,9 +1,9 @@ -#include <corsika/process/sibyll/ParticleConversion.h> #include <corsika/particles/ParticleProperties.h> +#include <corsika/process/sibyll/ParticleConversion.h> using namespace corsika::process::sibyll; -//const std::map<sibyll::PID, ParticleProperties::InternalParticleCode> +// const std::map<sibyll::PID, ParticleProperties::InternalParticleCode> // process::sibyll::Sibyll2Corsika = { // {PID::E_MINUS, InternalParticleCode::Electron}, //}; diff --git a/Processes/Sibyll/ParticleConversion.h b/Processes/Sibyll/ParticleConversion.h index 500ad53e..f39c1297 100644 --- a/Processes/Sibyll/ParticleConversion.h +++ b/Processes/Sibyll/ParticleConversion.h @@ -102,15 +102,15 @@ namespace corsika::process { static const std::map<sibyll::PID, corsika::particles::Code> Sibyll2Corsika = { {PID::E_MINUS, corsika::particles::Code::Electron}, - {PID::E_PLUS, corsika::particles::Code::Positron}, - {PID::NU_E, corsika::particles::Code::NuE}, - {PID::NU_E_BAR, corsika::particles::Code::NuEBar}, - {PID::MU_MINUS, corsika::particles::Code::MuMinus}, - {PID::MU_PLUS, corsika::particles::Code::MuPlus}, - {PID::NU_MU, corsika::particles::Code::NuMu}, - {PID::NU_MU_BAR, corsika::particles::Code::NuMuBar}, - {PID::TAU_MINUS, corsika::particles::Code::TauMinus}, - /* + {PID::E_PLUS, corsika::particles::Code::Positron}, + {PID::NU_E, corsika::particles::Code::NuE}, + {PID::NU_E_BAR, corsika::particles::Code::NuEBar}, + {PID::MU_MINUS, corsika::particles::Code::MuMinus}, + {PID::MU_PLUS, corsika::particles::Code::MuPlus}, + {PID::NU_MU, corsika::particles::Code::NuMu}, + {PID::NU_MU_BAR, corsika::particles::Code::NuMuBar}, + {PID::TAU_MINUS, corsika::particles::Code::TauMinus}, + /* TAU_PLUS = 90, NU_TAU = 92, NU_TAU_BAR = 93, @@ -194,6 +194,6 @@ namespace corsika::process { } // namespace sibyll -} // namespace process +} // namespace corsika::process #endif diff --git a/Stack/SuperStupidStack/SuperStupidStack.h b/Stack/SuperStupidStack/SuperStupidStack.h index a2d7aa38..1f02e908 100644 --- a/Stack/SuperStupidStack/SuperStupidStack.h +++ b/Stack/SuperStupidStack/SuperStupidStack.h @@ -4,18 +4,18 @@ #include <string> #include <vector> -#include <corsika/stack/Stack.h> #include <corsika/particles/ParticleProperties.h> +#include <corsika/stack/Stack.h> #include <corsika/units/PhysicalUnits.h> namespace corsika::stack { namespace super_stupid { - using corsika::units::EnergyType; using corsika::particles::Code; - using corsika::units::operator""_GeV;//literals; - + using corsika::units::EnergyType; + using corsika::units::operator""_GeV; // literals; + /** * Example of a particle object on the stack. */ @@ -92,5 +92,4 @@ namespace corsika::stack { } // namespace corsika::stack - #endif -- GitLab