Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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

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;
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 }
Utility class to parse command line options.
Definition: JParser.hh:1500
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:1882
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Definition: JParser.hh:66
Long64_t counter_type
Type definition for counter.
int getFrameIndex() const
Get frame index.
Auxiliary class for defining the range of iterations of objects.
Definition: JLimit.hh:41
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1961
int debug
debug level
Definition: JSirene.cc:63
#define FATAL(A)
Definition: JMessage.hh:67