Jpp  debug
the software that should make you happy
Classes | Functions | Variables
JSON Namespace Reference

Auxiliary classes and methods for detector calibration. More...

Classes

struct  JComparator
 Auxiliary data structure to compare (part of) JSon data. More...
 
struct  JPrinter
 Auxiliary data structure to print (part of) JSon data. More...
 
struct  JSon
 Auxiliary class to load json data from file. More...
 
struct  JCalibrationType
 Auxiliary data structure for pairwise nick and full name of calibration type. More...
 
struct  getCalibrationType
 Auxiliary data structure for correspondence between nick and full name of calibration types. More...
 

Functions

void load (const std::string &file_name, json &object)
 Load json data from input file. More...
 
void store (const std::string &file_name, const json &object)
 Store json data to output file. More...
 
bool is_valid (const json &js)
 Check validity of JSon data. More...
 

Variables

static const std::string TCAL = "tcal"
 PMT time offsets. More...
 
static const std::string PCAL = "pcal"
 (optical|base) module positions More...
 
static const std::string RCAL = "rcal"
 optical module orientations More...
 
static const std::string ACAL = "acal"
 acoustic time offsets (piezo sensor or hydrophone) More...
 
static const std::string CCAL = "ccal"
 compass alignment (a.k.a. quaternion calibration) More...
 
static const std::string SCAL = "scal"
 (module|PMT) status More...
 
static const std::string PMT_T0_CALIBRATION_t = "PMT_T0_CALIBRATION"
 PMT time offsets. More...
 
static const std::string DOM_POSITION_CALIBRATION_t = "DOM_POSITION_CALIBRATION"
 (optical|base) module positions More...
 
static const std::string DOM_ROTATION_CALIBRATION_t = "DOM_ROTATION_CALIBRATION"
 optical module orientations More...
 
static const std::string ACOUSTIC_T0_CALIBRATION_t = "ACOUSTIC_T0_CALIBRATION"
 acoustic time offsets (piezo sensor or hydrophone) More...
 
static const std::string COMPASS_CALIBRATION_t = "COMPASS_CALIBRATION"
 compass alignment (a.k.a. quaternion calibration) More...
 
static const std::string STATUS_CALIBRATION_t = "STATUS_CALIBRATION"
 (module|PMT) status More...
 
JSON::getCalibrationType getCalibrationType
 
static const std::string User_t = "User"
 
static const std::string UserId_t = "UserId"
 
static const std::string TypeId_t = "TypeId"
 
static const std::string Location_t = "Location"
 
static const std::string LocationId_t = "LocId"
 
static const std::string Time_t = "Time"
 
static const std::string Start_t = "Start"
 
static const std::string End_t = "End"
 
static const std::string Comment_t = "Comment"
 
static const std::string Encoding_t = "Encoding"
 
static const std::string Input_t = "Inputs"
 
static const std::string Error_t = "Error"
 
static const std::string Message_t = "Message"
 
static const std::string Code_t = "Code"
 
static const std::string Provenance_t = "Provenance"
 
static const std::string Info_t = "Info"
 
static const std::string Configuration_t = "Configuration"
 
static const std::string Arguments_t = "Arguments"
 
static const std::string Inputs_t = "Inputs"
 
static const std::string UUID_t = "UUID"
 
static const std::string APIVersion_t = "APIVersion"
 
static const std::string Result_t = "Result"
 
static const std::string Status_t = "StatusId"
 
static const std::string Decision_t = "DecisionId"
 
static const std::string OK_t = "OK"
 
static const std::string Fail_t = "FAIL"
 
static const std::string ValidFrom_t = "ValidFrom"
 
static const std::string ValidThrough_t = "ValidThrough"
 
static const std::string StartTime_t = "StartTime"
 
static const std::string EndTime_t = "EndTime"
 
static const std::string Tags_t = "Tags"
 
static const std::string Type_t = "Type"
 
static const std::string Test_t = "Test"
 
static const std::string Tests_t = "Tests"
 
static const std::string Data_t = "Data"
 
static const std::string URL_t = "URL"
 
static const std::string Name_t = "Name"
 
static const std::string Unit_t = "Unit"
 
