Auxiliary class to map module identifier to AHRS calibration.
More...
#include <JAHRSCalibration_t.hh>
Auxiliary class to map module identifier to AHRS calibration.
Definition at line 36 of file JAHRSCalibration_t.hh.
◆ JAHRSCalibration_t() [1/4]
JDATABASE::JAHRSCalibration_t::JAHRSCalibration_t |
( |
| ) |
|
|
inline |
◆ JAHRSCalibration_t() [2/4]
JDATABASE::JAHRSCalibration_t::JAHRSCalibration_t |
( |
const int | id, |
|
|
const int | option ) |
|
inline |
Constructor.
- Parameters
-
id | detector identifier |
option | option |
Definition at line 53 of file JAHRSCalibration_t.hh.
54 {
57
59
61
63
65
67 }
ResultSet & getResultSet(const std::string &query)
Get result set.
const char * getTable()
Get table name.
JDetectorsHelper & getDetector()
Auxiliary function for helper object initialisation.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
void configure(const JDetectorIntegration_t &detector, const int option)
Configure.
◆ JAHRSCalibration_t() [3/4]
JDATABASE::JAHRSCalibration_t::JAHRSCalibration_t |
( |
const JDetectorIntegration_t & | detector, |
|
|
const int | option ) |
|
inline |
Constructor.
- Parameters
-
detector | detector integration |
option | option |
Definition at line 76 of file JAHRSCalibration_t.hh.
◆ JAHRSCalibration_t() [4/4]
JDATABASE::JAHRSCalibration_t::JAHRSCalibration_t |
( |
const char * | file_name | ) |
|
|
inline |
Constructor.
- Parameters
-
Definition at line 87 of file JAHRSCalibration_t.hh.
88 {
90 }
void load(const char *file_name)
Load from input file.
◆ configure()
Configure.
The latest valid AHRS calibration data to the identifier of the parent module.
In this, the time order and validity of the AHRS calibration data are defined by AHRSComparator and JAHRSValidity, respectively.
The option corresponds to the maximal difference between latest version and latest valid version.
- Parameters
-
detector | detector integration |
option | option |
Definition at line 103 of file JAHRSCalibration_t.hh.
104 {
107
109
112
113 this->clear();
114
116
118
120
121 rs.Close();
122
123
125
126
128
129 vector<JAHRSCalibration>::const_iterator q = p;
130
131 for (++q; q !=
calibration.end() && q->SERIALNUMBER == p->SERIALNUMBER; ++q) {}
132
134
136
137 if (
distance(r1.first, r1.second) == 1) {
138
140
141 for (vector<JAHRSCalibration>::const_iterator i = p; i != q; ++i) {
142
144
145 this->insert(make_pair(id, *i));
146
147 break;
148 }
149 }
150 }
151
152 p = q;
153 }
154 }
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
static const JPBS_t AHRS(3, 4, 3, 4)
PBS of compass
JUPIHelper & getUPI()
Auxiliary function for helper object initialisation.
JCLBIDHelper & getCLBID()
Auxiliary function for helper object initialisation.
bool is_valid(const json &js)
Check validity of JSon data.
Auxiliary data structure for sorting of AHRS calibrations.
Auxiliary data structure to check validity of AHRS calibration data.
Universal product identifier (UPI).
◆ has()
bool JDATABASE::JAHRSCalibration_t::has |
( |
int | id | ) |
const |
|
inline |
Check availability of AHRS calibration for given module identifier.
- Parameters
-
- Returns
- true if AHRS calibration available; else false
Definition at line 163 of file JAHRSCalibration_t.hh.
164 {
165 return (this->find(id) != this->end());
166 }
◆ get()
Get AHRS calibration for given module identifier.
- Parameters
-
- Returns
- AHRS calibration
Definition at line 175 of file JAHRSCalibration_t.hh.
176 {
177 const_iterator i = this->find(id);
178
179 if (i != this->end())
180 return i->second;
181 else
182 THROW(JValueOutOfRange,
"Invalid module identifier " <<
id);
183 }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
◆ load()
Load from input file.
- Parameters
-
Definition at line 30 of file JObjectStreamIO.hh.
31 {
33 }
void load(const std::string &file_name, T &object)
Load object from input file.
◆ store()
Store to output file.
- Parameters
-
Definition at line 41 of file JObjectStreamIO.hh.
42 {
44 }
void store(const std::string &file_name, const T &object)
Store object to output file.
◆ operator>>
Read AHRS calibration from input stream.
- Parameters
-
in | input stream |
calibration | AHRS calibration |
- Returns
- input stream
Definition at line 193 of file JAHRSCalibration_t.hh.
194 {
195 int id;
196 JAHRSCalibration buffer;
197
198 while (in >> id >> buffer) {
199 calibration[id] = buffer;
200 }
201
202 return in;
203 }
◆ operator<<
Write AHRS calibration to output stream.
- Parameters
-
out | output stream |
calibration | AHRS calibration |
- Returns
- output stream
Definition at line 213 of file JAHRSCalibration_t.hh.
214 {
216
217 for (JAHRSCalibration_t::const_iterator i = calibration.begin(); i != calibration.end(); ++i) {
218 out << i->first << ' ' << i->second << endl;
219 }
220
221 return out;
222 }
The documentation for this struct was generated from the following file: