34 using namespace KM3NETDAQ;
44 JParser<> zap(
"Example program to histogram summary data.");
48 zap[
'n'] =
make_field(numberOfEvents) = JLimit::max();
54 catch(
const exception& error) {
55 FATAL(error.what() << endl);
59 const double factor = 1.0e-3;
66 TProfile
h1(
"h1", NULL, 32,-0.5, 31.5);
67 TProfile h2(
"h2", NULL, 32,-0.5, 31.5);
69 TH2D hu(
"hu", NULL, 201, -0.5, +200.5, 201, -0.5, +200.5);
71 TH2D hv(
"hv", NULL, 51, -0.5, +50.5, 200, 0.0, 50.0);
72 TH2D hw(
"hw", NULL, 51, -0.5, +50.5, 200, 0.0, 50.0);
78 while (inputFile.hasNext()) {
80 STATUS(
"event: " << setw(10) << inputFile.getCounter() <<
'\r');
DEBUG(endl);
85 << setw(8) << inputFile.getCounter() <<
' '
88 << setw(6) << summaryslice->size() << endl);
92 for (JDAQSummaryslice::const_iterator frame = summaryslice->begin(); frame != summaryslice->end(); ++frame) {
97 double R[2] = { 0.0 };
100 int upper[2] = { 0 };
104 const int index = (!frame->testHighRateVeto(pmt) && !frame->testFIFOStatus(pmt) ? 0 : 1);
107 R[index] += correct ?
getRate(*frame, pmt, factor) : frame->getRate(pmt, factor);
114 h0.Fill(correct ?
getRate(*frame, pmt, factor) : frame->getRate(pmt, factor), frame->getWeight(pmt, factor));
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));
120 hu.Fill((
double) frame->getUDPMaximalSequenceNumber(),
121 (double) frame->getUDPNumberOfReceivedPackets());
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]); }
128 hx.Fill((
double) N[1], R[0] / N[0]);
130 if (lower[0] != 0 && upper[0] != 0) {
131 hy.Fill((
double) N[1], R[0] / N[0]);
135 const bool status = (frame->getUDPNumberOfReceivedPackets() == frame->getUDPMaximalSequenceNumber() + 1 &&
136 frame->hasUDPTrailer());
138 h1.Fill((Double_t) 31, (frame->testWhiteRabbitStatus() ? 1.0 : 0.0));
139 h2.Fill((Double_t) 31, (status ? 1.0 : 0.0));
Utility class to parse command line options.
int getDetectorID() const
Get detector identifier.
then JShowerPostfit f $INPUT_FILE o $OUTPUT_FILE N
then for HISTOGRAM in h0 h1
Lookup table for PMT addresses in detector.
int getRunNumber() const
Get run number.
int getFrameIndex() const
Get frame index.
Auxiliary class for defining the range of iterations of objects.
Lookup table for PMT addresses in optical module.
double getRate(const JDAQSummaryFrame &frame, const int pmt, const double factor=1.0)
Get corrected rate of PMT.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
char ring
ring number ['A','F']
JDetectorAddressMap & getDetectorAddressMap()
Get detector address map.
then usage $script[distance] fi case set_variable R
const JPMTAddressTranslator & getAddressTranslator(const int tdc) const
Get PMT address translator.
then usage $script< input_file >< detector_file > fi set_variable OUTPUT_DIR set_variable SELECTOR JDAQTimesliceL1 set_variable DEBUG case set_variable DEBUG
const JLimit & getLimit() const
Get limit.
static const int NUMBER_OF_PMTS
Total number of PMTs in module.