static const std::string Values_t = "Values"
 
static const std::string Parameters_t = "Parameters"
 
static const std::string RunNumber_t = "RUN_NUMBER"
 
static const std::string PMTT0s_t = "PMTT0s"
 
static const std::string DOMPositions_t = "DOMPositions"
 
static const std::string DOMRotations_t = "DOMRotations"
 
static const std::string DOMAcousticT0_t = "DOMAcousticT0s"
 
static const std::string DOMCompassRotations_t = "DOMCompassRotations"
 
static const std::string DOMStatusInfo_t = "DOMStatusInfo"
 
static const std::string BasePositions_t = "BasePositions"
 
static const std::string BaseAcousticT0_t = "BaseAcousticT0s"
 
static const std::string BaseCompassRotations_t = "BaseCompassRotations"
 
static const std::string BaseStatusInfo_t = "BaseStatusInfo"
 
static const std::string DOMMap_t = "DOMMap"
 
static const std::string PMTThreshold_t = "PMT_Threshold"
 
static const std::string PMTStatusInfo_t = "PMTStatusInfo"
 
static const std::string PMTSupplyVoltage_t = "PMT_Supply_Voltage"
 
static const std::string PMTGain_t = "PMT_Gain"
 
static const std::string UPI_t = "UPI"
 
static const std::string PBS_t = "PBS"
 
static const std::string Variant_t = "Variant"
 
static const std::string DetOID_t = "DetOID"
 
static const std::string DetID_t = "DetID"
 
static const std::string Serial_t = "Serial"
 
static const std::string DOMId_t = "DOMId"
 
static const std::string Id_t = "Id"
 
static const std::string T0_t = "T0"
 
static const std::string PX_t = "PX"
 
static const std::string PY_t = "PY"
 
static const std::string PZ_t = "PZ"
 
static const std::string Q0_t = "Q0"
 
static const std::string QX_t = "QX"
 
static const std::string QY_t = "QY"
 
static const std::string QZ_t = "QZ"
 
static const std::string STATUS_t = "Status"
 
static const std::string Unitless_t = "-"
 
static const std::string Volt_t = "V"
 

Detailed Description

Auxiliary classes and methods for detector calibration.

Author
mdejong

Function Documentation

◆ load()

void JSON::load ( const std::string &  file_name,
json object 
)
inline

Load json data from input file.

Parameters
file_namefile name
objectjson data

Definition at line 28 of file JSon.hh.

29  {
30  using namespace std;
31 
32  ifstream in(file_name.c_str());
33 
34  in >> object;
35 
36  in.close();
37  }
Definition: JSTDTypes.hh:14

◆ store()

void JSON::store ( const std::string &  file_name,
const json object 
)
inline

Store json data to output file.

Parameters
file_namefile name
objectjson data

Definition at line 46 of file JSon.hh.

47  {
48  using namespace std;
49 
50  ofstream out(file_name.c_str());
51 
52  out << setw(2) << setprecision(8) << object;
53 
54  out.close();
55  }

◆ is_valid()

bool JSON::is_valid ( const json js)
inline

Check validity of JSon data.

Parameters
jsJSon data
Returns
true if valid; else false

Definition at line 246 of file JSon/JSupport.hh.

247  {
248  return (js.contains(Error_t) && js[Error_t][Code_t] == OK_t);
249  }
static const std::string Code_t
static const std::string OK_t
static const std::string Error_t

Variable Documentation

◆ TCAL

const std::string JSON::TCAL = "tcal"
static

PMT time offsets.

Definition at line 32 of file JSon/JSupport.hh.

◆ PCAL

const std::string JSON::PCAL = "pcal"
static

(optical|base) module positions

Definition at line 33 of file JSon/JSupport.hh.

◆ RCAL

const std::string JSON::RCAL = "rcal"
static

optical module orientations

Definition at line 34 of file JSon/JSupport.hh.

◆ ACAL

const std::string JSON::ACAL = "acal"
static

acoustic time offsets (piezo sensor or hydrophone)

Definition at line 35 of file JSon/JSupport.hh.

◆ CCAL

const std::string JSON::CCAL = "ccal"
static

compass alignment (a.k.a. quaternion calibration)

