1 #ifndef __JDETECTOR__JDETECTORCALIBRATION__
2 #define __JDETECTOR__JDETECTORCALIBRATION__
78 return std::stod(string_value_array[0]);
116 js =
json{ {
Id_t,
object.getID() },
129 object.setID(js.at(
Id_t).get<
int>());
172 {
T0_t,
object.getT0() } };
184 object.setID(js.at(
Serial_t).get<
int>());
186 object.setT0(js.at(
T0_t).get<
double>());
239 object.setID(js.at(
Serial_t).get<
int>());
241 object.setStatus(js.at(
STATUS_t).get<
int>());
274 const std::string&
result,
277 const double gain = 1.0) :
281 runNumbers (runNumberList),
293 return get_version();
304 get_version() = version;
320 os <<
object.getUPI();
322 js[
UPI_t] = os.str();
361 stringstream is(js.at(
UPI_t).get<
string>());
363 is >>
static_cast<JUPI_t&
>(object);
377 object.runNumbers.push_back(stoi(*i));
406 static int version = 3;
435 const std::string&
result,
436 const double threshold,
440 threshold (threshold),
441 runNumberList(runNumbers)
453 std::ostringstream os;
455 os <<
object.getUPI();
457 js[
UPI_t] = os.str();
464 {
Values_t,
object.runNumberList } };
478 stringstream is(js.at(
UPI_t).get<
string>());
480 is >>
static_cast<JUPI_t&
>(object);
528 js =
json{ {
Id_t,
object.getID() },
529 {
PX_t,
object.getX() },
530 {
PY_t,
object.getY() },
531 {
PZ_t,
object.getZ() } };
544 object.setID(js.at(
DOMId_t).get<
int>());
545 else if (js.contains(
Id_t))
546 object.setID(js.at(
Id_t) .get<
int>());
551 js.at(
PY_t).get<
double>(),
552 js.at(
PZ_t).get<
double>()));
592 js =
json{ {
Id_t,
object.getID() },
593 {
Q0_t,
object.getA() },
594 {
QX_t,
object.getB() },
595 {
QY_t,
object.getC() },
596 {
QZ_t,
object.getD() } };
609 object.setID(js.at(
DOMId_t).get<
int>());
610 else if (js.contains(
Id_t))
611 object.setID(js.at(
Id_t) .get<
int>());
616 js.at(
QX_t).get<
double>(),
617 js.at(
QY_t).get<
double>(),
618 js.at(
QZ_t).get<
double>()));
658 js =
json{ {
Id_t,
object.getID() },
672 object.setID(js.at(
DOMId_t).get<
int>());
673 else if (js.contains(
Id_t))
674 object.setID(js.at(
Id_t) .get<
int>());
678 object.setStatus(js.at(
STATUS_t).get<
int>());
718 js =
json{ {
Id_t,
object.getID() },
719 {
T0_t,
object.getT0() } };
732 object.setID(js.at(
DOMId_t).get<
int>());
733 else if (js.contains(
Id_t))
734 object.setID(js.at(
Id_t) .get<
int>());
738 object.setT0(js.at(
T0_t).get<
double>());
778 js =
json{ {
Id_t,
object.getID() },
779 {
Q0_t,
object.getA() },
780 {
QX_t,
object.getB() },
781 {
QY_t,
object.getC() },
782 {
QZ_t,
object.getD() } };
795 object.setID(js.at(
DOMId_t).get<
int>());
796 else if (js.contains(
Id_t))
797 object.setID(js.at(
Id_t) .get<
int>());
802 js.at(
QX_t).get<
double>(),
803 js.at(
QY_t).get<
double>(),
804 js.at(
QZ_t).get<
double>()));
Time calibration (including definition of sign of time offset).
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
I/O formatting auxiliaries.
#define MAKE_STRING(A)
Make string.
JSon definitions and auxiliaries.
Data structure for time calibration.
Data structure for position in three dimensions.
Data structure for unit quaternion in three dimensions.
Exception for missing value.
Auxiliary class for object identification.
Exception for accessing a value in a collection that is outside of its range.
file Auxiliary data structures and methods for detector calibration.
std::vector< std::string > get_string_array(T value)
Cast single value to array of strings, conform the DB-format.
std::vector< JCompassRotation_t > JCompassRotation
Compass rotation.
std::vector< JModuleMap_t > JModuleMap
module map
std::vector< JModuleStatus_t > JModuleStatus
Module status.
double retrieve_value(std::vector< std::string > string_value_array)
Retrieve value from json array of strings.
std::vector< JHVCalibration_t > JHVCalibration
PMT high voltage calibration.
std::vector< JPMTThresholdCalibration_t > JPMTThresholdCalibration
PMT threshold calibration.
std::vector< JPMTCalibration_t > JPMTCalibration
PMT time calibration.
std::vector< JModuleRotation_t > JModuleRotation
Module rotation.
std::vector< JPMTStatus_t > JPMTStatus
PMT status.
std::vector< JModulePosition_t > JModulePosition
Module position.
std::vector< JModuleCalibration_t > JModuleCalibration
Module time calibration.
std::string to_string(const T &value)
Convert value to string.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary classes and methods for detector calibration.
static const std::string Name_t
static const std::string RunNumber_t
static const std::string T0_t
static const std::string Id_t
static const std::string Parameters_t
static const std::string QX_t
static const std::string STATUS_t
static const std::string Unit_t
static const std::string PX_t
static const std::string Unitless_t
static const std::string Result_t
static const std::string QZ_t
static const std::string PMTThreshold_t
static const std::string DOMId_t
static const std::string PMTSupplyVoltage_t
static const std::string Values_t
static const std::string Test_t
static const std::string PZ_t
static const std::string Fail_t
static const std::string PY_t
static const std::string Q0_t
static const std::string DOMMap_t
static const std::string UPI_t
static const std::string Volt_t
static const std::string PMTGain_t
static const std::string Serial_t
static const std::string QY_t
Product breakdown structure (PBS).
Universal product identifier (UPI).
Auxiliary data structure for compass rotation.
JCompassRotation_t()
Default constructor.
friend void from_json(const json &js, JCompassRotation_t &object)
Convert JSon to compass rotation.
JCompassRotation_t(const JObjectID &id, const JQuaternion3D &rotation)
Constructor.
friend void to_json(json &js, const JCompassRotation_t &object)
Convert compass rotation to JSon.
Data structure for PMT high-voltage calibration.
JHVCalibration_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 int & get_version()
Get reference to HV-tuning database test type.
friend void from_json(const json &js, JHVCalibration_t &object)
Convert JSon to PMT high-voltage calibration.
std::vector< int > runNumbers
friend void to_json(json &js, const JHVCalibration_t &object)
Convert PMT high-voltage calibration to JSon.
static void setVersion(const int version)
Set HV-tuning database test type.
static int getVersion()
Get HV-tuning database test type.
Auxiliary data structure for module time calibration.
friend void to_json(json &js, const JModuleCalibration_t &object)
Convert module time calibration to JSon.
friend void from_json(const json &js, JModuleCalibration_t &object)
Convert JSon to module time calibration.
JModuleCalibration_t(const JObjectID &id, const JCalibration &calibration)
Constructor.
JModuleCalibration_t()
Default constructor.
Auxiliary data structure for module address map.
friend void from_json(const json &js, JModuleMap_t &object)
Convert JSon to module address map.
friend void to_json(json &js, const JModuleMap_t &object)
Convert module address map to JSon.
JModuleMap_t()
Default constructor.
std::map< std::string, int > map_type
JModuleMap_t(const JObjectID &id)
Constructor.
Auxiliary data structure for module position.
JModulePosition_t()
Default constructor.
JModulePosition_t(const JObjectID &id, const JPosition3D &position)
Constructor.
friend void to_json(json &js, const JModulePosition_t &object)
Convert module position to JSon.
friend void from_json(const json &js, JModulePosition_t &object)
Convert JSon to module position.
Auxiliary data structure for module rotation.
JModuleRotation_t(const JObjectID &id, const JQuaternion3D &rotation)
Constructor.
friend void to_json(json &js, const JModuleRotation_t &object)
Convert module rotation to JSon.
JModuleRotation_t()
Default constructor.
friend void from_json(const json &js, JModuleRotation_t &object)
Convert JSon to module rotation.
Auxiliary data structure for module status.
friend void from_json(const json &js, JModuleStatus_t &object)
Convert JSon to module status.
JModuleStatus_t()
Default constructor.
friend void to_json(json &js, const JModuleStatus_t &object)
Convert module status to JSon.
JModuleStatus_t(const JObjectID &id, const JStatus &status)
Constructor.
Auxiliary data structure for PMT time calibration.
JPMTCalibration_t()
Default constructor.
friend void from_json(const json &js, JPMTCalibration_t &object)
Convert JSon to PMT time calibration.
friend void to_json(json &js, const JPMTCalibration_t &object)
Convert PMT time calibration to JSon.
JPMTCalibration_t(const JObjectID &id, const JCalibration &calibration)
Constructor.
Auxiliary data structure for PMT status.
friend void from_json(const json &js, JPMTStatus_t &object)
Convert JSon to PMT status.
friend void to_json(json &js, const JPMTStatus_t &object)
Convert PMT status to JSon.
JPMTStatus_t()
Default constructor.
JPMTStatus_t(const JObjectID &id, const JStatus &status)
Constructor.
Data structure for PMT threshold calibration.
friend void from_json(const json &js, JPMTThresholdCalibration_t &object)
Convert JSon to PMT threshold calibration.
JPMTThresholdCalibration_t()
Default constructor.
JPMTThresholdCalibration_t(const JUPI_t &upi, const std::string &result, const double threshold, const std::vector< int > &runNumbers=std::vector< int >(0))
Constructor.
std::vector< int > runNumberList
friend void to_json(json &js, const JPMTThresholdCalibration_t &object)
Convert PMT threshold calibration to JSon.
Auxiliary class for handling status.