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
70
71 try {
72
73 JDB::reset(usr, pwd, cookie);
74
75 const int ID = getDetector<int> (detid);
76 detid = getDetector<string>(detid);
77
79
80 {
82
84
85 if (parameters.PMTUPI.getPBS() == PBS::PMT) {
86 detector[parameters.PMTUPI] =
JLocation_t(parameters.DUID, parameters.FLOORID, parameters.CABLEPOS);
87 }
88 }
89
90 rs.Close();
91 }
92 {
94
95 JSelector selection(&JDatalogNumbers::PARAMETER_NAME, "pmt_highvolt");
96
98
99 ResultSet& rs =
getResultSet(getTable<JDatalogNumbers>(), selection);
100
101 long long int counter = 0;
102
103 for (
JDatalogNumbers parameters; rs >> parameters && counter != numberOfRows; ++counter) {
104
106
107 const JUPI_t upi = parameters.SOURCE_NAME;
109
110 DEBUG(location <<
' ' <<
FIXED(7,1) << HV(upi) <<
' ' <<
FIXED(7,1) << parameters.DATA_VALUE << endl);
111
113
114 if (fabs(HV(upi).value - parameters.DATA_VALUE) > precision) {
115
116 ERROR(
"HV " << location <<
" set/read " <<
FIXED(7,1) << HV(upi) <<
"/" <<
FIXED(7,1) << parameters.DATA_VALUE << endl);
117
118 errors[upi] += 1;
119 }
120
121 } else {
122
123 aliens[upi] += 1;
124 }
125
127 }
128
129 rs.Close();
130 }
131
132 if (
debug >= warning_t) {
134 cout <<
"Error HV " << setw(32) << left << i->first << right <<
' ' <<
detector[i->first] <<
' ' << setw(3) << i->second << endl;
135 }
137 cout << "Alien UPI " << setw(32) << left << i->first << right << ' ' << setw(3) << i->second << endl;
138 }
139 }
140 }
141 catch(const exception& error) {
142 FATAL(error.what() << endl);
143 }
144
145 QAQC(setw(4) << errors.size() << endl);
146
147 return 0;
148}
#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.