27 int main(
int argc,
char **argv)
41 JParser<> zap(
"Example program for compass calibration.");
47 zap[
'D'] =
make_field(detid,
"Detector identifier") =
"";
52 catch(
const exception &error) {
53 FATAL(error.what() << endl);
63 ResultSet& rs =
getResultSet(getTable<JAHRSCalibration>());
69 catch(
const exception& error) {
70 FATAL(error.what() << endl);
82 DEBUG(
"Reading database table " << getTable<JDetectorIntegration_t>() << endl);
88 detid = getDetector<string>(detid);
90 ResultSet& rs =
getResultSet(getTable<JDetectorIntegration_t>());
96 catch(
const exception& error) {
97 FATAL(error.what() << endl);
115 for (++q; q !=
calibration.end() && q->SERIALNUMBER == p->SERIALNUMBER; ++q) {}
127 WARNING(
"AHRS " << location <<
' ' << upi <<
' '
128 <<
"invalid calibration" <<
' '
129 << p->TESTEND <<
" v" <<
getVersion(p->TESTNAME) <<
" -> "
130 << i->TESTEND <<
" v" <<
getVersion(i->TESTNAME) << endl);
143 const bool valid =
is_valid(*i) || (i != p);
147 cout << setw(8) << i->SERIALNUMBER <<
' '
148 << setw(22) << left << upi << right <<
' '
149 << setw(8) << i->TESTEND <<
' '
150 << setw(8) << i->FIRMWARE_VERSION <<
' '
152 << setw(10) << i->TESTOPID <<
' '
153 << (valid ?
"" :
"*") << endl;
170 cout << location <<
" ";
176 if (
distance(r1.first, r1.second) == 1) {
180 if (
distance(r2.first, r2.second) == 1) {
181 cout << setw(22) << left <<
detector[r2.first->second].container.getUPI() << right <<
' ';
182 cout << setw(22) << left <<
detector[r1.first->second].container.getUPI() << right <<
' ';
183 cout << setw(22) << left << upi << right <<
' ';
187 cout << setw(3) << (
calibration.FIRMWARE_VERSION !=
"" ?
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
General purpose messaging.
#define DEBUG(A)
Message macros.
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
int main(int argc, char **argv)
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
Utility class to parse command line options.
static const JPBS_t AHRS(3, 4, 3, 4)
PBS of compass
int getVersion(const std::string &version)
Get numerical value of AHRS calibration version.
ResultSet & getResultSet(const std::string &query)
Get result set.
static JGetPBSSequences getPBSSequences
Function object to get PBS sequences as a function of PBS.
JUPIHelper & getUPI()
Auxiliary function for helper object initialisation.
std::vector< JServer > getServernames()
Get list of names of available database servers.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
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.
Auxiliary data structure for location of product in detector.
bool is_valid() const
Check validity of location.
Auxiliary class to map UPI to location in detector.
JLocation_t getLocation(const JUPI_t &upi) const
Get location of product with given UPI.
Wrapper class for server name.
Universal product identifier (UPI).