Jpp test-rotations-new
the software that should make you happy
Loading...
Searching...
No Matches
software/JReconstruction/JHistory.cc
Go to the documentation of this file.
1#include <string>
2#include <iostream>
3#include <iomanip>
4
8
9#include "JDAQ/JDAQEventIO.hh"
12
14
15#include "JSupport/JSupport.hh"
18#include "JSupport/JMeta.hh"
19
21
22#include "Jeep/JParser.hh"
23#include "Jeep/JMessage.hh"
24
25
26/**
27 * \file
28 *
29 * Program to set fit status according match of history with list of application types.
30 *
31 * \author mdejong
32 */
33int main(int argc, char **argv)
34{
35 using namespace std;
36 using namespace JPP;
37 using namespace KM3NETDAQ;
38
41
42 JSingleFileScanner_t inputFile;
44 JLimit_t& numberOfEvents = inputFile.getLimit();
45 vector<int> apps;
46 int debug;
47
48 try {
49
50 JParser<> zap("Program to set fit status according match of history with list of application types.");
51
52 zap['f'] = make_field(inputFile);
53 zap['o'] = make_field(outputFile) = "history.root";
54 zap['n'] = make_field(numberOfEvents) = JLimit::max();
55 zap['A'] = make_field(apps);
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
65 outputFile.open();
66 outputFile.put(JMeta(argc, argv));
67
68 while (inputFile.hasNext()) {
69
70 STATUS("event: " << setw(10) << inputFile.getCounter() << '\r'); DEBUG(endl);
71
72 JFIT::JEvt out = *inputFile.next();
73
74 for (JFIT::JEvt::iterator i = out.begin(); i != out.end(); ++i) {
75 i->setStatus(i->getHistory().getStatus(apps) ? COMPLETE_CHAIN : INCOMPLETE_CHAIN);
76 }
77
78 outputFile.put(out);
79 }
80 STATUS(endl);
81
83
84 io >> outputFile;
85
86 outputFile.close();
87}
88
string outputFile
Recording of objects on file according a format that follows from the file name extension.
General purpose messaging.
#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
ROOT I/O of application specific meta data.
Parallel scanning of objects from a single file or multiple files according a format that follows fro...
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition JParser.hh:2142
ROOT TTree parameter settings of various packages.
Data structure for set of track fit results.
Utility class to parse command line options.
Definition JParser.hh:1698
Object writing to file.
Object reading from a list of files.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
KM3NeT DAQ data structures and auxiliaries.
Definition DataQueue.cc:39
int main(int argc, char **argv)
Type list.
Definition JTypeList.hh:23
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.