31{
35
37 JLimit_t& numberOfEvents = inputFile.getLimit();
39 bool correct;
41
42 try {
43
44 JParser<> zap(
"Example program to histogram summary data.");
45
51
53 }
54 catch(const exception& error) {
56 }
57
58
59 const double factor = 1.0e-3;
60
61
63
67
68 TH2D hu(
"hu",
NULL, 201, -0.5, +200.5, 201, -0.5, +200.5);
69
70 TH2D hv(
"hv",
NULL, 51, -0.5, +50.5, 200, 0.0, 50.0);
71 TH2D hw(
"hw",
NULL, 51, -0.5, +50.5, 200, 0.0, 50.0);
72
73 TH2D hx(
"hx",
NULL, NUMBER_OF_PMTS, -0.5, NUMBER_OF_PMTS - 0.5, 200, 0.0, 50.0);
74 TH2D hy(
"hy",
NULL, NUMBER_OF_PMTS, -0.5, NUMBER_OF_PMTS - 0.5, 200, 0.0, 50.0);
75
76 size_t udp[] = { 0, 0, 0, 0 };
77
78 while (inputFile.hasNext()) {
79
81
83
85 <<
setw(8) << inputFile.getCounter() <<
' '
89
91
93
95
96 int N[2] = { 0 };
97 double R[2] = { 0.0 };
98
99 int lower[2] = { 0 };
100 int upper[2] = { 0 };
101
103
104 const int index = (!frame->testHighRateVeto(pmt) && !frame->testFIFOStatus(pmt) ? 0 : 1);
105
106 N[index] += 1;
107 R[index] += correct ?
getRate(*frame, pmt, factor) : frame->
getRate(pmt, factor);
108
109 if (
memo.getAddressTranslator(pmt).ring <=
'D')
110 lower[index] += 1;
111 else
112 upper[index] += 1;
113
115
116 h1.Fill((
Double_t) pmt, (frame->testHighRateVeto(pmt) ? 1.0 : 0.0));
117 h2.Fill((
Double_t) pmt, (frame->testFIFOStatus (pmt) ? 1.0 : 0.0));
118 }
119
120 hu.Fill((
double) frame->getUDPMaximalSequenceNumber(),
121 (double) frame->getUDPNumberOfReceivedPackets());
122
123 if (N[0] != 0) {
hv.Fill((
double) frame->getUDPMaximalSequenceNumber(), R[0] / N[0]); }
124 if (N[1] != 0) {
hw.Fill((
double) frame->getUDPMaximalSequenceNumber(), R[1] / N[1]); }
125
126 if (N[0] != 0) {
127
128 hx.Fill((double) N[1], R[0] / N[0]);
129
130 if (lower[0] != 0 && upper[0] != 0) {
131 hy.Fill((double) N[1], R[0] / N[0]);
132 }
133 }
134
135 const bool status = (frame->getUDPNumberOfReceivedPackets() == frame->getUDPMaximalSequenceNumber() + 1 &&
136 frame->hasUDPTrailer());
137
139 udp[1] += (status ? 1 : 0);
140 udp[2] += max(frame->getUDPMaximalSequenceNumber() + 1,
141 frame->getUDPNumberOfReceivedPackets());
142 udp[3] += frame->getUDPNumberOfReceivedPackets();
143
144 h1.Fill((
Double_t) 31, (frame->testWhiteRabbitStatus() ? 1.0 : 0.0));
145 h2.Fill((
Double_t) 31, (status ? 1.0 : 0.0));
146 }
147 }
149
151
152 for (
int i = 0; i !=
sizeof(
udp)/
sizeof(
udp[0]); ++i) {
154 }
155
158 }
159
160 out.Write();
161 out.Close();
162}
#define DEBUG(A)
Message macros.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Lookup table for PMT addresses in detector.
Lookup table for PMT addresses in optical module.
Template definition of a multi-dimensional oscillation probability interpolation table.
static int getN()
Get number of bins.
static const double * getData(const double factor=1.0)
Get abscissa values.
JDetectorAddressMap & getDetectorAddressMap()
Get detector address map.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
JRECONSTRUCTION::JWeight getWeight
double getRate(const JDAQSummaryFrame &frame, const int pmt, const double factor=1.0)
Get corrected rate of PMT.
KM3NeT DAQ data structures and auxiliaries.
static const int NUMBER_OF_PMTS
Total number of PMTs in module.
Auxiliary class for defining the range of iterations of objects.
static counter_type max()
Get maximum counter value.
Auxiliary data structure for floating point format specification.