73int main(
int argc,
char **argv)
93 JParser<> zap(
"Auxiliary program to decompose detector to separate calibrations.");
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;
112 catch(
const exception &error) {
127 if (!hasDetectorAddressMap(
detector.getID())) {
128 FATAL(
"No detector address map for detector identier " <<
detector.getID() <<
endl);
144 for (
JPersons object; rs >> object; ) {
154 locid =
object.LOCATIONID;
165 for (
JRuns object; rs >> object; ) {
166 validity.setLowerLimit(
object.UNIXJOBSTART / 1000);
176 for (
JRuns object; rs >> object; ) {
177 validity.setUpperLimit(
object.UNIXJOBEND / 1000);
183 catch(
const exception& error) {
192 if (
module->getFloor() != 0) {
200 if (!JModule::compare(buffer, *
module, precision)) {
202 for (
size_t i = 0; i !=
module->size(); ++i) {
204 << (*
module)[i].getDirection() <<
' '
205 << buffer[i].getDirection() <<
' '
206 <<
FIXED(7,3) <<
acos(getDot((*
module)[i].getDirection(), buffer[i].getDirection())) * 180.0 / PI <<
" [deg]" <<
endl);
209 FATAL(
"Module " <<
setw(10) <<
module->getID() <<
' ' <<
module->getLocation() <<
" incompatible with reference." <<
endl);
215 { TypeId_t,
json() },
216 { LocationId_t,
locid },
223 const json error = { {Message_t,
"" },
225 {Arguments_t, json::array() } };
231 js[Error_t] =
json(error);
238 for (JModule::const_iterator pmt =
module->begin(); pmt !=
module->end(); ++pmt) {
243 js[Data_t][0] =
json(header);
244 js[Data_t][0][PMTT0s_t] =
json(data);
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]);
278 if (
module->getFloor() != 0) {
283 js[Data_t][0] =
json(header);
284 js[Data_t][0][DOMRotations_t] =
json(data);
295 if (
module->getFloor() == 0)
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]);
313 if (
module->getFloor() == 0)
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]);
328 js[Data_t][0] =
json(header);
334 for (JModule::const_iterator pmt =
module->begin(); pmt !=
module->end(); ++pmt) {
335 data.push_back(
JPMTStatus_t(pmt->getID(), pmt->getStatus()));
339 js[Data_t][0][PMTStatusInfo_t ] =
json(data);
345 if (
module->getFloor() == 0)
351 js[Data_t][0][BaseStatusInfo_t] =
json(data[0]);
352 js[Data_t][0][DOMStatusInfo_t] =
json(data[1]);