Jpp  18.2.0-rc.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Functions | Variables
JDAQTimesliceSelector.cc File Reference

Example program to histogram KM3NETDAQ::JDAQTimeslice. More...

#include <string>
#include <iostream>
#include <iomanip>
#include <limits>
#include "TROOT.h"
#include "TFile.h"
#include "TH1D.h"
#include "JDAQ/JDAQTimesliceIO.hh"
#include "km3net-dataformat/online/JDAQPMTIdentifier.hh"
#include "JSupport/JMultipleFileScanner.hh"
#include "JSupport/JSupport.hh"
#include "JROOT/JROOTClassSelector.hh"
#include "JLang/JTypeSelector.hh"
#include "JLang/JObjectMultiplexer.hh"
#include "JLang/JPipe.hh"
#include "JLang/JObjectOutput.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"

Go to the source code of this file.

Classes

struct  JAnalysis
 Example class for data analysis. More...
 

Functions

int main (int argc, char **argv)
 

Variables

JDAQPMTIdentifier PMT
 Command line options. More...
 
int debug
 debug level More...
 
string outputFile
 

Detailed Description

Example program to histogram KM3NETDAQ::JDAQTimeslice.

Author
mdejong

Definition in file JDAQTimesliceSelector.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 117 of file JDAQTimesliceSelector.cc.

118 {
119  using namespace std;
120  using namespace JPP;
121  using namespace KM3NETDAQ;
122 
124  JLimit_t& numberOfEvents = inputFile.getLimit();
125  JROOTClassSelector selector;
126 
127  try {
128 
129  JParser<> zap("Example program to histogram timeslice data.");
130 
131  zap['f'] = make_field(inputFile);
132  zap['o'] = make_field(outputFile) = "timeslice.root";
133  zap['n'] = make_field(numberOfEvents) = JLimit::max();
134  zap['P'] = make_field(PMT) = JDAQPMTIdentifier(-1, -1);
135  zap['C'] = make_field(selector) = getROOTClassSelection<JDAQTimesliceTypes_t>();
136  zap['d'] = make_field(debug) = 1;
137 
138  zap(argc, argv);
139  }
140  catch(const exception& error) {
141  FATAL(error.what() << endl);
142  }
143 
144 
145  JAnalysis analysis;
146 
147  inputFile | JValve<JDAQTimesliceTypes_t>(selector) | JType<JDAQTimeslice>() | analysis;
148 }
Utility class to parse command line options.
Definition: JParser.hh:1514
static const JPBS_t PMT(3, 4, 2, 3)
PBS of photo-multiplier tube (PMT)
Auxiliary class to select ROOT class based on class name.
Auxiliary class for a type holder.
Definition: JType.hh:19
string outputFile
Auxiliary class for selection of data type.
Auxiliary class for defining the range of iterations of objects.
Definition: JLimit.hh:41
Example class for data analysis.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1989
#define FATAL(A)
Definition: JMessage.hh:67
General purpose class for object reading from a list of file names.
const JLimit & getLimit() const
Get limit.
Definition: JLimit.hh:84
int debug
debug level

Variable Documentation

Command line options.

Definition at line 35 of file JDAQTimesliceSelector.cc.

int debug

debug level

Definition at line 36 of file JDAQTimesliceSelector.cc.

string outputFile

Definition at line 37 of file JDAQTimesliceSelector.cc.