Jpp
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
software
JDB
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
11
#include "
JDB/JDBincludes.hh
"
12
#include "
JDB/JDatabaseObjectIterator.hh
"
13
#include "
JSupport/JFileRecorder.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
*/
25
int
main
(
int
argc,
char
**argv)
26
{
27
using namespace
std;
28
using namespace
JPP;
29
30
typedef
JDBTypes_t
typelist;
31
32
JFileRecorder<typelist>
outputFile
;
33
string
usr;
34
string
pwd;
35
string
cookie;
36
string
query;
37
JSelector
selection;
38
int
debug
;
39
40
try
{
41
42
JParser<>
zap(
"Auxiliary program to convert data from data base into ROOT format."
);
43
44
zap[
'o'
] =
make_field
(
outputFile
);
45
zap[
'u'
] =
make_field
(usr) =
""
;
46
zap[
'!'
] =
make_field
(pwd) =
""
;
47
zap[
'C'
] =
make_field
(cookie) =
""
;
48
zap[
'q'
] =
make_field
(query) = getQueries<typelist>();
49
zap[
'@'
] =
make_field
(selection) =
JPARSER::initialised
();
50
zap[
'd'
] =
make_field
(
debug
) = 1;
51
52
zap[
'q'
] =
JPARSER::not_initialised
();
53
54
zap(argc, argv);
55
}
56
catch
(
const
exception &error) {
57
FATAL
(error.what() << endl);
58
}
59
60
outputFile
.open();
61
62
try
{
63
64
JDB::reset
(usr, pwd, cookie);
65
66
JDetectorsHelper::initialise();
67
68
JDatabaseObjectIterator<typelist>
in
(query, selection);
69
70
in >>
outputFile
;
71
}
72
catch
(
const
exception& error) {
73
FATAL
(error.what() << endl);
74
}
75
76
outputFile
.close();
77
}
JSUPPORT::JFileRecorder
Object writing to file.
Definition:
JFileRecorder.hh:41
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1493
JDatabaseObjectIterator.hh
JDATABASE::JDatabaseObjectIterator
Object iteration from database.
Definition:
JDatabaseObjectIterator.hh:52
JFileRecorder.hh
Recording of objects on file according a format that follows from the file name extension.
in
esac print_variable DETECTOR INPUT_FILE OUTPUT_FILE CDF for TYPE in
Definition:
JSirene.sh:45
JPARSER::initialised
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Definition:
JParser.hh:63
JDATABASE::JSelector
Auxiliary class for specifying selection of database data.
Definition:
JDB/JSelector.hh:67
outputFile
string outputFile
Definition:
JDAQTimesliceSelector.cc:37
JDBToolkit.hh
JLANG::JTypeList
Type list.
Definition:
JTypeList.hh:22
JSelector.hh
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition:
JParser.hh:1954
JSupport.hh
ROOT TTree parameter settings.
debug
int debug
debug level
Definition:
JSirene.cc:61
JMessage.hh
General purpose messaging.
FATAL
#define FATAL(A)
Definition:
JMessage.hh:67
JPARSER::not_initialised
Empty structure for specification of parser element that is not initialised (i.e. does require input)...
Definition:
JParser.hh:69
JTOOLS::reset
void reset(T &value)
Reset value.
Definition:
JToolsToolkit.hh:219
JParser.hh
Utility class to parse command line options.
JDBincludes.hh
This file is automatically created by make.
JDB.hh
main
int main(int argc, char *argv[])
Definition:
Main.cpp:15
Generated by
1.8.5