Jpp  17.3.0-rc.2
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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...
 

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|base) 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|base) 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...
 
static const std::string User_t = "User"
 
static const std::string Location_t = "Location"
 
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 OK_t = "OK"
 
static const std::string Fail_t = "FAIL"
 
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 PMTSerial_t = "Serial"
 
static const std::string DOMSerial_t = "DOMSerial"
 
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

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  }
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:46
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  }
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 128 of file JSon/JSupport.hh.

129  {
130  return (js.contains(Error_t) && js[Error_t][Code_t] == OK_t);
131  }
static const std::string Code_t
static const std::string Error_t
static const std::string OK_t

Variable Documentation

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

PMT time offsets.

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

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

(optical|base) module positions

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

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

(optical|base) module orientations

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

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

acoustic time offsets (piezo sensor or hydrophone)

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

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

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

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

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

(module|PMT) status

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

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

PMT time offsets.

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

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

(optical|base) module positions

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

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

(optical|base) module orientations

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

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

acoustic time offsets (piezo sensor or hydrophone)

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

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

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

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

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

(module|PMT) status

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

const std::string JSON::DOMSerial_t = "DOMSerial"
static

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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