Jpp  19.1.0-rc.1
the software that should make you happy
Functions
JRootDB.cc File Reference

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

#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <memory>
#include "JDB/JSupport.hh"
#include "JDB/JDBincludes.hh"
#include "JDB/JDBDictionary.hh"
#include "JROOT/JRootStreamer.hh"
#include "JROOT/JRootDictionary.hh"
#include "JROOT/JROOTClassSelector.hh"
#include "JROOT/JASCIIFileStreamer.hh"
#include "JLang/JNullStream.hh"
#include "JSupport/JFileRecorder.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 87 of file JRootDB.cc.

88 {
89  using namespace std;
90  using namespace JPP;
91 
92  typedef JDBTypes_t typelist;
93 
94  string inputFile;
95  string outputFile;
96  JROOTClassSelector selector;
97  int debug;
98 
99  try {
100 
101  JParser<> zap("Auxiliary program to convert ASCII data from data base into ROOT format.");
102 
103  zap['f'] = make_field(inputFile, "ASCII formatted input file."\
104  "\nFirst line should list data members of data structure given at option -C");
105  zap['o'] = make_field(outputFile);
106  zap['C'] = make_field(selector, "name of data structure") = getROOTClassSelection<typelist>();
107  zap['d'] = make_field(debug) = 1;
108 
109  zap['C'] = JPARSER::not_initialised();
110 
111  zap(argc, argv);
112  }
113  catch(const exception &error) {
114  FATAL(error.what() << endl);
115  }
116 
117  IO io;
118 
119  for_each<typelist>(io);
120 
121  io[selector]->copy(inputFile, outputFile);
122 }
string outputFile
#define FATAL(A)
Definition: JMessage.hh:67
int debug
debug level
Definition: JSirene.cc:69
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:2158
Utility class to parse command line options.
Definition: JParser.hh:1714
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Definition: JSTDTypes.hh:14
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:90
Auxiliary class to select ROOT class based on class name.