30{
33
35 string usr;
36 string pwd;
37 string cookie;
38 string detid;
39 int run;
40 long long int numberOfRows;
41 double precision;
44
45 try {
46
47 JParser<> zap(
"Auxiliary program to check HV."\
48 "\nFor detailed ROOT output, use corresponding example.");
49
54 zap[
'D'] =
make_field(detid,
"Detector identifier");
56 zap[
'n'] =
make_field(numberOfRows,
"Maximal number of rows") = numeric_limits<long long int>::max();
60
61 zap(argc, argv);
62 }
63 catch(const exception &error) {
64 FATAL(error.what() << endl);
65 }
66
67
71
72 try {
73
74 JDB::reset(usr, pwd, cookie);
75
76 const int ID = getDetector<int> (detid);
77 detid = getDetector<string>(detid);
78
80
81 {
83
85
86 if (parameters.PMTUPI.getPBS() == PBS::PMT) {
87 detector[parameters.PMTUPI] =
JLocation_t(parameters.DUID, parameters.FLOORID, parameters.CABLEPOS);
88 }
89 }
90
91 rs.Close();
92 }
93 {
95
96 JSelector selection(&JDatalogNumbers::PARAMETER_NAME, "pmt_highvolt");
97
99
100 ResultSet& rs =
getResultSet(getTable<JDatalogNumbers>(), selection);
101
102 long long int counter = 0;
103
104 for (
JDatalogNumbers parameters; rs >> parameters && counter != numberOfRows; ++counter) {
105
107
108 const JUPI_t upi = parameters.SOURCE_NAME;
110
111 DEBUG(location <<
' ' <<
FIXED(7,1) << HV(upi) <<
' ' <<
FIXED(7,1) << parameters.DATA_VALUE << endl);
112
114
115 counts[upi] += 1;
116
117 if (fabs(HV(upi).value - parameters.DATA_VALUE) > precision) {
118
119 ERROR(
"HV " << setw(10) << parameters.UNIXTIME <<
' ' << location <<
" set/read " <<
FIXED(7,1) << HV(upi) <<
"/" <<
FIXED(7,1) << parameters.DATA_VALUE << endl);
120
121 errors[upi] += 1;
122 }
123
124 } else {
125
126 aliens[upi] += 1;
127 }
128
130 }
131
132 rs.Close();
133 }
134
135 if (
debug >= warning_t) {
137 cout <<
"Error HV " << setw(32) << left << i->first << right <<
' ' <<
detector[i->first] <<
' ' << setw(3) << i->second <<
'/' << setw(3) << counts[i->first] << endl;
138 }
140 cout << "Alien UPI " << setw(32) << left << i->first << right << ' ' << setw(3) << i->second << endl;
141 }
142 }
143 }
144 catch(const exception& error) {
145 FATAL(error.what() << endl);
146 }
147
148 QAQC(setw(4) << errors.size() << endl);
149
150 return 0;
151}
#define DEBUG(A)
Message macros.
#define QAQC(A)
QA/QC output macro.
int qaqc
QA/QC file descriptor.
#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).
Auxiliary data structure for floating point format specification.
Auxiliary data structure for location of product in detector.
bool is_valid() const
Check validity of location.
Wrapper class for server name.
Universal product identifier (UPI).
Template definition for getting table specific selector.