Jpp 20.0.0-27-g39925593c-D
the software that should make you happy
Loading...
Searching...
No Matches
Functions
JSummaryMonitor.cc File Reference

Auxiliary program to monitor summary data. More...

#include <string>
#include <iostream>
#include <iomanip>
#include <set>
#include "JDAQ/JDAQSummarysliceIO.hh"
#include "JSupport/JSingleFileScanner.hh"
#include "JSupport/JSupport.hh"
#include "JTools/JStats.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 monitor summary data.

Author
mdejong

Definition in file JSummaryMonitor.cc.

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Definition at line 23 of file JSummaryMonitor.cc.

24{
25 using namespace std;
26 using namespace JPP;
27 using namespace KM3NETDAQ;
28
30 JLimit_t& numberOfEvents = inputFile.getLimit();
31 int qaqc;
33 int debug;
34
35 try {
36
37 JParser<> zap("Auxiliary program to monitor summary data.");
38
39 zap['f'] = make_field(inputFile);
40 zap['n'] = make_field(numberOfEvents) = JLimit::max();
41 zap['Q'] = make_field(qaqc) = 0;
42 zap['t'] = make_field(highRateThreshold) = 50000;
43 zap['d'] = make_field(debug) = 1;
44
45 zap(argc, argv);
46 }
47 catch(const exception &error) {
48 FATAL(error.what() << endl);
49 }
50
51
52 JStats Q1("DAQ ");
53 JStats Q2("WR ");
54 JStats Q3("High-rate veto");
55 JStats Q4("FIFO ");
56 JStats Q5("PMT ");
57 JStats Q6("Rate [Hz] ");
58
60
62 int nbOfDuplicated = 0;
63
64 while (inputFile.hasNext()) {
65
66 STATUS("event: " << setw(10) << inputFile.getCounter() << '\r'); DEBUG(endl);
67
68 JDAQSummaryslice* summaryslice = inputFile.next();
69
70 int frameIndex = summaryslice->getFrameIndex();
71
72 if (!frameIndexCounter.insert(frameIndex).second) {
73 nbOfDuplicated += 1;
74 }
75
76
77 int numberOfPTMs = 0;
78
79 for (JDAQSummaryslice::const_iterator frame = summaryslice->begin(); frame != summaryslice->end(); ++frame) {
80
81 Q1.put(frame->testDAQStatus() ? 1.0 : 0.0);
82 Q2.put(frame->testWhiteRabbitStatus() ? 1.0 : 0.0);
83
84 Q3.put((double) frame->countHighRateVeto() / (double) NUMBER_OF_PMTS);
85 Q4.put((double) frame->countFIFOStatus() / (double) NUMBER_OF_PMTS);
86
87 for (int pmt = 0; pmt != NUMBER_OF_PMTS; ++pmt) {
88
89 if ((*frame)[pmt].is_valid()) {
91 }
92
93 if (!frame->testHighRateVeto(pmt) &&
94 !frame->testFIFOStatus (pmt)) {
95 Q6.put(frame->getRate(pmt));
96 // Number of PMT/Timeslices with an unfiltered rate > 50 kHz
97 if (frame->getRate(pmt) > highRateThreshold){
99 }
100 }
101 }
102 }
103
104 Q5.put((double) numberOfPTMs);
105 }
106 STATUS(endl);
107
108 for (const JStats* p : { &Q1, &Q2, &Q3, &Q4, &Q5, &Q6}) {
109 STATUS(*p);
110 }
111
112 STATUS("Number of high-rate vetos not filtered " << setw(6) << nbOfHighRateNotFiltered << endl);
113 STATUS("Number of duplicated frame indices " << setw(6) << nbOfDuplicated << endl);
114
115 QAQC(""
116 << FIXED(7,5) << Q1.getMean() << ' '
117 << FIXED(7,5) << Q2.getMean() << ' '
118 << FIXED(7,5) << Q3.getMean() << ' '
119 << FIXED(7,5) << Q4.getMean() << ' '
120 << FIXED(8,1) << Q5.getMean() << ' '
121 << FIXED(7,0) << Q6.getMean() << ' '
122 << FIXED(7,0) << Q6.getSTDev() << ' '
123 << FIXED(7,0) << nbOfHighRateNotFiltered << ' '
124 << FIXED(7,0) << nbOfDuplicated << endl);
125}
#define DEBUG(A)
Message macros.
Definition JMessage.hh:62
#define STATUS(A)
Definition JMessage.hh:63
#define QAQC(A)
QA/QC output macro.
Definition JMessage.hh:100
int qaqc
QA/QC file descriptor.
#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
Template definition of a multi-dimensional oscillation probability interpolation table.
void insert(const JMultiFunction< __JFunction_t, __JMaplist_t, __JDistance_t > &input)
Insert multidimensional input.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
KM3NeT DAQ data structures and auxiliaries.
Definition DataQueue.cc:39
static const int NUMBER_OF_PMTS
Total number of PMTs in module.
Definition JDAQ.hh:26
Auxiliary data structure for floating point format specification.
Definition JManip.hh:448
Auxiliary class for defining the range of iterations of objects.
Definition JLimit.hh:45
static counter_type max()
Get maximum counter value.
Definition JLimit.hh:128
Auxiliary data structure for running average and standard deviation.
Definition JStats.hh:44