IAP GITLAB

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

added a few more basic unit-tests for Examples. This is supposed to catch...

added a few more basic unit-tests for Examples. This is supposed to catch future failures of this type.
parent 8656c3b5
No related branches found
No related tags found
No related merge requests found
......@@ -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);
}
......@@ -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);
}
......@@ -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);
}
......@@ -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
......
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