Jpp  15.0.0-rc.2
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions
JRunAnalyzer.cc File Reference
#include <iostream>
#include <iomanip>
#include "JDetector/JDetector.hh"
#include "JDetector/JModuleRouter.hh"
#include "JDetector/JDetectorToolkit.hh"
#include "JSupport/JSupport.hh"
#include "JSupport/JMeta.hh"
#include "JSupport/JMultipleFileScanner.hh"
#include "JSupport/JTreeScanner.hh"
#include "TROOT.h"
#include "Jeep/JParser.hh"
#include "km3net-dataformat/online/JDAQ.hh"
#include "JDAQ/JDAQTimesliceIO.hh"
#include "JDAQ/JDAQSummarysliceIO.hh"
#include "JLang/JObjectReader.hh"
#include "JROOT/JRootFileReader.hh"
#include "RunAnalyzer.hh"
#include "JRunHistograms.hh"

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 36 of file JRunAnalyzer.cc.

36  {
37 
38  string inputFile;
39  string outputFile;
40  string detectorFile;
41  JLimit_t nTimeslices;
42  JLimit_t nSummaryslices;
43  JLimit_t nEvents;
44 
45  try {
46 
47  JParser<> zap;
48 
49  zap['f'] = make_field(inputFile , "Path to input file " );
50  zap['o'] = make_field(outputFile , "Path to output file" ) = "out.root";
51  zap['a'] = make_field(detectorFile , "path to detector file" );
52  zap['t'] = make_field(nTimeslices , "number of timeslices" ) = JLimit::max();
53  zap['s'] = make_field(nSummaryslices , "number of summaryslices") = JLimit::max();
54  zap['n'] = make_field(nEvents , "number of events" ) = JLimit::max();
55 
56  zap(argc,argv);
57  }
58  catch(const exception &error) {
59  ERROR(error.what() << endl);
60  }
61 
62  RunAnalyzer Analyzer (inputFile, detectorFile, nTimeslices, nSummaryslices, nEvents);
63 
64  Analyzer.readEvents ();
65  Analyzer.readSummaryData ();
66  Analyzer.readTimesliceData<JDAQTimeslice> ();
67  Analyzer.readTimesliceData<JDAQTimesliceL0>();
68  Analyzer.readTimesliceData<JDAQTimesliceL1>();
69  Analyzer.readTimesliceData<JDAQTimesliceL2>();
70  Analyzer.readTimesliceData<JDAQTimesliceSN>();
71 
72  JRA_Histograms run_histograms = Analyzer.getHistograms();
73 
74  TFile out(outputFile.c_str(), "recreate");
75 
76  putObject(out, JMeta(argc, argv));
77 
78  JMeta::copy(inputFile.c_str(), out);
79 
80  run_histograms.Write_to_file(out);
81 
82  out.Close();
83 }
Auxiliary class for ROOT I/O of application specific meta data.
Definition: JMeta.hh:70
Utility class to parse command line options.
Definition: JParser.hh:1500
string outputFile
Timeslice data structure for L1 data.
Auxiliary class for defining the range of iterations of objects.
Definition: JLimit.hh:41
Class dedicated to the analysis of KM3NeT runs.
Definition: RunAnalyzer.hh:27
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1961
Timeslice data structure for L2 data.
#define ERROR(A)
Definition: JMessage.hh:66
Data time slice.
Timeslice data structure for SN data.
bool putObject(TDirectory &dir, const TObject &object)
Write object to ROOT directory.
void copy(const Head &from, JHead &to)
Copy header from from to to.
Definition: JHead.cc:139
Timeslice data structure for L0 data.