23 #include "JDB/JDBincludes.hh" 
   39 int main(
int argc, 
char **argv)
 
   43   using namespace KM3NETDAQ;
 
   57     JParser<> zap(
"Auxiliary program to print high-voltage tuning results.");
 
   62     zap[
'f'] = 
make_field(inputFile,    
"input file (ROOT or JSON output of JTuneHV)");
 
   64     zap[
'D'] = 
make_field(detid,        
"detector identifier");
 
   69   } 
catch(
const exception &error) {
 
   71     FATAL(error.what() << endl);
 
   83       JSelector  selector = getSelector<JPersons>(
JDB::get()->User());
 
   84       ResultSet& rs       = 
getResultSet(getTable<JPersons>(), selector);
 
   90       ResultSet& rs = 
getResultSet(getTable<JDetectorIntegration_t>());
 
   93         THROW(JDatabaseException, 
"Error reading " << getTable<JDetectorIntegration_t>());
 
   97   } 
catch (
const exception& error) {
 
   99     FATAL(error.what() << endl);
 
  115     ifstream ifs(inputFile.c_str());
 
  122     json::const_iterator data = js.find(
Tests_t);
 
  124     if (data != js.end()) {
 
  130       ERROR(
"HV calibration data could not be found!");
 
  135     if (DBtype != js.end()) {
 
  137       testType = DBtype->get<
string>();
 
  141       WARNING(
"No database test type specified.");
 
  145            RIGHT(20) << 
"HV"   << 
RIGHT (10)  << 
"gain" << 
RIGHT(10) << 
"status" << endl);
 
  147     for (JHVCalibration::const_iterator it = HVcals.cbegin(); it != HVcals.cend(); ++it) {
 
  149       const JUPI_t&      pmtUPI   = it->getUPI();
 
  151       const JLocation_t& location = router.getLocation(pmtUPI);
 
  155       const JDetectorIntegration_t::range_type 
range = 
detector.get(domUPI);
 
  157       for (JDetectorIntegration_t::range_const_iterator i = range.first; i != range.second; ++i) {
 
  159         const JUPI_t& upi = 
detector[i->second].content.getUPI();
 
  165           if (it->result != 
OK_t) {
 
  166             failureMap[domID].push_back(*it);
 
  173       NOTICE(
LEFT(30) << pmtUPI << 
"(a.k.a. " << domID << 
'.' << 
FILL(2,
'0') << location.position << 
" / " << location << 
"):" <<
 
  174              right << 
FIXED(20,1) << it->supplyVoltage << 
FIXED(10,1) << it->PMTgain << 
RIGHT(10) << it->result << endl);
 
  181     ERROR(inputFile << 
" is not a JSON file." << endl);
 
  190   NOTICE(endl << 
FILL(105, 
'-') << 
" List of failures" << setfill(
' ') << endl);
 
  194     Nfailed += i->second.size();
 
  199       WARNING(
"No successful calibrations found for module " << i->first << 
" (dead module?)" << endl);
 
  203       for (JHVCalibration::const_iterator 
j = i->second.cbegin(); 
j != i->second.cend(); ++
j) {
 
  205         const JUPI_t&      pmtUPI   = 
j->getUPI();
 
  206         const JLocation_t& location = router.getLocation(pmtUPI);
 
  208         NOTICE(
LEFT(30) << pmtUPI << 
"(a.k.a. " << i->first << 
'.' << 
FILL(2,
'0') << location.position << 
" / " << location << 
"):" <<
 
  209                right << 
FIXED(20,1) << 
j->supplyVoltage << 
FIXED(10,1) << 
j->PMTgain << 
RIGHT(10) << 
j->result << endl);
 
  211         failures.push_back(*
j);
 
  216   NOTICE(endl << 
FILL(105, 
'-') << 
" SUMMARY" << setfill(
' ') << endl);
 
  217   NOTICE(
LEFT(40)  << 
"Number of evaluated PMTs:" << 
RIGHT(20) << Ntotal << endl);
 
  218   NOTICE(
LEFT(40)  << 
"Number of successful evaluations:" << 
RIGHT(20) << Ntotal - Nfailed << endl);
 
  219   NOTICE(
LEFT(40)  << 
"Number of failed evaluations:" << 
RIGHT(20) << Nfailed << endl);
 
  220   NOTICE(
RIGHT(20) << 
'-' << 
LEFT(20) << 
" in missing modules:" << 
RIGHT(20) << Nmissing << endl);
 
  221   NOTICE(
RIGHT(20) << 
'-' << 
LEFT(20) << 
" other:" << 
RIGHT(20) << Nfailed - Nmissing << endl << endl);
 
  227     js[
User_t]          = person.LOGIN;
 
  236     ofs << setw(2) << setprecision(8);
 
Utility class to parse command line options. 
 
static const std::string Tests_t
 
static const JPBS_t DOM(3, 4)
PBS of optical module 
 
static const std::string OK_t
 
static const JPBSSequences PMT_SEQUENCES
PBS sequences for PMT. 
 
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message. 
 
T get(const JHead &header)
Get object from header. 
 
static const std::string Location_t
 
Auxiliary data structure for floating point format specification. 
 
static const JPBS_t CLB(3, 4, 3, 2)
PBS of central-logic board 
 
Auxiliary data structure for alignment of data. 
 
JDetectorsHelper getDetector
Function object for mapping serial number to object identifier of detector and vice versa...
 
I/O formatting auxiliaries. 
 
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object 
 
std::vector< JHVCalibration_t > JHVCalibration
PMT high voltage calibration. 
 
static const std::string Test_t
 
General purpose messaging. 
 
Auxiliary data structure for sequence of same character. 
 
z range($ZMAX-$ZMIN)< $MINIMAL_DZ." fi fi mv $WORKDIR/fit.root $MODULE_ROOT typeset -Z 4 STRING typeset -Z 2 FLOOR JPlot1D -f $
 
static const std::string EndTime_t
 
Utility class to parse command line options. 
 
static const std::string Type_t
 
ResultSet & getResultSet(const std::string &query)
Get result set. 
 
static const std::string StartTime_t
 
static const std::string User_t
Detector calibration key words for JSON I/O. 
 
JCLBIDHelper getCLBID
Function object for mapping UPI of central-logic board to module identifier. 
 
do set_variable DETECTOR_TXT $WORKDIR detector
 
KM3NeT DAQ constants, bit handling, etc. 
 
static const int NUMBER_OF_PMTS
Total number of PMTs in module. 
 
Specifications of file name extensions. 
 
bool isJSONFile(const char *file_name)
Check file format. 
 
int main(int argc, char *argv[])