Jpp 19.3.0-rc.2
the software that should make you happy
Loading...
Searching...
No Matches
JSampler.cc
Go to the documentation of this file.
1
2#include <string>
3#include <iostream>
4#include <iomanip>
5
7
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 */
22int main(int argc, char **argv)
23{
24 using namespace std;
25 using namespace JPP;
26 using namespace KM3NETDAQ;
27
29 JLimit_t numberOfEvents;
30 ULong_t seed;
31 int debug;
32
33 try {
34
35 JParser<> zap("Program to test sampling of summary data.");
36
37 zap['f'] = make_field(inputFile->getFilelist(), "inputFile");
38 zap['R'] = make_field(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}
General purpose messaging.
#define FATAL(A)
Definition JMessage.hh:67
int debug
debug level
Definition JSirene.cc:72
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition JParser.hh:2142
int main(int argc, char **argv)
Definition JSampler.cc:22
ROOT TTree parameter settings of various packages.
virtual bool hasNext() override
Check availability of next element.
const JSampler_t< T > & getSampler() const
Get sampler.
virtual const pointer_type & next() override
Get next element.
Utility class to parse command line options.
Definition JParser.hh:1698
int getFrameIndex() const
Get frame index.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Long64_t counter_type
Type definition for counter.
KM3NeT DAQ data structures and auxiliaries.
Definition DataQueue.cc:39
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Definition JParser.hh:68
Auxiliary class for defining the range of iterations of objects.
Definition JLimit.hh:45
Auxiliary class to sample from a list of files.