Jpp master_rocky-44-g75b7c4f75
the software that should make you happy
Loading...
Searching...
No Matches
JAsciiDB.cc
Go to the documentation of this file.
1#include <iostream>
2#include <iomanip>
3
4#include "dbclient/KM3NeTDBClient.h"
5
6#include "JDB/JDB.hh"
7#include "JDB/JDBToolkit.hh"
8#include "JDB/JSelector.hh"
9#include "JDB/JSupport.hh"
10#include "JDB/JDBincludes.hh"
11#include "JDB/JDBDictionary.hh"
15
16#include "Jeep/JParser.hh"
17#include "Jeep/JMessage.hh"
18
19
20/**
21 * \file
22 *
23 * Auxiliary program to convert data from data base into ASCII format.
24 * \author mdejong
25 */
26int main(int argc, char **argv)
27{
28 using namespace std;
29 using namespace JPP;
30
31 typedef JDBTypes_t typelist;
32
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 ASCII format.");
44
45 zap['s'] = make_field(server) = getServernames();
46 zap['u'] = make_field(usr) = "";
47 zap['!'] = make_field(pwd) = "";
48 zap['C'] = make_field(cookie) = "";
49 zap['q'] = make_field(query) = getQueries<typelist>();
50 zap['@'] = make_field(selection) = JPARSER::initialised();
51 zap['d'] = make_field(debug) = 1;
52
53 zap['q'] = JPARSER::not_initialised();
54
55 zap(argc, argv);
56 }
57 catch(const exception &error) {
58 FATAL(error.what() << endl);
59 }
60
61
62 JRootWriter writer(cout, JEquationParameters(), JDBDictionary::getInstance());
63
64 JRootStreamObjectOutput<typelist> out(writer, "\n");
65
66 try {
67
68 JDB::reset(usr, pwd, cookie);
69
70 JDBToolkit::initialise(getDetector);
71
72 JDatabaseObjectIterator<typelist> in(query, selection);
73
74 in >> out;
75 }
76 catch(const exception& error) {
77 FATAL(error.what() << endl);
78 }
79}
int main(int argc, char **argv)
Definition JAsciiDB.cc:26
ROOT TTree parameter settings.
This file is automatically created by make.
General purpose messaging.
#define FATAL(A)
Definition JMessage.hh:67
int debug
debug level
Definition JSirene.cc:69
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition JParser.hh:2142
Object iteration from database.
Simple data structure to support I/O of equations (see class JLANG::JEquation).
Utility class to parse command line options.
Definition JParser.hh:1698
Template implementation of stream output for single data type based on ROOT dictionary.
Implementation for ASCII output of objects with ROOT dictionary.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Wrapper class for server name.
Definition JDB.hh:53
Type list.
Definition JTypeList.hh:23
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Definition JParser.hh:68
Empty structure for specification of parser element that is not initialised (i.e. does require input)...
Definition JParser.hh:74