Jpp 19.3.0-rc.1
the software that should make you happy
Loading...
Searching...
No Matches
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 */
18int 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}
General purpose messaging.
#define FATAL(A)
Definition JMessage.hh:67
int debug
debug level
Definition JSirene.cc:72
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition JParser.hh:2142
int main(int argc, char **argv)
Setting of trigger bits.
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 char * getTriggerName(JTriggerbit_t bit)
Get trigger name.
KM3NeT DAQ data structures and auxiliaries.
Definition DataQueue.cc:39
static const unsigned int NUMBER_OF_TRIGGER_BITS
Number of trigger bits.