Jpp
18.6.0-rc.1
the software that should make you happy
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
examples
JSupport
JSummaryFileRouter.cc
Go to the documentation of this file.
1
#include <string>
2
#include <iostream>
3
#include <iomanip>
4
#include <limits>
5
#include <map>
6
7
#include "
JDAQ/JDAQEventIO.hh
"
8
#include "
JDAQ/JDAQSummarysliceIO.hh
"
9
10
#include "
JSupport/JSingleFileScanner.hh
"
11
#include "
JSupport/JSummaryFileRouter.hh
"
12
#include "
JSupport/JSupport.hh
"
13
14
#include "
JTools/JQuantile.hh
"
15
16
#include "
Jeep/JParser.hh
"
17
#include "
Jeep/JMessage.hh
"
18
19
20
/**
21
* \file
22
*
23
* Program to test JSUPPORT::JSummaryFileRouter.
24
* \author mdejong
25
*/
26
int
main
(
int
argc,
char
**argv)
27
{
28
using namespace
std;
29
using namespace
JPP;
30
using namespace
KM3NETDAQ;
31
32
JSingleFileScanner<JDAQEvent>
inputFile;
33
JLimit_t
& numberOfEvents = inputFile.
getLimit
();
34
double
rate_Hz;
35
int
debug
;
36
37
try
{
38
39
JParser<>
zap(
"Program to test router of summary data."
);
40
41
zap[
'f'
] =
make_field
(inputFile);
42
zap[
'n'
] =
make_field
(numberOfEvents) = JLimit::max();
43
zap[
'B'
] =
make_field
(rate_Hz) = 0.0;
44
zap[
'd'
] =
make_field
(
debug
) = 2;
45
46
zap(argc, argv);
47
}
48
catch
(
const
exception& error) {
49
FATAL
(error.what() << endl);
50
}
51
52
JSummaryFileRouter
router(inputFile.getFilename(), rate_Hz);
53
54
map<JDAQPMTIdentifier, JQuantile>
zmap;
55
56
while
(inputFile.hasNext()) {
57
58
STATUS
(
"event: "
<< setw(10) << inputFile.getCounter() <<
'\r'
);
DEBUG
(endl);
59
60
JDAQEvent
*
event
= inputFile.
next
();
61
62
router.update(*event);
63
64
for
(
JDAQEvent::const_iterator<JDAQSnapshotHit>
hit = event->begin<
JDAQSnapshotHit
>(); hit != event->end<
JDAQSnapshotHit
>(); ++hit) {
65
66
const
JDAQPMTIdentifier
id(hit->getModuleID(), hit->getPMT());
67
68
const
double
R
= router.getRate(
id
);
69
70
zmap[id].put(R);
71
}
72
}
73
74
for
(
map<JDAQPMTIdentifier, JQuantile>::const_iterator
i
= zmap.begin();
i
!= zmap.end(); ++
i
) {
75
cout << setw(10) <<
i
->first.getModuleID() <<
'.'
76
<<
FILL
(2,
'0'
) <<
i
->first.getPMTAddress() <<
FILL
() <<
' '
77
<<
FIXED
(9,2) <<
i
->second.getMean();
78
if
(
i
->second.getCount() > 2) {
79
cout <<
" +/- "
80
<<
FIXED
(9,2) <<
i
->second.getSTDev();
81
}
82
cout << endl;
83
}
84
}
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1711
KM3NETDAQ::JDAQKeyHit
DAQ key hit.
Definition:
JDAQKeyHit.hh:19
main
int main(int argc, char *argv[])
Definition:
Main.cc:15
JSupport.hh
ROOT TTree parameter settings of various packages.
std::map
Definition:
JSTDTypes.hh:17
STATUS
#define STATUS(A)
Definition:
JMessage.hh:63
KM3NETDAQ::JDAQEvent::const_iterator
Template const_iterator.
Definition:
JDAQEvent.hh:66
FIXED
Auxiliary data structure for floating point format specification.
Definition:
JManip.hh:446
JSingleFileScanner.hh
Scanning of objects from a single file according a format that follows from the extension of each fil...
i
then rm i
Definition:
JEvtReweightMupageParameterScan.sh:309
JSUPPORT::JLimit
Auxiliary class for defining the range of iterations of objects.
Definition:
JLimit.hh:41
JSummaryFileRouter.hh
KM3NETDAQ::JDAQEvent
DAQ Event.
Definition:
JDAQEvent.hh:30
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition:
JParser.hh:2158
KM3NETDAQ::JDAQPMTIdentifier
PMT identifier.
Definition:
JDAQPMTIdentifier.hh:20
JDAQSummarysliceIO.hh
JSUPPORT::JSummaryFileRouter
File router for fast addressing of summary data.
Definition:
JSummaryFileRouter.hh:36
JMessage.hh
General purpose messaging.
FILL
Auxiliary data structure for sequence of same character.
Definition:
JManip.hh:328
FATAL
#define FATAL(A)
Definition:
JMessage.hh:67
R
then JCookie sh JDataQuality D $DETECTOR_ID R
Definition:
JDataQuality.sh:41
JParser.hh
Utility class to parse command line options.
JQuantile.hh
JSUPPORT::JSingleFileScanner
Object reading from a list of files.
Definition:
JSingleFileScanner.hh:75
JSUPPORT::JLimit::getLimit
const JLimit & getLimit() const
Get limit.
Definition:
JLimit.hh:84
JDAQEventIO.hh
debug
int debug
debug level
Definition:
archive-put-wiki-detectors.sh:92
KM3NETDAQ::JDAQTriggerCounter::next
JTriggerCounter_t next()
Increment trigger counter.
Definition:
JDAQTriggerCounter.hh:121
DEBUG
#define DEBUG(A)
Message macros.
Definition:
JMessage.hh:62
Generated by
1.8.5