Jpp 19.3.0-rc.3
the software that should make you happy
Loading...
Searching...
No Matches
JRootDB.cc File Reference

Auxiliary program to convert ASCII data from data base into ROOT format. More...

#include <iostream>
#include <fstream>
#include <iomanip>
#include <memory>
#include "JDB/JSupport.hh"
#include "JDB/JDBincludes.hh"
#include "JDB/JDBDictionary.hh"
#include "JROOT/JRootStreamer.hh"
#include "JROOT/JROOTClassSelector.hh"
#include "JROOT/JASCIIFileStreamer.hh"
#include "JLang/JType.hh"
#include "JSupport/JFileRecorder.hh"
#include "JSupport/JMeta.hh"
#include "Jeep/JeepToolkit.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Auxiliary program to convert ASCII data from data base into ROOT format.

Author
mdejong

Definition in file JRootDB.cc.

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Definition at line 101 of file JRootDB.cc.

102{
103 using namespace std;
104 using namespace JPP;
105
106 typedef JDBTypes_t typelist;
107
108 string inputFile;
109 string outputFile;
110 JROOTClassSelector selector;
111 int debug;
112
113 try {
114
115 JParser<> zap("Auxiliary program to convert ASCII data from data base into ROOT format.");
116
117 zap['f'] = make_field(inputFile, "ASCII formatted input file."\
118 "\nFirst line should list data members of data structure given at option -C");
119 zap['o'] = make_field(outputFile);
120 zap['C'] = make_field(selector, "name of data structure") = getROOTClassSelection<typelist>();
121 zap['d'] = make_field(debug) = 1;
122
123 zap['C'] = JPARSER::not_initialised();
124
125 zap(argc, argv);
126 }
127 catch(const exception &error) {
128 FATAL(error.what() << endl);
129 }
130
131 IO io(getType<typelist>());
132
133 io[selector]->copy(inputFile, JMeta(argc,argv), outputFile);
134}
string outputFile
#define FATAL(A)
Definition JMessage.hh:67
int debug
debug level
Definition JSirene.cc:72
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition JParser.hh:2142
Utility class to parse command line options.
Definition JParser.hh:1698
JType< T > getType()
Get type.
Definition JType.hh:31
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
std::set< JROOTClassSelector > getROOTClassSelection(const bool option=false)
Get ROOT class selection.
Type list.
Definition JTypeList.hh:23
Empty structure for specification of parser element that is not initialised (i.e. does require input)...
Definition JParser.hh:74
Auxiliary class to select ROOT class based on class name.
Auxiliary class for ROOT I/O of application specific meta data.
Definition JMeta.hh:72