Jpp  18.2.1
the software that should make you happy
 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 "JSupport/JMeta.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  JServer server;
34  string usr;
35  string pwd;
36  string cookie;
37  string query;
38  JSelector selection;
39  int debug;
40 
41  try {
42 
43  JParser<> zap("Auxiliary program to convert data from data base into ROOT format.");
44 
45  zap['o'] = make_field(outputFile);
46  zap['s'] = make_field(server) = getServernames();
47  zap['u'] = make_field(usr) = "";
48  zap['!'] = make_field(pwd) = "";
49  zap['C'] = make_field(cookie) = "";
50  zap['q'] = make_field(query) = getQueries<typelist>();
51  zap['@'] = make_field(selection) = JPARSER::initialised();
52  zap['d'] = make_field(debug) = 1;
53 
54  zap['q'] = JPARSER::not_initialised();
55 
56  zap(argc, argv);
57  }
58  catch(const exception &error) {
59  FATAL(error.what() << endl);
60  }
61 
62 
63  try {
64 
65  JDB::reset(usr, pwd, cookie);
66 
67  JDBToolkit::initialise(getDetector);
68 
69  JDatabaseObjectIterator<typelist> in(query, selection);
70 
71  outputFile.open();
72 
73  outputFile.put(JMeta(argc, argv));
74 
75  in >> outputFile;
76 
77  outputFile.close();
78  }
79  catch(const exception& error) {
80  FATAL(error.what() << endl);
81  }
82 }
Auxiliary class for ROOT I/O of application specific meta data.
Definition: JMeta.hh:70
Object writing to file.
Utility class to parse command line options.
Definition: JParser.hh:1514
Object iteration from database.
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Definition: JParser.hh:83
Auxiliary class for specifying selection of database data.
string outputFile
JDetectorsHelper & getDetector()
Auxiliary function for helper object initialisation.
Definition: JDBToolkit.hh:378
Type list.
Definition: JTypeList.hh:22
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1989
#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:89
void reset(T &value)
Reset value.
std::vector< JServer > getServernames()
Get list of names of available database servers.
Definition: JDB.hh:106
Wrapper class for server name.
Definition: JDB.hh:50
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
Definition: JCanberra.sh:46
int debug
debug level