Jpp
Functions
JAsciiDB.cc File Reference
#include <iostream>
#include <iomanip>
#include "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 "JROOT/JRootStreamObjectOutput.hh"
#include "JROOT/JRootDictionary.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 ASCII format.

Author
mdejong

Definition in file JAsciiDB.cc.

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 25 of file JAsciiDB.cc.

26 {
27  using namespace std;
28  using namespace JPP;
29 
30  typedef JDBTypes_t typelist;
31 
32  string usr;
33  string pwd;
34  string cookie;
35  string query;
36  JSelector selection;
37  int debug;
38 
39  try {
40 
41  JParser<> zap("Auxiliary program to convert data from data base into ASCII format.");
42 
43  zap['u'] = make_field(usr) = "";
44  zap['!'] = make_field(pwd) = "";
45  zap['C'] = make_field(cookie) = "";
46  zap['q'] = make_field(query) = getQueries<typelist>();
47  zap['@'] = make_field(selection) = JPARSER::initialised();
48  zap['d'] = make_field(debug) = 1;
49 
50  zap['q'] = JPARSER::not_initialised();
51 
52  zap(argc, argv);
53  }
54  catch(const exception &error) {
55  FATAL(error.what() << endl);
56  }
57 
58 
59  JRootWriter writer(cout, JEquationParameters(), JRootDictionary::getInstance());
60 
61  JRootStreamObjectOutput<typelist> out(writer, "\n");
62 
63  try {
64 
65  JDB::reset(usr, pwd, cookie);
66 
67  JDetectorsHelper::initialise();
68 
69  JDatabaseObjectIterator<typelist> in(query, selection);
70 
71  in >> out;
72  }
73  catch(const exception& error) {
74  FATAL(error.what() << endl);
75  }
76 }
JLANG::getInstance
T & getInstance(const T &object)
Get static instance from temporary object.
Definition: JObject.hh:73
JPARSER::initialised
Empty structure for specification of parser element that is initialised (i.e.
Definition: JParser.hh:63
JPARSER::JParser
Utility class to parse command line options.
Definition: JParser.hh:1493
JPP
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Definition: JAAnetToolkit.hh:37
debug
int debug
debug level
Definition: JSirene.cc:59
JLANG::JTypeList
Type list.
Definition: JTypeList.hh:22
JDETECTOR::reset
void reset(JCLBInput &data, size_t size)
Reset CLB buffers.
Definition: JCLBSimulator.hh:41
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1954
std
Definition: jaanetDictionary.h:36
FATAL
#define FATAL(A)
Definition: JMessage.hh:67
JPARSER::not_initialised
Empty structure for specification of parser element that is not initialised (i.e.
Definition: JParser.hh:69