diff --git a/Documentation/Examples/boundary_example.cc b/Documentation/Examples/boundary_example.cc index 549022b445973673e4e8f6ae1d2af23d51f077d4..a2f0d1001fb7c4a71a6dd759fce19b55cd3a0ecf 100644 --- a/Documentation/Examples/boundary_example.cc +++ b/Documentation/Examples/boundary_example.cc @@ -73,8 +73,6 @@ struct MyBoundaryCrossingProcess return EProcessReturn::eOk; } - void Init() {} - private: std::ofstream fFile; }; @@ -166,7 +164,7 @@ int main() { // define air shower object, run simulation cascade::Cascade EAS(env, tracking, sequence, stack); - EAS.Init(); + EAS.Run(); cout << "Result: E0=" << E0 / 1_GeV << endl; diff --git a/Documentation/Examples/cascade_example.cc b/Documentation/Examples/cascade_example.cc index 82c108e5c21472ec9ff30a15d89aad38e88e284f..fb94eaa5bee349ed4d0e62a840137afa6a9dcb50 100644 --- a/Documentation/Examples/cascade_example.cc +++ b/Documentation/Examples/cascade_example.cc @@ -150,7 +150,7 @@ int main() { // define air shower object, run simulation cascade::Cascade EAS(env, tracking, sequence, stack); - EAS.Init(); + EAS.Run(); eLoss.PrintProfile(); // print longitudinal profile diff --git a/Documentation/Examples/cascade_proton_example.cc b/Documentation/Examples/cascade_proton_example.cc index 434652440cdf0a053dec251647b2b8ca0506d357..5125902df40a4a1c318d02400dbc3f7fb0131775 100644 --- a/Documentation/Examples/cascade_proton_example.cc +++ b/Documentation/Examples/cascade_proton_example.cc @@ -140,7 +140,7 @@ int main() { // define air shower object, run simulation cascade::Cascade EAS(env, tracking, sequence, stack); - EAS.Init(); + EAS.Run(); cout << "Result: E0=" << E0 / 1_GeV << endl; diff --git a/Documentation/Examples/vertical_EAS.cc b/Documentation/Examples/vertical_EAS.cc index a691e1408efd1cfdc71e46b97021c68d72509a3b..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,13 +206,12 @@ 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; cascade::Cascade EAS(env, tracking, sequence, stack); - EAS.Init(); // to fix the point of first interaction, uncomment the following two lines: // EAS.SetNodes(); 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/Cascade/Cascade.h b/Framework/Cascade/Cascade.h index 5130bebcae714829c603c079c6fc4f1753c46429..389ec0557e8bcc6da87fd57adafcf608d48a2a8e 100644 --- a/Framework/Cascade/Cascade.h +++ b/Framework/Cascade/Cascade.h @@ -85,15 +85,6 @@ namespace corsika::cascade { , fProcessSequence(pl) , fStack(stack) {} - /** - * The Init function is called before the actual cascade simulations. - * All components of the Cascade simulation must be configured here. - */ - void Init() { - fProcessSequence.Init(); - fStack.Init(); - } - /** * set the nodes for all particles on the stack according to their numerical * position diff --git a/Framework/Cascade/testCascade.cc b/Framework/Cascade/testCascade.cc index 9c132c904f4d9200656436896d08ec0cd989102f..a22cfbcb4f2746607fd0498c094d85eee3d69f2e 100644 --- a/Framework/Cascade/testCascade.cc +++ b/Framework/Cascade/testCascade.cc @@ -84,8 +84,6 @@ public: return EProcessReturn::eInteracted; } - void Init() { fCalls = 0; } - int GetCalls() const { return fCalls; } }; @@ -117,11 +115,6 @@ public: return EProcessReturn::eOk; } - void Init() { - fCalls = 0; - fCount = 0; - } - int GetCount() const { return fCount; } int GetCalls() const { return fCalls; } }; @@ -158,8 +151,6 @@ TEST_CASE("Cascade", "[Cascade]") { TestCascadeStackView> EAS(env, tracking, sequence, stack); - EAS.Init(); - SECTION("full cascade") { EAS.Run(); diff --git a/Framework/ProcessSequence/ProcessSequence.h b/Framework/ProcessSequence/ProcessSequence.h index 69a4da36b183a1f31c132e80136f30fc09a68eae..c54ea09f5f85b244f7021fffb5fe19e5c6619bd2 100644 --- a/Framework/ProcessSequence/ProcessSequence.h +++ b/Framework/ProcessSequence/ProcessSequence.h @@ -315,11 +315,6 @@ namespace corsika::process { } // end branch B return EProcessReturn::eOk; } - - void Init() { - A.Init(); - B.Init(); - } }; /// the << operator assembles many BaseProcess, ContinuousProcess, and diff --git a/Framework/ProcessSequence/testProcessSequence.cc b/Framework/ProcessSequence/testProcessSequence.cc index 1b46c9662a2e83307987a5b160a8ee44236171ce..e10d82e59cfe759f4ffc8a83541d08109317d46d 100644 --- a/Framework/ProcessSequence/testProcessSequence.cc +++ b/Framework/ProcessSequence/testProcessSequence.cc @@ -29,12 +29,12 @@ class ContinuousProcess1 : public ContinuousProcess<ContinuousProcess1> { public: ContinuousProcess1(const int v) - : fV(v) {} - void Init() { - cout << "ContinuousProcess1::Init" << endl; - assert(globalCount == fV); + : fV(v) { + + cout << "globalCount: " << globalCount << ", fV: " << fV << std::endl; globalCount++; } + template <typename D, typename T> inline EProcessReturn DoContinuous(D& d, T&) const { cout << "ContinuousProcess1::DoContinuous" << endl; @@ -48,12 +48,11 @@ class ContinuousProcess2 : public ContinuousProcess<ContinuousProcess2> { public: ContinuousProcess2(const int v) - : fV(v) {} - void Init() { - cout << "ContinuousProcess2::Init" << endl; - assert(globalCount == fV); + : fV(v) { + cout << "globalCount: " << globalCount << ", fV: " << fV << std::endl; globalCount++; } + template <typename D, typename T> inline EProcessReturn DoContinuous(D& d, T&) const { cout << "ContinuousProcess2::DoContinuous" << endl; @@ -65,18 +64,18 @@ public: class Process1 : public InteractionProcess<Process1> { public: Process1(const int v) - : fV(v) {} - void Init() { - cout << "Process1::Init" << endl; - assert(globalCount == fV); + : fV(v) { + cout << "globalCount: " << globalCount << ", fV: " << fV << std::endl; globalCount++; } + template <typename D, typename S> inline EProcessReturn DoInteraction(D& d, S&) const { for (int i = 0; i < nData; ++i) d.p[i] += 1 + i; return EProcessReturn::eOk; } - // private: + +private: int fV; }; @@ -85,12 +84,11 @@ class Process2 : public InteractionProcess<Process2> { public: Process2(const int v) - : fV(v) {} - void Init() { - cout << "Process2::Init" << endl; - assert(globalCount == fV); + : fV(v) { + cout << "globalCount: " << globalCount << ", fV: " << fV << std::endl; globalCount++; } + template <typename Particle> inline EProcessReturn DoInteraction(Particle&) const { cout << "Process2::DoInteraction" << endl; @@ -108,12 +106,11 @@ class Process3 : public InteractionProcess<Process3> { public: Process3(const int v) - : fV(v) {} - void Init() { - cout << "Process3::Init" << endl; - assert(globalCount == fV); + : fV(v) { + cout << "globalCount: " << globalCount << ", fV: " << fV << std::endl; globalCount++; } + template <typename Particle> inline EProcessReturn DoInteraction(Particle&) const { cout << "Process3::DoInteraction" << endl; @@ -131,18 +128,16 @@ class Process4 : public BaseProcess<Process4> { public: Process4(const int v) - : fV(v) {} - void Init() { - cout << "Process4::Init" << endl; - assert(globalCount == fV); + : fV(v) { + cout << "globalCount: " << globalCount << ", fV: " << fV << std::endl; globalCount++; } + template <typename D, typename T> inline EProcessReturn DoContinuous(D& d, T&) const { 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; @@ -154,12 +149,11 @@ class Decay1 : public DecayProcess<Decay1> { public: Decay1(const int v) - : fV(v) {} - void Init() { - cout << "Decay1::Init" << endl; - assert(globalCount == fV); + : fV(v) { + cout << "Decay1()" << endl; globalCount++; } + template <typename Particle> TimeType GetLifetime(Particle&) const { return 1_s; @@ -192,25 +186,22 @@ 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; - sequence.Init(); - // REQUIRE_NOTHROW( (sequence.Init()) ); - - // const auto sequence_wrong = m3 + m2 + m1 + m4; - // globalCount = 0; - // sequence_wrong.Init(); - // REQUIRE_THROWS(sequence_wrong.Init()); + [[maybe_unused]] auto sequence = m1 << m2 << m3 << m4; } SECTION("interaction length") { + globalCount = 0; ContinuousProcess1 cp1(0); Process2 m2(1); Process3 m3(2); @@ -222,13 +213,15 @@ TEST_CASE("Process Sequence", "[Process Sequence]") { InverseGrammageType const tot_inv = sequence2.GetTotalInverseInteractionLength(particle); cout << "lambda_tot=" << tot << "; lambda_tot_inv=" << tot_inv << endl; + globalCount = 0; } SECTION("lifetime") { + globalCount = 0; ContinuousProcess1 cp1(0); Process2 m2(1); Process3 m3(2); - Decay1 d3(2); + Decay1 d3(3); DummyData particle; @@ -236,14 +229,16 @@ TEST_CASE("Process Sequence", "[Process Sequence]") { TimeType const tot = sequence2.GetTotalLifetime(particle); InverseTimeType const tot_inv = sequence2.GetTotalInverseLifetime(particle); cout << "lambda_tot=" << tot << "; lambda_tot_inv=" << tot_inv << endl; + + globalCount = 0; } SECTION("sectionTwo") { - + globalCount = 0; ContinuousProcess1 cp1(0); - ContinuousProcess2 cp2(3); - Process2 m2(1); - Process3 m3(2); + ContinuousProcess2 cp2(1); + Process2 m2(2); + Process3 m3(3); auto sequence2 = cp1 << m2 << m3 << cp2; @@ -252,7 +247,6 @@ TEST_CASE("Process Sequence", "[Process Sequence]") { cout << "-->init sequence2" << endl; globalCount = 0; - sequence2.Init(); cout << "-->docont" << endl; sequence2.DoContinuous(particle, track); @@ -270,10 +264,7 @@ TEST_CASE("Process Sequence", "[Process Sequence]") { SECTION("StackProcess") { - ContinuousProcess1 cp1(0); - ContinuousProcess2 cp2(3); - Process2 m2(1); - Process3 m3(2); + globalCount = 0; Stack1 s1(1); Stack1 s2(2); @@ -294,8 +285,9 @@ TEST_CASE("Process Sequence", "[Process Sequence]") { in Processes/SwitchProcess/testSwtichProcess */ TEST_CASE("SwitchProcess") { + globalCount = 0; Process1 p1(0); - Process2 p2(0); + Process2 p2(1); switch_process::SwitchProcess s(p1, p2, 10_GeV); REQUIRE(is_switch_process_v<decltype(s)>); } diff --git a/Framework/StackInterface/CombinedStack.h b/Framework/StackInterface/CombinedStack.h index f971b64a7da0189142bc6bc568aed16b1a867180..2534ced4e89e3b5fc6fc231c57e0d0887d760ee0 100644 --- a/Framework/StackInterface/CombinedStack.h +++ b/Framework/StackInterface/CombinedStack.h @@ -106,11 +106,6 @@ namespace corsika::stack { class CombinedStackImpl : public Stack1Impl, public Stack2Impl { public: - void Init() { - Stack1Impl::Init(); - Stack2Impl::Init(); - } - void Clear() { Stack1Impl::Clear(); Stack2Impl::Clear(); diff --git a/Framework/StackInterface/Stack.h b/Framework/StackInterface/Stack.h index 7ddee326c7947cd905ab58907e024afeef1b4bd3..c4ce61945f955365d22d2d115bff175988d228e1 100644 --- a/Framework/StackInterface/Stack.h +++ b/Framework/StackInterface/Stack.h @@ -63,8 +63,6 @@ namespace corsika::stack { delete; ///< since Stack can be very big, we don't want to copy it public: - // Stack() { Init(); } - /** * if StackDataType is a reference member we *HAVE* to initialize * it in the constructor, this is typically needed for SecondaryView @@ -128,10 +126,7 @@ namespace corsika::stack { */ unsigned int GetCapacity() const { return fData.GetCapacity(); } unsigned int GetSize() const { return fData.GetSize(); } - template <typename... Args> - auto Init(Args... args) { - return fData.Init(args...); - } + template <typename... Args> auto Clear(Args... args) { return fData.Clear(args...); diff --git a/Framework/StackInterface/testCombinedStack.cc b/Framework/StackInterface/testCombinedStack.cc index d728abeb4019bfb206c7343ec51e76a3b9b10edb..6f4a9c17fe216133be861149887f87e7dd235a1d 100644 --- a/Framework/StackInterface/testCombinedStack.cc +++ b/Framework/StackInterface/testCombinedStack.cc @@ -32,7 +32,6 @@ class TestStackData2 { public: // these functions are needed for the Stack interface - void Init() {} void Clear() { fData2.clear(); } unsigned int GetSize() const { return fData2.size(); } unsigned int GetCapacity() const { return fData2.size(); } @@ -104,7 +103,6 @@ TEST_CASE("Combined Stack", "[stack]") { // construct a valid Stack object StackTest s; - s.Init(); s.Clear(); s.AddParticle(std::tuple{0.}); s.Copy(s.cbegin(), s.begin()); @@ -200,7 +198,6 @@ class TestStackData3 { public: // these functions are needed for the Stack interface - void Init() {} void Clear() { fData3.clear(); } unsigned int GetSize() const { return fData3.size(); } unsigned int GetCapacity() const { return fData3.size(); } diff --git a/Framework/StackInterface/testTestStack.h b/Framework/StackInterface/testTestStack.h index 89897b96a3d7db78c0016a4416fff316f7d68083..88e5fa1c6c9e06d1e55481f5f44849a92d6d8bc6 100644 --- a/Framework/StackInterface/testTestStack.h +++ b/Framework/StackInterface/testTestStack.h @@ -22,7 +22,6 @@ class TestStackData { public: // these functions are needed for the Stack interface - void Init() {} void Clear() { fData.clear(); } unsigned int GetSize() const { return fData.size(); } unsigned int GetCapacity() const { return fData.size(); } 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/EnergyLoss/EnergyLoss.h b/Processes/EnergyLoss/EnergyLoss.h index 584a80ff96f3032a9e083713fbecc0ba961a8537..0059acb5d15b4f7c8418263e43fb519215b6fb7d 100644 --- a/Processes/EnergyLoss/EnergyLoss.h +++ b/Processes/EnergyLoss/EnergyLoss.h @@ -31,7 +31,6 @@ namespace corsika::process::energy_loss { public: EnergyLoss(environment::ShowerAxis const& showerAxis); - void Init() {} process::EProcessReturn DoContinuous(setup::Stack::ParticleType&, setup::Trajectory const&); units::si::LengthType MaxStepLength(setup::Stack::ParticleType const&, diff --git a/Processes/HadronicElasticModel/HadronicElasticModel.cc b/Processes/HadronicElasticModel/HadronicElasticModel.cc index baddab65f5299250029d30d8bc19bc0b295ad936..d95c69d657cb36709ad25ae6febb3e293709e9dc 100644 --- a/Processes/HadronicElasticModel/HadronicElasticModel.cc +++ b/Processes/HadronicElasticModel/HadronicElasticModel.cc @@ -24,8 +24,6 @@ using SetupParticle = corsika::setup::Stack::ParticleType; namespace corsika::process::HadronicElasticModel { - void HadronicElasticInteraction::Init() {} - HadronicElasticInteraction::HadronicElasticInteraction(units::si::CrossSectionType x, units::si::CrossSectionType y) : fX(x) diff --git a/Processes/HadronicElasticModel/HadronicElasticModel.h b/Processes/HadronicElasticModel/HadronicElasticModel.h index 17af624a48d1bfaa605baa4becd76ebad16b7918..b719a30819c38e0057821e0af19208c118cbff4e 100644 --- a/Processes/HadronicElasticModel/HadronicElasticModel.h +++ b/Processes/HadronicElasticModel/HadronicElasticModel.h @@ -50,7 +50,6 @@ namespace corsika::process::HadronicElasticModel { HadronicElasticInteraction( // x & y values taken from DL for pp collisions units::si::CrossSectionType x = 0.0217 * units::si::barn, units::si::CrossSectionType y = 0.05608 * units::si::barn); - void Init(); template <typename Particle> corsika::units::si::GrammageType GetInteractionLength(Particle const& p); diff --git a/Processes/InteractionCounter/InteractionCounter.h b/Processes/InteractionCounter/InteractionCounter.h index 2adaefd9d2521e77109f51fb1a5dc66ece72774e..2ca7db507620b2143991e0d6830225a0bcb8373b 100644 --- a/Processes/InteractionCounter/InteractionCounter.h +++ b/Processes/InteractionCounter/InteractionCounter.h @@ -49,8 +49,6 @@ namespace corsika::process::interaction_counter { return process_.DoInteraction(projectile); } - void Init() { process_.Init(); } - template <typename TParticle> auto GetInteractionLength(TParticle const& particle) const { return process_.GetInteractionLength(particle); 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/LongitudinalProfile/LongitudinalProfile.cc b/Processes/LongitudinalProfile/LongitudinalProfile.cc index 9977b4340b42ade20846f34b27a3bee122783ab2..a02e6e6217c0fbd00710a4a7a6f0394e3d1c1a94 100644 --- a/Processes/LongitudinalProfile/LongitudinalProfile.cc +++ b/Processes/LongitudinalProfile/LongitudinalProfile.cc @@ -29,8 +29,6 @@ LongitudinalProfile::LongitudinalProfile(environment::ShowerAxis const& shower_a : shower_axis_{shower_axis} , profiles_{static_cast<unsigned int>(shower_axis.maximumX() / dX_) + 1} {} -void LongitudinalProfile::Init() {} - template <> corsika::process::EProcessReturn LongitudinalProfile::DoContinuous(Particle const& vP, Track const& vTrack) { diff --git a/Processes/LongitudinalProfile/LongitudinalProfile.h b/Processes/LongitudinalProfile/LongitudinalProfile.h index 54adf87bdc10eb0bc6373fe138775575fe623c73..4571757318a66914645160c0fcd00bb7c3670ba2 100644 --- a/Processes/LongitudinalProfile/LongitudinalProfile.h +++ b/Processes/LongitudinalProfile/LongitudinalProfile.h @@ -26,8 +26,6 @@ namespace corsika::process::longitudinal_profile { public: LongitudinalProfile(environment::ShowerAxis const&); - void Init(); - template <typename Particle, typename Track> corsika::process::EProcessReturn DoContinuous(Particle const&, Track const&); diff --git a/Processes/NullModel/NullModel.cc b/Processes/NullModel/NullModel.cc index a5666de98a59ec689c1b7330ffaa48518e5746b6..1a3afc793fd60c8cd5085c03cb444d3d1a399221 100644 --- a/Processes/NullModel/NullModel.cc +++ b/Processes/NullModel/NullModel.cc @@ -13,8 +13,6 @@ using namespace corsika; namespace corsika::process::null_model { - void NullModel::Init() {} - NullModel::NullModel(units::si::LengthType maxStepLength) : fMaxStepLength(maxStepLength) {} diff --git a/Processes/NullModel/NullModel.h b/Processes/NullModel/NullModel.h index 9c9f610b735d3aa6c1bce62f157ef909285116a3..ba80599f3e67cc9104b28b0ef35921b101841bb3 100644 --- a/Processes/NullModel/NullModel.h +++ b/Processes/NullModel/NullModel.h @@ -20,8 +20,6 @@ namespace corsika::process::null_model { NullModel(corsika::units::si::LengthType maxStepLength = corsika::units::si::meter * std::numeric_limits<double>::infinity()); - void Init(); - template <typename Particle, typename Track> process::EProcessReturn DoContinuous(Particle&, Track&) const; diff --git a/Processes/NullModel/testNullModel.cc b/Processes/NullModel/testNullModel.cc index c449c4ac621614b8b152ac2456727fe1b308f8d9..653393e11e38e380424e53d618befe7fab4b2ace 100644 --- a/Processes/NullModel/testNullModel.cc +++ b/Processes/NullModel/testNullModel.cc @@ -44,7 +44,6 @@ TEST_CASE("NullModel", "[processes]") { NullModel model(10_m); - model.Init(); [[maybe_unused]] const process::EProcessReturn ret = model.DoContinuous(particle, track); LengthType const length = model.MaxStepLength(particle, track); diff --git a/Processes/ObservationPlane/ObservationPlane.h b/Processes/ObservationPlane/ObservationPlane.h index 34b973e66a1d1cf1d8f826c63f8ee5fbb5e2c4df..9b1ecf613b1f9f5df8415fb9cffbf1ceba067690 100644 --- a/Processes/ObservationPlane/ObservationPlane.h +++ b/Processes/ObservationPlane/ObservationPlane.h @@ -27,7 +27,6 @@ namespace corsika::process::observation_plane { public: ObservationPlane(geometry::Plane const&, std::string const&, bool = true); - void Init() {} corsika::process::EProcessReturn DoContinuous( corsika::setup::Stack::ParticleType const& vParticle, diff --git a/Processes/ObservationPlane/testObservationPlane.cc b/Processes/ObservationPlane/testObservationPlane.cc index 426db4657984d5134d7416b2670d54b754dd0819..7f3f183a6def750818aa1eb05be4bec81937d587 100644 --- a/Processes/ObservationPlane/testObservationPlane.cc +++ b/Processes/ObservationPlane/testObservationPlane.cc @@ -64,7 +64,6 @@ TEST_CASE("ContinuousProcess interface", "[proccesses][observation_plane]") { Vector<dimensionless_d>(rootCS, {0., 0., 1.})); ObservationPlane obs(obsPlane, "particles.dat", true); - obs.Init(); const LengthType length = obs.MaxStepLength(particle, track); const process::EProcessReturn ret = obs.DoContinuous(particle, track); @@ -86,7 +85,6 @@ TEST_CASE("ContinuousProcess interface", "[proccesses][observation_plane]") { Vector<dimensionless_d>(rootCS, {0., 0., 1.})); ObservationPlane obs(obsPlane, "particles.dat", false); - obs.Init(); const LengthType length = obs.MaxStepLength(particle, track); const process::EProcessReturn ret = obs.DoContinuous(particle, track); diff --git a/Processes/ParticleCut/ParticleCut.cc b/Processes/ParticleCut/ParticleCut.cc index d10dbf74b9e28a5872e617dd8e28394ad822cd19..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; @@ -91,13 +90,14 @@ namespace corsika::process { return EProcessReturn::eOk; } - void ParticleCut::Init() { + ParticleCut::ParticleCut(const units::si::HEPEnergyType vCut) + : fECut(vCut) { + fEmEnergy = 0._GeV; fEmCount = 0; fInvEnergy = 0._GeV; fInvCount = 0; fEnergy = 0._GeV; - // defineEmParticles(); } void ParticleCut::ShowResults() { diff --git a/Processes/ParticleCut/ParticleCut.h b/Processes/ParticleCut/ParticleCut.h index 8ecf7917a7230aef67889cde73ba125a5438de98..53571551c445852648e1e86a4a713ee22bd7f64e 100644 --- a/Processes/ParticleCut/ParticleCut.h +++ b/Processes/ParticleCut/ParticleCut.h @@ -26,8 +26,7 @@ namespace corsika::process { unsigned int fInvCount = 0; public: - ParticleCut(const units::si::HEPEnergyType vCut) - : fECut(vCut) {} + ParticleCut(const units::si::HEPEnergyType vCut); bool ParticleIsInvisible(particles::Code) const; EProcessReturn DoSecondaries(corsika::setup::StackView&); @@ -37,7 +36,6 @@ namespace corsika::process { bool ParticleIsEmParticle(particles::Code) const; - void Init(); void ShowResults(); units::si::HEPEnergyType GetInvEnergy() const { return fInvEnergy; } 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/Pythia/Decay.cc b/Processes/Pythia/Decay.cc index 21f9d92a25a08c251006bb0593cda8ea0550a115..ea81121009d25363335ce8fb0261d5327fa39f37 100644 --- a/Processes/Pythia/Decay.cc +++ b/Processes/Pythia/Decay.cc @@ -28,14 +28,7 @@ using Track = Trajectory; namespace corsika::process::pythia { - Decay::Decay() {} - Decay::Decay(std::set<particles::Code> vHandled) - : handleAllDecays_(false) - , handledDecays_(vHandled) {} - - Decay::~Decay() { cout << "Pythia::Decay n=" << fCount << endl; } - - void Decay::Init() { + Decay::Decay() { // set random number generator in pythia Pythia8::RndmEngine* rndm = new corsika::process::pythia::Random(); @@ -77,6 +70,12 @@ namespace corsika::process::pythia { throw std::runtime_error("Pythia::Decay: Initialization failed!"); } + Decay::Decay(std::set<particles::Code> vHandled) + : handleAllDecays_(false) + , handledDecays_(vHandled) {} + + Decay::~Decay() { cout << "Pythia::Decay n=" << fCount << endl; } + bool Decay::CanHandleDecay(const particles::Code vParticleCode) { using namespace corsika::particles; // if known to pythia and not proton, electron or neutrino it can decay diff --git a/Processes/Pythia/Decay.h b/Processes/Pythia/Decay.h index 4e2d423a2f2ac8037feb4c8e02ea28f83b68a787..dfa1a25808579cb969dfd756d4a1f704a79c12e0 100644 --- a/Processes/Pythia/Decay.h +++ b/Processes/Pythia/Decay.h @@ -26,7 +26,6 @@ namespace corsika::process { Decay(); Decay(std::set<particles::Code>); ~Decay(); - void Init(); // is Pythia::Decay set to handle the decay of this particle? bool IsDecayHandled(const corsika::particles::Code); diff --git a/Processes/Pythia/Interaction.cc b/Processes/Pythia/Interaction.cc index 0b22b5b5e742e3b97ad88b53d70539a0bdeaa9bf..f6b2a01403ce6bc3462c6d476fb94f1299c6bbf3 100644 --- a/Processes/Pythia/Interaction.cc +++ b/Processes/Pythia/Interaction.cc @@ -29,9 +29,10 @@ namespace corsika::process::pythia { typedef corsika::geometry::Vector<corsika::units::si::hepmomentum_d> MomentumVector; - Interaction::~Interaction() { cout << "Pythia::Interaction n=" << fCount << endl; } + Interaction::~Interaction() {} - void Interaction::Init() { + Interaction::Interaction() { + cout << "Pythia::Interaction n=" << fCount << endl; using random::RNGManager; diff --git a/Processes/Pythia/Interaction.h b/Processes/Pythia/Interaction.h index 117c2325185fc9d56c03319dc82bd0cc41d70542..d6e3862bf72c3b1728c75931ee7bffb509adeed2 100644 --- a/Processes/Pythia/Interaction.h +++ b/Processes/Pythia/Interaction.h @@ -24,11 +24,9 @@ namespace corsika::process::pythia { bool fInitialized = false; public: - Interaction() {} + Interaction(); ~Interaction(); - void Init(); - void SetParticleListStable(std::vector<particles::Code> const&); void SetUnstable(const corsika::particles::Code); void SetStable(const corsika::particles::Code); diff --git a/Processes/Pythia/testPythia8.cc b/Processes/Pythia/testPythia8.cc index 1a7ba3cc2b7910c40499e885a5c45120c383da84..f947a8b813fbe20add8fbc869f79313fb527b7f1 100644 --- a/Processes/Pythia/testPythia8.cc +++ b/Processes/Pythia/testPythia8.cc @@ -65,8 +65,6 @@ TEST_CASE("Pythia", "[processes]") { random::RNGManager::GetInstance().RegisterRandomStream("pythia"); process::pythia::Decay model; - - model.Init(); } } @@ -136,7 +134,7 @@ TEST_CASE("pythia process") { auto projectile = view.GetProjectile(); process::pythia::Decay model; - model.Init(); + [[maybe_unused]] const TimeType time = model.GetLifetime(particle); model.DoDecay(projectile); CHECK(stack.GetSize() == 3); @@ -186,7 +184,7 @@ TEST_CASE("pythia process") { auto projectile = view.GetProjectile(); process::pythia::Interaction model; - model.Init(); + [[maybe_unused]] const process::EProcessReturn ret = model.DoInteraction(projectile); [[maybe_unused]] const GrammageType length = model.GetInteractionLength(particle); } diff --git a/Processes/QGSJetII/Interaction.cc b/Processes/QGSJetII/Interaction.cc index b5afcb9a684e42c0c83a9e01c40c1f578079294d..d1b84e5c1a11b73b2d67f6474c45a1d4d791a6ca 100644 --- a/Processes/QGSJetII/Interaction.cc +++ b/Processes/QGSJetII/Interaction.cc @@ -46,11 +46,7 @@ namespace corsika::process::qgsjetII { cout << "Searching for QGSJetII data tables in " << data_path_ << endl; } } - } - - Interaction::~Interaction() { cout << "QgsjetII::Interaction n=" << count_ << endl; } - void Interaction::Init() { // initialize QgsjetII if (!initialized_) { qgset_(); @@ -60,6 +56,8 @@ namespace corsika::process::qgsjetII { } } + Interaction::~Interaction() { cout << "QgsjetII::Interaction n=" << count_ << endl; } + units::si::CrossSectionType Interaction::GetCrossSection( const particles::Code beamId, const particles::Code targetId, const units::si::HEPEnergyType Elab, const unsigned int Abeam, diff --git a/Processes/QGSJetII/Interaction.h b/Processes/QGSJetII/Interaction.h index aeed49ec78371dc8ddecf9728eeb013ae0dcb43d..f72cbdcc7bf5aea207afa938010b900e34cbf835 100644 --- a/Processes/QGSJetII/Interaction.h +++ b/Processes/QGSJetII/Interaction.h @@ -30,8 +30,6 @@ namespace corsika::process::qgsjetII { Interaction(const std::string& dataPath = ""); ~Interaction(); - void Init(); - bool WasInitialized() { return initialized_; } int GetMaxTargetMassNumber() const { return maxMassNumber_; } bool IsValidTarget(corsika::particles::Code TargetId) const { diff --git a/Processes/QGSJetII/QGSJetIIFragmentsStack.h b/Processes/QGSJetII/QGSJetIIFragmentsStack.h index 9adb857134362b83b58d1ac9e45bd84193a92015..5da94661c7d054bf93ceae558cab13b9bc3f0310 100644 --- a/Processes/QGSJetII/QGSJetIIFragmentsStack.h +++ b/Processes/QGSJetII/QGSJetIIFragmentsStack.h @@ -20,7 +20,6 @@ namespace corsika::process::qgsjetII { class QGSJetIIFragmentsStackData { public: - void Init(); void Dump() const {} void Clear() { diff --git a/Processes/QGSJetII/QGSJetIIStack.h b/Processes/QGSJetII/QGSJetIIStack.h index 60ce7350edc758e5c06917855868a01868f93c58..8e3c87ddc9581464428809e86f8cce1dde87623a 100644 --- a/Processes/QGSJetII/QGSJetIIStack.h +++ b/Processes/QGSJetII/QGSJetIIStack.h @@ -22,7 +22,6 @@ namespace corsika::process::qgsjetII { class QGSJetIIStackData { public: - void Init(); void Dump() const {} void Clear() { diff --git a/Processes/QGSJetII/testQGSJetII.cc b/Processes/QGSJetII/testQGSJetII.cc index bc1a56ba8a6d56b88aca009d7a0bd547b76f74a3..edfaad83bcc800c4aeaa45670a1779c41955952b 100644 --- a/Processes/QGSJetII/testQGSJetII.cc +++ b/Processes/QGSJetII/testQGSJetII.cc @@ -139,7 +139,7 @@ TEST_CASE("QgsjetIIInterface", "[processes]") { auto const projectileMomentum = projectile.GetMomentum(); Interaction model; - model.Init(); + [[maybe_unused]] const process::EProcessReturn ret = model.DoInteraction(projectile); [[maybe_unused]] const GrammageType length = model.GetInteractionLength(particle); diff --git a/Processes/Sibyll/Decay.cc b/Processes/Sibyll/Decay.cc index 04113d40ba9c9fd545ece366bfc8a9d4f2989cb9..d1a0c0cb1aff2d14a7ca98f8f5b2422af83de80a 100644 --- a/Processes/Sibyll/Decay.cc +++ b/Processes/Sibyll/Decay.cc @@ -42,7 +42,6 @@ namespace corsika::process::sibyll { } Decay::~Decay() { cout << "Sibyll::Decay n=" << fCount << endl; } - void Decay::Init() {} bool Decay::CanHandleDecay(const particles::Code vParticleCode) { using namespace corsika::particles; diff --git a/Processes/Sibyll/Decay.h b/Processes/Sibyll/Decay.h index de8a730d17a9c5fcef7ec8a72178fb55bbfb8e70..85e62273741ba784ada7efee5a2b685702abf357 100644 --- a/Processes/Sibyll/Decay.h +++ b/Processes/Sibyll/Decay.h @@ -27,7 +27,6 @@ namespace corsika::process { Decay(); Decay(std::set<particles::Code>); ~Decay(); - void Init(); void PrintDecayConfig(const corsika::particles::Code); void PrintDecayConfig(); diff --git a/Processes/Sibyll/Interaction.cc b/Processes/Sibyll/Interaction.cc index 4894301e729825941a1120777eabafca845ca179..8300462c6de387e9f0ed62d8adca49db96c3fcd3 100644 --- a/Processes/Sibyll/Interaction.cc +++ b/Processes/Sibyll/Interaction.cc @@ -32,14 +32,9 @@ using Track = Trajectory; namespace corsika::process::sibyll { - Interaction::Interaction() {} - - Interaction::~Interaction() { - cout << "Sibyll::Interaction n=" << count_ << " Nnuc=" << nucCount_ << endl; - } - - void Interaction::Init() { + bool Interaction::initialized_ = false; + Interaction::Interaction() { using random::RNGManager; // initialize Sibyll @@ -49,6 +44,10 @@ namespace corsika::process::sibyll { } } + Interaction::~Interaction() { + cout << "Sibyll::Interaction n=" << count_ << " Nnuc=" << nucCount_ << endl; + } + void Interaction::SetAllStable() { for (int i = 0; i < 99; ++i) s_csydec_.idb[i] = -1 * abs(s_csydec_.idb[i]); } @@ -320,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 80a1282185c100084b02766833a1cc7e9a83b52d..bcc9b632e8ce622ef55dbb2c25ea6d160f0609c9 100644 --- a/Processes/Sibyll/Interaction.h +++ b/Processes/Sibyll/Interaction.h @@ -20,17 +20,15 @@ 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(); ~Interaction(); - void Init(); - void SetAllStable(); - bool WasInitialized() { return initialized_; } + static bool WasInitialized() { return initialized_; } bool IsValidCoMEnergy(corsika::units::si::HEPEnergyType ecm) const { return (minEnergyCoM_ <= ecm) && (ecm <= maxEnergyCoM_); } diff --git a/Processes/Sibyll/NuclearInteraction.cc b/Processes/Sibyll/NuclearInteraction.cc index 802cee9334e4a5f5303da3d7152d4149ac679072..451a5c643478a54db7199a0ef919ddc464cacb5c 100644 --- a/Processes/Sibyll/NuclearInteraction.cc +++ b/Processes/Sibyll/NuclearInteraction.cc @@ -34,12 +34,6 @@ using Track = Trajectory; namespace corsika::process::sibyll { - template <> - NuclearInteraction<SetupEnvironment>::NuclearInteraction( - process::sibyll::Interaction& hadint, SetupEnvironment const& env) - : environment_(env) - , hadronicInteraction_(hadint) {} - template <> NuclearInteraction<SetupEnvironment>::~NuclearInteraction() { cout << "Nuclib::NuclearInteraction n=" << count_ << " Nnuc=" << nucCount_ << endl; @@ -134,26 +128,6 @@ namespace corsika::process::sibyll { } } - template <> - void NuclearInteraction<SetupEnvironment>::Init() { - // initialize hadronic interaction module - // TODO: safe to run multiple initializations? - if (!hadronicInteraction_.WasInitialized()) hadronicInteraction_.Init(); - - // check compatibility of energy ranges, someone could try to use low-energy model.. - if (!hadronicInteraction_.IsValidCoMEnergy(GetMinEnergyPerNucleonCoM()) || - !hadronicInteraction_.IsValidCoMEnergy(GetMaxEnergyPerNucleonCoM())) - throw std::runtime_error( - "NuclearInteraction: hadronic interaction model incompatible!"); - - // initialize nuclib - // TODO: make sure this does not overlap with sibyll - nuc_nuc_ini_(); - - // initialize cross sections - InitializeNuclearCrossSections(); - } - template <> units::si::CrossSectionType NuclearInteraction<SetupEnvironment>::ReadCrossSectionTable( const int ia, particles::Code pTarget, units::si::HEPEnergyType elabnuc) { @@ -608,4 +582,27 @@ namespace corsika::process::sibyll { return process::EProcessReturn::eOk; } + template <> + NuclearInteraction<SetupEnvironment>::NuclearInteraction( + process::sibyll::Interaction& hadint, SetupEnvironment const& env) + : environment_(env) + , hadronicInteraction_(hadint) { + + // initialize hadronic interaction module + // TODO: safe to run multiple initializations? + + // check compatibility of energy ranges, someone could try to use low-energy model.. + if (!hadronicInteraction_.IsValidCoMEnergy(GetMinEnergyPerNucleonCoM()) || + !hadronicInteraction_.IsValidCoMEnergy(GetMaxEnergyPerNucleonCoM())) + throw std::runtime_error( + "NuclearInteraction: hadronic interaction model incompatible!"); + + // initialize nuclib + // TODO: make sure this does not overlap with sibyll + nuc_nuc_ini_(); + + // initialize cross sections + InitializeNuclearCrossSections(); + } + } // namespace corsika::process::sibyll diff --git a/Processes/Sibyll/NuclearInteraction.h b/Processes/Sibyll/NuclearInteraction.h index 061545c76a7dfdd5b2ed1a25e74c2e98fc98cb41..8897d199dfa605f76c43a53c6edfeb838f797d7b 100644 --- a/Processes/Sibyll/NuclearInteraction.h +++ b/Processes/Sibyll/NuclearInteraction.h @@ -30,7 +30,7 @@ namespace corsika::process::sibyll { public: NuclearInteraction(corsika::process::sibyll::Interaction&, TEnvironment const&); ~NuclearInteraction(); - void Init(); + void InitializeNuclearCrossSections(); void PrintCrossSectionTable(corsika::particles::Code); corsika::units::si::CrossSectionType ReadCrossSectionTable( diff --git a/Processes/Sibyll/SibStack.h b/Processes/Sibyll/SibStack.h index 41cbce1e412ebde01858f2a54ff0af9d28b2ef2d..e3ebcc8ff87ba629a32c93f30840c131d5ae0cbb 100644 --- a/Processes/Sibyll/SibStack.h +++ b/Processes/Sibyll/SibStack.h @@ -22,7 +22,6 @@ namespace corsika::process::sibyll { class SibStackData { public: - void Init(); void Dump() const {} void Clear() { s_plist_.np = 0; } diff --git a/Processes/Sibyll/testSibyll.cc b/Processes/Sibyll/testSibyll.cc index 7568f2b74b81912707e61e24563c6c209d774a22..2aab98c2ab9716d82e2cd78cf5f0ae6b817381eb 100644 --- a/Processes/Sibyll/testSibyll.cc +++ b/Processes/Sibyll/testSibyll.cc @@ -135,7 +135,6 @@ TEST_CASE("SibyllInterface", "[processes]") { Interaction model; - model.Init(); [[maybe_unused]] const process::EProcessReturn ret = model.DoInteraction(projectile); [[maybe_unused]] auto const pSum = sumMomentum(view, cs); @@ -163,7 +162,6 @@ TEST_CASE("SibyllInterface", "[processes]") { Interaction hmodel; NuclearInteraction model(hmodel, env); - model.Init(); [[maybe_unused]] const process::EProcessReturn ret = model.DoInteraction(projectile); [[maybe_unused]] const GrammageType length = model.GetInteractionLength(particle); } @@ -187,8 +185,6 @@ TEST_CASE("SibyllInterface", "[processes]") { model.PrintDecayConfig(); - model.Init(); - [[maybe_unused]] const TimeType time = model.GetLifetime(particle); /*[[maybe_unused]] const process::EProcessReturn ret =*/model.DoDecay(projectile); diff --git a/Processes/StackInspector/StackInspector.cc b/Processes/StackInspector/StackInspector.cc index 772196febdf3904d133e581bbb02dd359a8a803a..56b1f0df8f4819c07b4c77f431e54851d3ad2344 100644 --- a/Processes/StackInspector/StackInspector.cc +++ b/Processes/StackInspector/StackInspector.cc @@ -32,7 +32,11 @@ StackInspector<TStack>::StackInspector(const int vNStep, const bool vReportStack : StackProcess<StackInspector<TStack>>(vNStep) , ReportStack_(vReportStack) , E0_(vE0) - , StartTime_(std::chrono::system_clock::now()) {} + , StartTime_(std::chrono::system_clock::now()) { + + ReportStack_ = false; + StartTime_ = std::chrono::system_clock::now(); +} template <typename TStack> StackInspector<TStack>::~StackInspector() {} @@ -78,12 +82,6 @@ process::EProcessReturn StackInspector<TStack>::DoStack(const TStack& vS) { return process::EProcessReturn::eOk; } -template <typename TStack> -void StackInspector<TStack>::Init() { - ReportStack_ = false; - StartTime_ = std::chrono::system_clock::now(); -} - #include <corsika/cascade/testCascade.h> #include <corsika/setup/SetupStack.h> diff --git a/Processes/StackInspector/StackInspector.h b/Processes/StackInspector/StackInspector.h index de4a9912c9f5c2f050bbf5ad4fe48e0c39bfae8f..280ff15e6b97117d9936996a1953490063d688d2 100644 --- a/Processes/StackInspector/StackInspector.h +++ b/Processes/StackInspector/StackInspector.h @@ -30,7 +30,6 @@ namespace corsika::process { const corsika::units::si::HEPEnergyType vE0); ~StackInspector(); - void Init(); EProcessReturn DoStack(const TStack&); /** diff --git a/Processes/StackInspector/testStackInspector.cc b/Processes/StackInspector/testStackInspector.cc index ed27628a6d9798c285831aed05bf328709bac8c5..89edc2a44e8f56f2d9022f2d0ecb688a7e41881f 100644 --- a/Processes/StackInspector/testStackInspector.cc +++ b/Processes/StackInspector/testStackInspector.cc @@ -47,7 +47,6 @@ TEST_CASE("StackInspector", "[processes]") { StackInspector<TestCascadeStack> model(1, true, E0); - model.Init(); [[maybe_unused]] const process::EProcessReturn ret = model.DoStack(stack); } } diff --git a/Processes/SwitchProcess/SwitchProcess.h b/Processes/SwitchProcess/SwitchProcess.h index e59e28da249f57610c09ecd48ffa1c9135e9974f..fe9293cf05986536a3142fa9a303960da4cb0181 100644 --- a/Processes/SwitchProcess/SwitchProcess.h +++ b/Processes/SwitchProcess/SwitchProcess.h @@ -36,11 +36,6 @@ namespace corsika::process::switch_process { , fHighEProcess(vHighEProcess) , fThresholdEnergy(vThresholdEnergy) {} - void Init() { - fLowEProcess.Init(); - fHighEProcess.Init(); - } - template <typename TParticle> corsika::units::si::InverseGrammageType GetInverseInteractionLength(TParticle& p) { return 1 / GetInteractionLength(p); diff --git a/Processes/SwitchProcess/testSwitchProcess.cc b/Processes/SwitchProcess/testSwitchProcess.cc index 0fee9b70cefdd4f3896b29886eed780248fe92b1..0cff57f16fca233f3f75a38e22f006a4759341fe 100644 --- a/Processes/SwitchProcess/testSwitchProcess.cc +++ b/Processes/SwitchProcess/testSwitchProcess.cc @@ -24,7 +24,6 @@ class TestStackData { public: // these functions are needed for the Stack interface - void Init() {} void Clear() { fData.clear(); } unsigned int GetSize() const { return fData.size(); } unsigned int GetCapacity() const { return fData.size(); } @@ -96,7 +95,6 @@ auto constexpr kgMSq = 1_kg / (1_m * 1_m); template <int N> struct DummyProcess : InteractionProcess<DummyProcess<N>> { - void Init() {} template <typename TParticle> corsika::units::si::GrammageType GetInteractionLength(TParticle const&) const { diff --git a/Processes/TrackWriter/TrackWriter.cc b/Processes/TrackWriter/TrackWriter.cc index 530b4778c622f4877e4ddc9732e49b1f4963732c..8c4506120a98297582ee5d1a09154b084450fa87 100644 --- a/Processes/TrackWriter/TrackWriter.cc +++ b/Processes/TrackWriter/TrackWriter.cc @@ -22,7 +22,9 @@ using Track = Trajectory; namespace corsika::process::track_writer { - void TrackWriter::Init() { + TrackWriter::TrackWriter(std::string const& filename) + : fFilename(filename) { + using namespace std::string_literals; fFile.open(fFilename); diff --git a/Processes/TrackWriter/TrackWriter.h b/Processes/TrackWriter/TrackWriter.h index 8387d4a9fc91fc41569999d1575cdabb59e95ed0..f253c6d42fcd4af6893ae02df84361d26a445abc 100644 --- a/Processes/TrackWriter/TrackWriter.h +++ b/Processes/TrackWriter/TrackWriter.h @@ -19,10 +19,7 @@ namespace corsika::process::track_writer { class TrackWriter : public corsika::process::ContinuousProcess<TrackWriter> { public: - TrackWriter(std::string const& filename) - : fFilename(filename) {} - - void Init(); + TrackWriter(std::string const& filename); template <typename Particle, typename Track> corsika::process::EProcessReturn DoContinuous(Particle&, Track&); diff --git a/Processes/UrQMD/UrQMD.h b/Processes/UrQMD/UrQMD.h index 6fb3d0234cd13a077f7d7ad95e49710091eb2128..1852e3d2e6e2a1336f224d7af05c3abdbd216486 100644 --- a/Processes/UrQMD/UrQMD.h +++ b/Processes/UrQMD/UrQMD.h @@ -26,7 +26,6 @@ namespace corsika::process::UrQMD { class UrQMD : public corsika::process::InteractionProcess<UrQMD> { public: UrQMD(std::string const& path = utl::CorsikaData("UrQMD/UrQMD-1.3.1-xs.dat")); - void Init() {} corsika::units::si::GrammageType GetInteractionLength( corsika::setup::Stack::StackIterator const&) const; diff --git a/Setup/SetupStack.h b/Setup/SetupStack.h index 30f60cd87303cd2a0ddf9e157064aaaab9f8fcd5..5bf8a2b49dee733f3e1d101fc8b60cbc4134de97 100644 --- a/Setup/SetupStack.h +++ b/Setup/SetupStack.h @@ -37,7 +37,6 @@ public: using BaseNodeType = typename TEnvType::BaseNodeType; // these functions are needed for the Stack interface - void Init() {} void Clear() { fNode.clear(); } unsigned int GetSize() const { return fNode.size(); } unsigned int GetCapacity() const { return fNode.size(); }