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, -1500.0, +1500.0));
83 JDB::reset(usr, pwd, cookie);
85 const int ID = getDetector<int> (detid);
86 detid = getDetector<string>(detid);
97 if (parameters.PMTUPI.getPBS() == PBS::PMT) {
98 detector[parameters.PMTUPI] =
JLocation_t(parameters.DUID, parameters.FLOORID, parameters.CABLEPOS);
105 for (
const int run : runs) {
114 const JLocation_t location(parameters.DUID, parameters.FLOORID, parameters.CABLEPOS);
116 if (parameters.CABLEPOS != parameters.PMTINTID) {
117 WARNING(
"PMT " << location <<
" position " << parameters.PMTINTID << endl);
120 HV[location] = parameters.HV_VALUE;
126 if (
debug >= debug_t) {
128 cout <<
"HV settings " << setw(8) << run << endl;
131 cout << i->first <<
' ' <<
FIXED(6,1) << i->second << endl;
135 JSelector selection(&JDatalogNumbers::PARAMETER_NAME,
"pmt_highvolt@");
139 ResultSet& rs = getResultSet(getTable<JDatalogNumbers>(), selection);
141 long long int counter = 0;
143 for (
JDatalogNumbers parameters; rs >> parameters && counter != numberOfRows; ++counter) {
147 const JUPI_t upi = parameters.SOURCE_NAME;
150 DEBUG(location <<
' ' <<
FIXED(7,1) << HV[location] <<
' ' <<
FIXED(7,1) << parameters.DATA_VALUE << endl);
154 G1[location].put(parameters.getTime(), parameters.DATA_VALUE);
156 H1[location]->Fill(HV[location] - parameters.DATA_VALUE);
158 if (fabs(HV[location] - parameters.DATA_VALUE) > precision) {
159 ERROR(
"HV " << location <<
" set/read " <<
FIXED(7,1) << HV[location] <<
"/" <<
FIXED(7,1) << parameters.DATA_VALUE << endl);
173 catch(
const exception& error) {
174 FATAL(error.what() << endl);
179 ERROR(
"Alien UPI " << setw(24) << i->first <<
' ' << i->second << endl);