Jpp test-rotations-new
the software that should make you happy
Loading...
Searching...
No Matches
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

◆ main()

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}
#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 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.