Program to merge different files with JFIT::JEvt data.
More...
#include <string>
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <iterator>
#include "evt/Head.hh"
#include "evt/Evt.hh"
#include "JDAQ/JDAQEvent.hh"
#include "JDAQ/JDAQTimeslice.hh"
#include "JDAQ/JDAQSummaryslice.hh"
#include "JTrigger/JTriggerParameters.hh"
#include "JSupport/JParallelFileScanner.hh"
#include "JSupport/JFileRecorder.hh"
#include "JSupport/JSupport.hh"
#include "JSupport/JMeta.hh"
#include "JFit/JEvt.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"
Go to the source code of this file.
|
int | main (int argc, char **argv) |
|
Program to merge different files with JFIT::JEvt data.
- Author
- mdejong
Definition in file JMergeFit.cc.
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 33 of file JMergeFit.cc.
37 using namespace KM3NETDAQ;
39 typedef JParallelFileScanner< JTypeList<JDAQEvent, JEvt> > JParallelFileScanner_t;
40 typedef JParallelFileScanner_t::multi_pointer_type multi_pointer_type;
50 JParser<> zap(
"Program to merge different files with JFIT::JEvt data.");
52 zap[
'f'] =
make_field(inputFile,
"list of JEvt compatible files");
54 zap[
'n'] =
make_field(numberOfEvents) = JLimit::max();
59 catch(
const exception& error) {
60 FATAL(error.what() << endl);
65 if (inputFile.empty()) {
66 FATAL(
"No input files." << endl);
73 for (inputFile[0].setLimit(numberOfEvents); inputFile[0].hasNext(); ) {
75 STATUS(
"event: " << setw(10) << inputFile[0].getCounter() <<
'\r');
DEBUG(endl);
77 multi_pointer_type ps = inputFile[0].next();
84 for (
size_t i = 1; i != inputFile.size(); ++i) {
86 if (inputFile[i].hasNext()) {
88 multi_pointer_type __ps = inputFile[i].next();
91 const JEvt* __evt = __ps;
95 copy(__evt->begin(), __evt->end(), back_inserter(out));
99 FATAL(
"Inconsistent data at "
100 << inputFile[0].
getFilename() <<
":" << inputFile[0].getCounter() <<
" != "
101 << inputFile[i].
getFilename() <<
":" << inputFile[i].getCounter() << endl);
110 JMultipleFileScanner<JRemove<typelist, JEvt>::typelist> io(inputFile[0]);
Utility class to parse command line options.
JLimit JLimit_t
Type definition of limit.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
void copy(const Head &from, JHead &to)
Copy header from from to to.
std::string getFilename(const std::string &file_name)
Get file name part, i.e.
#define DEBUG(A)
Message macros.