Jpp
18.0.0-rc.4
the software that should make you happy
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
examples
JDB
JPrintRunsetup.cc
Go to the documentation of this file.
1
#include <string>
2
#include <iostream>
3
#include <map>
4
5
#include "
JDB/JDB.hh
"
6
#include "
JDB/JDBToolkit.hh
"
7
#include "
JDB/JSelector.hh
"
8
#include "
JDB/JSelectorSupportkit.hh
"
9
#include "
JDB/JAllParams.hh
"
10
#include "
JDB/JRunsetupParams.hh
"
11
12
#include "
Jeep/JParser.hh
"
13
#include "
Jeep/JMessage.hh
"
14
15
16
/**
17
* \file
18
* Auxiliary program to print run setup data.
19
* \author lnauta
20
*/
21
int
main
(
const
int
argc,
const
char
*
const
argv[])
22
{
23
using namespace
std;
24
using namespace
JPP;
25
26
JServer server;
27
string
usr;
28
string
pwd;
29
string
cookie;
30
string
detid;
31
string
rs_oid;
32
int
debug
;
33
34
try
{
35
36
JParser<>
zap(
"Auxiliary program to print run setup data."
);
37
38
zap[
's'
] =
make_field
(server) =
getServernames
();
39
zap[
'u'
] =
make_field
(usr) =
""
;
40
zap[
'!'
] =
make_field
(pwd) =
""
;
41
zap[
'C'
] =
make_field
(cookie) =
""
;
42
zap[
'D'
] =
make_field
(detid);
43
zap[
'R'
] =
make_field
(rs_oid);
44
zap[
'd'
] =
make_field
(
debug
) = 1;
45
46
zap(argc, argv);
47
}
48
catch
(
const
exception& error) {
49
FATAL
(error.what() << endl);
50
}
51
52
53
try
{
54
55
JDB::reset
(usr, pwd, cookie);
56
57
detid = getDetector<string>(detid);
58
59
map<string, string>
umap;
60
61
{
62
ResultSet& rs =
getResultSet
(getTable<JAllParams>());
//, getSelector<JAllParams>("DATAACQUISITION"));
63
64
for
(JAllParams buffer; rs >> buffer; ) {
65
umap[buffer.OID] = buffer.NAME;
66
}
67
68
rs.Close();
69
}
70
71
ResultSet& rs =
getResultSet
(getTable<JRunsetupParams>(), getSelector<JRunsetupParams>(detid, rs_oid));
72
73
for
(JRunsetupParams buffer; rs >> buffer; ) {
74
cout << setw(24) << left << buffer.UPIFILTER << right <<
" "
<< buffer.PAR_OID <<
" -> "
<< umap[buffer.PAR_OID] <<
" = "
<< buffer.VALUE << endl;
75
}
76
}
77
catch
(
const
exception& error) {
78
FATAL
(error.what() << endl);
79
}
80
}
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1514
main
int main(int argc, char *argv[])
Definition:
Main.cc:15
std::map
Definition:
JSTDTypes.hh:16
JDBToolkit.hh
JRunsetupParams.hh
JSelector.hh
JAllParams.hh
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition:
JParser.hh:1989
JMessage.hh
General purpose messaging.
FATAL
#define FATAL(A)
Definition:
JMessage.hh:67
JTOOLS::reset
void reset(T &value)
Reset value.
Definition:
JToolsToolkit.hh:219
JParser.hh
Utility class to parse command line options.
JDATABASE::getResultSet
ResultSet & getResultSet(const std::string &query)
Get result set.
Definition:
JDB.hh:436
JDATABASE::getServernames
std::vector< JServer > getServernames()
Get list of names of available database servers.
Definition:
JDB.hh:106
JSelectorSupportkit.hh
JDB.hh
debug
int debug
debug level
Definition:
archive-put-wiki-detectors.sh:92
Generated by
1.8.5