Jpp
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
examples
JDAQ
JDAQStatus.cc
Go to the documentation of this file.
1
2
#include <string>
3
#include <iostream>
4
#include <iomanip>
5
#include <limits>
6
7
#include "
JDAQ/JDAQSummarysliceIO.hh
"
8
9
#include "
JSupport/JMultipleFileScanner.hh
"
10
#include "
JSupport/JSupport.hh
"
11
#include "
JTools/JQuantile.hh
"
12
13
#include "
Jeep/JPrint.hh
"
14
#include "
Jeep/JParser.hh
"
15
#include "
Jeep/JMessage.hh
"
16
17
18
/**
19
* \file
20
*
21
* Example program to histogram KM3NETDAQ::JDAQSummaryslice.
22
* \author mdejong
23
*/
24
int
main
(
int
argc,
char
**argv)
25
{
26
using namespace
std;
27
using namespace
JPP;
28
using namespace
KM3NETDAQ;
29
30
JMultipleFileScanner<>
inputFile;
31
JLimit_t
& numberOfEvents = inputFile.
getLimit
();
32
int
debug
;
33
34
try
{
35
36
JParser<>
zap(
"Example program to histogram summary data."
);
37
38
zap[
'f'
] =
make_field
(inputFile);
39
zap[
'n'
] =
make_field
(numberOfEvents) = JLimit::max();
40
zap[
'd'
] =
make_field
(
debug
) = 2;
41
42
zap(argc, argv);
43
}
44
catch
(
const
exception& error) {
45
FATAL
(error.what() << endl);
46
}
47
48
49
cout.tie(&cerr);
50
51
for
(
JMultipleFileScanner<>::const_iterator
i = inputFile.begin(); i != inputFile.end(); ++i) {
52
53
int
run = -1;
54
JQuantile
Q[2];
55
56
for
(
JMultipleFileScanner<JDAQSummaryslice>
in
(*i);
in
.hasNext(); ) {
57
58
STATUS
(
"event: "
<< setw(10) <<
in
.getCounter() <<
'\r'
);
DEBUG
(endl);
59
60
JDAQSummaryslice
* summary =
in
.next();
61
62
if
(run == -1) {
63
run = summary->
getRunNumber
();
64
}
65
66
for
(JDAQSummaryslice::const_iterator frame = summary->begin(); frame != summary->end(); ++frame) {
67
68
if
(!frame->testHighRateVeto() && !frame->testFIFOStatus()) {
69
Q[0].
put
(frame->getUDPNumberOfReceivedPackets() == (frame->getUDPMaximalSequenceNumber() + 1) ? 1.0 : 0.0);
70
Q[1].
put
(frame->hasUDPTrailer() ? 1.0 : 0.0);
71
}
72
}
73
}
74
75
cout << setw(8) << run <<
' '
76
<<
FIXED
(6,4) << Q[0].
getMean
() <<
' '
77
<<
FIXED
(6,4) << Q[1].
getMean
() << endl;
78
}
79
STATUS
(endl);
80
}
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1493
JSupport.hh
ROOT TTree parameter settings.
JTOOLS::JQuantile
Quantile calculator.
Definition:
JQuantile.hh:83
STATUS
#define STATUS(A)
Definition:
JMessage.hh:63
in
esac print_variable DETECTOR INPUT_FILE OUTPUT_FILE CDF for TYPE in
Definition:
JSirene.sh:45
FIXED
Auxiliary data structure for floating point format specification.
Definition:
JPrint.hh:481
KM3NETDAQ::JDAQChronometer::getRunNumber
int getRunNumber() const
Get run number.
Definition:
JDAQChronometer.hh:121
JTOOLS::JQuantile::getMean
double getMean() const
Get mean value.
Definition:
JQuantile.hh:331
JSUPPORT::JLimit
Auxiliary class for defining the range of iterations of objects.
Definition:
JLimit.hh:41
JPrint.hh
I/O formatting auxiliaries.
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition:
JParser.hh:1954
JDAQSummarysliceIO.hh
JTOOLS::JQuantile::put
void put(const double x, const double w=1.0)
Put value.
Definition:
JQuantile.hh:198
debug
int debug
debug level
Definition:
JSirene.cc:61
JMessage.hh
General purpose messaging.
FATAL
#define FATAL(A)
Definition:
JMessage.hh:67
JMultipleFileScanner.hh
Scanning of objects from multiple files according a format that follows from the extension of each fi...
JSUPPORT::JMultipleFileScanner<>
JParser.hh
Utility class to parse command line options.
JQuantile.hh
JSUPPORT::JLimit::getLimit
const JLimit & getLimit() const
Get limit.
Definition:
JLimit.hh:73
KM3NETDAQ::JDAQSummaryslice
Data summary slice.
Definition:
JDAQSummaryslice.hh:25
DEBUG
#define DEBUG(A)
Message macros.
Definition:
JMessage.hh:62
main
int main(int argc, char *argv[])
Definition:
Main.cpp:15
Generated by
1.8.5