diff --git a/corsika/detail/framework/random/RNGManager.inl b/corsika/detail/framework/random/RNGManager.inl index a7385ab32ade1a74c8b2f0d5713b43ec8f5a297e..171a8ddcdfb3088e67322f3fdf8b9c20189f73f4 100644 --- a/corsika/detail/framework/random/RNGManager.inl +++ b/corsika/detail/framework/random/RNGManager.inl @@ -12,47 +12,47 @@ namespace corsika { - inline void RNGManager::RegisterRandomStream(std::string const& pStreamName) { + inline void RNGManager::registerRandomStream(std::string const& pStreamName) { RNG rng; - if (auto const& it = seeds.find(pStreamName); it != seeds.end()) { + if (auto const& it = seeds_.find(pStreamName); it != seeds_.end()) { rng.seed(it->second); } - rngs[pStreamName] = std::move(rng); + rngs_[pStreamName] = std::move(rng); } - inline RNG& RNGManager::GetRandomStream(std::string const& pStreamName) { - if (IsRegistered(pStreamName)) { - return rngs.at(pStreamName); + inline RNG& RNGManager::getRandomStream(std::string const& pStreamName) { + if (isRegistered(pStreamName)) { + return rngs_.at(pStreamName); } else { // this stream name is not in the map throw std::runtime_error("'" + pStreamName + "' is not a registered stream."); } } - inline bool RNGManager::IsRegistered(std::string const& pStreamName) const { - return rngs.count(pStreamName) > 0; + inline bool RNGManager::isRegistered(std::string const& pStreamName) const { + return rngs_.count(pStreamName) > 0; } inline std::stringstream RNGManager::dumpState() const { std::stringstream buffer; - for (auto const& [streamName, rng] : rngs) { + for (auto const& [streamName, rng] : rngs_) { buffer << '"' << streamName << "\" = \"" << rng << '"' << std::endl; } return buffer; } - inline void RNGManager::SeedAll(uint64_t vSeed) { - for (auto& entry : rngs) { entry.second.seed(vSeed++); } + inline void RNGManager::seedAll(uint64_t vSeed) { + for (auto& entry : rngs_) { entry.second.seed(vSeed++); } } - inline void RNGManager::SeedAll() { + inline void RNGManager::seedAll(void) { std::random_device rd; std::seed_seq sseq{rd(), rd(), rd(), rd(), rd(), rd()}; - for (auto& entry : rngs) { + for (auto& entry : rngs_) { std::vector<std::uint32_t> seeds(1); sseq.generate(seeds.begin(), seeds.end()); std::uint32_t seed = seeds[0]; diff --git a/corsika/detail/modules/StackInspector.inl b/corsika/detail/modules/StackInspector.inl index a6edb39a5c0c230b17292f4f08d172d696a02723..0767cf15a7285853cf3a8972cab134d15f29e258 100644 --- a/corsika/detail/modules/StackInspector.inl +++ b/corsika/detail/modules/StackInspector.inl @@ -47,7 +47,7 @@ namespace corsika::stack_inspector { Etot += E; if (ReportStack_) { corsika::CoordinateSystem& rootCS = - corsika::RootCoordinateSystem::GetInstance() + corsika::RootCoordinateSystem::getInstance() .GetRootCoordinateSystem(); // for printout auto pos = iterP.GetPosition().GetCoordinates(rootCS); std::cout << "StackInspector: i=" << std::setw(5) << std::fixed << (i++) diff --git a/corsika/detail/modules/pythia8/Decay.inl b/corsika/detail/modules/pythia8/Decay.inl index c0e4d7e0cac7bb1e8585a742eb54aef02b3d5873..8de31e7d57503ce1d5f617317c261f0635765c6d 100644 --- a/corsika/detail/modules/pythia8/Decay.inl +++ b/corsika/detail/modules/pythia8/Decay.inl @@ -81,7 +81,7 @@ namespace corsika::pythia8 { // coordinate system, get global frame of reference corsika::CoordinateSystem& rootCS = - corsika::RootCoordinateSystem::GetInstance().GetRootCoordinateSystem(); + corsika::RootCoordinateSystem::getInstance().GetRootCoordinateSystem(); fCount++; diff --git a/corsika/detail/modules/pythia8/Interaction.inl b/corsika/detail/modules/pythia8/Interaction.inl index 649ea2ad7d4734506f521f8f708f22677c5e1551..331f151f8f145d167eeaa7f7a111616b3fa2ad94 100644 --- a/corsika/detail/modules/pythia8/Interaction.inl +++ b/corsika/detail/modules/pythia8/Interaction.inl @@ -160,7 +160,7 @@ namespace corsika::pythia8 { // coordinate system, get global frame of reference CoordinateSystem& rootCS = - RootCoordinateSystem::GetInstance().GetRootCoordinateSystem(); + RootCoordinateSystem::getInstance().GetRootCoordinateSystem(); const corsika::Code corsikaBeamId = p.GetPID(); @@ -244,7 +244,7 @@ namespace corsika::pythia8 { if (corsika::pythia8::Interaction::CanInteract(corsikaBeamId)) { const CoordinateSystem& rootCS = - RootCoordinateSystem::GetInstance().GetRootCoordinateSystem(); + RootCoordinateSystem::getInstance().GetRootCoordinateSystem(); // position and time of interaction, not used in Sibyll Point pOrig = vP.GetPosition(); diff --git a/corsika/detail/modules/qgsjetII/Interaction.inl b/corsika/detail/modules/qgsjetII/Interaction.inl index ec3ecb0676afa3b0a3757ad92f9eade7ee5ebb3c..3900c95d60dc28eb07bfc8aa9fc541391e0a35d8 100644 --- a/corsika/detail/modules/qgsjetII/Interaction.inl +++ b/corsika/detail/modules/qgsjetII/Interaction.inl @@ -96,7 +96,7 @@ namespace corsika::qgsjetII { // coordinate system, get global frame of reference CoordinateSystem& rootCS = - RootCoordinateSystem::GetInstance().GetRootCoordinateSystem(); + RootCoordinateSystem::getInstance().GetRootCoordinateSystem(); const corsika::Code corsikaBeamId = vP.GetPID(); @@ -171,7 +171,7 @@ namespace corsika::qgsjetII { if (corsika::qgsjetII::CanInteract(corsikaBeamId)) { const CoordinateSystem& rootCS = - RootCoordinateSystem::GetInstance().GetRootCoordinateSystem(); + RootCoordinateSystem::getInstance().GetRootCoordinateSystem(); // position and time of interaction, not used in QgsjetII Point pOrig = vP.GetPosition(); diff --git a/corsika/detail/modules/qgsjetII/qgsjet-II-04.inl b/corsika/detail/modules/qgsjetII/qgsjet-II-04.inl index afb06661d799fb61a69a064a214a9f706c9341be..56578021db0093f8a3c922ffa10004607520c492 100644 --- a/corsika/detail/modules/qgsjetII/qgsjet-II-04.inl +++ b/corsika/detail/modules/qgsjetII/qgsjet-II-04.inl @@ -30,7 +30,7 @@ datadir::datadir(const std::string& dir) { double qgran_(int&) { static corsika::RNG& rng = - corsika::RNGManager::GetInstance().GetRandomStream("qgran"); + corsika::RNGManager::getInstance().GetRandomStream("qgran"); std::uniform_real_distribution<double> dist; return dist(rng); diff --git a/corsika/detail/modules/sibyll/Interaction.inl b/corsika/detail/modules/sibyll/Interaction.inl index 98a52ddca8e531870723d5ddece39bd3195f5efa..1aa26e4159e763b5d7aa81fcf5b69c7d5d68ad9f 100644 --- a/corsika/detail/modules/sibyll/Interaction.inl +++ b/corsika/detail/modules/sibyll/Interaction.inl @@ -110,7 +110,7 @@ namespace corsika::sibyll { // coordinate system, get global frame of reference CoordinateSystem& rootCS = - RootCoordinateSystem::GetInstance().GetRootCoordinateSystem(); + RootCoordinateSystem::getInstance().GetRootCoordinateSystem(); const corsika::Code corsikaBeamId = vP.GetPID(); @@ -193,7 +193,7 @@ namespace corsika::sibyll { if (corsika::sibyll::CanInteract(corsikaBeamId)) { const CoordinateSystem& rootCS = - RootCoordinateSystem::GetInstance().GetRootCoordinateSystem(); + RootCoordinateSystem::getInstance().GetRootCoordinateSystem(); // position and time of interaction, not used in Sibyll Point pOrig = vP.GetPosition(); diff --git a/corsika/detail/modules/sibyll/NuclearInteraction.inl b/corsika/detail/modules/sibyll/NuclearInteraction.inl index 9bf72cf55b24dc5ae8a847543a2bb7b4dc303274..0cd03c264c90531829eeb1d30597407346b12a57 100644 --- a/corsika/detail/modules/sibyll/NuclearInteraction.inl +++ b/corsika/detail/modules/sibyll/NuclearInteraction.inl @@ -211,7 +211,7 @@ namespace corsika::sibyll { // coordinate system, get global frame of reference CoordinateSystem& rootCS = - RootCoordinateSystem::GetInstance().GetRootCoordinateSystem(); + RootCoordinateSystem::getInstance().GetRootCoordinateSystem(); const corsika::Code corsikaBeamId = vP.GetPID(); @@ -334,7 +334,7 @@ namespace corsika::sibyll { count_++; const CoordinateSystem& rootCS = - RootCoordinateSystem::GetInstance().GetRootCoordinateSystem(); + RootCoordinateSystem::getInstance().GetRootCoordinateSystem(); // position and time of interaction, not used in NUCLIB Point pOrig = vP.GetPosition(); diff --git a/corsika/framework/core/Cascade.hpp b/corsika/framework/core/Cascade.hpp index e66448d6f59527dbfe220d1ffe2788fae3aa0a35..27b665f6c0708e639ae7d8e9a2142bd4f85f6391 100644 --- a/corsika/framework/core/Cascade.hpp +++ b/corsika/framework/core/Cascade.hpp @@ -110,7 +110,7 @@ namespace corsika { TTracking& fTracking; TProcessList& fProcessSequence; TStack& fStack; - corsika::RNG& fRNG = corsika::RNGManager::GetInstance().GetRandomStream("cascade"); + corsika::RNG& fRNG = corsika::RNGManager::getInstance().getRandomStream("cascade"); }; } // namespace corsika diff --git a/corsika/framework/random/ExponentialDistribution.hpp b/corsika/framework/random/ExponentialDistribution.hpp index ae7d89ad8866ad4371ed5bc52695a37f35d7d98d..0dc7f4d575f18b6100042ee84e9442475395e0d2 100644 --- a/corsika/framework/random/ExponentialDistribution.hpp +++ b/corsika/framework/random/ExponentialDistribution.hpp @@ -20,17 +20,17 @@ namespace corsika { template <class TQuantity> class ExponentialDistribution { using RealType = typename TQuantity::value_type; - std::exponential_distribution<RealType> dist{1.}; + std::exponential_distribution<RealType> dist_{1.}; - TQuantity const fBeta; + TQuantity const beta_; public: ExponentialDistribution(TQuantity beta) - : fBeta(beta) {} + : beta_(beta) {} template <class Generator> TQuantity operator()(Generator& g) { - return fBeta * dist(g); + return beta_ * dist_(g); } }; diff --git a/corsika/framework/random/RNGManager.hpp b/corsika/framework/random/RNGManager.hpp index 4778c179dd172ab13499ef5eded3db66ebec70f6..0c6ebfd9c67b3f1a64121ce611bf49e50eb98399 100644 --- a/corsika/framework/random/RNGManager.hpp +++ b/corsika/framework/random/RNGManager.hpp @@ -31,8 +31,8 @@ namespace corsika { friend class corsika::Singleton<RNGManager>; - std::map<std::string, RNG> rngs; - std::map<std::string, std::seed_seq> seeds; + std::map<std::string, RNG> rngs_; + std::map<std::string, std::seed_seq> seeds_; protected: RNGManager() {} // why ? @@ -44,18 +44,18 @@ namespace corsika { * * \throws sth. when stream \a pModuleName is already registered */ - void RegisterRandomStream(std::string const& pStreamName); + void registerRandomStream(std::string const& pStreamName); /*! * returns the pre-stored stream of given name \a pStreamName if * available */ - RNG& GetRandomStream(std::string const& pStreamName); + RNG& getRandomStream(std::string const& pStreamName); /*! * Check whether a stream has been registered. */ - bool IsRegistered(std::string const& pStreamName) const; + bool isRegistered(std::string const& pStreamName) const; /*! * dumps the names and states of all registered random-number streams @@ -67,9 +67,9 @@ namespace corsika { * Set explicit seeds for all currently registered streams. The actual seed values * are incremented from \a vSeed. */ - void SeedAll(uint64_t vSeed); + void seedAll(uint64_t vSeed); - void SeedAll(); //!< seed all currently registered streams with "real" randomness + void seedAll(void); //!< seed all currently registered streams with "real" randomness }; } // namespace corsika diff --git a/corsika/framework/random/UniformRealDistribution.hpp b/corsika/framework/random/UniformRealDistribution.hpp index 666411a52bf87d8c6bb9eb77c4d3c336c0e1c89c..3ea701b0497bb0db1249f23003f25d8b09ce45a9 100644 --- a/corsika/framework/random/UniformRealDistribution.hpp +++ b/corsika/framework/random/UniformRealDistribution.hpp @@ -21,21 +21,21 @@ namespace corsika { template <class TQuantity> class UniformRealDistribution { using RealType = typename TQuantity::value_type; - std::uniform_real_distribution<RealType> dist{RealType(0.), RealType(1.)}; + std::uniform_real_distribution<RealType> dist_{RealType(0.), RealType(1.)}; - TQuantity const a, b; + TQuantity const min_, max_; public: UniformRealDistribution(TQuantity b) - : a{TQuantity(phys::units::detail::magnitude_tag, 0)} - , b(b) {} + : min_{TQuantity(phys::units::detail::magnitude_tag, 0)} + , max_(b) {} UniformRealDistribution(TQuantity a, TQuantity b) - : a(a) - , b(b) {} + : min_(a) + , max_(b) {} template <class Generator> TQuantity operator()(Generator& g) { - return a + dist(g) * (b - a); + return min_ + dist_(g) * (max_ - min_); } }; diff --git a/corsika/framework/utility/Singleton.hpp b/corsika/framework/utility/Singleton.hpp index 7c81cd3050a4c30c0b076bc73dcb68aad8049946..d8d214caa5a36141148ea338eac8acb2f294799b 100644 --- a/corsika/framework/utility/Singleton.hpp +++ b/corsika/framework/utility/Singleton.hpp @@ -41,7 +41,7 @@ namespace corsika { template <typename T> class Singleton { public: - static T& GetInstance() { + static T& getInstance() { static T instance; return instance; } diff --git a/corsika/media/Environment.hpp b/corsika/media/Environment.hpp index 4a241d886435786d4ec288d448556b45f87037b4..51cae1847d7ff5fc48d09f17b459bbd740626019 100644 --- a/corsika/media/Environment.hpp +++ b/corsika/media/Environment.hpp @@ -25,7 +25,7 @@ namespace corsika { Environment() : fCoordinateSystem( - corsika::RootCoordinateSystem::GetInstance().GetRootCoordinateSystem()) + corsika::RootCoordinateSystem::getInstance().GetRootCoordinateSystem()) , fUniverse(std::make_unique<BaseNodeType>( std::make_unique<Universe>(fCoordinateSystem))) {} diff --git a/corsika/modules/HadronicElasticModel.hpp b/corsika/modules/HadronicElasticModel.hpp index 0789ab6b269ac7a375774ea0c7ba4d9833626eee..6ea5250749b52e0ed7d9ef3c83e1a847d5bdc130 100644 --- a/corsika/modules/HadronicElasticModel.hpp +++ b/corsika/modules/HadronicElasticModel.hpp @@ -40,7 +40,7 @@ namespace corsika::hadronic_elastic_model { using inveV2 = decltype(1 / square(electronvolt)); corsika::RNG& fRNG = - corsika::RNGManager::GetInstance().GetRandomStream("HadronicElasticModel"); + corsika::RNGManager::getInstance().getRandomStream("HadronicElasticModel"); inveV2 B(eV2 s) const; CrossSectionType CrossSection(SquaredHEPEnergyType s) const; diff --git a/corsika/modules/pythia8/Interaction.hpp b/corsika/modules/pythia8/Interaction.hpp index e76a46508dd7ee5043a9d2855cf345b9d35ab05c..d2639b9f9b182bbfe8a9ffea303ff01fd924f212 100644 --- a/corsika/modules/pythia8/Interaction.hpp +++ b/corsika/modules/pythia8/Interaction.hpp @@ -55,7 +55,7 @@ namespace corsika::pythia8 { corsika::EProcessReturn DoInteraction(TProjectile&); private: - corsika::RNG& fRNG = corsika::RNGManager::GetInstance().GetRandomStream("pythia"); + corsika::RNG& fRNG = corsika::RNGManager::getInstance().getRandomStream("pythia"); Pythia8::Pythia fPythia; Pythia8::SigmaTotal fSigma; const bool fInternalDecays = true; diff --git a/corsika/modules/pythia8/Random.hpp b/corsika/modules/pythia8/Random.hpp index 75d9681eeb7c79f51fdbf15567cd083aafa81bc7..1cad31b2f4518fc9f86d6fc7d858487e209df028 100644 --- a/corsika/modules/pythia8/Random.hpp +++ b/corsika/modules/pythia8/Random.hpp @@ -19,7 +19,7 @@ namespace corsika::pythia8 { private: std::uniform_real_distribution<double> fDist; - corsika::RNG& fRNG = corsika::RNGManager::GetInstance().GetRandomStream("pythia"); + corsika::RNG& fRNG = corsika::RNGManager::getInstance().getRandomStream("pythia"); }; } // namespace corsika::pythia8 diff --git a/corsika/modules/qgsjetII/Interaction.hpp b/corsika/modules/qgsjetII/Interaction.hpp index 6a129d609d40c25a4f9477ce4595b82b3ed67327..4e0ed339782636a3373083a553e95305923de037 100644 --- a/corsika/modules/qgsjetII/Interaction.hpp +++ b/corsika/modules/qgsjetII/Interaction.hpp @@ -55,7 +55,7 @@ namespace corsika::qgsjetII { corsika::EProcessReturn DoInteraction(TProjectile&); private: - corsika::RNG& fRNG = corsika::RNGManager::GetInstance().GetRandomStream("qgran"); + corsika::RNG& fRNG = corsika::RNGManager::getInstance().getRandomStream("qgran"); const int maxMassNumber_ = 208; }; diff --git a/corsika/modules/qgsjetII/Random.hpp b/corsika/modules/qgsjetII/Random.hpp index 626a5e274337da1f5dd6e22862d965eda7286cd3..5941b190e473f9a539354bf0a088f43d5a74204c 100644 --- a/corsika/modules/qgsjetII/Random.hpp +++ b/corsika/modules/qgsjetII/Random.hpp @@ -15,7 +15,7 @@ namespace qgsjetII { double rndm_interface() { static corsika::RNG& rng = - corsika::RNGManager::GetInstance().GetRandomStream("qgran"); + corsika::RNGManager::getInstance().getRandomStream("qgran"); std::uniform_real_distribution<double> dist; return dist(rng); } diff --git a/corsika/modules/sibyll/Interaction.hpp b/corsika/modules/sibyll/Interaction.hpp index ce091811cf96453b962a71e94a5f932dedc76a27..05d3ad33dbe0c0634d59e073a1d4ed4cab16bb1b 100644 --- a/corsika/modules/sibyll/Interaction.hpp +++ b/corsika/modules/sibyll/Interaction.hpp @@ -65,7 +65,7 @@ namespace corsika::sibyll { corsika::EProcessReturn DoInteraction(TProjectile&); private: - corsika::RNG& RNG_ = corsika::RNGManager::GetInstance().GetRandomStream("s_rndm"); + corsika::RNG& RNG_ = corsika::RNGManager::getInstance().getRandomStream("s_rndm"); // FOR NOW keep trackedParticles private, could be configurable std::vector<corsika::Code> const trackedParticles_ = { corsika::Code::PiPlus, corsika::Code::PiMinus, corsika::Code::Pi0, diff --git a/corsika/modules/sibyll/NuclearInteraction.hpp b/corsika/modules/sibyll/NuclearInteraction.hpp index d7f75d90bf4a481160e3ddacc1104eecdfe1b5b2..d273d1bf827f59e64b42b5a6ae1d965fc7856bf2 100644 --- a/corsika/modules/sibyll/NuclearInteraction.hpp +++ b/corsika/modules/sibyll/NuclearInteraction.hpp @@ -56,7 +56,7 @@ namespace corsika::sibyll { TEnvironment const& environment_; corsika::sibyll::Interaction& hadronicInteraction_; std::map<corsika::Code, int> targetComponentsIndex_; - corsika::RNG& RNG_ = corsika::RNGManager::GetInstance().GetRandomStream("s_rndm"); + corsika::RNG& RNG_ = corsika::RNGManager::getInstance().getRandomStream("s_rndm"); static constexpr unsigned int gNSample_ = 500; // number of samples in MC estimation of cross section static constexpr unsigned int gMaxNucleusAProjectile_ = 56; diff --git a/corsika/modules/sibyll/Random.hpp b/corsika/modules/sibyll/Random.hpp index cfa3b071e8c39061cc3c47ee1fbd66f8e12471e9..475d7e5c73f208a8d75c58af2f13ba4e967882c0 100644 --- a/corsika/modules/sibyll/Random.hpp +++ b/corsika/modules/sibyll/Random.hpp @@ -15,7 +15,7 @@ namespace sibyll { double rndm_interface() { static corsika::RNG& rng = - corsika::RNGManager::GetInstance().GetRandomStream("s_rndm"); + corsika::RNGManager::getInstance().getRandomStream("s_rndm"); std::uniform_real_distribution<double> dist; return dist(rng); } diff --git a/corsika/modules/sibyll/SibStack.hpp b/corsika/modules/sibyll/SibStack.hpp index 9240995d0fa91abc482e7473054ce2779b7fc48b..3c2b1c0d12ddb95b1a4da541e34b1adf53d40588 100644 --- a/corsika/modules/sibyll/SibStack.hpp +++ b/corsika/modules/sibyll/SibStack.hpp @@ -46,7 +46,7 @@ namespace corsika::sibyll { HEPEnergyType GetMass(const unsigned int i) const { return s_plist_.p[4][i] * 1_GeV; } MomentumVector GetMomentum(const unsigned int i) const { CoordinateSystem& rootCS = - RootCoordinateSystem::GetInstance().GetRootCoordinateSystem(); + RootCoordinateSystem::getInstance().GetRootCoordinateSystem(); QuantityVector<hepmomentum_d> components = { s_plist_.p[0][i] * 1_GeV, s_plist_.p[1][i] * 1_GeV, s_plist_.p[2][i] * 1_GeV}; return MomentumVector(rootCS, components); diff --git a/corsika/modules/urqmd/Random.hpp b/corsika/modules/urqmd/Random.hpp index 0754d11ee7061bf08742d85e8a2ebbfa28a1dde6..3a1d8e347be09231669311a2fe379bd78a4c3370 100644 --- a/corsika/modules/urqmd/Random.hpp +++ b/corsika/modules/urqmd/Random.hpp @@ -18,7 +18,7 @@ namespace urqmd { */ double rndm_interface() { static corsika::RNG& rng = - corsika::RNGManager::GetInstance().GetRandomStream("UrQMD"); + corsika::RNGManager::getInstance().getRandomStream("UrQMD"); static std::uniform_real_distribution<double> dist; return dist(rng); } diff --git a/corsika/modules/urqmd/UrQMD.hpp b/corsika/modules/urqmd/UrQMD.hpp index 55fc39e7eb0d2a7e71d852ea9e1d4e6847177664..42ad785c84e7fd1d4304c6e1b1d4277fac00c3af 100644 --- a/corsika/modules/urqmd/UrQMD.hpp +++ b/corsika/modules/urqmd/UrQMD.hpp @@ -38,7 +38,7 @@ namespace corsika::urqmd { private: static CrossSectionType GetCrossSection(corsika::Code, corsika::Code, HEPEnergyType, int); - corsika::RNG& fRNG = corsika::RNGManager::GetInstance().GetRandomStream("UrQMD"); + corsika::RNG& fRNG = corsika::RNGManager::getInstance().getRandomStream("UrQMD"); std::uniform_int_distribution<int> fBooleanDist{0, 1}; }; diff --git a/corsika/stack/SuperStupidStack.hpp b/corsika/stack/SuperStupidStack.hpp index 34251a82be64b1fb29354590b69b398326637d4a..ffa0e4cb20b33a2534624e3d6b0462ddd4931af7 100644 --- a/corsika/stack/SuperStupidStack.hpp +++ b/corsika/stack/SuperStupidStack.hpp @@ -22,259 +22,193 @@ namespace corsika { - -/** - * Example of a particle object on the stack. - */ - -template <typename StackIteratorInterface> -struct ParticleInterface : public ParticleBase<StackIteratorInterface> { - -private: - - typedef corsika::ParticleBase<StackIteratorInterface> super_type; - -public: - - typedef corsika::Vector<corsika::units::si::hepmomentum_d> momentum_vector_type; - - std::string as_string() const { - using namespace corsika::units::si; - return fmt::format("particle: i={}, PID={}, E={}GeV", super_type::GetIndex(), - particles::GetName(this->getPID()), this->getEnergy() / 1_GeV); - } - - void setParticleData( std::tuple<corsika::Code, corsika::units::si::HEPEnergyType, - momentum_vector_type, corsika::Point, corsika::units::si::TimeType> const& v) { - this->setPID(std::get<0>(v)); - this->setEnergy(std::get<1>(v)); - this->setMomentum(std::get<2>(v)); - this->setPosition(std::get<3>(v)); - this->setTime(std::get<4>(v)); - } - - void setParticleData( ParticleInterface<StackIteratorInterface> const&, - std::tuple<corsika::Code, corsika::units::si::HEPEnergyType, - momentum_vector_type, corsika::Point, corsika::units::si::TimeType> const& v) { - this->setPID(std::get<0>(v)); - this->setEnergy(std::get<1>(v)); - this->setMomentum(std::get<2>(v)); - this->setPosition(std::get<3>(v)); - this->setTime(std::get<4>(v)); - } - - /// individual setters - void setPID(const corsika::Code id) { - super_type::GetStackData().setPID(super_type::GetIndex(), id); - } - void setEnergy(const corsika::units::si::HEPEnergyType& e) { - super_type::GetStackData().setEnergy(super_type::GetIndex(), e); - } - void setMomentum(const momentum_vector_type& v) { - super_type::GetStackData().setMomentum(super_type::GetIndex(), v); - } - void setPosition(const corsika::Point& v) { - super_type::GetStackData().setPosition(super_type::GetIndex(), v); - } - void setTime(const corsika::units::si::TimeType& v) { - super_type::GetStackData().setTime(super_type::GetIndex(), v); - } - - /// individual getters - corsika::Code getPID() const { - return super_type::GetStackData().getPID(super_type::GetIndex()); - } - corsika::units::si::HEPEnergyType getEnergy() const { - return super_type::GetStackData().getEnergy(super_type::GetIndex()); - } - momentum_vector_type getMomentum() const { - return super_type::GetStackData().getMomentum(super_type::GetIndex()); - } - corsika::Point getPosition() const { - return super_type::GetStackData().getPosition(super_type::GetIndex()); - } - corsika::units::si::TimeType getTime() const { - return super_type::GetStackData().getTime(super_type::GetIndex()); - } - /** - * @name derived quantities - * - * @{ - */ - corsika::Vector<corsika::units::si::dimensionless_d> getDirection() const { - return this->getMomentum() / this->getEnergy(); - } - - corsika::units::si::HEPMassType getMass() const { - return corsika::GetMass(this->getPID()); - } - - int16_t getChargeNumber() const { - return corsika::GetChargeNumber(this->getPID()); - } - ///@} -}; - -/** - * Memory implementation of the most simple (stupid) particle stack object. - * - */ - -class SuperStupidStackImpl { - -public: - - typedef corsika::Vector<corsika::units::si::hepmomentum_d> momentum_type; - typedef std::vector<corsika::Code> code_vector_type; - typedef std::vector<corsika::units::si::HEPEnergyType> energy_vector_type; - typedef std::vector<corsika::Point> point_vector_type; - typedef std::vector<corsika::units::si::TimeType> time_vector_type; - typedef std::vector<momentum_type> momentum_vector_type; - - SuperStupidStackImpl()=default; - - SuperStupidStackImpl( SuperStupidStackImpl const& other)=default; - - SuperStupidStackImpl( SuperStupidStackImpl && other)=default; - - - SuperStupidStackImpl& operator=( SuperStupidStackImpl const& other)=default; - - SuperStupidStackImpl& operator=( SuperStupidStackImpl && other)=default; - - - void init() {} - void dump() const {} - - void clear() { - dataPID_.clear(); - dataE_.clear(); - momentum_.clear(); - position_.clear(); - time_.clear(); - } - - unsigned int getSize() const { return dataPID_.size(); } - unsigned int getCapacity() const { return dataPID_.size(); } - - void setPID(size_t i, const corsika::Code id) { - dataPID_[i] = id; - } - void setEnergy(size_t i, corsika::units::si::HEPEnergyType const& e) { - dataE_[i] = e; - } - void setMomentum(size_t i, momentum_type const& v) { - momentum_[i] = v; - } - void setPosition(size_t i, corsika::Point const& v) { - position_[i] = v; - } - void setTime(size_t i, corsika::units::si::TimeType const& v) { - time_[i] = v; - } - - corsika::Code getPID(size_t i) const { - return dataPID_[i]; - } - - corsika::units::si::HEPEnergyType getEnergy(size_t i) const { - return dataE_[i]; - } - - momentum_type getMomentum(size_t i) const { - return momentum_[i]; - } - - corsika::Point getPosition(size_t i) const { - return position_[i]; - } - corsika::units::si::TimeType getTime(size_t i) const { - return time_[i]; - } - - corsika::units::si::HEPEnergyType getDataE(size_t i) const { - return dataE_[i]; - } - - void setDataE(size_t i, corsika::units::si::HEPEnergyType const& dataE) { - dataE_[i] = dataE; - } - - corsika::Code getDataPid(size_t i) const { - return dataPID_; - } - - void setDataPid(size_t i, corsika::Code const& dataPid) { - dataPID_[i] = dataPid; - } - /** - * Function to copy particle at location i2 in stack to i1 - */ - void copy(size_t i1, size_t i2) { - dataPID_[i2] = dataPID_[i1]; - dataE_[i2] = dataE_[i1]; - momentum_[i2] = momentum_[i1]; - position_[i2] = position_[i1]; - time_[i2] = time_[i1]; - } - - - /** - * FIXME: change to iterators. - * Function to copy particle at location i2 in stack to i1 - */ - void swap(size_t i1, size_t i2) { - std::swap(dataPID_[i2] , dataPID_[i1]); - std::swap(dataE_[i2] , dataE_[i1]); - std::swap(momentum_[i2], momentum_[i1]); - std::swap(position_[i2], position_[i1]); - std::swap(time_[i2] , time_[i1]); - } - - void incrementSize() { - using corsika::Point; - using corsika::Code; - - dataPID_.push_back(Code::Unknown); - dataE_.push_back(0 * corsika::units::si::electronvolt); - - CoordinateSystem& dummyCS = RootCoordinateSystem::GetInstance().GetRootCoordinateSystem(); - - momentum_.push_back(momentum_type( dummyCS, - {0 * corsika::units::si::electronvolt, 0 * corsika::units::si::electronvolt, - 0 * corsika::units::si::electronvolt})); - - position_.push_back( - Point(dummyCS, {0 * corsika::units::si::meter, 0 * corsika::units::si::meter, - 0 * corsika::units::si::meter})); - time_.push_back(0 * corsika::units::si::second); - } - - void decrementSize() { - if (dataE_.size() > 0) { - dataPID_.pop_back(); - dataE_.pop_back(); - momentum_.pop_back(); - position_.pop_back(); - time_.pop_back(); - } - } - - -private: - - /// the actual memory to store particle data - code_vector_type dataPID_; - energy_vector_type dataE_; - momentum_vector_type momentum_; - point_vector_type position_; - time_vector_type time_; - -}; // end class SuperStupidStackImpl - - -typedef Stack<SuperStupidStackImpl, ParticleInterface> SuperStupidStack; - + typedef corsika::Vector<hepmomentum_d> MomentumVector; + + namespace super_stupid { + + /** + * Example of a particle object on the stack. + */ + + template <typename StackIteratorInterface> + class ParticleInterface : public ParticleBase<StackIteratorInterface> { + + protected: + using corsika::ParticleBase<StackIteratorInterface>::GetStack; + using corsika::ParticleBase<StackIteratorInterface>::GetStackData; + + public: + using corsika::ParticleBase<StackIteratorInterface>::GetIndex; + + public: + void SetParticleData(const std::tuple<corsika::Code, HEPEnergyType, MomentumVector, + corsika::Point, TimeType>& v) { + SetPID(std::get<0>(v)); + SetEnergy(std::get<1>(v)); + SetMomentum(std::get<2>(v)); + SetPosition(std::get<3>(v)); + SetTime(std::get<4>(v)); + } + /* + void SetParticleData(const corsika::Code vDataPID, + const HEPEnergyType vDataE, + const MomentumVector& vMomentum, + const corsika::Point& vPosition, + const TimeType vTime) { + }*/ + + void SetParticleData(ParticleInterface<StackIteratorInterface>&, + const std::tuple<corsika::Code, HEPEnergyType, MomentumVector, + corsika::Point, TimeType>& v) { + SetPID(std::get<0>(v)); + SetEnergy(std::get<1>(v)); + SetMomentum(std::get<2>(v)); + SetPosition(std::get<3>(v)); + SetTime(std::get<4>(v)); + } + /* void SetParticleData(ParticleInterface<StackIteratorInterface>&, + const corsika::Code vDataPID, + const HEPEnergyType vDataE, + const MomentumVector& vMomentum, + const corsika::Point& vPosition, + const TimeType vTime) { + SetPID(vDataPID); + SetEnergy(vDataE); + SetMomentum(vMomentum); + SetPosition(vPosition); + SetTime(vTime); + }*/ + + /// individual setters + void SetPID(const corsika::Code id) { GetStackData().SetPID(GetIndex(), id); } + void SetEnergy(const HEPEnergyType& e) { GetStackData().SetEnergy(GetIndex(), e); } + void SetMomentum(const MomentumVector& v) { + GetStackData().SetMomentum(GetIndex(), v); + } + void SetPosition(const corsika::Point& v) { + GetStackData().SetPosition(GetIndex(), v); + } + void SetTime(const TimeType& v) { GetStackData().SetTime(GetIndex(), v); } + + /// individual getters + corsika::Code GetPID() const { return GetStackData().GetPID(GetIndex()); } + HEPEnergyType GetEnergy() const { return GetStackData().GetEnergy(GetIndex()); } + MomentumVector GetMomentum() const { + return GetStackData().GetMomentum(GetIndex()); + } + corsika::Point GetPosition() const { + return GetStackData().GetPosition(GetIndex()); + } + TimeType GetTime() const { return GetStackData().GetTime(GetIndex()); } + /** + * @name derived quantities + * + * @{ + */ + corsika::Vector<dimensionless_d> GetDirection() const { + return GetMomentum() / GetEnergy(); + } + HEPMassType GetMass() const { return corsika::GetMass(GetPID()); } + int16_t GetChargeNumber() const { return corsika::GetChargeNumber(GetPID()); } + ///@} + }; + + /** + * Memory implementation of the most simple (stupid) particle stack object. + */ + + class SuperStupidStackImpl { + + public: + void Init() {} + void Dump() const {} + + void Clear() { + fDataPID.clear(); + fDataE.clear(); + fMomentum.clear(); + fPosition.clear(); + fTime.clear(); + } + + unsigned int GetSize() const { return fDataPID.size(); } + unsigned int GetCapacity() const { return fDataPID.size(); } + + void SetPID(const unsigned int i, const corsika::Code id) { fDataPID[i] = id; } + void SetEnergy(const unsigned int i, const HEPEnergyType e) { fDataE[i] = e; } + void SetMomentum(const unsigned int i, const MomentumVector& v) { + fMomentum[i] = v; + } + void SetPosition(const unsigned int i, const corsika::Point& v) { + fPosition[i] = v; + } + void SetTime(const unsigned int i, const TimeType& v) { fTime[i] = v; } + + corsika::Code GetPID(const unsigned int i) const { return fDataPID[i]; } + HEPEnergyType GetEnergy(const unsigned int i) const { return fDataE[i]; } + MomentumVector GetMomentum(const unsigned int i) const { return fMomentum[i]; } + corsika::Point GetPosition(const unsigned int i) const { return fPosition[i]; } + TimeType GetTime(const unsigned int i) const { return fTime[i]; } + + /** + * Function to copy particle at location i2 in stack to i1 + */ + void Copy(const unsigned int i1, const unsigned int i2) { + fDataPID[i2] = fDataPID[i1]; + fDataE[i2] = fDataE[i1]; + fMomentum[i2] = fMomentum[i1]; + fPosition[i2] = fPosition[i1]; + fTime[i2] = fTime[i1]; + } + + /** + * Function to copy particle at location i2 in stack to i1 + */ + void Swap(const unsigned int i1, const unsigned int i2) { + std::swap(fDataPID[i2], fDataPID[i1]); + std::swap(fDataE[i2], fDataE[i1]); + std::swap(fMomentum[i2], fMomentum[i1]); + std::swap(fPosition[i2], fPosition[i1]); + std::swap(fTime[i2], fTime[i1]); + } + + void IncrementSize() { + using corsika::Code; + using corsika::Point; + fDataPID.push_back(Code::Unknown); + fDataE.push_back(0 * electronvolt); + CoordinateSystem& dummyCS = + RootCoordinateSystem::getInstance().GetRootCoordinateSystem(); + fMomentum.push_back(MomentumVector( + dummyCS, {0 * electronvolt, 0 * electronvolt, 0 * electronvolt})); + fPosition.push_back(Point(dummyCS, {0 * meter, 0 * meter, 0 * meter})); + fTime.push_back(0 * second); + } + + void DecrementSize() { + if (fDataE.size() > 0) { + fDataPID.pop_back(); + fDataE.pop_back(); + fMomentum.pop_back(); + fPosition.pop_back(); + fTime.pop_back(); + } + } + + private: + /// the actual memory to store particle data + + std::vector<corsika::Code> fDataPID; + std::vector<HEPEnergyType> fDataE; + std::vector<MomentumVector> fMomentum; + std::vector<corsika::Point> fPosition; + std::vector<TimeType> fTime; + + }; // end class SuperStupidStackImpl + + typedef Stack<SuperStupidStackImpl, ParticleInterface> SuperStupidStack; + + } // namespace super_stupid } // namespace corsika diff --git a/examples/boundary_example.cpp b/examples/boundary_example.cpp index 2096ddce4b68b03d29d41ae9051b95e979b50717..56b1b326552465f57155a3895f1d2d7fd79972ea 100644 --- a/examples/boundary_example.cpp +++ b/examples/boundary_example.cpp @@ -69,7 +69,7 @@ private: int main() { feenableexcept(FE_INVALID); // initialize random number sequence(s) - corsika::RNGManager::GetInstance().RegisterRandomStream("cascade"); + corsika::RNGManager::getInstance().registerRandomStream("cascade"); // setup environment, geometry using EnvType = Environment<setup::IEnvironmentModel>; @@ -100,7 +100,7 @@ int main() { // setup processes, decays and interactions tracking_line::TrackingLine tracking; - RNGManager::GetInstance().RegisterRandomStream("s_rndm"); + RNGManager::getInstance().registerRandomStream("s_rndm"); corsika::sibyll::Interaction sibyll; corsika::sibyll::Decay decay; diff --git a/examples/cascade_example.cpp b/examples/cascade_example.cpp index 41233a03df708227de8e96d00cfb5cfd159abed4..e5433c8263669c91501ef8cabda9c9aaf534e841 100644 --- a/examples/cascade_example.cpp +++ b/examples/cascade_example.cpp @@ -44,7 +44,7 @@ int main() { feenableexcept(FE_INVALID); // initialize random number sequence(s) - corsika::RNGManager::GetInstance().RegisterRandomStream("cascade"); + corsika::RNGManager::getInstance().registerRandomStream("cascade"); // setup environment, geometry using EnvType = corsika::Environment<setup::IEnvironmentModel>; @@ -115,8 +115,8 @@ int main() { tracking_line::TrackingLine tracking; stack_inspector::StackInspector<setup::Stack> stackInspect(1, true, E0); - corsika::RNGManager::GetInstance().RegisterRandomStream("s_rndm"); - corsika::RNGManager::GetInstance().RegisterRandomStream("pythia"); + corsika::RNGManager::getInstance().registerRandomStream("s_rndm"); + corsika::RNGManager::getInstance().registerRandomStream("pythia"); corsika::sibyll::Interaction sibyll; corsika::sibyll::NuclearInteraction sibyllNuc(sibyll, env); corsika::sibyll::Decay decay; diff --git a/examples/cascade_proton_example.cpp b/examples/cascade_proton_example.cpp index 56ad016399ae1c0f6e6132c83d3c4040c80af28b..87e4f47afc37fb70aee8e7ef83e619017bc647d9 100644 --- a/examples/cascade_proton_example.cpp +++ b/examples/cascade_proton_example.cpp @@ -44,7 +44,7 @@ using namespace std; int main() { feenableexcept(FE_INVALID); // initialize random number sequence(s) - corsika::RNGManager::GetInstance().RegisterRandomStream("cascade"); + corsika::RNGManager::getInstance().registerRandomStream("cascade"); // setup environment, geometry using EnvType = Environment<setup::IEnvironmentModel>; @@ -103,8 +103,8 @@ int main() { corsika::Code::PiPlus, corsika::Code::PiMinus, corsika::Code::KPlus, corsika::Code::KMinus, corsika::Code::K0Long, corsika::Code::K0Short}; - corsika::RNGManager::GetInstance().RegisterRandomStream("s_rndm"); - corsika::RNGManager::GetInstance().RegisterRandomStream("pythia"); + corsika::RNGManager::getInstance().registerRandomStream("s_rndm"); + corsika::RNGManager::getInstance().registerRandomStream("pythia"); // corsika::sibyll::Interaction sibyll(env); corsika::pythia8::Interaction pythia; // corsika::sibyll::NuclearInteraction sibyllNuc(env, sibyll); @@ -112,7 +112,7 @@ int main() { corsika::pythia8::Decay decay(trackedHadrons); corsika::particle_cut::ParticleCut cut(20_GeV); - // corsika::RNGManager::GetInstance().RegisterRandomStream("HadronicElasticModel"); + // corsika::RNGManager::getInstance().registerRandomStream("HadronicElasticModel"); // corsika::HadronicElasticModel::HadronicElasticInteraction // hadronicElastic(env); diff --git a/examples/geometry_example.cpp b/examples/geometry_example.cpp index e2d7e284f941e83905f90f69a44b4ed5c8072926..5eb68de94b954456eb4e173fd8956492e3308bb7 100644 --- a/examples/geometry_example.cpp +++ b/examples/geometry_example.cpp @@ -25,7 +25,7 @@ int main() { // define the root coordinate system corsika::CoordinateSystem& root = - corsika::RootCoordinateSystem::GetInstance().GetRootCoordinateSystem(); + corsika::RootCoordinateSystem::getInstance().GetRootCoordinateSystem(); // another CS defined by a translation relative to the root CS CoordinateSystem cs2 = root.translate({0_m, 0_m, 1_m}); diff --git a/examples/helix_example.cpp b/examples/helix_example.cpp index 357e791afbe57610a3abeb700453a9aa1bfdd0fa..364b7f6039f948da8143cdd5180d469139e17695 100644 --- a/examples/helix_example.cpp +++ b/examples/helix_example.cpp @@ -21,7 +21,7 @@ using namespace corsika::units::si; int main() { corsika::CoordinateSystem& root = - corsika::RootCoordinateSystem::GetInstance().GetRootCoordinateSystem(); + corsika::RootCoordinateSystem::getInstance().GetRootCoordinateSystem(); Point const r0(root, {0_m, 0_m, 0_m}); auto const omegaC = 2 * M_PI * 1_Hz; diff --git a/examples/logger_example.cpp b/examples/logger_example.cpp index 3270277c3db799febd270492a7d1715014b70d75..5da1496e8be6b33168f6139a10b648b9796b579c 100644 --- a/examples/logger_example.cpp +++ b/examples/logger_example.cpp @@ -26,7 +26,7 @@ int main() { // logger<ostream,messageconst,StdBuffer> info(std::cout, StdBuffer(10000)); /* - Logging& logs = Logging::GetInstance(); + 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 diff --git a/examples/stack_example.cpp b/examples/stack_example.cpp index bee9dd3674df07d82a754453a2d1591bc395cf60..7d97400273732abd785fe8e1c7475885320b4a51 100644 --- a/examples/stack_example.cpp +++ b/examples/stack_example.cpp @@ -22,7 +22,7 @@ using namespace std; void fill(corsika::super_stupid::SuperStupidStack& s) { const corsika::CoordinateSystem& rootCS = - corsika::RootCoordinateSystem::GetInstance().GetRootCoordinateSystem(); + corsika::RootCoordinateSystem::getInstance().GetRootCoordinateSystem(); for (int i = 0; i < 11; ++i) { s.AddParticle( std::tuple<corsika::Code, units::si::HEPEnergyType, corsika::MomentumVector, diff --git a/examples/vertical_EAS.cpp b/examples/vertical_EAS.cpp index c4c9bf52c7ba6cc7ba087af4ec0b512e4405ff61..dbb64116cf5b2b200ad54a2805e55eca695247df 100644 --- a/examples/vertical_EAS.cpp +++ b/examples/vertical_EAS.cpp @@ -42,12 +42,12 @@ using namespace corsika::setup; using namespace std; void registerRandomStreams() { - corsika::RNGManager::GetInstance().RegisterRandomStream("cascade"); - corsika::RNGManager::GetInstance().RegisterRandomStream("s_rndm"); - // corsika::RNGManager::GetInstance().RegisterRandomStream("pythia"); - corsika::RNGManager::GetInstance().RegisterRandomStream("UrQMD"); + corsika::RNGManager::getInstance().registerRandomStream("cascade"); + corsika::RNGManager::getInstance().registerRandomStream("s_rndm"); + // corsika::RNGManager::getInstance().registerRandomStream("pythia"); + corsika::RNGManager::getInstance().registerRandomStream("UrQMD"); - corsika::RNGManager::GetInstance().SeedAll(); + corsika::RNGManager::getInstance().seedAll(); } int main() { diff --git a/modules/urqmd/urqmd_xs.cc b/modules/urqmd/urqmd_xs.cc index 79ce9c7c877605a147cb41c1e8157663c81c409e..d85c56e78fd36cade6ccf9119828815721e69929 100644 --- a/modules/urqmd/urqmd_xs.cc +++ b/modules/urqmd/urqmd_xs.cc @@ -20,7 +20,7 @@ using namespace corsika; using namespace corsika::units::si; int main() { - random::RNGManager::GetInstance().RegisterRandomStream("UrQMD"); + random::RNGManager::getInstance().registerRandomStream("UrQMD"); corsika::UrQMD::UrQMD urqmd; std::vector<Code> const projectiles{{Code::Proton, Code::AntiProton, Code::Neutron, diff --git a/tests/framework/testCOMBoost.cpp b/tests/framework/testCOMBoost.cpp index 52f666d0924eeffad2e7c5d7853f36069005f958..d26222a7be0624abd0e41793486fdf81f8857e37 100644 --- a/tests/framework/testCOMBoost.cpp +++ b/tests/framework/testCOMBoost.cpp @@ -21,7 +21,7 @@ using namespace corsika; double constexpr absMargin = 1e-6; CoordinateSystem const& rootCS = - RootCoordinateSystem::GetInstance().GetRootCoordinateSystem(); + RootCoordinateSystem::getInstance().GetRootCoordinateSystem(); // helper function for energy-momentum // relativistic energy diff --git a/tests/framework/testCascade.cpp b/tests/framework/testCascade.cpp index 03e360ea1e41e27c94e33b7a4db2a8711c55b325..f8b0d8734bd377b6c72067d8e6672e2394332950 100644 --- a/tests/framework/testCascade.cpp +++ b/tests/framework/testCascade.cpp @@ -153,8 +153,8 @@ TEST_CASE("Cascade", "[Cascade]") { HEPEnergyType E0 = 100_GeV; - random::RNGManager& rmng = random::RNGManager::GetInstance(); - rmng.RegisterRandomStream("cascade"); + random::RNGManager& rmng = random::RNGManager::getInstance(); + rmng.registerRandomStream("cascade"); auto env = MakeDummyEnv(); auto const& rootCS = env.GetCoordinateSystem(); diff --git a/tests/framework/testFourVector.cpp b/tests/framework/testFourVector.cpp index c17fb3695b2937ebde2301b76c13f8301b39033a..06a96f3a375beddb7737da40ea64128fd80afb3c 100644 --- a/tests/framework/testFourVector.cpp +++ b/tests/framework/testFourVector.cpp @@ -25,7 +25,7 @@ TEST_CASE("four vectors") { // this is just needed as a baseline CoordinateSystem& rootCS = - RootCoordinateSystem::GetInstance().GetRootCoordinateSystem(); + RootCoordinateSystem::getInstance().GetRootCoordinateSystem(); /* Test: P2 = E2 - p2 all in [GeV] diff --git a/tests/framework/testGeometry.cpp b/tests/framework/testGeometry.cpp index d7d27539a7a9e649abb76064be846afd86cc6111..dbffa55cf3ce0caa3beae0ac9b33df3c54f30dfc 100644 --- a/tests/framework/testGeometry.cpp +++ b/tests/framework/testGeometry.cpp @@ -25,7 +25,7 @@ double constexpr absMargin = 1.0e-8; TEST_CASE("transformations between CoordinateSystems") { CoordinateSystem& rootCS = - RootCoordinateSystem::GetInstance().GetRootCoordinateSystem(); + RootCoordinateSystem::getInstance().GetRootCoordinateSystem(); REQUIRE(getTransformation(rootCS, rootCS).isApprox(EigenTransform::Identity())); @@ -182,7 +182,7 @@ TEST_CASE("transformations between CoordinateSystems") { TEST_CASE("Sphere") { CoordinateSystem& rootCS = - RootCoordinateSystem::GetInstance().GetRootCoordinateSystem(); + RootCoordinateSystem::getInstance().GetRootCoordinateSystem(); Point center(rootCS, {0_m, 3_m, 4_m}); Sphere sphere(center, 5_m); @@ -202,7 +202,7 @@ TEST_CASE("Sphere") { TEST_CASE("Trajectories") { CoordinateSystem& rootCS = - RootCoordinateSystem::GetInstance().GetRootCoordinateSystem(); + RootCoordinateSystem::getInstance().GetRootCoordinateSystem(); Point r0(rootCS, {0_m, 0_m, 0_m}); SECTION("Line") { diff --git a/tests/framework/testRandom.cpp b/tests/framework/testRandom.cpp index d094582a69f191ba755f2ce2979901f07e8227b2..28f83017edb6d2b3be2722de648d9a7e56d6426a 100644 --- a/tests/framework/testRandom.cpp +++ b/tests/framework/testRandom.cpp @@ -22,28 +22,28 @@ using namespace corsika; SCENARIO("random-number streams can be registered and retrieved") { GIVEN("a RNGManager") { - RNGManager& rngManager = RNGManager::GetInstance(); + RNGManager& rngManager = RNGManager::getInstance(); WHEN("the sequence name is not registered") { - REQUIRE(rngManager.IsRegistered("stream_A") == false); + REQUIRE(rngManager.isRegistered("stream_A") == false); THEN("a sequence is registered by name") { - rngManager.RegisterRandomStream("stream_A"); + rngManager.registerRandomStream("stream_A"); THEN("the sequence can be retrieved") { - REQUIRE_NOTHROW(rngManager.GetRandomStream("stream_A")); + REQUIRE_NOTHROW(rngManager.getRandomStream("stream_A")); THEN("we can check that the sequence exists") { - REQUIRE_NOTHROW(rngManager.GetRandomStream("stream_A")); + REQUIRE_NOTHROW(rngManager.getRandomStream("stream_A")); THEN("an unknown sequence cannot be retrieved") { - REQUIRE(rngManager.IsRegistered("stream_A") == true); + REQUIRE(rngManager.isRegistered("stream_A") == true); THEN("an unknown sequence cannot be retrieved") { - REQUIRE_THROWS(rngManager.GetRandomStream("stream_UNKNOWN")); + REQUIRE_THROWS(rngManager.getRandomStream("stream_UNKNOWN")); THEN("an unknown sequence is not registered") { - REQUIRE(rngManager.IsRegistered("stream_UNKNOWN") == false); + REQUIRE(rngManager.isRegistered("stream_UNKNOWN") == false); } } } diff --git a/tests/media/testEnvironment.cpp b/tests/media/testEnvironment.cpp index 99f484d1087d1f21f135442b54c6d41bbcc012cd..af6251f71471e8dd7c05ce89a40bcc38fbd73755 100644 --- a/tests/media/testEnvironment.cpp +++ b/tests/media/testEnvironment.cpp @@ -30,7 +30,7 @@ using namespace corsika; using namespace corsika::units::si; CoordinateSystem const& gCS = - RootCoordinateSystem::GetInstance().GetRootCoordinateSystem(); + RootCoordinateSystem::getInstance().GetRootCoordinateSystem(); Point const gOrigin(gCS, {0_m, 0_m, 0_m}); diff --git a/tests/modules/testNullModel.cpp b/tests/modules/testNullModel.cpp index 18b7ff6ba86c030d7243a890cc298e4f15e2ee41..8bf395c086862cba6831371c4598741d7612b3b5 100644 --- a/tests/modules/testNullModel.cpp +++ b/tests/modules/testNullModel.cpp @@ -26,7 +26,7 @@ using namespace corsika; TEST_CASE("NullModel", "[processes]") { auto const& dummyCS = - corsika::RootCoordinateSystem::GetInstance().GetRootCoordinateSystem(); + corsika::RootCoordinateSystem::getInstance().GetRootCoordinateSystem(); corsika::Point const origin(dummyCS, {0_m, 0_m, 0_m}); corsika::Vector<SpeedType::dimension_type> v(dummyCS, 0_m / second, 0_m / second, 1_m / second); diff --git a/tests/modules/testObservationPlane.cpp b/tests/modules/testObservationPlane.cpp index d757dabb6ddb3e7de6aa7583746523b3dbba1c3e..193daa647ba0b23de470271dba68b21b57fe3fcc 100644 --- a/tests/modules/testObservationPlane.cpp +++ b/tests/modules/testObservationPlane.cpp @@ -22,7 +22,7 @@ using namespace corsika; TEST_CASE("ContinuousProcess interface", "[proccesses][observation_plane]") { - auto const& rootCS = RootCoordinateSystem::GetInstance().GetRootCoordinateSystem(); + auto const& rootCS = RootCoordinateSystem::getInstance().GetRootCoordinateSystem(); /* Test with downward going 1_GeV neutrino, starting at 0,1_m,10m diff --git a/tests/modules/testPythia8.cpp b/tests/modules/testPythia8.cpp index 1d6bb6d36585429f2367e618af38f60b514d71d3..19ab9b0cc0fdbc693dd0a3aa51cac13242a952e3 100644 --- a/tests/modules/testPythia8.cpp +++ b/tests/modules/testPythia8.cpp @@ -61,7 +61,7 @@ TEST_CASE("Pythia", "[processes]") { corsika::Code::PiPlus, corsika::Code::PiMinus, corsika::Code::KPlus, corsika::Code::KMinus, corsika::Code::K0Long, corsika::Code::K0Short}; - corsika::RNGManager::GetInstance().RegisterRandomStream("pythia"); + corsika::RNGManager::getInstance().registerRandomStream("pythia"); corsika::pythia8::Decay model(particleList); @@ -123,7 +123,7 @@ TEST_CASE("pythia process") { corsika::Code::PiPlus, corsika::Code::PiMinus, corsika::Code::KPlus, corsika::Code::KMinus, corsika::Code::K0Long, corsika::Code::K0Short}; - corsika::RNGManager::GetInstance().RegisterRandomStream("pythia"); + corsika::RNGManager::getInstance().registerRandomStream("pythia"); corsika::SecondaryView view(particle); auto projectile = view.GetProjectile(); diff --git a/tests/modules/testQGSJetII.cpp b/tests/modules/testQGSJetII.cpp index be05439f29b64887d676004c095af66bbd434795..d09371a849b51049ad4de003c56d1ef15e32b570 100644 --- a/tests/modules/testQGSJetII.cpp +++ b/tests/modules/testQGSJetII.cpp @@ -88,7 +88,7 @@ TEST_CASE("QgsjetIIInterface", "[processes]") { const corsika::CoordinateSystem& cs = env.GetCoordinateSystem(); - corsika::RNGManager::GetInstance().RegisterRandomStream("qgran"); + corsika::RNGManager::getInstance().registerRandomStream("qgran"); SECTION("InteractionInterface") { diff --git a/tests/modules/testSibyll.cpp b/tests/modules/testSibyll.cpp index 49be8dca49e4640ccd3e0c5cc21908c6622ffb43..dc6b7e760cc30e53fb32cffdec703dc1feedc384 100644 --- a/tests/modules/testSibyll.cpp +++ b/tests/modules/testSibyll.cpp @@ -95,7 +95,7 @@ TEST_CASE("SibyllInterface", "[processes]") { const corsika::CoordinateSystem& cs = env.GetCoordinateSystem(); - corsika::RNGManager::GetInstance().RegisterRandomStream("s_rndm"); + corsika::RNGManager::getInstance().registerRandomStream("s_rndm"); SECTION("InteractionInterface") { diff --git a/tests/modules/testStackInspector.cpp b/tests/modules/testStackInspector.cpp index 77dde76059cd8f8e259ec106d46483e57d5d51f4..45f71ccc5e91f7c5247ea01688c1303556eac2a4 100644 --- a/tests/modules/testStackInspector.cpp +++ b/tests/modules/testStackInspector.cpp @@ -24,7 +24,7 @@ using namespace corsika; TEST_CASE("StackInspector", "[processes]") { - auto const& rootCS = RootCoordinateSystem::GetInstance().GetRootCoordinateSystem(); + auto const& rootCS = RootCoordinateSystem::getInstance().GetRootCoordinateSystem(); Point const origin(rootCS, {0_m, 0_m, 0_m}); Vector<units::si::SpeedType::dimension_type> v(rootCS, 0_m / second, 0_m / second, 1_m / second); diff --git a/tests/modules/testUrQMD.cpp b/tests/modules/testUrQMD.cpp index cb737f0eaf9e5e06542c85f6114adecf636f0289..00293889ddd0c62adf475692fb38ac90658cc58c 100644 --- a/tests/modules/testUrQMD.cpp +++ b/tests/modules/testUrQMD.cpp @@ -123,7 +123,7 @@ TEST_CASE("UrQMD") { } feenableexcept(FE_INVALID); - corsika::RNGManager::GetInstance().RegisterRandomStream("UrQMD"); + corsika::RNGManager::getInstance().registerRandomStream("UrQMD"); UrQMD urqmd; SECTION("cross sections") { diff --git a/tests/stack/testNuclearStackExtension.cpp b/tests/stack/testNuclearStackExtension.cpp index 72017c91a05c70d9c062fd72c20f0ff31cc4e246..477404cbfa720430f8d7314040b8428002d4be97 100644 --- a/tests/stack/testNuclearStackExtension.cpp +++ b/tests/stack/testNuclearStackExtension.cpp @@ -22,8 +22,8 @@ using namespace std; TEST_CASE("NuclearStackExtension", "[stack]") { - geometry::CoordinateSystem& dummyCS = - geometry::RootCoordinateSystem::GetInstance().GetRootCoordinateSystem(); + CoordinateSystem& dummyCS = + RootCoordinateSystem::getInstance().GetRootCoordinateSystem(); SECTION("write non nucleus") { NuclearStackExtension<corsika::stack::super_stupid::SuperStupidStack, diff --git a/tests/stack/testSuperStupidStack.cpp b/tests/stack/testSuperStupidStack.cpp index a9f4fadc90d9d21125a92173b13b652e5aa7af90..74412b69bfb38f9e9c3f0f64d894948658c99ed0 100644 --- a/tests/stack/testSuperStupidStack.cpp +++ b/tests/stack/testSuperStupidStack.cpp @@ -24,8 +24,8 @@ using namespace std; TEST_CASE("SuperStupidStack", "[stack]") { - geometry::CoordinateSystem& dummyCS = - geometry::RootCoordinateSystem::GetInstance().GetRootCoordinateSystem(); + CoordinateSystem& dummyCS = + RootCoordinateSystem::getInstance().GetRootCoordinateSystem(); SECTION("read+write") {