IAP GITLAB

Skip to content
Snippets Groups Projects
Commit cd6fbba2 authored by Felix Riehn's avatar Felix Riehn
Browse files

added summary

parent 288a94a0
No related branches found
No related tags found
2 merge requests!234WIP: Initial example of python as script language from C++,!201Resolve "handling of off-shell particles"
......@@ -46,6 +46,9 @@ namespace corsika::process {
const HEPEnergyType e_shifted =
sqrt(p_original.GetSquaredNorm() + m_corsika * m_corsika);
auto const e_shift_relative = (e_shifted / e_original - 1);
count_ = count_ + 1;
average_shift_ += abs(e_shift_relative);
if (abs(e_shift_relative) > max_shift_) max_shift_ = abs(e_shift_relative);
/*
For now we warn if the necessary shift is larger than 1%.
we could promote this to an error.
......
......@@ -19,12 +19,24 @@
namespace corsika::process {
namespace on_shell_check {
class OnShellCheck : public process::SecondariesProcess<OnShellCheck> {
double average_shift_ = 0;
double max_shift_ = 0;
double count_ = 0;
public:
OnShellCheck(const double vMassTolerance, const double vEnergyTolerance)
: mass_tolerance_(vMassTolerance)
, energy_tolerance_(vEnergyTolerance) {}
~OnShellCheck() {
std::cout << "OnShellCheck: summary" << std::endl
<< " particles shifted: " << int(count_) << std::endl;
if (count_)
std::cout << " average energy shift (%): " << average_shift_ / count_ * 100.
<< std::endl
<< " max. energy shift (%): " << max_shift_ * 100. << std::endl;
};
EProcessReturn DoSecondaries(corsika::setup::StackView&);
void Init();
......
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