38int main(
int argc,
char **argv)
50 long long int numberOfRows;
56 JParser<> zap(
"Auxiliary program to check HV.");
58 zap[
's'] =
make_field(server) = getServernames();
63 zap[
'D'] =
make_field(detid,
"Detector identifier");
65 zap[
'n'] =
make_field(numberOfRows,
"Maximal number of rows") = numeric_limits<long long int>::max();
71 catch(
const exception &error) {
72 FATAL(error.what() << endl);
77 JManager<JLocation_t, TH1D> H1(
new TH1D(
"HV[%]", NULL, 201, -256.0, +256.0));
84 JDB::reset(usr, pwd, cookie);
86 const int ID = getDetector<int> (detid);
87 detid = getDetector<string>(detid);
96 if (parameters.PMTUPI.getPBS() == PBS::PMT) {
97 detector[parameters.PMTUPI] =
JLocation_t(parameters.DUID, parameters.FLOORID, parameters.CABLEPOS);
104 for (
const int run : runs) {
108 JSelector selection(&JDatalogNumbers::PARAMETER_NAME,
"pmt_highvolt");
112 ResultSet& rs = getResultSet(getTable<JDatalogNumbers>(), selection);
114 long long int counter = 0;
116 for (
JDatalogNumbers parameters; rs >> parameters && counter != numberOfRows; ++counter) {
120 const JUPI_t upi = parameters.SOURCE_NAME;
123 DEBUG(location <<
' ' <<
FIXED(7,1) << HV(upi) <<
' ' <<
FIXED(7,1) << parameters.DATA_VALUE << endl);
127 G1[location].put(parameters.getTime(), parameters.DATA_VALUE);
129 H1[location]->Fill(HV(upi).value - parameters.DATA_VALUE);
131 if (fabs(HV(upi).value - parameters.DATA_VALUE) > precision) {
133 ERROR(
"HV " << location <<
" set/read " <<
FIXED(7,1) << HV(upi) <<
"/" <<
FIXED(7,1) << parameters.DATA_VALUE << endl);
149 if (
debug >= warning_t) {
151 cout <<
"Error HV " << setw(32) << left << i->first << right <<
' ' <<
detector[i->first] <<
' ' << setw(3) << i->second << endl;
154 cout <<
"Alien UPI " << setw(32) << left << i->first << right <<
' ' << setw(3) << i->second << endl;
158 catch(
const exception& error) {
159 FATAL(error.what() << endl);