71{
74
76 string usr;
77 string pwd;
78 string cookie;
79 string detid;
80 int run;
81 int ranking;
82 string variant;
86
87 try {
88
89 JParser<> zap(
"Auxiliary program to download official detector.");
90
97 zap[
'R'] =
make_field(ranking,
"ranking (1 is best)") = 1;
100 zap[
'F'] =
make_field(format,
"column names: "
101 << RUN_t << ' '
109
110 zap(argc, argv);
111 }
112 catch(const exception &error) {
113 FATAL(error.what() << endl);
114 }
115
116 try {
117
118 JDB::reset(usr, pwd, cookie);
119
121
123
125
126 DEBUG(setw(2) << js << endl);
127
129 FATAL(
"JSon error code not okay." << endl);
130 }
131
133 FATAL(
"JSon output does not contain data." << endl);
134 }
135
137
140 cout << setw(24) << left << element.CalibrationType << ' ' << right << element.CalibrationId << endl;
141 }
142 }
143
145
147
149
150 *(JDB::get()->DetX)(detid.c_str(),
158
160
163 }
164
165 if (
detector.setToLatestVersion()) {
166 NOTICE(
"Set detector version to " <<
detector.getVersion() << endl);
167 }
168
170
171 } else {
172
174
176
178
181 else
182 ERROR(
"Invalid JSon data " << setw(2) << buffer);
183 }
184 }
185 }
186
187 if (!format.empty()) {
188
189 for (vector<string>::const_iterator i = format.begin(); i != format.end(); ++i) {
190
191 if (*i == RUN_t)
192 cout << ' ' << run;
193 else
195 }
196
197 cout << endl;
198 }
199 }
200 catch(const exception& error) {
201 FATAL(error.what() << endl);
202 }
203
204 return 0;
205}
#define DEBUG(A)
Message macros.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
#define MAKE_STRING(A)
Make string.
Utility class to parse command line options.
JDetectorsHelper & getDetector()
Auxiliary function for helper object initialisation.
void get_json(json &js, const std::string &query)
Get json.
std::vector< JServer > getServernames()
Get list of names of available database servers.
static const JGetDetectorVersion getDetectorVersion
Function object to map detector version to numerical value.
void store(const std::string &file_name, const JDetector &detector)
Store detector to output file.
std::vector< T > getDetectorVersions()
Get detector versions.
std::string setWildCard(const std::string &file_name, const std::string &value)
Get file name by setting wild card to given value.
bool hasWildCard(const std::string &file_name)
Check presence of wild card.
static const char FILENAME_WILDCARD
wild card character for file name substitution
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
static const std::string PMT_T0_CALIBRATION_t
PMT time offsets.
static const std::string COMPASS_CALIBRATION_t
compass alignment (a.k.a. quaternion calibration)
bool is_valid(const json &js)
Check validity of JSon data.
static const std::string DOM_POSITION_CALIBRATION_t
(optical|base) module positions
static const std::string STATUS_CALIBRATION_t
(module|PMT) status
static const std::string Data_t
static const std::string DOM_ROTATION_CALIBRATION_t
optical module orientations
static const std::string ACOUSTIC_T0_CALIBRATION_t
acoustic time offsets (piezo sensor or hydrophone)
static const char *const getName()
Table name.
static const char *const getName()
Table name.
Wrapper class for server name.
Template definition for getting table specific selector.
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Auxiliary data structure for correspondence between nick and full name of calibration types.
const std::string & getNickname(const std::string &type) const
Get calibration type.