diff --git a/Documentation/Examples/vertical_EAS.cc b/Documentation/Examples/vertical_EAS.cc index 5d4731ad8b554fa0e023d78c2f0cb0c6c339d180..3e1af668f1f8a0e07bc82fea9b22eca42b5e1476 100644 --- a/Documentation/Examples/vertical_EAS.cc +++ b/Documentation/Examples/vertical_EAS.cc @@ -195,9 +195,6 @@ int main(int argc, char** argv) { process::UrQMD::UrQMD urqmd; process::interaction_counter::InteractionCounter urqmdCounted{urqmd}; - sibyllNuc.Init(); - sibyll.Init(); - process::conex_source_cut::CONEXSourceCut conexSource( center, showerAxis, t, injectionHeight, E0, particles::GetPDG(particles::Code::Proton)); @@ -209,8 +206,8 @@ int main(int argc, char** argv) { 55_GeV); auto decaySequence = decayPythia << decaySibyll; - auto sequence = switchProcess << reset_particle_mass << decaySequence << conexSource << longprof - << eLoss << cut << observationLevel; + auto sequence = switchProcess << reset_particle_mass << decaySequence << conexSource + << longprof << eLoss << cut << observationLevel; // define air shower object, run simulation tracking_line::TrackingLine tracking; diff --git a/Environment/BaseExponential.h b/Environment/BaseExponential.h index 47391dc56deddc036318f8da5159e076daecbc11..97e2689bc249b79f33574149e4f9e2eb03c2e4eb 100644 --- a/Environment/BaseExponential.h +++ b/Environment/BaseExponential.h @@ -6,7 +6,6 @@ * the license. */ - #pragma once #include <corsika/geometry/Line.h> diff --git a/Environment/SlidingPlanarExponential.h b/Environment/SlidingPlanarExponential.h index 305b8666c7b6ea3d60fa1964ad550106a2327532..41058d864f1904b5add45ee902c77ded3c3eb8ec 100644 --- a/Environment/SlidingPlanarExponential.h +++ b/Environment/SlidingPlanarExponential.h @@ -6,7 +6,6 @@ * the license. */ - #pragma once #include <corsika/environment/FlatExponential.h> diff --git a/Environment/testShowerAxis.cc b/Environment/testShowerAxis.cc index 8c2441b98fa72800a8b6394b6b30abf0b3561e2e..232b734cb9f4153c73826c258d109d424b83e982 100644 --- a/Environment/testShowerAxis.cc +++ b/Environment/testShowerAxis.cc @@ -1,8 +1,6 @@ /* * (c) Copyright 2018 CORSIKA Project, corsika-project@lists.kit.edu * - * See file AUTHORS for a list of contributors. - * * This software is distributed under the terms of the GNU General Public * Licence version 3 (GPL Version 3). See file LICENSE for a full version of * the license. diff --git a/Framework/ProcessSequence/testProcessSequence.cc b/Framework/ProcessSequence/testProcessSequence.cc index 4b71e89c042daa7e6bbe39654351a323fcdf3c6c..e10d82e59cfe759f4ffc8a83541d08109317d46d 100644 --- a/Framework/ProcessSequence/testProcessSequence.cc +++ b/Framework/ProcessSequence/testProcessSequence.cc @@ -32,7 +32,6 @@ public: : fV(v) { cout << "globalCount: " << globalCount << ", fV: " << fV << std::endl; - assert(globalCount == fV); globalCount++; } @@ -51,7 +50,6 @@ public: ContinuousProcess2(const int v) : fV(v) { cout << "globalCount: " << globalCount << ", fV: " << fV << std::endl; - assert(globalCount == fV); globalCount++; } @@ -68,7 +66,6 @@ public: Process1(const int v) : fV(v) { cout << "globalCount: " << globalCount << ", fV: " << fV << std::endl; - assert(globalCount == fV); globalCount++; } @@ -77,7 +74,8 @@ public: for (int i = 0; i < nData; ++i) d.p[i] += 1 + i; return EProcessReturn::eOk; } - // private: + +private: int fV; }; @@ -88,7 +86,6 @@ public: Process2(const int v) : fV(v) { cout << "globalCount: " << globalCount << ", fV: " << fV << std::endl; - assert(globalCount == fV); globalCount++; } @@ -111,7 +108,6 @@ public: Process3(const int v) : fV(v) { cout << "globalCount: " << globalCount << ", fV: " << fV << std::endl; - assert(globalCount == fV); globalCount++; } @@ -134,7 +130,6 @@ public: Process4(const int v) : fV(v) { cout << "globalCount: " << globalCount << ", fV: " << fV << std::endl; - assert(globalCount == fV); globalCount++; } @@ -143,7 +138,6 @@ public: for (int i = 0; i < nData; ++i) { d.p[i] /= 1.2; } return EProcessReturn::eOk; } - // inline double MinStepLength(D& d) { template <typename Particle> EProcessReturn DoInteraction(Particle&) const { return EProcessReturn::eOk; @@ -157,7 +151,6 @@ public: Decay1(const int v) : fV(v) { cout << "Decay1()" << endl; - assert(globalCount == fV); globalCount++; } @@ -193,16 +186,18 @@ struct DummyTrajectory {}; TEST_CASE("Process Sequence", "[Process Sequence]") { - SECTION("Check init order") { + SECTION("Check construction") { globalCount = 0; Process1 m1(0); + CHECK(globalCount == 1); Process2 m2(1); + CHECK(globalCount == 2); Process3 m3(2); + CHECK(globalCount == 3); Process4 m4(3); + CHECK(globalCount == 4); - auto sequence = m1 << m2 << m3 << m4; - - globalCount = 0; + [[maybe_unused]] auto sequence = m1 << m2 << m3 << m4; } SECTION("interaction length") { diff --git a/Processes/CONEXSourceCut/CONEXSourceCut.cc b/Processes/CONEXSourceCut/CONEXSourceCut.cc index 5d0f68f8cb07dfc226a28b125c5d600dfd6061a5..8b90ff0ab167fe6893436b84e0f1aa667b2bb29a 100644 --- a/Processes/CONEXSourceCut/CONEXSourceCut.cc +++ b/Processes/CONEXSourceCut/CONEXSourceCut.cc @@ -1,8 +1,6 @@ /* * (c) Copyright 2020 CORSIKA Project, corsika-project@lists.kit.edu * - * See file AUTHORS for a list of contributors. - * * This software is distributed under the terms of the GNU General Public * Licence version 3 (GPL Version 3). See file LICENSE for a full version of * the license. @@ -119,8 +117,6 @@ void CONEXSourceCut::addParticle(int egs_pid, HEPEnergyType energy, conex::cegs4_(n, i); } -void CONEXSourceCut::Init() {} - void CONEXSourceCut::SolveCE() { conex::conexcascade_(); @@ -163,7 +159,6 @@ void CONEXSourceCut::SolveCE() { } } - CONEXSourceCut::CONEXSourceCut(geometry::Point center, environment::ShowerAxis const& showerAxis, units::si::LengthType groundDist, diff --git a/Processes/CONEXSourceCut/CONEXSourceCut.h b/Processes/CONEXSourceCut/CONEXSourceCut.h index 9ea6e3d68c0038c00fe2a5d879a2fc9e49b8015f..fec7190d3e057d2f9e63859238a7f30a1e9d9333 100644 --- a/Processes/CONEXSourceCut/CONEXSourceCut.h +++ b/Processes/CONEXSourceCut/CONEXSourceCut.h @@ -1,8 +1,6 @@ /* * (c) Copyright 2020 CORSIKA Project, corsika-project@lists.kit.edu * - * See file AUTHORS for a list of contributors. - * * This software is distributed under the terms of the GNU General Public * Licence version 3 (GPL Version 3). See file LICENSE for a full version of * the license. @@ -37,8 +35,6 @@ namespace corsika::process { particles::PDGCode primaryID); corsika::process::EProcessReturn DoSecondaries(corsika::setup::StackView&); - void Init(); - void SolveCE(); void addParticle(int egs_pid, units::si::HEPEnergyType energy, @@ -49,7 +45,6 @@ namespace corsika::process { auto const& GetObserverCS() const { return conexObservationCS_; } private: - //! CONEX e.m. particle codes static std::array<std::pair<particles::Code, int>, 3> constexpr egs_em_codes_{ {{particles::Code::Gamma, 0}, @@ -66,4 +61,3 @@ namespace corsika::process { }; } // namespace conex_source_cut } // namespace corsika::process - diff --git a/Processes/CONEXSourceCut/CONEX_f.h b/Processes/CONEXSourceCut/CONEX_f.h index a3076f5b63882d0cc992ab025cd1332c2bde24b5..3baba085ea27c185ce6796691840fb48e029ed56 100644 --- a/Processes/CONEXSourceCut/CONEX_f.h +++ b/Processes/CONEXSourceCut/CONEX_f.h @@ -1,8 +1,6 @@ /* * (c) Copyright 2020 CORSIKA Project, corsika-project@lists.kit.edu * - * See file AUTHORS for a list of contributors. - * * This software is distributed under the terms of the GNU General Public * Licence version 3 (GPL Version 3). See file LICENSE for a full version of * the license. diff --git a/Processes/CONEXSourceCut/testCONEXSourceCut.cc b/Processes/CONEXSourceCut/testCONEXSourceCut.cc index 058714e9556c2c02b66c7a576de7601194743f46..3dfc6c73e0a320851d6d89fb0af864102ad7f540 100644 --- a/Processes/CONEXSourceCut/testCONEXSourceCut.cc +++ b/Processes/CONEXSourceCut/testCONEXSourceCut.cc @@ -1,8 +1,6 @@ /* * (c) Copyright 2020 CORSIKA Project, corsika-project@lists.kit.edu * - * See file AUTHORS for a list of contributors. - * * This software is distributed under the terms of the GNU General Public * Licence version 3 (GPL Version 3). See file LICENSE for a full version of * the license. @@ -69,10 +67,9 @@ TEST_CASE("CONEXSourceCut") { environment::ShowerAxis const showerAxis{injectionPos, (showerCore - injectionPos) * 1.02, env}; - corsika::process::sibyll::Interaction sibyll; - process::sibyll::NuclearInteraction sibyllNuc(sibyll, env); - sibyll.Init(); - sibyllNuc.Init(); + // need to initialize Sibyll, done in constructor: + process::sibyll::Interaction sibyll; + [[maybe_unused]] process::sibyll::NuclearInteraction sibyllNuc(sibyll, env); corsika::process::conex_source_cut::CONEXSourceCut conex( center, showerAxis, t, injectionHeight, E0, diff --git a/Processes/InteractionCounter/testInteractionCounter.cc b/Processes/InteractionCounter/testInteractionCounter.cc index 880e86f5c83379e1cf6d25a0360172647ba5cd8b..8b47f1bf67b1a411315d5ac6303cfb5c365583fb 100644 --- a/Processes/InteractionCounter/testInteractionCounter.cc +++ b/Processes/InteractionCounter/testInteractionCounter.cc @@ -6,7 +6,6 @@ * the license. */ - #include <corsika/process/interaction_counter/InteractionCounter.h> #include <corsika/environment/Environment.h> @@ -118,7 +117,7 @@ TEST_CASE("InteractionCounter") { auto [env, csPtr, nodePtr] = setupEnvironment(particles::Code::Oxygen); [[maybe_unused]] auto& env_dummy = env; - + SECTION("DoInteraction nucleus") { unsigned short constexpr A = 14, Z = 7; auto [stackPtr, secViewPtr] = setupStack(A, Z, 105_TeV, nodePtr, *csPtr); diff --git a/Processes/ParticleCut/ParticleCut.cc b/Processes/ParticleCut/ParticleCut.cc index 23a860bd6d052760f59f189de825bb11c88b8957..defa0c1014dfaa3afd0e52b459d2bafa963a36c4 100644 --- a/Processes/ParticleCut/ParticleCut.cc +++ b/Processes/ParticleCut/ParticleCut.cc @@ -6,7 +6,6 @@ * the license. */ - #include <corsika/process/particle_cut/ParticleCut.h> using namespace std; diff --git a/Processes/ParticleCut/testParticleCut.cc b/Processes/ParticleCut/testParticleCut.cc index 9c98697f099399541c768b44d75a12c19c079b1f..b3d375f206ae1cd3c61cfdcdd53c5408f7a0cb68 100644 --- a/Processes/ParticleCut/testParticleCut.cc +++ b/Processes/ParticleCut/testParticleCut.cc @@ -6,7 +6,6 @@ * the license. */ - #include <corsika/process/particle_cut/ParticleCut.h> #include <corsika/environment/Environment.h> diff --git a/Processes/Sibyll/Interaction.cc b/Processes/Sibyll/Interaction.cc index 19a13678d84ca0e20b42d3d691c63d077c1eecf3..8300462c6de387e9f0ed62d8adca49db96c3fcd3 100644 --- a/Processes/Sibyll/Interaction.cc +++ b/Processes/Sibyll/Interaction.cc @@ -32,6 +32,8 @@ using Track = Trajectory; namespace corsika::process::sibyll { + bool Interaction::initialized_ = false; + Interaction::Interaction() { using random::RNGManager; @@ -317,8 +319,8 @@ namespace corsika::process::sibyll { auto pnew = vP.AddSecondary( tuple<particles::Code, units::si::HEPEnergyType, stack::MomentumVector, geometry::Point, units::si::TimeType>{ - pid, Plab.GetTimeLikeComponent(), Plab.GetSpaceLikeComponents(), pOrig, - tOrig}); + pid, Plab.GetTimeLikeComponent(), Plab.GetSpaceLikeComponents(), pOrig, + tOrig}); Plab_final += pnew.GetMomentum(); Elab_final += pnew.GetEnergy(); diff --git a/Processes/Sibyll/Interaction.h b/Processes/Sibyll/Interaction.h index a37021e80af1544f1e1f3b243056e26ff860f983..bcc9b632e8ce622ef55dbb2c25ea6d160f0609c9 100644 --- a/Processes/Sibyll/Interaction.h +++ b/Processes/Sibyll/Interaction.h @@ -20,7 +20,7 @@ namespace corsika::process::sibyll { int count_ = 0; int nucCount_ = 0; - bool initialized_ = false; + static bool initialized_; ///! flag to assure init is done only once public: Interaction(); @@ -28,7 +28,7 @@ namespace corsika::process::sibyll { void SetAllStable(); - bool WasInitialized() { return initialized_; } + static bool WasInitialized() { return initialized_; } bool IsValidCoMEnergy(corsika::units::si::HEPEnergyType ecm) const { return (minEnergyCoM_ <= ecm) && (ecm <= maxEnergyCoM_); }