Jpp  17.2.0
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 
58 
59  /**
60  * Detector calibration key words for JSON I/O.
61  */
62 
63  // Meta data
64  static const std::string User_t = "User";
65  static const std::string Location_t = "Location";
66  static const std::string Time_t = "Time";
67  static const std::string Start_t = "Start";
68  static const std::string End_t = "End";
69  static const std::string Comment_t = "Comment";
70  static const std::string Encoding_t = "Encoding";
71  static const std::string Input_t = "Inputs";
72  static const std::string Error_t = "Error";
73  static const std::string Message_t = "Message";
74  static const std::string Code_t = "Code";
75  static const std::string Provenance_t = "Provenance";
76  static const std::string Info_t = "Info";
77  static const std::string Configuration_t = "Configuration";
78  static const std::string Arguments_t = "Arguments";
79  static const std::string Inputs_t = "Inputs";
80  static const std::string UUID_t = "UUID";
81  static const std::string APIVersion_t = "APIVersion";
82  static const std::string Result_t = "Result";
83  static const std::string OK_t = "OK";
84  static const std::string Fail_t = "FAIL";
85 
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 PMTT0s_t = "PMTT0s";
101  static const std::string PMTStatusInfo_t = "PMTStatusInfo";
102  static const std::string PMTSupplyVoltage_t = "PMT_Supply_Voltage";
103  static const std::string PMTThreshold_t = "PMT_Threshold";
104  static const std::string DOMPositions_t = "DOMPositions";
105  static const std::string DOMRotations_t = "DOMRotations";
106  static const std::string DOMAcousticT0_t = "DOMAcousticT0s";
107  static const std::string DOMCompassRotations_t = "DOMCompassRotations";
108  static const std::string DOMStatusInfo_t = "DOMStatusInfo";
109  static const std::string PMTGain_t = "PMT_Gain";
110  static const std::string BasePositions_t = "BasePositions";
111  static const std::string BaseRotations_t = "BaseRotations";
112  static const std::string BaseStatusInfo_t = "BaseStatusInfo";
113 
114  // Identifiers
115  static const std::string UPI_t = "UPI";
116  static const std::string PBS_t = "PBS";
117  static const std::string Variant_t = "Variant";
118  static const std::string DetOID_t = "DetOID";
119  static const std::string DetID_t = "DetID";
120  static const std::string PMTSerial_t = "Serial";
121  static const std::string DOMSerial_t = "DOMSerial";
122  static const std::string DOMId_t = "DOMId";
123  static const std::string Id_t = "Id";
124 
125  // Variable names
126  static const std::string T0_t = "T0";
127  static const std::string PX_t = "PX";
128  static const std::string PY_t = "PY";
129  static const std::string PZ_t = "PZ";
130  static const std::string Q0_t = "Q0";
131  static const std::string QX_t = "QX";
132  static const std::string QY_t = "QY";
133  static const std::string QZ_t = "QZ";
134  static const std::string STATUS_t = "Status";
135 
136  // Units
137  static const std::string Unitless_t = "-";
138  static const std::string Volt_t = "V";
139 
140 
141  /**
142  * Check validity of JSon data.
143  *
144  * \param js JSon data
145  * \return true if valid; else false
146  */
147  inline bool is_valid(const json& js)
148  {
149  return ((js.contains(Result_t) && js[Result_t] == OK_t) ||
150  (js.contains(Error_t) && js[Error_t][Code_t] == OK_t));
151  }
152 
153 
154  /**
155  * Cast single value to array of strings, conform the DB-format.
156  *
157  * \param value value
158  * \return std::vector containing value casted to string
159  */
160  template <class T>
162  {
163  using namespace std;
164 
165  return vector<string>{ to_string(value) };
166  }
167 
168 
169  /**
170  * Retrieve value from json array of strings.
171  *
172  * \param string_value_array array of string-casted values
173  * \return double-casted value
174  */
175  inline double retrieve_value(std::vector<std::string> string_value_array)
176  {
177  return std::stod(string_value_array[0]);
178  }
179 
180 
181  /**
182  * Auxiliary data structure for PMT time calibration.
183  */
185  public JObjectID,
186  public JCalibration
187  {
188  /**
189  * Default constructor.
190  */
192  {}
193 
194 
195  /**
196  * Constructor.
197  *
198  * \param id PMT identifier
199  * \param calibration PMT time calibration
200  */
202  const JCalibration& calibration) :
203  JObjectID (id),
204  JCalibration(calibration)
205  {}
206  };
207 
208 
209  /**
210  * Convert PMT time calibration to JSon.
211  *
212  * \param js json
213  * \param object PMT time calibration
214  */
215  inline void to_json(json& js, const JPMTCalibration_t& object)
216  {
217  js = json{ { PMTSerial_t, object.getID() },
218  { T0_t, object.getT0() } };
219  }
220 
221 
222  /**
223  * Convert JSon to PMT time calibration.
224  *
225  * \param js json
226  * \param object PMT time calibration
227  */
228  inline void from_json(const json& js, JPMTCalibration_t& object)
229  {
230  object.setID(js.at(PMTSerial_t).get<int>());
231 
232  object.setT0(js.at(T0_t).get<double>());
233  }
234 
235 
236  /**
237  * Auxiliary data structure for PMT status.
238  */
239  struct JPMTStatus_t :
240  public JObjectID,
241  public JStatus
242  {
243  /**
244  * Default constructor.
245  */
247  {}
248 
249 
250  /**
251  * Constructor.
252  *
253  * \param id PMT identifier
254  * \param status PMT status
255  */
257  const JStatus& status) :
258  JObjectID(id),
259  JStatus (status)
260  {}
261  };
262 
263 
264  /**
265  * Convert PMT status to JSon.
266  *
267  * \param js json
268  * \param object PMT status
269  */
270  inline void to_json(json& js, const JPMTStatus_t& object)
271  {
272  js = json{ { PMTSerial_t, object.getID() },
273  { STATUS_t, object.getStatus() } };
274  }
275 
276 
277  /**
278  * Convert JSon to PMT status.
279  *
280  * \param js json
281  * \param object PMT status
282  */
283  inline void from_json(const json& js, JPMTStatus_t& object)
284  {
285  object.setID(js.at(PMTSerial_t).get<int>());
286 
287  object.setStatus(js.at(STATUS_t).get<int>());
288  }
289 
290 
291  /**
292  * Data structure for PMT high-voltage calibration.
293  */
295  public JUPI_t
296  {
297  /**
298  * Default constructor.
299  */
301  JUPI_t (),
302  result (Fail_t),
303  supplyVoltage(0.0),
304  runNumbers (std::vector<int>(0)),
305  PMTgain (0.0)
306  {}
307 
308 
309  /**
310  * Constructor.
311  *
312  * \param upi %UPI
313  * \param result result
314  * \param hv HV
315  * \param runNumberList run numbers
316  * \param gain gain
317  */
319  const std::string& result,
320  const double hv,
321  const std::vector<int> runNumberList = std::vector<int>(0),
322  const double gain = 1.0) :
323  JUPI_t (upi),
324  result (result),
325  supplyVoltage(hv),
326  runNumbers (runNumberList),
327  PMTgain (gain)
328  {}
329 
330 
331  /**
332  * Get HV-tuning database test type.
333  *
334  * \return HV-tuning database test type
335  */
336  static int getVersion()
337  {
338  return get_version();
339  }
340 
341 
342  /**
343  * Set HV-tuning database test type.
344  *
345  * \param version HV-tuning database test type
346  */
347  static void setVersion(const int version)
348  {
349  get_version() = version;
350  }
351 
352 
353  std::string result;
356  double PMTgain;
357 
358 
359  private:
360 
361  /**
362  * Get reference to HV-tuning database test type.
363  *
364  * \return HV-tuning database test type
365  */
366  static int& get_version()
367  {
368  static int version = 3;
369 
370  return version;
371  }
372  };
373 
374 
375  /**
376  * Convert PMT high-voltage calibration to JSon.
377  *
378  * \param js json2
379  * \param object PMT high-voltage calibration
380  */
381  inline void to_json(json& js, const JHVCalibration_t& object)
382  {
383  using namespace std;
384 
385  ostringstream os;
386 
387  os << object.getUPI();
388 
389  js[UPI_t] = os.str();
390  js[Test_t + Result_t] = object.result;
392  { Unit_t, Volt_t },
393  { Values_t, get_string_array(object.supplyVoltage) } };
394 
395  static const int version = JHVCalibration_t::getVersion();
396 
397  if (version < 2) {
398 
399  js[Test_t + Parameters_t][2] = json{ { Name_t, PMTGain_t },
400  { Unit_t, Unitless_t },
401  { Values_t, get_string_array(object.PMTgain) } };
402  }
403 
404 
405  if (version < 3) {
406 
407  vector<string> runNumberList;
408 
409  for (vector<int>::const_iterator i = object.runNumbers.cbegin(); i != object.runNumbers.cend(); ++i) {
410  runNumberList.push_back(to_string(*i));
411  }
412 
413  js[Test_t + Parameters_t][1] = json{ { Name_t, RunNumber_t },
414  { Unit_t, Unitless_t },
415  { Values_t, runNumberList } };
416  }
417  }
418 
419 
420  /**
421  * Convert JSon to PMT high-voltage calibration.
422  *
423  * \param js json
424  * \param object PMT high-voltage calibration
425  */
426  inline void from_json(const json& js, JHVCalibration_t& object)
427  {
428  using namespace std;
429 
430  stringstream is(js.at(UPI_t).get<string>());
431 
432  is >> static_cast<JUPI_t&>(object);
433 
434  json parameters = js.at(Test_t + Parameters_t);
435 
436  if (JHVCalibration_t::getVersion() > 0 && parameters.size() > 0) {
437 
438  object.result = js.at(Test_t + Result_t).get<string>();
439  object.supplyVoltage = retrieve_value(parameters[0].at(Values_t).get<vector<string>>());
440 
441  if (JHVCalibration_t::getVersion() < 3 && parameters.size() > 1) {
442 
443  vector<string> runNumberList = parameters[1].at(Values_t).get<vector<string>>();
444 
445  for (vector<string>::const_iterator i = runNumberList.begin(); i != runNumberList.end(); ++i) {
446  object.runNumbers.push_back(stoi(*i));
447  }
448  }
449 
450  if (JHVCalibration_t::getVersion() < 2 && parameters.size() > 2) {
451  object.PMTgain = retrieve_value(parameters[2].at(Values_t).get<vector<string>>());
452  }
453 
454  } else {
455 
456  THROW(JValueOutOfRange, "JHVCalibration_t::from_json(): No " << MAKE_STRING(Test_t + Parameters_t) << " found." << endl);
457  }
458  }
459 
460 
461  /**
462  * Data structure for PMT threshold calibration.
463  */
465  public JUPI_t
466  {
467  /**
468  * Default constructor.
469  */
471  {}
472 
473  /**
474  * Constructor.
475  *
476  * \param upi %UPI
477  * \param result result
478  * \param threshold threshold
479  * \param runNumbers run numbers
480  */
482  const std::string& result,
483  const double threshold,
484  const std::vector<int>& runNumbers = std::vector<int>(0)) :
485  JUPI_t (upi),
486  result (result),
487  threshold (threshold),
488  runNumberList(runNumbers)
489  {}
490 
491  std::string result;
492  double threshold;
494  };
495 
496 
497  /**
498  * Convert PMT threshold calibration to JSon.
499  *
500  * \param js json
501  * \param object PMT threshold calibration
502  */
503  inline void to_json(json& js, const JPMTThresholdCalibration_t& object)
504  {
505  std::ostringstream os;
506 
507  os << object.getUPI();
508 
509  js[UPI_t] = os.str();
510  js[Test_t + Result_t] = object.result;
511  js[Test_t + Parameters_t][0] = json{ { Name_t, PMTThreshold_t },
512  { Unit_t, Unitless_t },
513  { Values_t, get_string_array(object.threshold) } };
514  js[Test_t + Parameters_t][2] = json{ { Name_t, RunNumber_t },
515  { Unit_t, Unitless_t },
516  { Values_t, object.runNumberList } };
517  }
518 
519 
520  /**
521  * Convert JSon to PMT threshold calibration.
522  *
523  * \param js json
524  * \param object PMT threshold calibration
525  */
526  inline void from_json(const json& js, JPMTThresholdCalibration_t& object)
527  {
528  using namespace std;
529 
530  stringstream is(js.at(UPI_t).get<string>());
531 
532  is >> static_cast<JUPI_t&>(object);
533 
534  object.result = js.at(Test_t + Result_t).get<string>();
535  object.threshold = retrieve_value(js.at(Test_t + Parameters_t)[0].at(Values_t).get<vector<string>>());
536  object.runNumberList = js.at(Test_t + Parameters_t)[2].at(Values_t).get<vector<int>>();
537  }
538 
539 
540  /**
541  * Auxiliary data structure for module position.
542  */
544  public JObjectID,
545  public JPosition3D
546  {
547  /**
548  * Default constructor.
549  */
551  {}
552 
553 
554  /**
555  * Constructor.
556  *
557  * \param id module identifier
558  * \param position module position
559  */
561  const JPosition3D& position) :
562  JObjectID (id),
563  JPosition3D(position)
564  {}
565  };
566 
567 
568  /**
569  * Convert module position to JSon.
570  *
571  * \param js json
572  * \param object module position
573  */
574  inline void to_json(json& js, const JModulePosition_t& object)
575  {
576  js = json{ { Id_t, object.getID() },
577  { PX_t, object.getX() },
578  { PY_t, object.getY() },
579  { PZ_t, object.getZ() } };
580  }
581 
582 
583  /**
584  * Convert JSon to module position.
585  *
586  * \param js json
587  * \param object module position
588  */
589  inline void from_json(const json& js, JModulePosition_t& object)
590  {
591  if (js.contains(DOMId_t))
592  object.setID(js.at(DOMId_t).get<int>());
593  else if (js.contains(Id_t))
594  object.setID(js.at(Id_t) .get<int>());
595  else
596  THROW(JNoValue, "Missing module identifier.");
597 
598  object.setPosition(JPosition3D(js.at(PX_t).get<double>(),
599  js.at(PY_t).get<double>(),
600  js.at(PZ_t).get<double>()));
601  }
602 
603 
604  /**
605  * Auxiliary data structure for module rotation.
606  */
608  public JObjectID,
609  public JQuaternion3D
610  {
611  /**
612  * Default constructor.
613  */
615  {}
616 
617 
618  /**
619  * Constructor.
620  *
621  * \param id module identifier
622  * \param rotation module rotation
623  */
625  const JQuaternion3D& rotation) :
626  JObjectID (id),
627  JQuaternion3D(rotation)
628  {}
629  };
630 
631 
632  /**
633  * Convert module rotation to JSon.
634  *
635  * \param js json
636  * \param object module rotation
637  */
638  inline void to_json(json& js, const JModuleRotation_t& object)
639  {
640  js = json{ { Id_t, object.getID() },
641  { Q0_t, object.getA() },
642  { QX_t, object.getB() },
643  { QY_t, object.getC() },
644  { QZ_t, object.getD() } };
645  }
646 
647 
648  /**
649  * Convert JSon to module rotation.
650  *
651  * \param js json
652  * \param object module rotation
653  */
654  inline void from_json(const json& js, JModuleRotation_t& object)
655  {
656  if (js.contains(DOMId_t))
657  object.setID(js.at(DOMId_t).get<int>());
658  else if (js.contains(Id_t))
659  object.setID(js.at(Id_t) .get<int>());
660  else
661  THROW(JNoValue, "Missing module identifier.");
662 
663  object.setQuaternion(JQuaternion3D(js.at(Q0_t).get<double>(),
664  js.at(QX_t).get<double>(),
665  js.at(QY_t).get<double>(),
666  js.at(QZ_t).get<double>()));
667  }
668 
669 
670  /**
671  * Auxiliary data structure for module status.
672  */
674  public JObjectID,
675  public JStatus
676  {
677  /**
678  * Default constructor.
679  */
681  {}
682 
683 
684  /**
685  * Constructor.
686  *
687  * \param id module identifier
688  * \param status module status
689  */
691  const JStatus& status) :
692  JObjectID(id),
693  JStatus (status)
694  {}
695  };
696 
697 
698  /**
699  * Convert module status to JSon.
700  *
701  * \param js json
702  * \param object module status
703  */
704  inline void to_json(json& js, const JModuleStatus_t& object)
705  {
706  js = json{ { Id_t, object.getID() },
707  { STATUS_t, object.getStatus() } };
708  }
709 
710 
711  /**
712  * Convert JSon to module status.
713  *
714  * \param js json
715  * \param object module status
716  */
717  inline void from_json(const json& js, JModuleStatus_t& object)
718  {
719  if (js.contains(DOMId_t))
720  object.setID(js.at(DOMId_t).get<int>());
721  else if (js.contains(Id_t))
722  object.setID(js.at(Id_t) .get<int>());
723  else
724  THROW(JNoValue, "Missing module identifier.");
725 
726  object.setStatus(js.at(STATUS_t).get<int>());
727  }
728 
729 
730  /**
731  * Auxiliary data structure for module time calibration.
732  */
734  public JObjectID,
735  public JCalibration
736  {
737  /**
738  * Default constructor.
739  */
741  {}
742 
743 
744  /**
745  * Constructor.
746  *
747  * \param id module identifier
748  * \param calibration module time calibration
749  */
751  const JCalibration& calibration) :
752  JObjectID (id),
753  JCalibration(calibration)
754  {}
755  };
756 
757 
758  /**
759  * Convert module time calibration to JSon.
760  *
761  * \param js json
762  * \param object module time calibration
763  */
764  inline void to_json(json& js, const JModuleCalibration_t& object)
765  {
766  js = json{ { Id_t, object.getID() },
767  { T0_t, object.getT0() } };
768  }
769 
770 
771  /**
772  * Convert JSon to module time calibration.
773  *
774  * \param js json
775  * \param object module time calibration
776  */
777  inline void from_json(const json& js, JModuleCalibration_t& object)
778  {
779  if (js.contains(DOMId_t))
780  object.setID(js.at(DOMId_t).get<int>());
781  else if (js.contains(Id_t))
782  object.setID(js.at(Id_t) .get<int>());
783  else
784  THROW(JNoValue, "Missing module identifier.");
785 
786  object.setT0(js.at(T0_t).get<double>());
787  }
788 
789 
790  /**
791  * Auxiliary data structure for compass rotation.
792  */
794  public JObjectID,
795  public JQuaternion3D
796  {
797  /**
798  * Default constructor.
799  */
801  {}
802 
803 
804  /**
805  * Constructor.
806  *
807  * \param id module identifier
808  * \param rotation compass rotation
809  */
811  const JQuaternion3D& rotation) :
812  JObjectID (id),
813  JQuaternion3D(rotation)
814  {}
815  };
816 
817 
818  /**
819  * Convert compass rotation to JSon.
820  *
821  * \param js json
822  * \param object compass rotation
823  */
824  inline void to_json(json& js, const JCompassRotation_t& object)
825  {
826  js = json{ { Id_t, object.getID() },
827  { Q0_t, object.getA() },
828  { QX_t, object.getB() },
829  { QY_t, object.getC() },
830  { QZ_t, object.getD() } };
831  }
832 
833 
834  /**
835  * Convert JSon to compass rotation.
836  *
837  * \param js json
838  * \param object compass rotation
839  */
840  inline void from_json(const json& js, JCompassRotation_t& object)
841  {
842  if (js.contains(DOMId_t))
843  object.setID(js.at(DOMId_t).get<int>());
844  else if (js.contains(Id_t))
845  object.setID(js.at(Id_t) .get<int>());
846  else
847  THROW(JNoValue, "Missing module identifier.");
848 
849  object.setQuaternion(JQuaternion3D(js.at(Q0_t).get<double>(),
850  js.at(QX_t).get<double>(),
851  js.at(QY_t).get<double>(),
852  js.at(QZ_t).get<double>()));
853  }
854 
855 
856  typedef std::vector<JHVCalibration_t> JHVCalibration; //!< PMT high voltage calibration
858  typedef std::vector<JPMTCalibration_t> JPMTCalibration; //!< PMT time calibration
859  typedef std::vector<JPMTStatus_t> JPMTStatus; //!< PMT status
860  typedef std::vector<JModulePosition_t> JModulePosition; //!< Module position
861  typedef std::vector<JModuleRotation_t> JModuleRotation; //!< Module rotation
862  typedef std::vector<JModuleStatus_t> JModuleStatus; //!< Module status
863  typedef std::vector<JModuleCalibration_t> JModuleCalibration; //!< Module time calibration
864  typedef std::vector<JCompassRotation_t> JCompassRotation; //!< Compass rotation
865 }
866 
867 #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
void to_json(json &js, const JPMTCalibration_t &object)
Convert PMT time calibration to JSon.
static const std::string PZ_t
Data structure for PMT threshold calibration.
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.
std::vector< JPMTThresholdCalibration_t > JPMTThresholdCalibration
PMT threshold calibration.
#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 compass rotation.
void from_json(const json &js, JPMTCalibration_t &object)
Convert JSon to PMT time calibration.
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
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 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
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.
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 QX_t
static const std::string Fail_t