Jpp
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
examples
JSupport
JSampler.cc
Go to the documentation of this file.
1
2
#include <string>
3
#include <iostream>
4
#include <iomanip>
5
6
#include "
JDAQ/JDAQSummarysliceIO.hh
"
7
8
#include "
JSupport/JMultipleFileSampler.hh
"
9
#include "
JSupport/JRandomSampler.hh
"
10
#include "
JSupport/JSupport.hh
"
11
12
#include "
Jeep/JParser.hh
"
13
#include "
Jeep/JMessage.hh
"
14
15
16
/**
17
* \file
18
*
19
* Program to test sampling of summary data using the JSUPPORT::JMultipleFileSampler class.
20
* \author mdejong
21
*/
22
int
main
(
int
argc,
char
**argv)
23
{
24
using namespace
std;
25
using namespace
JPP;
26
using namespace
KM3NETDAQ;
27
28
JMultipleFileSampler<JDAQSummaryslice, JRandomSampler>
inputFile;
29
JLimit_t
numberOfEvents;
30
UInt_t seed;
31
int
debug
;
32
33
try
{
34
35
JParser<>
zap(
"Program to test sampling of summary data."
);
36
37
zap[
'f'
] =
getOption
(inputFile.get<
JMultipleFileScanner<>
,
true
>(),
"inputFile"
);
38
zap[
'R'
] =
getOption
(inputFile.getSampler(),
"sampler"
) =
JPARSER::initialised
();
39
zap[
'n'
] =
make_field
(numberOfEvents);
40
zap[
'S'
] =
make_field
(seed) = 0;
41
zap[
'd'
] =
make_field
(
debug
) = 1;
42
43
zap(argc, argv);
44
}
45
catch
(
const
exception& error) {
46
FATAL
(error.what() << endl);
47
}
48
49
gRandom->SetSeed(seed);
50
51
for
(
counter_type
i = 0; i != numberOfEvents && inputFile.hasNext(); ++i) {
52
53
cout <<
"event: "
<< setw(8) << i << flush;
54
55
JDAQSummaryslice
* summary = inputFile.next();
56
57
cout <<
" index "
<< setw(8) << summary->
getFrameIndex
() << endl;
58
}
59
}
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1493
JMultipleFileSampler.hh
JSupport.hh
ROOT TTree parameter settings.
JRandomSampler.hh
JPARSER::getOption
JParserTemplateElement< bool > getOption(bool &object, const std::string &name, const std::string &help="")
Auxiliary method for creation of template parser element object.
Definition:
JParser.hh:1875
JPARSER::initialised
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Definition:
JParser.hh:63
JROOT::counter_type
Long64_t counter_type
Type definition for counter.
Definition:
JROOT/JCounter.hh:24
KM3NETDAQ::JDAQChronometer::getFrameIndex
int getFrameIndex() const
Get frame index.
Definition:
JDAQChronometer.hh:132
JSUPPORT::JLimit
Auxiliary class for defining the range of iterations of objects.
Definition:
JLimit.hh:41
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition:
JParser.hh:1954
JDAQSummarysliceIO.hh
debug
int debug
debug level
Definition:
JSirene.cc:61
JMessage.hh
General purpose messaging.
FATAL
#define FATAL(A)
Definition:
JMessage.hh:67
JSUPPORT::JMultipleFileScanner<>
JParser.hh
Utility class to parse command line options.
JSUPPORT::JMultipleFileSampler< JDAQSummaryslice, JRandomSampler >
KM3NETDAQ::JDAQSummaryslice
Data summary slice.
Definition:
JDAQSummaryslice.hh:25
main
int main(int argc, char *argv[])
Definition:
Main.cpp:15
Generated by
1.8.5