39 struct JTreeRouter_t {
52 JTreeRouter_t(
const std::string& input_file) :
66 const Long64_t i = indexer.find(evt);
70 return scanner.getEntry(i);
87 int main(
int argc,
char **argv)
91 using namespace KM3NETDAQ;
94 typedef JParallelFileScanner_t::multi_pointer_type multi_pointer_type;
103 JParser<> zap(
"Program to merge different files with JFIT::JEvt data " \
104 "(e.g. from JMuonXXX[.sh] and JShowerXXX[.sh] applied to the same input data)." \
105 "\nThe input files should be event-by-event synchronised.");
107 zap[
'f'] =
make_field(inputFile,
"list of JEvt compatible files");
113 catch(
const exception& error) {
114 FATAL(error.what() << endl);
119 if (inputFile.empty()) {
120 FATAL(
"No input files." << endl);
128 JParallelFileScanner_t
in(inputFile[0]);
132 for (
size_t i = 1; i != inputFile.size(); ++i) {
133 buffer.push_back(JTreeRouter_t(inputFile[i]));
136 while (in.hasNext()) {
138 STATUS(
"event: " << setw(10) << in.getCounter() <<
'\r');
DEBUG(endl);
140 multi_pointer_type ps = in.next();
143 const JEvt* evt = ps;
147 for (
size_t i = 1; i != inputFile.size(); ++i) {
149 const JEvt* p = buffer[i].get(*tev);
153 copy(p->begin(), p->end(), back_inserter(out));
157 FATAL(
"Inconsistent data at " << in.getFilename() <<
":" << in.getCounter() << endl);
Utility class to parse command line options.
int main(int argc, char *argv[])
ROOT TTree parameter settings of various packages.
Recording of objects on file according a format that follows from the file name extension.
General purpose class for parallel reading of objects from a single file or multiple files...
Template definition for direct access of elements in ROOT TChain.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Parallel scanning of objects from a single file or multiple files according a format that follows fro...
General purpose messaging.
General purpose class for object reading from a list of file names.
Utility class to parse command line options.
void copy(const Head &from, JHead &to)
Copy header from from to to.
Auxiliary class to determine value of DAQ objects.
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
#define DEBUG(A)
Message macros.