#include #include #include #include "JSirene/JSireneToolkit.hh" #include "Jeep/JPrint.hh" #include "Jeep/JParser.hh" #include "Jeep/JMessage.hh" /** * \file * * Auxiliary program to print number of photo-electrons. * \author mdejong */ int main(int argc, char **argv) { using namespace std; int npe; int debug; try { JParser<> zap("Auxiliary program to print number of photo-electrons."); zap['N'] = make_field(npe); zap['d'] = make_field(debug) = 2; zap(argc, argv); } catch(const exception &error) { FATAL(error.what() << endl); } using namespace JPP; int number_of_hits = 0; for (int n0 = npe; n0 != 0; ++number_of_hits) { const int n1 = getNumberOfPhotoElectrons(n0); cout << setw(3) << n1 << ' ' << flush; n0 -= n1; } cout << endl; cout << "number of hits " << number_of_hits << endl; }