Jpp master_rocky-44-g75b7c4f75
the software that should make you happy
Loading...
Searching...
No Matches
JConvertDB.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"
13#include "JSupport/JMeta.hh"
14
15#include "Jeep/JParser.hh"
16#include "Jeep/JMessage.hh"
17
18
19/**
20 * \file
21 *
22 * Auxiliary program to convert data from data base into ROOT format.
23 * \author mdejong
24 */
25int main(int argc, char **argv)
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
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}
int main(int argc, char **argv)
Definition JConvertDB.cc:25
string outputFile
ROOT TTree parameter settings.
This file is automatically created by make.
Recording of objects on file according a format that follows from the file name extension.
General purpose messaging.
#define FATAL(A)
Definition JMessage.hh:67
int debug
debug level
Definition JSirene.cc:69
ROOT I/O of application specific meta data.
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.
Auxiliary class for specifying selection of database data.
Utility class to parse command line options.
Definition JParser.hh:1698
Object writing to file.
const std::vector< std::string > & getQueries()
Get list of possible queries.
JDetectorsHelper & getDetector()
Auxiliary function for helper object initialisation.
std::vector< JServer > getServernames()
Get list of names of available database servers.
Definition JDB.hh:107
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
static void initialise(JHelper_t &helper, const Args &...args)
Initialise.
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
Auxiliary class for ROOT I/O of application specific meta data.
Definition JMeta.hh:72