Jpp  18.3.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JPrintTriggerBits.cc
Go to the documentation of this file.
1 #include <iostream>
2 #include <iomanip>
3 
5 
7 
8 #include "Jeep/JParser.hh"
9 #include "Jeep/JMessage.hh"
10 
11 
12 /**
13  * \file
14  *
15  * Auxiliary program to print trigger bits.
16  * \author mdejong
17  */
18 int main(int argc, char **argv)
19 {
20  using namespace std;
21  using namespace JPP;
22  using namespace KM3NETDAQ;
23 
24  int debug;
25 
26  try {
27 
28  JParser<> zap("Auxiliary program to print trigger bits.");
29 
30  zap['d'] = make_field(debug) = 1;
31 
32  zap(argc, argv);
33  }
34  catch(const exception &error) {
35  FATAL(error.what() << endl);
36  }
37 
38  size_t number_of_trigger_bits = 0;
39 
40  for (size_t i = 1; i <= NUMBER_OF_TRIGGER_BITS; ++i) {
41 
42  const char* const buffer = getTriggerName(i);
43 
44  if (buffer != NULL) {
45 
46  cout << (number_of_trigger_bits == 0 ? "" : " ") << buffer;
47 
48  ++number_of_trigger_bits;
49  }
50  }
51 
52  if (number_of_trigger_bits != 0) {
53  cout << endl;
54  }
55 
56  return 0;
57 }
Utility class to parse command line options.
Definition: JParser.hh:1514
int main(int argc, char *argv[])
Definition: Main.cc:15
static const unsigned int NUMBER_OF_TRIGGER_BITS
Number of trigger bits.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1989
General purpose messaging.
#define FATAL(A)
Definition: JMessage.hh:67
Utility class to parse command line options.
const char * getTriggerName(JTriggerbit_t bit)
Get trigger name.
Setting of trigger bits.
int debug
debug level