Jpp
16.0.0-rc.1
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
software
JDB
JAHRSCalibration.cc
Go to the documentation of this file.
1
#include <iostream>
2
#include <iomanip>
3
4
#include "
JDB/JDB.hh
"
5
#include "
JDB/JDBToolkit.hh
"
6
#include "
JDB/JSelector.hh
"
7
#include "
JDB/JSelectorSupportkit.hh
"
8
#include "
JDB/JAHRSCalibration_t.hh
"
9
10
#include "
Jeep/JParser.hh
"
11
#include "
Jeep/JMessage.hh
"
12
13
14
/**
15
* \file
16
*
17
* Auxiliary program to store AHRS calibration data on local disk.
18
* \author mdejong
19
*/
20
int
main
(
int
argc,
char
**argv)
21
{
22
using namespace
std;
23
using namespace
JPP;
24
25
JServer server;
26
string
usr;
27
string
pwd;
28
string
cookie;
29
int
option;
30
string
detid;
31
string
outputFile
;
32
int
debug
;
33
34
try
{
35
36
JParser<>
zap(
"Auxiliary program to store AHRS calibration data on local disk."
);
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[
'O'
] =
make_field
(option) = 0;
43
zap[
'D'
] =
make_field
(detid);
44
zap[
'o'
] =
make_field
(
outputFile
) =
"ahrs_calibration.txt"
;
45
zap[
'd'
] =
make_field
(
debug
) = 2;
46
47
zap(argc, argv);
48
}
49
catch
(
const
exception &error) {
50
FATAL
(error.what() << endl);
51
}
52
53
54
try
{
55
56
JDB::reset
(usr, pwd, cookie);
57
58
STATUS
(
"Reading AHRS calibration data... "
<< flush);
59
60
const
JAHRSCalibration_t calibration(getDetector<int>(detid), option);
61
62
STATUS
(
"OK"
<< endl);
63
64
if
(
outputFile
!=
""
) {
65
66
STATUS
(
"Storing AHRS calibration data to "
<<
outputFile
<<
"... "
<< flush);
67
68
calibration.store(
outputFile
.c_str());
69
70
STATUS
(
"OK"
<< endl);
71
72
}
else
{
73
74
cout << calibration << 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:1500
main
int main(int argc, char *argv[])
Definition:
Main.cc:15
STATUS
#define STATUS(A)
Definition:
JMessage.hh:63
outputFile
string outputFile
Definition:
JDAQTimesliceSelector.cc:37
JDBToolkit.hh
JSelector.hh
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition:
JParser.hh:1961
debug
int debug
debug level
Definition:
JSirene.cc:63
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::getServernames
std::vector< JServer > getServernames()
Get list of names of available database servers.
Definition:
JDB.hh:98
JSelectorSupportkit.hh
JDB.hh
JAHRSCalibration_t.hh
Generated by
1.8.5