Jpp test-rotations-new
the software that should make you happy
Loading...
Searching...
No Matches
JConvertDB.cc File Reference

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

#include <iostream>
#include <iomanip>
#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

◆ main()

int main ( int argc,
char ** argv )

Definition at line 94 of file JConvertDB.cc.

95{
96 using namespace std;
97 using namespace JPP;
98
99 typedef JDBTypes_t typelist;
100
101 string outputFile;
102 JServer server;
103 string usr;
104 string pwd;
105 string cookie;
106 string query;
107 JSelector selection;
108 int debug;
109
110 try {
111
112 JParser<> zap("Auxiliary program to convert data from data base into ROOT format.");
113
114 zap['o'] = make_field(outputFile);
115 zap['s'] = make_field(server) = getServernames();
116 zap['u'] = make_field(usr) = "";
117 zap['!'] = make_field(pwd) = "";
118 zap['C'] = make_field(cookie) = "";
119 zap['q'] = make_field(query) = getQueries<typelist>();
120 zap['@'] = make_field(selection) = JPARSER::initialised();
121 zap['d'] = make_field(debug) = 1;
122
123 zap['q'] = JPARSER::not_initialised();
124
125 zap(argc, argv);
126 }
127 catch(const exception &error) {
128 FATAL(error.what() << endl);
129 }
130
131
132 try {
133
134 JDB::reset(usr, pwd, cookie);
135
137
138 IO io(getType<typelist>());
139
140 io[query]->copy(query, selection, JMeta(argc,argv), outputFile);
141 }
142 catch(const exception& error) {
143 FATAL(error.what() << endl);
144 }
145}
string outputFile
#define FATAL(A)
Definition JMessage.hh:67
int debug
debug level
Definition JSirene.cc:72
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition JParser.hh:2142
Auxiliary class for specifying selection of database data.
Utility class to parse command line options.
Definition JParser.hh:1698
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:108
JType< T > getType()
Get type.
Definition JType.hh:31
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:54
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