36 int main(
int argc, 
char **argv)
 
   47   long long int   numberOfRows;
 
   53     JParser<> zap(
"Auxiliary program to check HV.");
 
   59     zap[
'D'] = 
make_field(detid,        
"Detector identifier");
 
   61     zap[
'n'] = 
make_field(numberOfRows, 
"Maximal number of rows")         = numeric_limits<long long int>::max();
 
   67   catch(
const exception &error) {
 
   68     FATAL(error.what() << endl);
 
   82     JDetectorIntegration detector;
 
   85       DEBUG(
"Reading database table " << getTable<JDetectorIntegration>() << endl); 
 
   87       ResultSet& rs  = 
getResultSet(getTable<JDetectorIntegration>());
 
   89       if (! (rs >> detector)) {
 
   90         THROW(JDatabaseException, 
"Error reading " << getTable<JDetectorIntegration>());
 
   94     DEBUG(
"Number of integrated products (before) " << right << detector.size() << endl);
 
   96     detector.configure(detid);
 
   98     DEBUG(
"Number of integrated products (after)  " << right << detector.size() << endl);
 
  100     const JProductRouter router(detector);
 
  105       ResultSet& rs  = 
getResultSet(getTable<JPMTHVRunSettings>(), getSelector<JPMTHVRunSettings>(detid, run));
 
  107       for (JPMTHVRunSettings parameters; rs >> parameters; ) {
 
  109         const JLocation_t location(parameters.DUID, parameters.FLOORID, parameters.PMTINTID);  
 
  111         HV[location] = parameters.HV_VALUE;
 
  119       cout << 
"HV settings:" << endl;
 
  122         cout << i->first << 
' ' << 
FIXED(6,1) << i->second << endl;
 
  126     JSelector selection(&JDatalogNumbers::PARAMETER_NAME, 
"pmt_highvolt@");
 
  128     selection += getSelector<JDatalogNumbers>(detid, run, run);
 
  130     ResultSet& rs  = 
getResultSet(getTable<JDatalogNumbers>(), selection);
 
  132     long long int counter = 0;
 
  134     for (JDatalogNumbers parameters; rs >> parameters && counter != numberOfRows; ++counter) {
 
  138       const JUPI         upi      = parameters.SOURCE_NAME;
 
  139       const JLocation_t& location = router.getLocation(upi);
 
  141       DEBUG(location << 
' ' << 
FIXED(6,1) << HV[location] << 
' ' << 
FIXED(6,1) << parameters.DATA_VALUE << endl);
 
  143       if (location != JLocation_t()) {
 
  145         const double hv = HV[location] - parameters.DATA_VALUE ;
 
  147         manager[location]->
Fill(hv);
 
  149         if (fabs(hv) > precision) {
 
  150           WARNING(
"HV " << location << 
" set/read " << 
FIXED(6,1) << HV[location] << 
"/" << 
FIXED(6,1) << parameters.DATA_VALUE << endl);
 
  156   catch(
const exception& error) {
 
  157     FATAL(error.what() << endl);