Jpp
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
software
JDB
JDetectorDB.cc
Go to the documentation of this file.
1
#include <string>
2
#include <iostream>
3
#include <iomanip>
4
5
#include "
JDB/JDB.hh
"
6
#include "
JDetector/JDetector.hh
"
7
#include "
JDetector/JDetectorToolkit.hh
"
8
#include "
JSupport/JMeta.hh
"
9
10
#include "
Jeep/JParser.hh
"
11
#include "
Jeep/JMessage.hh
"
12
13
14
/**
15
* \file
16
*
17
* Auxiliary program to print detector from database.
18
* \author mdejong
19
*/
20
int
main
(
int
argc,
char
**argv)
21
{
22
using namespace
std;
23
using namespace
JPP;
24
25
string
usr;
26
string
pwd;
27
string
cookie;
28
string
id;
29
string
tcalset;
30
string
pcalset;
31
string
rcalset;
32
string
outputFile
;
33
int
run;
34
int
debug
;
35
36
try
{
37
38
JParser<>
zap(
"Auxiliary program to print detector from database."
);
39
40
zap[
'u'
] =
make_field
(usr) =
""
;
41
zap[
'!'
] =
make_field
(pwd) =
""
;
42
zap[
'C'
] =
make_field
(cookie) =
""
;
43
zap[
'D'
] =
make_field
(
id
);
44
zap[
'r'
] =
make_field
(run);
45
zap[
't'
] =
make_field
(tcalset) =
""
;
///< tcal: t0 (time offsets) calibration set from DB
46
zap[
'p'
] =
make_field
(pcalset) =
""
;
///< pcal: position (x,y,z) calibration set from DB
47
zap[
'q'
] =
make_field
(rcalset) =
""
;
///< rcal: orientation (quarterions) calibration set from DB
48
zap[
'o'
] =
make_field
(
outputFile
) =
""
;
49
zap[
'd'
] =
make_field
(
debug
) = 1;
50
51
zap(argc, argv);
52
}
53
catch
(
const
exception &error) {
54
FATAL
(error.what() << endl);
55
}
56
57
try
{
58
59
JDB::reset
(usr, pwd, cookie);
60
61
JDetector
detector
;
62
63
if
(!tcalset.empty() && !pcalset.empty() && !rcalset.empty())
64
*(
JDB::get
()->DetX)(
id
.c_str(), tcalset.c_str(), pcalset.c_str(), rcalset.c_str()) >> detector;
65
else
66
*(
JDB::get
()->DetX)(
id
.c_str(), run) >> detector;
67
68
detector.
comment
.
add
(
JMeta
(argc,argv));
69
70
if
(detector.
setVersion
(JDetectorVersion::V3)) {
71
NOTICE
(
"Set detector version to "
<< JDetectorVersion::V3 << endl);
72
}
73
74
if
(
outputFile
!=
""
)
75
store
(
outputFile
, detector);
76
else
77
cout <<
detector
;
78
}
79
catch
(
const
exception& error) {
80
FATAL
(error.what() << endl);
81
}
82
}
JSUPPORT::JMeta
Auxiliary class for ROOT I/O of application specific meta data.
Definition:
JMeta.hh:71
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1493
JDETECTOR::JDetector
Detector data structure.
Definition:
JDetector.hh:80
JAANET::get
T get(const JHead &header)
Get object from header.
Definition:
JHeadToolkit.hh:295
JDETECTOR::JDetector::setVersion
void setVersion(const JVersion &version)
Set version.
Definition:
JDetector.hh:126
outputFile
string outputFile
Definition:
JDAQTimesliceSelector.cc:37
JDetector.hh
Data structure for detector geometry and calibration.
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition:
JParser.hh:1954
JMeta.hh
ROOT I/O of application specific meta data.
NOTICE
#define NOTICE(A)
Definition:
JMessage.hh:64
debug
int debug
debug level
Definition:
JSirene.cc:61
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.
JDetectorToolkit.hh
JDETECTOR::store
void store(const JString &file_name, const JDetector &detector)
Store detector to output file.
Definition:
JDetectorToolkit.hh:538
JEEP::JComment::add
JComment & add(const std::string &comment)
Add comment.
Definition:
JComment.hh:51
JDB.hh
JDETECTOR::JDetector::comment
JComment comment
Definition:
JDetector.hh:429
detector
detector
Definition:
examples/JDataFilter/JDataFilter.sh:104
main
int main(int argc, char *argv[])
Definition:
Main.cpp:15
Generated by
1.8.5