Jpp  15.0.1-rc.1-highQE
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions
JSummaryMonitor.cc File Reference

Auxiliary program to monitor summary data. More...

#include <string>
#include <iostream>
#include <iomanip>
#include "JDAQ/JDAQSummarysliceIO.hh"
#include "JSupport/JSingleFileScanner.hh"
#include "JSummaryslice/JSummaryslice.hh"
#include "JSupport/JSupport.hh"
#include "JTools/JQuantile.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

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;
32  int debug;
33 
34  try {
35 
36  JParser<> zap("Auxiliary program to monitor summary data.");
37 
38  zap['f'] = make_field(inputFile);
39  zap['n'] = make_field(numberOfEvents) = JLimit::max();
40  zap['Q'] = make_field(qaqc) = 0;
41  zap['d'] = make_field(debug) = 1;
42 
43  zap(argc, argv);
44  }
45  catch(const exception &error) {
46  FATAL(error.what() << endl);
47  }
48 
49 
50  JQuantile Q1("DAQ ");
51  JQuantile Q2("WR ");
52  JQuantile Q3("High-rate veto");
53  JQuantile Q4("FIFO ");
54  JQuantile Q5("PMT ");
55  JQuantile Q6("Rate [Hz] ");
56 
57  while (inputFile.hasNext()) {
58 
59  STATUS("event: " << setw(10) << inputFile.getCounter() << '\r'); DEBUG(endl);
60 
61  JDAQSummaryslice* summaryslice = inputFile.next();
62 
63  int numberOfPTMs = 0;
64 
65  for (JDAQSummaryslice::const_iterator frame = summaryslice->begin(); frame != summaryslice->end(); ++frame) {
66 
67  Q1.put(frame->testDAQStatus() ? 1.0 : 0.0);
68  Q2.put(frame->testWhiteRabbitStatus() ? 1.0 : 0.0);
69 
70  Q3.put((double) frame->countHighRateVeto() / (double) NUMBER_OF_PMTS);
71  Q4.put((double) frame->countFIFOStatus() / (double) NUMBER_OF_PMTS);
72 
73  for (int pmt = 0; pmt != NUMBER_OF_PMTS; ++pmt) {
74 
75  if (frame->getValue(pmt) != 0) {
76  ++numberOfPTMs;
77  }
78 
79  if (!frame->testHighRateVeto(pmt) &&
80  !frame->testFIFOStatus (pmt)) {
81  Q6.put(frame->getRate(pmt));
82  }
83  }
84  }
85 
86  Q5.put((double) numberOfPTMs);
87  }
88  STATUS(endl);
89 
90  for (const JQuantile* p : { &Q1, &Q2, &Q3, &Q4, &Q5, &Q6}) {
91  STATUS(*p);
92  }
93 
94  QAQC(""
95  << FIXED(7,5) << Q1.getMean() << ' '
96  << FIXED(7,5) << Q2.getMean() << ' '
97  << FIXED(7,5) << Q3.getMean() << ' '
98  << FIXED(7,5) << Q4.getMean() << ' '
99  << FIXED(8,1) << Q5.getMean() << ' '
100  << FIXED(7,0) << Q6.getMean() << ' '
101  << FIXED(7,0) << Q6.getSTDev() << endl);
102 }
Utility class to parse command line options.
Definition: JParser.hh:1500
Auxiliary data structure for running average, standard deviation and quantiles.
Definition: JQuantile.hh:43
#define STATUS(A)
Definition: JMessage.hh:63
Auxiliary data structure for floating point format specification.
Definition: JManip.hh:446
Auxiliary class for defining the range of iterations of objects.
Definition: JLimit.hh:41
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1961
int debug
debug level
Definition: JSirene.cc:63
#define FATAL(A)
Definition: JMessage.hh:67
#define QAQC(A)
QA/QC output macro.
Definition: JMessage.hh:100
then usage $script< input_file >< detector_file > fi set_variable OUTPUT_DIR set_variable SELECTOR JDAQTimesliceL1 set_variable DEBUG case set_variable DEBUG
Object reading from a list of files.
const JLimit & getLimit() const
Get limit.
Definition: JLimit.hh:73
static const int NUMBER_OF_PMTS
Total number of PMTs in module.
Definition: JDAQ.hh:26
int qaqc
QA/QC file descriptor.