Jpp  17.2.1-pre0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JDetectorCalibration.hh
Go to the documentation of this file.
1 #ifndef __JDETECTOR__JDETECTORCALIBRATION__
2 #define __JDETECTOR__JDETECTORCALIBRATION__
3 
4 #include <string>
5 #include <vector>
6 
7 #include "JSon/JSon.hh"
8 
9 #include "JDB/JPBS_t.hh"
10 #include "JDB/JUPI_t.hh"
11 
12 #include "JLang/JObjectID.hh"
13 #include "JLang/JException.hh"
14 
15 #include "Jeep/JPrint.hh"
16 #include "Jeep/JStatus.hh"
17 
19 
22 
23 
24 /**
25  * \author mdejong, bjung, acreusot
26  */
27 
28 namespace JDETECTOR {}
29 namespace JPP { using namespace JDETECTOR; }
30 
31 /**
32  * Auxiliary classes and methods for detector calibration.
33  */
34 namespace JDETECTOR {
35 
36  using JSON::json;
37 
38  using JLANG::JObjectID;
40  using JLANG::JNoValue;
41 
42  using JDATABASE::JUPI_t;
43  using JDATABASE::JPBS_t;
44 
45  using JEEP::JStatus;
46 
49 
50 
51  static const std::string TCAL = "tcal"; //!< PMT time offsets
52  static const std::string PCAL = "pcal"; //!< (optical|base) module positions
53  static const std::string RCAL = "rcal"; //!< (optical|base) module orientations
54  static const std::string ACAL = "acal"; //!< acoustic time offsets (piezo sensor or hydrophone)
55  static const std::string CCAL = "ccal"; //!< compass alignment (a.k.a.\ quaternion calibration)
56  static const std::string SCAL = "scal"; //!< PMT status
57  static const std::string MMAP = "mmap"; //!< module address map
58 
59 
60  /**
61  * Detector calibration key words for JSON I/O.
62  */
63 
64  // Meta data
65  static const std::string User_t = "User";
66  static const std::string Location_t = "Location";
67  static const std::string Time_t = "Time";
68  static const std::string Start_t = "Start";
69  static const std::string End_t = "End";
70  static const std::string Comment_t = "Comment";
71  static const std::string Encoding_t = "Encoding";
72  static const std::string Input_t = "Inputs";
73  static const std::string Error_t = "Error";
74  static const std::string Message_t = "Message";
75  static const std::string Code_t = "Code";
76  static const std::string Provenance_t = "Provenance";
77  static const std::string Info_t = "Info";
78  static const std::string Configuration_t = "Configuration";
79  static const std::string Arguments_t = "Arguments";
80  static const std::string Inputs_t = "Inputs";
81  static const std::string UUID_t = "UUID";
82  static const std::string APIVersion_t = "APIVersion";
83  static const std::string Result_t = "Result";
84  static const std::string OK_t = "OK";
85  static const std::string Fail_t = "FAIL";
86 
87  // Type specifiers
88  static const std::string Type_t = "Type";
89  static const std::string Test_t = "Test";
90  static const std::string Tests_t = "Tests";
91  static const std::string Data_t = "Data";
92  static const std::string URL_t = "URL";
93  static const std::string Name_t = "Name";
94  static const std::string Unit_t = "Unit";
95  static const std::string Values_t = "Values";
96  static const std::string Parameters_t = "Parameters";
97  static const std::string RunNumber_t = "RUN_NUMBER";
98 
99  // Calibration types
100  static const std::string DOMMap_t = "DOMMap";
101  static const std::string PMTT0s_t = "PMTT0s";
102  static const std::string PMTStatusInfo_t = "PMTStatusInfo";
103  static const std::string PMTSupplyVoltage_t = "PMT_Supply_Voltage";
104  static const std::string PMTThreshold_t = "PMT_Threshold";
105  static const std::string DOMPositions_t = "DOMPositions";
106  static const std::string DOMRotations_t = "DOMRotations";
107  static const std::string DOMAcousticT0_t = "DOMAcousticT0s";
108  static const std::string DOMCompassRotations_t = "DOMCompassRotations";
109  static const std::string DOMStatusInfo_t = "DOMStatusInfo";
110  static const std::string PMTGain_t = "PMT_Gain";
111  static const std::string BasePositions_t = "BasePositions";
112  static const std::string BaseRotations_t = "BaseRotations";
113  static const std::string BaseStatusInfo_t = "BaseStatusInfo";
114 
115  // Identifiers
116  static const std::string UPI_t = "UPI";
117  static const std::string PBS_t = "PBS";
118  static const std::string Variant_t = "Variant";
119  static const std::string DetOID_t = "DetOID";
120  static const std::string DetID_t = "DetID";
121  static const std::string PMTSerial_t = "Serial";
122  static const std::string DOMSerial_t = "DOMSerial";
123  static const std::string DOMId_t = "DOMId";
124  static const std::string Id_t = "Id";
125 
126  // Variable names
127  static const std::string T0_t = "T0";
128  static const std::string PX_t = "PX";
129  static const std::string PY_t = "PY";
130  static const std::string PZ_t = "PZ";
131  static const std::string Q0_t = "Q0";
132  static const std::string QX_t = "QX";
133  static const std::string QY_t = "QY";
134  static const std::string QZ_t = "QZ";
135  static const std::string STATUS_t = "Status";
136 
137  // Units
138  static const std::string Unitless_t = "-";
139  static const std::string Volt_t = "V";
140 
141 
142  /**
143  * Check validity of JSon data.
144  *
145  * \param js JSon data
146  * \return true if valid; else false
147  */
148  inline bool is_valid(const json& js)
149  {
150  return ((js.contains(Result_t) && js[Result_t] == OK_t) ||
151  (js.contains(Error_t) && js[Error_t][Code_t] == OK_t));
152  }
153 
154 
155  /**
156  * Cast single value to array of strings, conform the DB-format.
157  *
158  * \param value value
159  * \return std::vector containing value casted to string
160  */
161  template <class T>
163  {
164  using namespace std;
165 
166  return vector<string>{ to_string(value) };
167  }
168 
169 
170  /**
171  * Retrieve value from json array of strings.
172  *
173  * \param string_value_array array of string-casted values
174  * \return double-casted value
175  */
176  inline double retrieve_value(std::vector<std::string> string_value_array)
177  {
178  return std::stod(string_value_array[0]);
179  }
180 
181 
182  /**
183  * Auxiliary data structure for module address map.
184  */
185  struct JModuleMap_t :
186  public JObjectID,
187  public std::map<std::string, int>
188  {
190 
191  /**
192  * Default constructor.
193  */
195  {}
196 
197 
198  /**
199  * Constructor.
200  *
201  * \param id module identifier
202  */
203  JModuleMap_t(const JObjectID& id) :
204  JObjectID(id)
205  {}
206  };
207 
208 
209  /**
210  * Convert module address map to JSon.
211  *
212  * \param js json
213  * \param object module address map
214  */
215  inline void to_json(json& js, const JModuleMap_t& object)
216  {
217  js = json{ { Id_t, object.getID() },
218  { DOMMap_t, static_cast<const JModuleMap_t::map_type&>(object) } };
219  }
220 
221 
222  /**
223  * Convert JSon to module address map.
224  *
225  * \param js json
226  * \param object module address map
227  */
228  inline void from_json(const json& js, JModuleMap_t& object)
229  {
230  object.setID(js.at(Id_t).get<int>());
231 
232  static_cast<JModuleMap_t::map_type&>(object) = js.at(DOMMap_t).get<JModuleMap_t::map_type>();
233  }
234 
235 
236  /**
237  * Auxiliary data structure for PMT time calibration.
238  */
240  public JObjectID,
241  public JCalibration
242  {
243  /**
244  * Default constructor.
245  */
247  {}
248 
249 
250  /**
251  * Constructor.
252  *
253  * \param id PMT identifier
254  * \param calibration PMT time calibration
255  */
257  const JCalibration& calibration) :
258  JObjectID (id),
259  JCalibration(calibration)
260  {}
261  };
262 
263 
264  /**
265  * Convert PMT time calibration to JSon.
266  *
267  * \param js json
268  * \param object PMT time calibration
269  */
270  inline void to_json(json& js, const JPMTCalibration_t& object)
271  {
272  js = json{ { PMTSerial_t, object.getID() },
273  { T0_t, object.getT0() } };
274  }
275 
276 
277  /**
278  * Convert JSon to PMT time calibration.
279  *
280  * \param js json
281  * \param object PMT time calibration
282  */
283  inline void from_json(const json& js, JPMTCalibration_t& object)
284  {
285  object.setID(js.at(PMTSerial_t).get<int>());
286 
287  object.setT0(js.at(T0_t).get<double>());
288  }
289 
290 
291  /**
292  * Auxiliary data structure for PMT status.
293  */
294  struct JPMTStatus_t :
295  public JObjectID,
296  public JStatus
297  {
298  /**
299  * Default constructor.
300  */
302  {}
303 
304 
305  /**
306  * Constructor.
307  *
308  * \param id PMT identifier
309  * \param status PMT status
310  */
312  const JStatus& status) :
313  JObjectID(id),
314  JStatus (status)
315  {}
316  };
317 
318 
319  /**
320  * Convert PMT status to JSon.
321  *
322  * \param js json
323  * \param object PMT status
324  */
325  inline void to_json(json& js, const JPMTStatus_t& object)
326  {
327  js = json{ { PMTSerial_t, object.getID() },
328  { STATUS_t, object.getStatus() } };
329  }
330 
331 
332  /**
333  * Convert JSon to PMT status.
334  *
335  * \param js json
336  * \param object PMT status
337  */
338  inline void from_json(const json& js, JPMTStatus_t& object)
339  {
340  object.setID(js.at(PMTSerial_t).get<int>());
341 
342  object.setStatus(js.at(STATUS_t).get<int>());
343  }
344 
345 
346  /**
347  * Data structure for PMT high-voltage calibration.
348  */
350  public JUPI_t
351  {
352  /**
353  * Default constructor.
354  */
356  JUPI_t (),
357  result (Fail_t),
358  supplyVoltage(0.0),
359  runNumbers (std::vector<int>(0)),
360  PMTgain (0.0)
361  {}
362 
363 
364  /**
365  * Constructor.
366  *
367  * \param upi %UPI
368  * \param result result
369  * \param hv HV
370  * \param runNumberList run numbers
371  * \param gain gain
372  */
374  const std::string& result,
375  const double hv,
376  const std::vector<int> runNumberList = std::vector<int>(0),
377  const double gain = 1.0) :
378  JUPI_t (upi),
379  result (result),
380  supplyVoltage(hv),
381  runNumbers (runNumberList),
382  PMTgain (gain)
383  {}
384 
385 
386  /**
387  * Get HV-tuning database test type.
388  *
389  * \return HV-tuning database test type
390  */
391  static int getVersion()
392  {
393  return get_version();
394  }
395 
396 
397  /**
398  * Set HV-tuning database test type.
399  *
400  * \param version HV-tuning database test type
401  */
402  static void setVersion(const int version)
403  {
404  get_version() = version;
405  }
406 
407 
411  double PMTgain;
412 
413 
414  private:
415 
416  /**
417  * Get reference to HV-tuning database test type.
418  *
419  * \return HV-tuning database test type
420  */
421  static int& get_version()
422  {
423  static int version = 3;
424 
425  return version;
426  }
427  };
428 
429 
430  /**
431  * Convert PMT high-voltage calibration to JSon.
432  *
433  * \param js json2
434  * \param object PMT high-voltage calibration
435  */
436  inline void to_json(json& js, const JHVCalibration_t& object)
437  {
438  using namespace std;
439 
440  ostringstream os;
441 
442  os << object.getUPI();
443 
444  js[UPI_t] = os.str();
445  js[Test_t + Result_t] = object.result;
447  { Unit_t, Volt_t },
448  { Values_t, get_string_array(object.supplyVoltage) } };
449 
450  static const int version = JHVCalibration_t::getVersion();
451 
452  if (version < 2) {
453 
454  js[Test_t + Parameters_t][2] = json{ { Name_t, PMTGain_t },
455  { Unit_t, Unitless_t },
456  { Values_t, get_string_array(object.PMTgain) } };
457  }
458 
459 
460  if (version < 3) {
461 
462  vector<string> runNumberList;
463 
464  for (vector<int>::const_iterator i = object.runNumbers.cbegin(); i != object.runNumbers.cend(); ++i) {
465  runNumberList.push_back(to_string(*i));
466  }
467 
468  js[Test_t + Parameters_t][1] = json{ { Name_t, RunNumber_t },
469  { Unit_t, Unitless_t },
470  { Values_t, runNumberList } };
471  }
472  }
473 
474 
475  /**
476  * Convert JSon to PMT high-voltage calibration.
477  *
478  * \param js json
479  * \param object PMT high-voltage calibration
480  */
481  inline void from_json(const json& js, JHVCalibration_t& object)
482  {
483  using namespace std;
484 
485  stringstream is(js.at(UPI_t).get<string>());
486 
487  is >> static_cast<JUPI_t&>(object);
488 
489  json parameters = js.at(Test_t + Parameters_t);
490 
491  if (JHVCalibration_t::getVersion() > 0 && parameters.size() > 0) {
492 
493  object.result = js.at(Test_t + Result_t).get<string>();
494  object.supplyVoltage = retrieve_value(parameters[0].at(Values_t).get<vector<string>>());
495 
496  if (JHVCalibration_t::getVersion() < 3 && parameters.size() > 1) {
497 
498  vector<string> runNumberList = parameters[1].at(Values_t).get<vector<string>>();
499 
500  for (vector<string>::const_iterator i = runNumberList.begin(); i != runNumberList.end(); ++i) {
501  object.runNumbers.push_back(stoi(*i));
502  }
503  }
504 
505  if (JHVCalibration_t::getVersion() < 2 && parameters.size() > 2) {
506  object.PMTgain = retrieve_value(parameters[2].at(Values_t).get<vector<string>>());
507  }
508 
509  } else {
510 
511  THROW(JValueOutOfRange, "JHVCalibration_t::from_json(): No " << MAKE_STRING(Test_t + Parameters_t) << " found." << endl);
512  }
513  }
514 
515 
516  /**
517  * Data structure for PMT threshold calibration.
518  */
520  public JUPI_t
521  {
522  /**
523  * Default constructor.
524  */
526  {}
527 
528  /**
529  * Constructor.
530  *
531  * \param upi %UPI
532  * \param result result
533  * \param threshold threshold
534  * \param runNumbers run numbers
535  */
537  const std::string& result,
538  const double threshold,
539  const std::vector<int>& runNumbers = std::vector<int>(0)) :
540  JUPI_t (upi),
541  result (result),
542  threshold (threshold),
543  runNumberList(runNumbers)
544  {}
545 
547  double threshold;
549  };
550 
551 
552  /**
553  * Convert PMT threshold calibration to JSon.
554  *
555  * \param js json
556  * \param object PMT threshold calibration
557  */
558  inline void to_json(json& js, const JPMTThresholdCalibration_t& object)
559  {
560  std::ostringstream os;
561 
562  os << object.getUPI();
563 
564  js[UPI_t] = os.str();
565  js[Test_t + Result_t] = object.result;
566  js[Test_t + Parameters_t][0] = json{ { Name_t, PMTThreshold_t },
567  { Unit_t, Unitless_t },
568  { Values_t, get_string_array(object.threshold) } };
569  js[Test_t + Parameters_t][2] = json{ { Name_t, RunNumber_t },
570  { Unit_t, Unitless_t },
571  { Values_t, object.runNumberList } };
572  }
573 
574 
575  /**
576  * Convert JSon to PMT threshold calibration.
577  *
578  * \param js json
579  * \param object PMT threshold calibration
580  */
581  inline void from_json(const json& js, JPMTThresholdCalibration_t& object)
582  {
583  using namespace std;
584 
585  stringstream is(js.at(UPI_t).get<string>());
586 
587  is >> static_cast<JUPI_t&>(object);
588 
589  object.result = js.at(Test_t + Result_t).get<string>();
590  object.threshold = retrieve_value(js.at(Test_t + Parameters_t)[0].at(Values_t).get<vector<string>>());
591  object.runNumberList = js.at(Test_t + Parameters_t)[2].at(Values_t).get<vector<int>>();
592  }
593 
594 
595  /**
596  * Auxiliary data structure for module position.
597  */
599  public JObjectID,
600  public JPosition3D
601  {
602  /**
603  * Default constructor.
604  */
606  {}
607 
608 
609  /**
610  * Constructor.
611  *
612  * \param id module identifier
613  * \param position module position
614  */
616  const JPosition3D& position) :
617  JObjectID (id),
618  JPosition3D(position)
619  {}
620  };
621 
622 
623  /**
624  * Convert module position to JSon.
625  *
626  * \param js json
627  * \param object module position
628  */
629  inline void to_json(json& js, const JModulePosition_t& object)
630  {
631  js = json{ { Id_t, object.getID() },
632  { PX_t, object.getX() },
633  { PY_t, object.getY() },
634  { PZ_t, object.getZ() } };
635  }
636 
637 
638  /**
639  * Convert JSon to module position.
640  *
641  * \param js json
642  * \param object module position
643  */
644  inline void from_json(const json& js, JModulePosition_t& object)
645  {
646  if (js.contains(DOMId_t))
647  object.setID(js.at(DOMId_t).get<int>());
648  else if (js.contains(Id_t))
649  object.setID(js.at(Id_t) .get<int>());
650  else
651  THROW(JNoValue, "Missing module identifier.");
652 
653  object.setPosition(JPosition3D(js.at(PX_t).get<double>(),
654  js.at(PY_t).get<double>(),
655  js.at(PZ_t).get<double>()));
656  }
657 
658 
659  /**
660  * Auxiliary data structure for module rotation.
661  */
663  public JObjectID,
664  public JQuaternion3D
665  {
666  /**
667  * Default constructor.
668  */
670  {}
671 
672 
673  /**
674  * Constructor.
675  *
676  * \param id module identifier
677  * \param rotation module rotation
678  */
680  const JQuaternion3D& rotation) :
681  JObjectID (id),
682  JQuaternion3D(rotation)
683  {}
684  };
685 
686 
687  /**
688  * Convert module rotation to JSon.
689  *
690  * \param js json
691  * \param object module rotation
692  */
693  inline void to_json(json& js, const JModuleRotation_t& object)
694  {
695  js = json{ { Id_t, object.getID() },
696  { Q0_t, object.getA() },
697  { QX_t, object.getB() },
698  { QY_t, object.getC() },
699  { QZ_t, object.getD() } };
700  }
701 
702 
703  /**
704  * Convert JSon to module rotation.
705  *
706  * \param js json
707  * \param object module rotation
708  */
709  inline void from_json(const json& js, JModuleRotation_t& object)
710  {
711  if (js.contains(DOMId_t))
712  object.setID(js.at(DOMId_t).get<int>());
713  else if (js.contains(Id_t))
714  object.setID(js.at(Id_t) .get<int>());
715  else
716  THROW(JNoValue, "Missing module identifier.");
717 
718  object.setQuaternion(JQuaternion3D(js.at(Q0_t).get<double>(),
719  js.at(QX_t).get<double>(),
720  js.at(QY_t).get<double>(),
721  js.at(QZ_t).get<double>()));
722  }
723 
724 
725  /**
726  * Auxiliary data structure for module status.
727  */
729  public JObjectID,
730  public JStatus
731  {
732  /**
733  * Default constructor.
734  */
736  {}
737 
738 
739  /**
740  * Constructor.
741  *
742  * \param id module identifier
743  * \param status module status
744  */
746  const JStatus& status) :
747  JObjectID(id),
748  JStatus (status)
749  {}
750  };
751 
752 
753  /**
754  * Convert module status to JSon.
755  *
756  * \param js json
757  * \param object module status
758  */
759  inline void to_json(json& js, const JModuleStatus_t& object)
760  {
761  js = json{ { Id_t, object.getID() },
762  { STATUS_t, object.getStatus() } };
763  }
764 
765 
766  /**
767  * Convert JSon to module status.
768  *
769  * \param js json
770  * \param object module status
771  */
772  inline void from_json(const json& js, JModuleStatus_t& object)
773  {
774  if (js.contains(DOMId_t))
775  object.setID(js.at(DOMId_t).get<int>());
776  else if (js.contains(Id_t))
777  object.setID(js.at(Id_t) .get<int>());
778  else
779  THROW(JNoValue, "Missing module identifier.");
780 
781  object.setStatus(js.at(STATUS_t).get<int>());
782  }
783 
784 
785  /**
786  * Auxiliary data structure for module time calibration.
787  */
789  public JObjectID,
790  public JCalibration
791  {
792  /**
793  * Default constructor.
794  */
796  {}
797 
798 
799  /**
800  * Constructor.
801  *
802  * \param id module identifier
803  * \param calibration module time calibration
804  */
806  const JCalibration& calibration) :
807  JObjectID (id),
808  JCalibration(calibration)
809  {}
810  };
811 
812 
813  /**
814  * Convert module time calibration to JSon.
815  *
816  * \param js json
817  * \param object module time calibration
818  */
819  inline void to_json(json& js, const JModuleCalibration_t& object)
820  {
821  js = json{ { Id_t, object.getID() },
822  { T0_t, object.getT0() } };
823  }
824 
825 
826  /**
827  * Convert JSon to module time calibration.
828  *
829  * \param js json
830  * \param object module time calibration
831  */
832  inline void from_json(const json& js, JModuleCalibration_t& object)
833  {
834  if (js.contains(DOMId_t))
835  object.setID(js.at(DOMId_t).get<int>());
836  else if (js.contains(Id_t))
837  object.setID(js.at(Id_t) .get<int>());
838  else
839  THROW(JNoValue, "Missing module identifier.");
840 
841  object.setT0(js.at(T0_t).get<double>());
842  }
843 
844 
845  /**
846  * Auxiliary data structure for compass rotation.
847  */
849  public JObjectID,
850  public JQuaternion3D
851  {
852  /**
853  * Default constructor.
854  */
856  {}
857 
858 
859  /**
860  * Constructor.
861  *
862  * \param id module identifier
863  * \param rotation compass rotation
864  */
866  const JQuaternion3D& rotation) :
867  JObjectID (id),
868  JQuaternion3D(rotation)
869  {}
870  };
871 
872 
873  /**
874  * Convert compass rotation to JSon.
875  *
876  * \param js json
877  * \param object compass rotation
878  */
879  inline void to_json(json& js, const JCompassRotation_t& object)
880  {
881  js = json{ { Id_t, object.getID() },
882  { Q0_t, object.getA() },
883  { QX_t, object.getB() },
884  { QY_t, object.getC() },
885  { QZ_t, object.getD() } };
886  }
887 
888 
889  /**
890  * Convert JSon to compass rotation.
891  *
892  * \param js json
893  * \param object compass rotation
894  */
895  inline void from_json(const json& js, JCompassRotation_t& object)
896  {
897  if (js.contains(DOMId_t))
898  object.setID(js.at(DOMId_t).get<int>());
899  else if (js.contains(Id_t))
900  object.setID(js.at(Id_t) .get<int>());
901  else
902  THROW(JNoValue, "Missing module identifier.");
903 
904  object.setQuaternion(JQuaternion3D(js.at(Q0_t).get<double>(),
905  js.at(QX_t).get<double>(),
906  js.at(QY_t).get<double>(),
907  js.at(QZ_t).get<double>()));
908  }
909 
910 
911  typedef std::vector<JHVCalibration_t> JHVCalibration; //!< PMT high voltage calibration
913  typedef std::vector<JModuleMap_t> JModuleMap; //!< module map
914  typedef std::vector<JPMTCalibration_t> JPMTCalibration; //!< PMT time calibration
915  typedef std::vector<JPMTStatus_t> JPMTStatus; //!< PMT status
916  typedef std::vector<JModulePosition_t> JModulePosition; //!< Module position
917  typedef std::vector<JModuleRotation_t> JModuleRotation; //!< Module rotation
918  typedef std::vector<JModuleStatus_t> JModuleStatus; //!< Module status
919  typedef std::vector<JModuleCalibration_t> JModuleCalibration; //!< Module time calibration
920  typedef std::vector<JCompassRotation_t> JCompassRotation; //!< Compass rotation
921 }
922 
923 #endif
static const std::string PMTStatusInfo_t
static const std::string DOMSerial_t
static const std::string UUID_t
static const std::string DetID_t
Exceptions.
static const std::string PMTGain_t
static const std::string RCAL
(optical|base) module orientations
JModuleMap_t()
Default constructor.
static const std::string PZ_t
Data structure for PMT threshold calibration.
void to_json(json &js, const JModuleMap_t &object)
Convert module address map to JSon.
JPMTStatus_t(const JObjectID &id, const JStatus &status)
Constructor.
static const std::string Name_t
static void setVersion(const int version)
Set HV-tuning database test type.
static const std::string PMTSupplyVoltage_t
static const std::string Q0_t
JPMTCalibration_t()
Default constructor.
Time calibration (including definition of sign of time offset).
static const std::string Unit_t
version
Definition: JEditTuneHV.sh:5
static const std::string Time_t
static const std::string UPI_t
static const std::string Tests_t
static const std::string DOMPositions_t
static const std::string OK_t
JModuleRotation_t(const JObjectID &id, const JQuaternion3D &rotation)
Constructor.
static const std::string DOMId_t
JHVCalibration_t()
Default constructor.
JModuleMap_t(const JObjectID &id)
Constructor.
std::vector< JPMTThresholdCalibration_t > JPMTThresholdCalibration
PMT threshold calibration.
std::vector< JModuleMap_t > JModuleMap
module map
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:696
JCompassRotation_t()
Default constructor.
std::vector< JModuleRotation_t > JModuleRotation
Module rotation.
static const std::string TCAL
PMT time offsets.
static const std::string QZ_t
static const std::string Variant_t
*fatal Wrong number of arguments esac JCookie sh typeset Z DETECTOR typeset Z SOURCE_RUN typeset Z TARGET_RUN set_variable PARAMETERS_FILE $WORKDIR parameters
Definition: diff-Tuna.sh:38
static const std::string PX_t
static const std::string Location_t
Universal product identifier (UPI).
Definition: JUPI_t.hh:29
static const std::string CCAL
compass alignment (a.k.a. quaternion calibration)
Data structure for time calibration.
static int & get_version()
Get reference to HV-tuning database test type.
double retrieve_value(std::vector< std::string > string_value_array)
Retrieve value from json array of strings.
JPMTCalibration_t(const JObjectID &id, const JCalibration &calibration)
Constructor.
is
Definition: JDAQCHSM.chsm:167
static const std::string Encoding_t
JCompassRotation_t(const JObjectID &id, const JQuaternion3D &rotation)
Constructor.
JPMTStatus_t()
Default constructor.
std::vector< JCompassRotation_t > JCompassRotation
Compass rotation.
#define MAKE_STRING(A)
Make string.
Definition: JPrint.hh:127
static const std::string Inputs_t
static const std::string Provenance_t
static const std::string Result_t
Auxiliary data structure for module time calibration.
Exception for missing value.
Definition: JException.hh:198
static const std::string Arguments_t
static const std::string Volt_t
static const std::string Configuration_t
I/O formatting auxiliaries.
Auxiliary data structure for module address map.
Auxiliary data structure for compass rotation.
static const std::string T0_t
static const std::string Id_t
static const std::string SCAL
PMT status.
JModuleCalibration_t(const JObjectID &id, const JCalibration &calibration)
Constructor.
std::vector< JHVCalibration_t > JHVCalibration
PMT high voltage calibration.
do set_variable OUTPUT_DIRECTORY $WORKDIR T
static const std::string DOMRotations_t
Auxiliary class for handling status.
Definition: JStatus.hh:37
static const std::string PCAL
(optical|base) module positions
bool is_valid(const json &js)
Check validity of JSon data.
static const std::string ACAL
acoustic time offsets (piezo sensor or hydrophone)
JModuleStatus_t()
Default constructor.
static const std::string PMTThreshold_t
then awk string
JModuleStatus_t(const JObjectID &id, const JStatus &status)
Constructor.
static const std::string Code_t
static const std::string Test_t
static const std::string Info_t
static const std::string PMTSerial_t
static const std::string Message_t
JPMTThresholdCalibration_t(const JUPI_t &upi, const std::string &result, const double threshold, const std::vector< int > &runNumbers=std::vector< int >(0))
Constructor.
static const std::string DOMAcousticT0_t
JModuleCalibration_t()
Default constructor.
static const std::string RunNumber_t
static const std::string DetOID_t
JModulePosition_t(const JObjectID &id, const JPosition3D &position)
Constructor.
static const std::string BaseRotations_t
static const std::string Comment_t
Data structure for unit quaternion in three dimensions.
static const std::string Values_t
static const std::string PY_t
std::vector< JModuleStatus_t > JModuleStatus
Module status.
then $JPP_DIR examples JDetector JToT o $OUTPUT_FILE n N $NPE P gain
Definition: JToT.sh:47
static const std::string DOMMap_t
static const std::string DOMCompassRotations_t
JModulePosition_t()
Default constructor.
JHVCalibration_t(const JUPI_t &upi, const std::string &result, const double hv, const std::vector< int > runNumberList=std::vector< int >(0), const double gain=1.0)
Constructor.
static const std::string PBS_t
void from_json(const json &js, JModuleMap_t &object)
Convert JSon to module address map.
Auxiliary data structure for PMT status.
Auxiliary class for object identification.
Definition: JObjectID.hh:22
Data structure for PMT high-voltage calibration.
nlohmann::json json
std::vector< JPMTStatus_t > JPMTStatus
PMT status.
static const std::string Type_t
std::string to_string(const T &value)
Convert value to string.
static const std::string APIVersion_t
Auxiliary data structure for module rotation.
JModuleRotation_t()
Default constructor.
Product breakdown structure (PBS).
Definition: JPBS_t.hh:27
static const std::string Input_t
static const std::string User_t
Detector calibration key words for JSON I/O.
Auxiliary data structure for module position.
static const std::string DOMStatusInfo_t
Data structure for position in three dimensions.
Definition: JPosition3D.hh:36
Exception for accessing a value in a collection that is outside of its range.
Definition: JException.hh:162
static const std::string PMTT0s_t
std::vector< JModulePosition_t > JModulePosition
Module position.
static const std::string Error_t
static const std::string URL_t
static const std::string STATUS_t
static const std::string Parameters_t
static const std::string Data_t
static const std::string End_t
static const std::string Start_t
Auxiliary data structure for PMT time calibration.
static const std::string QY_t
static int getVersion()
Get HV-tuning database test type.
Auxiliary data structure for module status.
static const std::string Unitless_t
std::vector< JPMTCalibration_t > JPMTCalibration
PMT time calibration.
std::map< std::string, int > map_type
static const std::string BaseStatusInfo_t
static const std::string BasePositions_t
std::vector< JModuleCalibration_t > JModuleCalibration
Module time calibration.
std::vector< std::string > get_string_array(T value)
Cast single value to array of strings, conform the DB-format.
static const std::string MMAP
module address map
static const std::string QX_t
static const std::string Fail_t