74{
77
79
81 string usr;
87 JRange_t range;
88 double precision;
90
91 try {
92
93 JParser<> zap(
"Auxiliary program to decompose detector to separate calibrations.");
94
101 "\nFile name should contain wild card \'" << FILENAME_WILDCARD << "\' or"\
104 &JCalibrationType::nick_name));
107 zap[
'p'] =
make_field(precision,
"precision for match with reference module") = 1.0e-5;
109
111 }
112 catch(const exception &error) {
114 }
115
116
117
119
120 try {
122 }
125 }
126
128 FATAL(
"No detector address map for detector identier " <<
detector.getID() <<
endl);
129 }
130
132
136
137 try {
138
140
141 {
143
144 for (
JPersons object; rs >> object; ) {
146 }
147
148 rs.Close();
149 }
150 {
152
154 locid =
object.LOCATIONID;
156 }
157
158 rs.Close();
159 }
160
162
164
165 for (
JRuns object; rs >> object; ) {
166 validity.setLowerLimit(
object.UNIXJOBSTART / 1000);
167 }
168
169 rs.Close();
170 }
171
173
175
176 for (
JRuns object; rs >> object; ) {
177 validity.setUpperLimit(
object.UNIXJOBEND / 1000);
178 }
179
180 rs.Close();
181 }
182 }
183 catch(const exception& error) {
185 }
186
187
188
189
191
192 if (
module->getFloor() != 0) {
193
195
197
199
200 if (!JModule::compare(buffer, *
module, precision)) {
201
202 for (size_t i = 0; i != module->size(); ++i) {
207 }
208
209 FATAL(
"Module " <<
setw(10) <<
module->getID() <<
' ' <<
module->getLocation() <<
" incompatible with reference." <<
endl);
210 }
211 }
212 }
213
215 { TypeId_t,
json() },
216 { LocationId_t,
locid },
222
223 const json error = { {Message_t,
"" },
224 {Code_t, OK_t },
225 {Arguments_t, json::array() } };
226
227
229
231 js[Error_t] =
json(error);
232
234
236
238 for (JModule::const_iterator pmt =
module->begin(); pmt !=
module->end(); ++pmt) {
240 }
241 }
242
243 js[Data_t][0] =
json(header);
244 js[Data_t][0][PMTT0s_t] =
json(data);
245
247 }
248
250
252
254
256
259 else
261 }
262
263 js[Data_t][0] =
json(header);
264 js[Data_t][0][BasePositions_t] =
json(data[0]);
265 js[Data_t][0][DOMPositions_t] =
json(data[1]);
266
268 }
269
271
273
275
277
278 if (
module->getFloor() != 0) {
280 }
281 }
282
283 js[Data_t][0] =
json(header);
284 js[Data_t][0][DOMRotations_t] =
json(data);
285
287 }
288
290
292
294
295 if (
module->getFloor() == 0)
297 else
299 }
300
301 js[Data_t][0] =
json(header);
302 js[Data_t][0][BaseAcousticT0_t] =
json(data[0]);
303 js[Data_t][0][DOMAcousticT0_t] =
json(data[1]);
304
306 }
307
309
311
313 if (
module->getFloor() == 0)
315 else
317 }
318
319 js[Data_t][0] =
json(header);
320 js[Data_t][0][BaseCompassRotations_t] =
json(data[0]);
321 js[Data_t][0][DOMCompassRotations_t] =
json(data[1]);
322
324 }
325
327
328 js[Data_t][0] =
json(header);
329
330 {
332
334 for (JModule::const_iterator pmt =
module->begin(); pmt !=
module->end(); ++pmt) {
336 }
337 }
338
339 js[Data_t][0][PMTStatusInfo_t ] =
json(data);
340 }
341 {
343
345 if (
module->getFloor() == 0)
347 else
349 }
350
351 js[Data_t][0][BaseStatusInfo_t] =
json(data[0]);
352 js[Data_t][0][DOMStatusInfo_t] =
json(data[1]);
353 }
354
356 }
357
358 return 0;
359}
#define DEBUG(A)
Message macros.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Data structure for time calibration.
int getFloor() const
Get floor number.
Data structure for a composite optical module.
void rotate(const JRotation3D &R)
Rotate module.
Template definition of a multi-dimensional oscillation probability interpolation table.
Utility class to parse command line options.
JDirection3D getDirection(const Vec &dir)
Get direction.
JPosition3D getPosition(const Vec &pos)
Get position.
ResultSet & getResultSet(const std::string &query)
Get result set.
std::vector< JServer > getServernames()
Get list of names of available database servers.
JDetectorBuilder & getDetectorBuilder()
Get detector builder.
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
JCalibration getCalibration(const JCalibration &first, const JCalibration &second)
Get calibration to go from first to second calibration.
void store(const std::string &file_name, const JDetector &detector)
Store detector to output file.
bool hasDetectorAddressMap(const int id)
Check if detector address map is available.
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.
double getDot(const JFirst_t &first, const JSecond_t &second)
Get dot product of objects.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary data structure for floating point format specification.
Wrapper class for server name.
Auxiliary data structure for compass rotation.
Auxiliary interface for building detector.
Auxiliary data structure for module time calibration.
Auxiliary data structure for module position.
Auxiliary data structure for module rotation.
Auxiliary data structure for module status.
Auxiliary data structure for PMT time calibration.
Auxiliary data structure for PMT status.
Auxiliary data structure for streaming of STL containers.
Auxiliary data structure for correspondence between nick and full name of calibration types.
Auxiliary class for date and time.
std::string toString() const
Get ASCII formatted date and time.