49int main(
int argc,
char **argv)
55 Long64_t numberOfEvents;
60 JParser<> zap(
"Auxiliary program to convert binary data to ROOT formatted data.");
64 zap[
'n'] =
make_field(numberOfEvents) = numeric_limits<Long64_t>::max();
69 catch(
const exception &error) {
70 FATAL(error.what() << endl);
93 Long64_t event_count = 0;
95 for (vector<string>::const_iterator i = inputFile.begin(); i != inputFile.end(); ++i) {
97 STATUS(
"File: " << *i << endl);
99 ifstream in(i->c_str());
101 for (
JStreamReader is(in); event_count < numberOfEvents; ++event_count) {
103 STATUS(
"event: " << setw(10) << event_count <<
'\r');
DEBUG(endl);
105 if (!(is >> preamble)) {
109 DEBUG(
"length " << preamble.getLength() << endl);
110 DEBUG(
"type " << preamble.getDataType() << endl);
114 ERROR(
"File " << *i <<
" invalid length " << preamble.getLength() << endl);
121 if (i != writer.end()) {
123 buffer.resize(preamble.getLength());
132 i->second->copy(bin);
138 ERROR(
"Illegal data type, skip" << endl);
General purpose messaging.
#define DEBUG(A)
Message macros.
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
int main(int argc, char **argv)
ROOT TTree parameter settings of various packages.
TTree reading for template data type.
Binary input based on std::istream.
Utility class to parse command line options.
virtual bool is_open() const override
Check is file is open.
Auxiliary class to copy input data to corresponding TTree.
virtual void open(const char *file_name) override
Open file.
void insert()
Insert (list of) data type(s).
virtual void close() override
Close file.
static JKey_t getKey(JType< T > type)
Get key.
map_type::iterator iterator
Simple data structure for the DAQ preamble required for a correct calculation of the object size for ...
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Support classes and methods for experiment specific I/O.
KM3NeT DAQ data structures and auxiliaries.
int getDataType()
Template definition for method returning data type.
size_t getSizeof< JDAQPreamble >()
Get size of type.
Auxiliary class for a type holder.