26{
   29 
   31 
   33  string   usr;
   34  string   pwd;
   35  string   cookie;
   36  string   detid;
   37  run_type runs;
   39  bool     usePMTID;                    
   41 
   42  try {
   43 
   44    JParser<> zap(
"Auxiliary program to determine TDC constraints (input to JFitK40.cc) according HV settings from the database.");
 
   45 
   50    zap[
'D'] = 
make_field(detid,        
"Detector identifier");
 
   51    zap[
'r'] = 
make_field(runs,         
"Pair of data taking runs");
 
   55 
   56    zap(argc, argv);
   57  }
   58  catch(const exception& error) {
   59    FATAL(error.what() << endl);
 
   60  }
   61 
   62 
   63  try {
   64 
   65    JDB::reset(usr, pwd, cookie);
   66 
   67    const int ID = getDetector<int>   (detid);
 
   68    detid        = getDetector<string>(detid);
   69 
   71 
   73 
   74    {
   76 
   79      }
   80 
   81      rs.Close();
   82    }
   83 
   87    };
   88 
   89    filebuf buffer;
   90 
   93    }
   94 
   95    ostream os(buffer.is_open() ? &buffer : cout.rdbuf());
   96 
   97    for (detector_type::const_iterator i = 
detector.begin(); i != 
detector.end(); ++i) {
 
   98      if (i->PMTUPI.getPBS() == PBS::PMT) {
   99        try {
  100          if (pmt_hv[0](i->PMTUPI).value == pmt_hv[1](i->PMTUPI).value) {
  101            if (usePMTID)
  102              os << setw(10) << i->DOMID << ' ' << setw(2) << i->PMTID    << endl;
  103            else
  104              os << setw(10) << i->DOMID << ' ' << setw(2) << i->CABLEPOS << endl;
  105          }
  106        }
  107        catch(const exception& error) {
  108          ERROR(
"Invalid UPI " << i->PMTUPI << 
' ' << setw(10) << i->DOMID << 
' ' << setw(2) << i->PMTID << endl);
 
  109        }
  110      }
  111    }
  112 
  113    buffer.close();
  114  }
  115  catch(const exception& error) {
  116    FATAL(error.what() << endl);
 
  117  }
  118}
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
 
Auxiliary class for PMT HVs.
 
Utility class to parse command line options.
 
ResultSet & getResultSet(const std::string &query)
Get result set.
 
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).
 
Wrapper class for server name.
 
Template definition for getting table specific selector.