Jpp 19.3.0-rc.1
the software that should make you happy
Loading...
Searching...
No Matches
JNPE.cc File Reference

Auxiliary program to print number of photo-electrons. More...

#include <string>
#include <iostream>
#include <iomanip>
#include "JSirene/JSireneToolkit.hh"
#include "Jeep/JPrint.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Auxiliary program to print number of photo-electrons.

Author
mdejong

Definition in file JNPE.cc.

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Definition at line 18 of file JNPE.cc.

19{
20 using namespace std;
21
22 int npe;
23 int debug;
24
25 try {
26
27 JParser<> zap("Auxiliary program to print number of photo-electrons.");
28
29 zap['N'] = make_field(npe);
30 zap['d'] = make_field(debug) = 2;
31
32 zap(argc, argv);
33 }
34 catch(const exception &error) {
35 FATAL(error.what() << endl);
36 }
37
38 using namespace JPP;
39
40 int number_of_hits = 0;
41
42 for (int n0 = npe; n0 != 0; ++number_of_hits) {
43
44 const int n1 = getNumberOfPhotoElectrons(n0);
45
46 cout << setw(3) << n1 << ' ' << flush;
47
48 n0 -= n1;
49 }
50
51 cout << endl;
52 cout << "number of hits " << number_of_hits << endl;
53}
#define FATAL(A)
Definition JMessage.hh:67
int debug
debug level
Definition JSirene.cc:72
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition JParser.hh:2142
Utility class to parse command line options.
Definition JParser.hh:1698
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
const struct JSIRENE::number_of_photo_electrons_type getNumberOfPhotoElectrons