Jpp test-rotations-new
the software that should make you happy
Loading...
Searching...
No Matches
JDATABASE::JAHRSCalibrationComparator Struct Reference

Auxiliary data structure for sorting of AHRS calibrations. More...

#include <JAHRSCalibrationToolkit.hh>

Public Member Functions

bool operator() (const std::string &first, const std::string &second) const
 Comparison of operation identifiers.
 
bool operator() (const JAHRSCalibration &first, const JAHRSCalibration &second) const
 Comparison of AHRS calibrations.
 

Detailed Description

Auxiliary data structure for sorting of AHRS calibrations.

Definition at line 186 of file JAHRSCalibrationToolkit.hh.

Member Function Documentation

◆ operator()() [1/2]

bool JDATABASE::JAHRSCalibrationComparator::operator() ( const std::string & first,
const std::string & second ) const
inline

Comparison of operation identifiers.

Parameters
firstfirst operation identifiers
secondsecond operation identifiers
Returns
true if first calibration better than second; else false

Definition at line 194 of file JAHRSCalibrationToolkit.hh.

196 {
197 using namespace std;
198 using namespace JPP;
199
200 if (!first.empty() && !second.empty()) {
201
202 if (first[0] == second[0])
203 return to_value<int>(first.substr(1)) > to_value<int>(second.substr(1));
204 else
205 return first[0] > second[0];
206
207 } else {
208
209 return first > second;
210 }
211 }
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).

◆ operator()() [2/2]

bool JDATABASE::JAHRSCalibrationComparator::operator() ( const JAHRSCalibration & first,
const JAHRSCalibration & second ) const
inline

Comparison of AHRS calibrations.

Parameters
firstfirst AHRS calibration
secondsecond AHRS calibration
Returns
true if first AHRS calibration better than second; else false

Definition at line 221 of file JAHRSCalibrationToolkit.hh.

223 {
224 if (first.SERIALNUMBER == second.SERIALNUMBER) {
225
226 if (first.TESTEND == second.TESTEND) {
227
228 if (getVersion(first.TESTNAME) == getVersion(second.TESTNAME))
229 return (*this)(first.TESTOPID, second.TESTOPID);
230 else
231 return getVersion(first.TESTNAME) > getVersion(second.TESTNAME);
232
233 } else {
234
235 return first.TESTEND > second.TESTEND;
236 }
237
238 } else {
239
240 return first.SERIALNUMBER > second.SERIALNUMBER;
241 }
242 }
int getVersion(const std::string &version)
Get numerical value of AHRS calibration version.

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