Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions
JConvertDB.cc File Reference

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

#include <iostream>
#include <iomanip>
#include "dbclient/KM3NeTDBClient.h"
#include "JDB/JDB.hh"
#include "JDB/JDBToolkit.hh"
#include "JDB/JSelector.hh"
#include "JDB/JSupport.hh"
#include "JDB/JDBincludes.hh"
#include "JDB/JDatabaseObjectIterator.hh"
#include "JSupport/JFileRecorder.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 data from data base into ROOT format.

Author
mdejong

Definition in file JConvertDB.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 25 of file JConvertDB.cc.

26 {
27  using namespace std;
28  using namespace JPP;
29 
30  typedef JDBTypes_t typelist;
31 
33  string usr;
34  string pwd;
35  string cookie;
36  string query;
37  JSelector selection;
38  int debug;
39 
40  try {
41 
42  JParser<> zap("Auxiliary program to convert data from data base into ROOT format.");
43 
44  zap['o'] = make_field(outputFile);
45  zap['u'] = make_field(usr) = "";
46  zap['!'] = make_field(pwd) = "";
47  zap['C'] = make_field(cookie) = "";
48  zap['q'] = make_field(query) = getQueries<typelist>();
49  zap['@'] = make_field(selection) = JPARSER::initialised();
50  zap['d'] = make_field(debug) = 1;
51 
52  zap['q'] = JPARSER::not_initialised();
53 
54  zap(argc, argv);
55  }
56  catch(const exception &error) {
57  FATAL(error.what() << endl);
58  }
59 
60  outputFile.open();
61 
62  try {
63 
64  JDB::reset(usr, pwd, cookie);
65 
66  JDetectorsHelper::initialise();
67 
68  JDatabaseObjectIterator<typelist> in(query, selection);
69 
70  in >> outputFile;
71  }
72  catch(const exception& error) {
73  FATAL(error.what() << endl);
74  }
75 
76  outputFile.close();
77 }
Object writing to file.
Utility class to parse command line options.
Definition: JParser.hh:1493
Object iteration from database.
esac print_variable DETECTOR INPUT_FILE OUTPUT_FILE CDF for TYPE in
Definition: JSirene.sh:45
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Definition: JParser.hh:63
Auxiliary class for specifying selection of database data.
string outputFile
Type list.
Definition: JTypeList.hh:22
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1954
int debug
debug level
Definition: JSirene.cc:61
#define FATAL(A)
Definition: JMessage.hh:67
Empty structure for specification of parser element that is not initialised (i.e. does require input)...
Definition: JParser.hh:69
void reset(T &value)
Reset value.