Jpp 19.3.0-rc.4
the software that should make you happy
Loading...
Searching...
No Matches
JFit.cc File Reference

Auxiliary program to mimic reconstruction. More...

#include <string>
#include <iostream>
#include <iomanip>
#include <memory>
#include "km3net-dataformat/offline/Head.hh"
#include "km3net-dataformat/offline/MultiHead.hh"
#include "km3net-dataformat/offline/Evt.hh"
#include "JDAQ/JDAQEventIO.hh"
#include "JDAQ/JDAQTimesliceIO.hh"
#include "JDAQ/JDAQSummarysliceIO.hh"
#include "JDAQ/JDAQEvaluator.hh"
#include "JTrigger/JTriggerParameters.hh"
#include "JSupport/JSupport.hh"
#include "JSupport/JSingleFileScanner.hh"
#include "JSupport/JTreeScanner.hh"
#include "JSupport/JFileRecorder.hh"
#include "JSupport/JMeta.hh"
#include "JReconstruction/JEvt.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

Auxiliary program to mimic reconstruction.

Author
mdejong, gmaggi, azegarelli

Definition in file examples/JReconstruction/JFit.cc.

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Definition at line 35 of file examples/JReconstruction/JFit.cc.

36{
37 using namespace std;
38 using namespace JPP;
39 using namespace KM3NETDAQ;
40
43
44 JSingleFileScanner_t inputFile;
46 JLimit_t& numberOfEvents = inputFile.getLimit();
47 int debug;
48
49 try {
50
51 JParser<> zap("Auxiliary program to mimic reconstruction.");
52
53 zap['f'] = make_field(inputFile);
54 zap['o'] = make_field(outputFile) = "prefit.root";
55 zap['n'] = make_field(numberOfEvents) = JLimit::max();
56 zap['d'] = make_field(debug) = 1;
57
58 zap(argc, argv);
59 }
60 catch(const exception& error) {
61 FATAL(error.what() << endl);
62 }
63
64
66
67 outputFile.open();
68 outputFile.put(JMeta(argc, argv));
69
70 JEvt evt;
71
72 JTreeScanner<JDAQEvent, JDAQEvaluator> in(inputFile, inputFile.getLimit());
73
74 while (in.hasNext()) {
75
76 STATUS("event: " << setw(10) << in.getCounter() << '\r'); DEBUG(endl);
77
78 const JDAQEvent* tev = in.next();
79
80 outputFile.put(evt);
81 outputFile.put(*tev);
82 }
83 STATUS(endl);
84
86
87 io >> outputFile;
88
89 outputFile.close();
90}
string outputFile
#define DEBUG(A)
Message macros.
Definition JMessage.hh:62
#define STATUS(A)
Definition JMessage.hh:63
#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
Data structure for set of track fit results.
Utility class to parse command line options.
Definition JParser.hh:1698
void setSplitLevel(int value)
Set split level.
Object writing to file.
Object reading from a list of files.
Template definition for direct access of elements in ROOT TChain.
JTriggerCounter_t next()
Increment trigger counter.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
JTreeParameters & getTreeParameters()
Template definition for method returning TTree parameters.
KM3NeT DAQ data structures and auxiliaries.
Definition DataQueue.cc:39
Acoustic event fit.
Auxiliary class for recursive type list generation.
Definition JTypeList.hh:351
Auxiliary class for defining the range of iterations of objects.
Definition JLimit.hh:45
static counter_type max()
Get maximum counter value.
Definition JLimit.hh:128
Auxiliary class for ROOT I/O of application specific meta data.
Definition JMeta.hh:72
Auxiliary base class for file name.