Definition at line 36 of file JSon/JSupport.hh.

◆ SCAL

const std::string JSON::SCAL = "scal"
static

(module|PMT) status

Definition at line 37 of file JSon/JSupport.hh.

◆ PMT_T0_CALIBRATION_t

const std::string JSON::PMT_T0_CALIBRATION_t = "PMT_T0_CALIBRATION"
static

PMT time offsets.

Definition at line 39 of file JSon/JSupport.hh.

◆ DOM_POSITION_CALIBRATION_t

const std::string JSON::DOM_POSITION_CALIBRATION_t = "DOM_POSITION_CALIBRATION"
static

(optical|base) module positions

Definition at line 40 of file JSon/JSupport.hh.

◆ DOM_ROTATION_CALIBRATION_t

const std::string JSON::DOM_ROTATION_CALIBRATION_t = "DOM_ROTATION_CALIBRATION"
static

optical module orientations

Definition at line 41 of file JSon/JSupport.hh.

◆ ACOUSTIC_T0_CALIBRATION_t

const std::string JSON::ACOUSTIC_T0_CALIBRATION_t = "ACOUSTIC_T0_CALIBRATION"
static

acoustic time offsets (piezo sensor or hydrophone)

Definition at line 42 of file JSon/JSupport.hh.

◆ COMPASS_CALIBRATION_t

const std::string JSON::COMPASS_CALIBRATION_t = "COMPASS_CALIBRATION"
static

compass alignment (a.k.a. quaternion calibration)

Definition at line 43 of file JSon/JSupport.hh.

◆ STATUS_CALIBRATION_t

const std::string JSON::STATUS_CALIBRATION_t = "STATUS_CALIBRATION"
static

(module|PMT) status

Definition at line 44 of file JSon/JSupport.hh.

◆ getCalibrationType

◆ User_t

const std::string JSON::User_t = "User"
static

Definition at line 149 of file JSon/JSupport.hh.

◆ UserId_t

const std::string JSON::UserId_t = "UserId"
static

Definition at line 150 of file JSon/JSupport.hh.

◆ TypeId_t

const std::string JSON::TypeId_t = "TypeId"
static

Definition at line 151 of file JSon/JSupport.hh.

◆ Location_t

const std::string JSON::Location_t = "Location"
static

Definition at line 152 of file JSon/JSupport.hh.

◆ LocationId_t

const std::string JSON::LocationId_t = "LocId"
static

Definition at line 153 of file JSon/JSupport.hh.

◆ Time_t

const std::string JSON::Time_t = "Time"
static

Definition at line 154 of file JSon/JSupport.hh.

◆ Start_t

const std::string JSON::Start_t = "Start"
static

Definition at line 155 of file JSon/JSupport.hh.

◆ End_t

const std::string JSON::End_t = "End"
static

Definition at line 156 of file JSon/JSupport.hh.

◆ Comment_t

const std::string JSON::Comment_t = "Comment"
static

Definition at line 157 of file JSon/JSupport.hh.

◆ Encoding_t

const std::string JSON::Encoding_t = "Encoding"
static

Definition at line 158 of file JSon/JSupport.hh.

◆ Input_t

const std::string JSON::Input_t = "Inputs"
static

Definition at line 159 of file JSon/JSupport.hh.

◆ Error_t

const std::string JSON::Error_t = "Error"
static

Definition at line 160 of file JSon/JSupport.hh.

◆ Message_t

const std::string JSON::Message_t = "Message"
static

Definition at line 161 of file JSon/JSupport.hh.

◆ Code_t

const std::string JSON::Code_t = "Code"
static

Definition at line 162 of file JSon/JSupport.hh.

◆ Provenance_t

const std::string JSON::Provenance_t = "Provenance"
static

Definition at line 163 of file JSon/JSupport.hh.

◆ Info_t

const std::string JSON::Info_t = "Info"
static

Definition at line 164 of file JSon/JSupport.hh.

◆ Configuration_t

const std::string JSON::Configuration_t = "Configuration"
static

Definition at line 165 of file JSon/JSupport.hh.

◆ Arguments_t

const std::string JSON::Arguments_t = "Arguments"
static

