diff --git a/Documentation/Examples/cascade_example.cc b/Documentation/Examples/cascade_example.cc index e26258a7782297766e855148a340ee7031671f80..4fe3368a5f79e8185bcc37d7e413a501450c8d8d 100644 --- a/Documentation/Examples/cascade_example.cc +++ b/Documentation/Examples/cascade_example.cc @@ -45,19 +45,16 @@ using namespace corsika::environment; using namespace std; using namespace corsika::units::hep; -static EnergyType fEnergy = 0. * 1_GeV; - -// FOR NOW: global static variables for ParticleCut process -// this is just wrong... -static EnergyType fEmEnergy; -static int fEmCount; - -static EnergyType fInvEnergy; -static int fInvCount; - class ProcessCut : public corsika::process::ContinuousProcess<ProcessCut> { + EnergyType fECut; + mutable EnergyType fEnergy = 0_GeV; + mutable EnergyType fEmEnergy = 0_GeV; + mutable int fEmCount = 0; + mutable EnergyType fInvEnergy = 0_GeV; + mutable int fInvCount = 0; + public: ProcessCut(const EnergyType v) : fECut(v) {} @@ -139,7 +136,8 @@ public: EProcessReturn DoContinuous(Particle& p, setup::Trajectory&, Stack&) const { const Code pid = p.GetPID(); EnergyType energy = p.GetEnergy(); - cout << "ProcessCut: DoContinuous: " << pid << " E= " << energy << endl; + cout << "ProcessCut: DoContinuous: " << pid << " E= " << energy + << ", EcutTot=" << (fEmEnergy + fInvEnergy + fEnergy) / 1_GeV << " GeV" << endl; EProcessReturn ret = EProcessReturn::eOk; if (isEmParticle(pid)) { cout << "removing em. particle..." << endl; diff --git a/Framework/Units/PhysicalUnits.h b/Framework/Units/PhysicalUnits.h index 1ad2d6428ef870aeaccd3fd55400d8e03a5ab2bf..fe4e284acd7f039147acebb39512390bcef1431c 100644 --- a/Framework/Units/PhysicalUnits.h +++ b/Framework/Units/PhysicalUnits.h @@ -12,7 +12,6 @@ on. This breaks ADL (argument-dependent lookup). Here we "fix" this: */ namespace phys::units { - // using namespace phys::units::io; using phys::units::io::operator<<; } // namespace phys::units diff --git a/Stack/SuperStupidStack/testSuperStupidStack.cc b/Stack/SuperStupidStack/testSuperStupidStack.cc index 6047fc8513ddaeef769ad6fc401b63f6be9339d0..dbb585a237d2ec201bd99449046046ea6afa7ecc 100644 --- a/Stack/SuperStupidStack/testSuperStupidStack.cc +++ b/Stack/SuperStupidStack/testSuperStupidStack.cc @@ -46,8 +46,8 @@ TEST_CASE("SuperStupidStack", "[stack]") { REQUIRE(pout.GetPID() == particles::Code::Electron); REQUIRE(pout.GetEnergy() == 1.5_GeV); // REQUIRE(pout.GetMomentum() == stack::super_stupid::MomentumVector(dummyCS, {1_GeV, - // 1_GeV, 1_GeV})); REQUIRE(pout.GetPosition() == Point(dummyCS, {1 * meter, 1 * meter, - // 1 * meter})); + // 1_GeV, 1_GeV})); REQUIRE(pout.GetPosition() == Point(dummyCS, {1 * meter, 1 * + // meter, 1 * meter})); REQUIRE(pout.GetTime() == 100_s); }