#include #include #include #include "km3net-dataformat/offline/Head.hh" #include "km3net-dataformat/offline/MultiHead.hh" #include "km3net-dataformat/offline/Evt.hh" #include "JDAQ/JDAQTimesliceIO.hh" #include "JDAQ/JDAQEventIO.hh" #include "JDAQ/JDAQSummarysliceIO.hh" #include "JTrigger/JTriggerParameters.hh" #include "JSupport/JMultipleFileScanner.hh" #include "JSupport/JFileRecorder.hh" #include "JSupport/JMonteCarloFileSupportkit.hh" #include "JSupport/JTriggerParametersSupportkit.hh" #include "JSupport/JMeta.hh" #include "JSupport/JSupport.hh" #include "JLang/JPipe.hh" #include "JROOT/JROOTClassSelector.hh" #include "Jeep/JParser.hh" #include "Jeep/JMessage.hh" /** * \file * Auxiliary program to convert data formats and/or to select data. * Possible file name extensions include ".evt" (ASCII), ".root" (ROOT) and ".dat" (binary).\n * The following data structures and file name extensions are supported: * * * * * * * * *
type evt root dat
KM3NETDAQ::JDAQEvent I/O I/O
KM3NETDAQ::JDAQTimeslice I/O I/O
KM3NETDAQ::JDAQSummaryslice I/O I/O
Head I I/O
Evt I I/O
* * The name of the data structure following option -C should be preceded by a '+' or '-' * to add or remove data types in the output, respectively.\n * In this, ROOT wildcards are accepted (e.g. -C -\\\.\\* will remove all data types). * * \author mdejong */ int main(int argc, char **argv) { using namespace std; using namespace JPP; typedef JAllTypes_t typelist; JMultipleFileScanner inputFile; JFileRecorder outputFile; JLimit_t& numberOfEvents = inputFile.getLimit(); JROOTClassSelection selection = getROOTClassSelection(); bool& merge = JMultipleFileScanner::merge; int debug; try { JParser<> zap("Auxiliary program to convert data formats and/or to select data."); zap['f'] = make_field(inputFile); zap['o'] = make_field(outputFile); zap['n'] = make_field(numberOfEvents) = JLimit::max(); zap['C'] = make_field(selection, "Precede name of data structure by a '+' or '-' " "to add or remove data types in the output, respectively." "\nROOT wildcards are accepted.") = JPARSER::initialised(); zap['m'] = make_field(merge, "Allow merging of files w/o Monte Carlo headers"); zap['d'] = make_field(debug) = 1; zap(argc, argv); } catch(const exception& error) { FATAL(error.what() << endl); } outputFile.open(); outputFile.put(JMeta(argc,argv)); inputFile | JValve(selection) | outputFile; outputFile.close(); }