Jpp
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
software
JGizmo
JPrintDAQHeader.cc
Go to the documentation of this file.
1
2
#include <string>
3
#include <iostream>
4
#include <iomanip>
5
6
#include "
JDAQ/JDAQHeaderIO.hh
"
7
#include "
JDAQ/JDAQTimesliceIO.hh
"
8
#include "
JDAQ/JDAQEventIO.hh
"
9
#include "
JDAQ/JDAQSummarysliceIO.hh
"
10
#include "
JLang/JObjectMultiplexer.hh
"
11
#include "
JSupport/JMultipleFileScanner.hh
"
12
#include "
JSupport/JSupport.hh
"
13
14
#include "
Jeep/JPrint.hh
"
15
#include "
Jeep/JParser.hh
"
16
#include "
Jeep/JMessage.hh
"
17
18
/**
19
* \file
20
*
21
* Auxiliary program to print DAQ header data.
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<JDAQTypes_t>
inputFile;
31
JLimit_t
& numberOfEvents = inputFile.
getLimit
();
32
int
debug
;
33
34
try
{
35
36
JParser<>
zap(
"Auxiliary program to print DAQ header data."
);
37
38
zap[
'f'
] =
make_field
(inputFile,
"input file."
);
39
zap[
'n'
] =
make_field
(numberOfEvents) = 1;
40
zap[
'd'
] =
make_field
(
debug
,
"debug flag."
) = 1;
41
42
zap(argc, argv);
43
}
44
catch
(
const
exception &error) {
45
FATAL
(error.what() << endl);
46
}
47
48
49
JObjectMultiplexer<JDAQTypes_t, JDAQHeader>
in
(inputFile);
50
51
JDAQHeader
header;
52
53
int
numberOfErrors = 0;
54
counter_type
counter = 0;
55
56
for
( ; in.
hasNext
() && counter != inputFile.getLimit(); ++counter) {
57
58
const
JDAQHeader
* p = in.
next
();
59
60
if
(counter == 0)
61
header = *p;
62
else
if
(header.getDetectorID() != p->
getDetectorID
() ||
63
header.getRunNumber () != p->
getRunNumber
())
64
++numberOfErrors;
65
}
66
67
if
(inputFile.getLimit() > 1) {
68
ASSERT
(numberOfErrors == 0);
69
}
70
71
if
(counter > 0)
72
cout << header << endl;
73
else
74
FATAL
(
"No header."
);
75
76
return
0;
77
}
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1493
JSupport.hh
ROOT TTree parameter settings.
KM3NETDAQ::JDAQChronometer::getDetectorID
int getDetectorID() const
Get detector identifier.
Definition:
JDAQChronometer.hh:110
in
esac print_variable DETECTOR INPUT_FILE OUTPUT_FILE CDF for TYPE in
Definition:
JSirene.sh:45
JROOT::counter_type
Long64_t counter_type
Type definition for counter.
Definition:
JROOT/JCounter.hh:24
JLANG::JObjectMultiplexer
Auxiliary class for multiplexing object iterators.
Definition:
JObjectIterator.hh:35
KM3NETDAQ::JDAQChronometer::getRunNumber
int getRunNumber() const
Get run number.
Definition:
JDAQChronometer.hh:121
JSUPPORT::JLimit
Auxiliary class for defining the range of iterations of objects.
Definition:
JLimit.hh:41
ASSERT
#define ASSERT(A,...)
Assert macro.
Definition:
JMessage.hh:90
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
JLANG::JObjectMultiplexer::next
virtual const pointer_type & next()
Get next element.
Definition:
JObjectMultiplexer.hh:76
debug
int debug
debug level
Definition:
JSirene.cc:61
JMessage.hh
General purpose messaging.
JObjectMultiplexer.hh
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...
KM3NETDAQ::JDAQHeader
DAQ header.
Definition:
JDAQHeader.hh:17
JSUPPORT::JMultipleFileScanner
General purpose class for object reading from a list of file names.
Definition:
JMultipleFileScanner.hh:167
JParser.hh
Utility class to parse command line options.
JLANG::JObjectMultiplexer::hasNext
virtual bool hasNext()
Check availability of next element.
Definition:
JObjectMultiplexer.hh:62
JDAQHeaderIO.hh
JSUPPORT::JLimit::getLimit
const JLimit & getLimit() const
Get limit.
Definition:
JLimit.hh:73
JDAQEventIO.hh
JDAQTimesliceIO.hh
main
int main(int argc, char *argv[])
Definition:
Main.cpp:15
Generated by
1.8.5