Definition at line 166 of file JSon/JSupport.hh.

◆ Inputs_t

const std::string JSON::Inputs_t = "Inputs"
static

Definition at line 167 of file JSon/JSupport.hh.

◆ UUID_t

const std::string JSON::UUID_t = "UUID"
static

Definition at line 168 of file JSon/JSupport.hh.

◆ APIVersion_t

const std::string JSON::APIVersion_t = "APIVersion"
static

Definition at line 169 of file JSon/JSupport.hh.

◆ Result_t

const std::string JSON::Result_t = "Result"
static

Definition at line 170 of file JSon/JSupport.hh.

◆ Status_t

const std::string JSON::Status_t = "StatusId"
static

Definition at line 171 of file JSon/JSupport.hh.

◆ Decision_t

const std::string JSON::Decision_t = "DecisionId"
static

Definition at line 172 of file JSon/JSupport.hh.

◆ OK_t

const std::string JSON::OK_t = "OK"
static

Definition at line 173 of file JSon/JSupport.hh.

◆ Fail_t

const std::string JSON::Fail_t = "FAIL"
static

Definition at line 174 of file JSon/JSupport.hh.

◆ ValidFrom_t

const std::string JSON::ValidFrom_t = "ValidFrom"
static

Definition at line 175 of file JSon/JSupport.hh.

◆ ValidThrough_t

const std::string JSON::ValidThrough_t = "ValidThrough"
static

Definition at line 176 of file JSon/JSupport.hh.

◆ StartTime_t

const std::string JSON::StartTime_t = "StartTime"
static

Definition at line 177 of file JSon/JSupport.hh.

◆ EndTime_t

const std::string JSON::EndTime_t = "EndTime"
static

Definition at line 178 of file JSon/JSupport.hh.

◆ Tags_t

const std::string JSON::Tags_t = "Tags"
static

Definition at line 179 of file JSon/JSupport.hh.

◆ Type_t

const std::string JSON::Type_t = "Type"
static

Definition at line 182 of file JSon/JSupport.hh.

◆ Test_t

const std::string JSON::Test_t = "Test"
static

Definition at line 183 of file JSon/JSupport.hh.

◆ Tests_t

const std::string JSON::Tests_t = "Tests"
static

Definition at line 184 of file JSon/JSupport.hh.

◆ Data_t

const std::string JSON::Data_t = "Data"
static

Definition at line 185 of file JSon/JSupport.hh.

◆ URL_t

const std::string JSON::URL_t = "URL"
static

Definition at line 186 of file JSon/JSupport.hh.

◆ Name_t

const std::string JSON::Name_t = "Name"
static

Definition at line 187 of file JSon/JSupport.hh.

◆ Unit_t

const std::string JSON::Unit_t = "Unit"
static

Definition at line 188 of file JSon/JSupport.hh.

◆ Values_t

const std::string JSON::Values_t = "Values"
static

Definition at line 189 of file JSon/JSupport.hh.

◆ Parameters_t

const std::string JSON::Parameters_t = "Parameters"
static

Definition at line 190 of file JSon/JSupport.hh.

◆ RunNumber_t

const std::string JSON::RunNumber_t = "RUN_NUMBER"
static

Definition at line 191 of file JSon/JSupport.hh.

◆ PMTT0s_t

const std::string JSON::PMTT0s_t = "PMTT0s"
static

Definition at line 194 of file JSon/JSupport.hh.

◆ DOMPositions_t

const std::string JSON::DOMPositions_t = "DOMPositions"
static

Definition at line 195 of file JSon/JSupport.hh.

◆ DOMRotations_t

const std::string JSON::DOMRotations_t = "DOMRotations"
static

Definition at line 196 of file JSon/JSupport.hh.

◆ DOMAcousticT0_t

const std::string JSON::DOMAcousticT0_t = "DOMAcousticT0s"
static

Definition at line 197 of file JSon/JSupport.hh.

◆ DOMCompassRotations_t

const std::string JSON::DOMCompassRotations_t = "DOMCompassRotations"
static

Definition at line 198 of file JSon/JSupport.hh.

◆ DOMStatusInfo_t

const std::string JSON::DOMStatusInfo_t = "DOMStatusInfo"
static

