diff --git a/Documentation/Examples/boundary_example.cc b/Documentation/Examples/boundary_example.cc index f9839a7b2685cf972a191034a53bd4b6008e1023..ff4885b378251e0e93e3137c5357dc0f1858d211 100644 --- a/Documentation/Examples/boundary_example.cc +++ b/Documentation/Examples/boundary_example.cc @@ -178,4 +178,8 @@ int main() { cut.GetCutEnergy() + cut.GetInvEnergy() + cut.GetEmEnergy(); cout << "total energy (GeV): " << Efinal / 1_GeV << endl << "relative difference (%): " << (Efinal / E0 - 1.) * 100 << endl; + + // basic check for unit-tests + assert(cut.GetNumberEmParticles() == 29785); + assert(cut.GetNumberInvParticles() == 26697); } diff --git a/Documentation/Examples/cascade_example.cc b/Documentation/Examples/cascade_example.cc index 3b5d561005c4cb2bb904c0fff358979ec5d2b5b6..c2cc3c4f49f0ce60b089a9e3b893151e6b7464e8 100644 --- a/Documentation/Examples/cascade_example.cc +++ b/Documentation/Examples/cascade_example.cc @@ -158,4 +158,8 @@ int main() { << "relative difference (%): " << (Efinal / E0 - 1) * 100 << endl; cout << "total dEdX energy (GeV): " << eLoss.GetTotal() / 1_GeV << endl << "relative difference (%): " << eLoss.GetTotal() / E0 * 100 << endl; + + // basic check for unit-tests + assert(cut.GetNumberEmParticles() == 127); + assert(cut.GetNumberInvParticles() == 116); } diff --git a/Documentation/Examples/vertical_EAS.cc b/Documentation/Examples/vertical_EAS.cc index 0b3d4641a8fa6db56ea407049ceef2332d185228..7745c16289848a8fe8d58c122ae2f607b1bace7c 100644 --- a/Documentation/Examples/vertical_EAS.cc +++ b/Documentation/Examples/vertical_EAS.cc @@ -151,4 +151,8 @@ int main() { << "relative difference (%): " << (Efinal / E0 - 1) * 100 << endl; cout << "total dEdX energy (GeV): " << eLoss.GetTotal() / 1_GeV << endl << "relative difference (%): " << eLoss.GetTotal() / E0 * 100 << endl; + + // basic check for unit-tests + assert(cut.GetNumberEmParticles() == 526); + assert(cut.GetNumberInvParticles() == 645); } diff --git a/Processes/ParticleCut/ParticleCut.h b/Processes/ParticleCut/ParticleCut.h index 6d5f7a685cccbce7f2e079a3c291f90dbf20039b..739a1919ebc20a8c080759baedf4eae5cb942e75 100644 --- a/Processes/ParticleCut/ParticleCut.h +++ b/Processes/ParticleCut/ParticleCut.h @@ -24,9 +24,9 @@ namespace corsika::process { units::si::HEPEnergyType fEnergy = 0 * units::si::electronvolt; units::si::HEPEnergyType fEmEnergy = 0 * units::si::electronvolt; - int fEmCount = 0; + unsigned int fEmCount = 0; units::si::HEPEnergyType fInvEnergy = 0 * units::si::electronvolt; - int fInvCount = 0; + unsigned int fInvCount = 0; public: ParticleCut(const units::si::HEPEnergyType vCut) @@ -46,6 +46,8 @@ namespace corsika::process { units::si::HEPEnergyType GetInvEnergy() const { return fInvEnergy; } units::si::HEPEnergyType GetCutEnergy() const { return fEnergy; } units::si::HEPEnergyType GetEmEnergy() const { return fEmEnergy; } + unsigned int GetNumberEmParticles() const { return fEmCount; } + unsigned int GetNumberInvParticles() const { return fInvCount; } }; } // namespace particle_cut } // namespace corsika::process