Jpp 19.3.0-rc.1
the software that should make you happy
Loading...
Searching...
No Matches
JSON::getCalibrationType Struct Reference

Auxiliary data structure for correspondence between nick and full name of calibration types. More...

#include <JSupport.hh>

Inheritance diagram for JSON::getCalibrationType:
std::vector< JCalibrationType >

Public Member Functions

 getCalibrationType ()
 Default constructor.
 
bool hasNickname (const std::string &type) const
 Has calibration type.
 
bool hasFullname (const std::string &type) const
 Has calibration type.
 
const std::string & getNickname (const std::string &type) const
 Get calibration type.
 
const std::string & getFullname (const std::string &type) const
 Get calibration type.
 

Detailed Description

Auxiliary data structure for correspondence between nick and full name of calibration types.

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

Constructor & Destructor Documentation

◆ getCalibrationType()

JSON::getCalibrationType::getCalibrationType ( )
inline

Default constructor.

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

66 {
67 this->push_back( { TCAL, PMT_T0_CALIBRATION_t } );
68 this->push_back( { PCAL, DOM_POSITION_CALIBRATION_t } );
69 this->push_back( { RCAL, DOM_ROTATION_CALIBRATION_t } );
70 this->push_back( { ACAL, ACOUSTIC_T0_CALIBRATION_t } );
71 this->push_back( { CCAL, COMPASS_CALIBRATION_t } );
72 this->push_back( { SCAL, STATUS_CALIBRATION_t } );
73 }
static const std::string PMT_T0_CALIBRATION_t
PMT time offsets.
static const std::string COMPASS_CALIBRATION_t
compass alignment (a.k.a. quaternion calibration)
static const std::string TCAL
PMT time offsets.
static const std::string DOM_POSITION_CALIBRATION_t
(optical|base) module positions
static const std::string STATUS_CALIBRATION_t
(module|PMT) status
static const std::string PCAL
(optical|base) module positions
static const std::string SCAL
(module|PMT) status
static const std::string RCAL
optical module orientations
static const std::string ACAL
acoustic time offsets (piezo sensor or hydrophone)
static const std::string CCAL
compass alignment (a.k.a. quaternion calibration)
static const std::string DOM_ROTATION_CALIBRATION_t
optical module orientations
static const std::string ACOUSTIC_T0_CALIBRATION_t
acoustic time offsets (piezo sensor or hydrophone)

Member Function Documentation

◆ hasNickname()

bool JSON::getCalibrationType::hasNickname ( const std::string & type) const
inline

Has calibration type.

Parameters
typefull name
Returns
true if available; else false

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

83 {
84 using namespace std;
85 using namespace JPP;
86
87 return (find_if(this->begin(), this->end(), make_predicate(&JCalibrationType::full_name, type)) != this->end());
88 }
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
std::string full_name
full name (e.g. "XXX_YYY_CALIBRATION")

◆ hasFullname()

bool JSON::getCalibrationType::hasFullname ( const std::string & type) const
inline

Has calibration type.

Parameters
typenick name
Returns
full name

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

98 {
99 using namespace std;
100 using namespace JPP;
101
102 return (find_if(this->begin(), this->end(), make_predicate(&JCalibrationType::nick_name, type)) != this->end());
103 }
std::string nick_name
nick name (e.g. "xcal")

◆ getNickname()

const std::string & JSON::getCalibrationType::getNickname ( const std::string & type) const
inline

Get calibration type.

Parameters
typefull name
Returns
nick name

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

113 {
114 using namespace std;
115 using namespace JPP;
116
117 const_iterator p = find_if(this->begin(), this->end(), make_predicate(&JCalibrationType::full_name, type));
118
119 if (p != this->end())
120 return p->nick_name;
121 else
122 THROW(JValueOutOfRange, "Invalid calibration type <" << type << ">");
123 }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Exception for accessing a value in a collection that is outside of its range.

◆ getFullname()

const std::string & JSON::getCalibrationType::getFullname ( const std::string & type) const
inline

Get calibration type.

Parameters
typenick name
Returns
full name

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

133 {
134 using namespace std;
135 using namespace JPP;
136
137 const_iterator p = find_if(this->begin(), this->end(), make_predicate(&JCalibrationType::nick_name, type));
138
139 if (p != this->end())
140 return p->full_name;
141 else
142 THROW(JValueOutOfRange, "Invalid calibration type <" << type << ">");
143 }

The documentation for this struct was generated from the following file: