IAP GITLAB

Skip to content
Snippets Groups Projects
Commit 813a49b9 authored by ralfulrich's avatar ralfulrich
Browse files

a bit more printout

parent e836ee96
No related branches found
No related tags found
1 merge request!39Resolve "cascade example debugging"
...@@ -45,19 +45,16 @@ using namespace corsika::environment; ...@@ -45,19 +45,16 @@ using namespace corsika::environment;
using namespace std; using namespace std;
using namespace corsika::units::hep; 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> { class ProcessCut : public corsika::process::ContinuousProcess<ProcessCut> {
EnergyType fECut; 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: public:
ProcessCut(const EnergyType v) ProcessCut(const EnergyType v)
: fECut(v) {} : fECut(v) {}
...@@ -139,7 +136,8 @@ public: ...@@ -139,7 +136,8 @@ public:
EProcessReturn DoContinuous(Particle& p, setup::Trajectory&, Stack&) const { EProcessReturn DoContinuous(Particle& p, setup::Trajectory&, Stack&) const {
const Code pid = p.GetPID(); const Code pid = p.GetPID();
EnergyType energy = p.GetEnergy(); 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; EProcessReturn ret = EProcessReturn::eOk;
if (isEmParticle(pid)) { if (isEmParticle(pid)) {
cout << "removing em. particle..." << endl; cout << "removing em. particle..." << endl;
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
on. This breaks ADL (argument-dependent lookup). Here we "fix" this: on. This breaks ADL (argument-dependent lookup). Here we "fix" this:
*/ */
namespace phys::units { namespace phys::units {
// using namespace phys::units::io;
using phys::units::io::operator<<; using phys::units::io::operator<<;
} // namespace phys::units } // namespace phys::units
......
...@@ -46,8 +46,8 @@ TEST_CASE("SuperStupidStack", "[stack]") { ...@@ -46,8 +46,8 @@ TEST_CASE("SuperStupidStack", "[stack]") {
REQUIRE(pout.GetPID() == particles::Code::Electron); REQUIRE(pout.GetPID() == particles::Code::Electron);
REQUIRE(pout.GetEnergy() == 1.5_GeV); REQUIRE(pout.GetEnergy() == 1.5_GeV);
// REQUIRE(pout.GetMomentum() == stack::super_stupid::MomentumVector(dummyCS, {1_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_GeV, 1_GeV})); REQUIRE(pout.GetPosition() == Point(dummyCS, {1 * meter, 1 *
// 1 * meter})); // meter, 1 * meter}));
REQUIRE(pout.GetTime() == 100_s); REQUIRE(pout.GetTime() == 100_s);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment