Jpp  17.3.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions
JPrintTriggerBits.cc File Reference

Auxiliary program to print trigger bits. More...

#include <iostream>
#include <iomanip>
#include "km3net-dataformat/online/JDAQTriggerMask.hh"
#include "JTrigger/JTriggerBits.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 trigger bits.

Author
mdejong

Definition in file JPrintTriggerBits.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 18 of file JPrintTriggerBits.cc.

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:1517
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:1993
#define FATAL(A)
Definition: JMessage.hh:67
const char * getTriggerName(JTriggerbit_t bit)
Get trigger name.
int debug
debug level