Jpp 20.0.0-27-g39925593c-D
the software that should make you happy
Loading...
Searching...
No Matches
Functions
JSampler.cc File Reference

Program to test sampling of summary data using the JSUPPORT::JMultipleFileSampler class. More...

#include <string>
#include <iostream>
#include <iomanip>
#include "JDAQ/JDAQSummarysliceIO.hh"
#include "JSupport/JMultipleFileSampler.hh"
#include "JSupport/JRandomSampler.hh"
#include "JSupport/JSupport.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Program to test sampling of summary data using the JSUPPORT::JMultipleFileSampler class.

Author
mdejong

Definition in file JSampler.cc.

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Definition at line 22 of file JSampler.cc.

23{
24 using namespace std;
25 using namespace JPP;
26 using namespace KM3NETDAQ;
27
29 JLimit_t numberOfEvents;
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}
#define FATAL(A)
Definition JMessage.hh:67
int debug
debug level
Definition JSirene.cc:72
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition JParser.hh:2142
Template definition of a multi-dimensional oscillation probability interpolation table.
int getFrameIndex() const
Get frame index.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
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