Definition at line 199 of file JSon/JSupport.hh.

◆ BasePositions_t

const std::string JSON::BasePositions_t = "BasePositions"
static

Definition at line 200 of file JSon/JSupport.hh.

◆ BaseAcousticT0_t

const std::string JSON::BaseAcousticT0_t = "BaseAcousticT0s"
static

Definition at line 201 of file JSon/JSupport.hh.

◆ BaseCompassRotations_t

const std::string JSON::BaseCompassRotations_t = "BaseCompassRotations"
static

Definition at line 202 of file JSon/JSupport.hh.

◆ BaseStatusInfo_t

const std::string JSON::BaseStatusInfo_t = "BaseStatusInfo"
static

Definition at line 203 of file JSon/JSupport.hh.

◆ DOMMap_t

const std::string JSON::DOMMap_t = "DOMMap"
static

Definition at line 206 of file JSon/JSupport.hh.

◆ PMTThreshold_t

const std::string JSON::PMTThreshold_t = "PMT_Threshold"
static

Definition at line 209 of file JSon/JSupport.hh.

◆ PMTStatusInfo_t

const std::string JSON::PMTStatusInfo_t = "PMTStatusInfo"
static

Definition at line 210 of file JSon/JSupport.hh.

◆ PMTSupplyVoltage_t

const std::string JSON::PMTSupplyVoltage_t = "PMT_Supply_Voltage"
static

Definition at line 211 of file JSon/JSupport.hh.

◆ PMTGain_t

const std::string JSON::PMTGain_t = "PMT_Gain"
static

Definition at line 212 of file JSon/JSupport.hh.

◆ UPI_t

const std::string JSON::UPI_t = "UPI"
static

Definition at line 215 of file JSon/JSupport.hh.

◆ PBS_t

const std::string JSON::PBS_t = "PBS"
static

Definition at line 216 of file JSon/JSupport.hh.

◆ Variant_t

const std::string JSON::Variant_t = "Variant"
static

Definition at line 217 of file JSon/JSupport.hh.

◆ DetOID_t

const std::string JSON::DetOID_t = "DetOID"
static

Definition at line 218 of file JSon/JSupport.hh.

◆ DetID_t

const std::string JSON::DetID_t = "DetID"
static

Definition at line 219 of file JSon/JSupport.hh.

◆ Serial_t

const std::string JSON::Serial_t = "Serial"
static

Definition at line 220 of file JSon/JSupport.hh.

◆ DOMId_t

const std::string JSON::DOMId_t = "DOMId"
static

Definition at line 221 of file JSon/JSupport.hh.

◆ Id_t

const std::string JSON::Id_t = "Id"
static

Definition at line 222 of file JSon/JSupport.hh.

◆ T0_t

const std::string JSON::T0_t = "T0"
static

Definition at line 225 of file JSon/JSupport.hh.

◆ PX_t

const std::string JSON::PX_t = "PX"
static

Definition at line 226 of file JSon/JSupport.hh.

◆ PY_t

const std::string JSON::PY_t = "PY"
static

Definition at line 227 of file JSon/JSupport.hh.

◆ PZ_t

const std::string JSON::PZ_t = "PZ"
static

Definition at line 228 of file JSon/JSupport.hh.

◆ Q0_t

const std::string JSON::Q0_t = "Q0"
static

Definition at line 229 of file JSon/JSupport.hh.

◆ QX_t

const std::string JSON::QX_t = "QX"
static

Definition at line 230 of file JSon/JSupport.hh.

◆ QY_t

const std::string JSON::QY_t = "QY"
static

Definition at line 231 of file JSon/JSupport.hh.

◆ QZ_t

const std::string JSON::QZ_t = "QZ"
static

Definition at line 232 of file JSon/JSupport.hh.

◆ STATUS_t

const std::string JSON::STATUS_t = "Status"
static

Definition at line 233 of file JSon/JSupport.hh.

◆ Unitless_t

const std::string JSON::Unitless_t = "-"
static

Definition at line 236 of file JSon/JSupport.hh.

◆ Volt_t

const std::string JSON::Volt_t = "V"
static

Definition at line 237 of file JSon/JSupport.hh.