40{
44
45 string inputFile;
48
52
54
55 try {
56
58
62
63 JParser<> zap(
"Auxiliary program to print high-voltage tuning results.");
64
65 zap[
'f'] =
make_field(inputFile,
"input file (JSON output of JTuneHV)");
70
72
73 } catch(const exception &error) {
74
76 }
77
79
80 FATAL(
"Missing user information (please specify via -#login and -#locationID).");
81 }
82
83
84 const JUUID& UUID = JUUID::rndm();
85
87
89
91
92 try {
94 }
95 catch (const exception& error) {
97 }
98
100
101
105
107
109
111
113
114 ifstream
ifs(inputFile.c_str());
115
118
119
120
121 json::const_iterator
i0 =
js.find(APIVersion_t);
122
123 if (
i0 !=
js.cend()) {
124
126
128 }
129
131
132 json::const_iterator
i1 =
js.find(Data_t);
133
135 (
i1 !=
js.cend() &&
i1->size() > 0)) {
136
137 DBTestType = (*i1)[0].at(Test_t + Type_t).get<
string>();
138
139 JHVCalibration_t::setVersion(getDBVersionTuneHV(
DBTestType));
140
142 metaInfoStr += (*i1)[0].at(Provenance_t + Info_t).at(Configuration_t).get<
string>();
143
144 } else {
145
147
148 JHVCalibration_t::setVersion(getDBVersionTuneHV(
DBTestType));
149
151 }
152
153
156
157 for (JHVCalibration::const_iterator
it =
HVcals.cbegin();
it !=
HVcals.cend(); ++
it) {
158
160 const JModule&
module = PMTrouter.getParentModule(pmtUPI.getNumber());
162
164
165 if (
it->result != OK_t) {
167 }
168
171
173 }
174
175 } else {
176
177 ERROR(inputFile <<
" is not a JSON file." <<
endl);
178 }
179
180
183
185
187
189
191
192 if (i->second.size() == NUMBER_OF_PMTS) {
193
195 WARNING(
"No successful calibrations found for module " << i->first <<
" (dead module?)" <<
endl);
196
197 } else {
198
199 for (JHVCalibration::const_iterator j = i->second.cbegin();
j != i->second.cend(); ++
j) {
200
202 const JModule&
module = PMTrouter.getParentModule(pmtUPI.getNumber());
204
206
208 right <<
FIXED(20,1) <<
j->supplyVoltage <<
RIGHT(10) <<
j->result <<
endl);
209
211 }
212 }
213 }
214
221
222
224
226
228
229 json error = { {Message_t,
"" },
230 {Code_t, OK_t },
231 {Arguments_t, json::array() } };
232
235
239 {Start_t + Time_t, timer.
toString() },
240 {End_t + Time_t, timer().
toString() },
243
247 js[Error_t] =
json(error);
250 js[Data_t][0] =
json(data);
251
252 } else {
253
260 }
261
263
266
268 }
269
270 return 0;
271}
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
#define MAKE_STRING(A)
Make string.
#define gmake_property(A)
macros to convert (template) parameter to JPropertiesElement object
Data structure for a composite optical module.
Router for direct addressing of PMT data in detector data structure.
Utility class to parse parameter values.
Template definition of a multi-dimensional oscillation probability interpolation table.
Utility class to parse command line options.
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
bool isJSONFile(const char *file_name)
Check file format.
KM3NeT DAQ data structures and auxiliaries.
Auxiliary data structure for alignment of data.
Auxiliary data structure for sequence of same character.
Auxiliary data structure for floating point format specification.
Auxiliary data structure for location of product in detector.
Universal product identifier (UPI).
Auxiliary data structure for general purpose version number.
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Auxiliary class for date and time.
std::string toString() const
Get ASCII formatted date and time.
void sub(const time_t t1)
Subtract given time.
Auxiliary data structure for alignment of data.
Auxiliary data structure for alignment of data.