58 JParser<> zap(
"Auxiliary program to merge high-voltage calibration results.");
60 zap[
'f'] =
make_field(inputFiles,
"input files");
67 }
catch(
const exception &error) {
69 FATAL(error.what() << endl);
72 if (login.empty() || locationID.empty()) {
73 FATAL(
"Missing user information (please specify via -#login and -#locationID)." << endl);
77 const JUUID& UUID = JUUID::rndm();
82 timer->tm_sec -= elapsedTime;
87 JDBAPIVersion DBAPIVersion;
89 string metaInfoStr =
MAKE_STRING(JMeta(argc, argv));
95 NOTICE(
"Merging " << (*fileIt) << endl);
100 ifstream ifs(fileIt->c_str());
109 if (i0 != js.cend()) {
111 istringstream iss(i0->get<
string>());
118 json::const_iterator i1 = js.find(
Data_t);
120 if ( (DBAPIVersion.getMajorVersion() == 2) &&
121 (i1 != js.cend() && i1->size() > 0) ) {
141 for (JHVCalibration::const_iterator cal = HVcals.cbegin(); cal != HVcals.cend(); ++cal) {
143 if (find_if(merged.cbegin(), merged.cend(),
make_predicate(&JHVCalibration_t::getNumber, cal->getNumber())) == merged.cend()) {
144 merged.push_back(*cal);
150 WARNING(*fileIt <<
" is not a JSON file; skip" << endl);
155 if (testTypes.size() > 1) {
157 WARNING(
"Ambiguous database test types; Assuming " << *testTypes.crbegin() << endl);
159 }
else if (testTypes.size() == 0) {
161 FATAL(
"No database test type specified.");
167 if (DBAPIVersion.getMajorVersion() == 2) {
188 js[
Start_t] = timer.toString(format);
189 js[
End_t] = timer().toString(format);
204 ofs << setw(2) << setprecision(8);
static JDBTestTypesTuneHV & getDBVersionTuneHV
Function object for looking up the HV-tuning database version number corresponding to a specific test...
Utility class to parse command line options.
static const std::string UUID_t
JPredicate< JResult_t T::*, JComparison::eq > make_predicate(JResult_t T::*member, const JResult_t value)
Helper method to create predicate for data member.
static const std::string Time_t
#define gmake_property(A)
macro to convert (template) parameter to JPropertiesElement object
static const std::string Tests_t
static const std::string OK_t
Utility class to parse parameter values.
static const std::string Location_t
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
JDateAndTimeFormat
Date and time formats.
static const std::string Encoding_t
#define MAKE_STRING(A)
Make string.
static const std::string Provenance_t
static const std::string Arguments_t
static const std::string Configuration_t
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
std::vector< JHVCalibration_t > JHVCalibration
PMT high voltage calibration.
static const std::string Code_t
static const std::string Test_t
static const std::string Info_t
static const std::string Message_t
static const std::string Type_t
static const std::string APIVersion_t
static const std::string User_t
Detector calibration key words for JSON I/O.
static const std::string Error_t
static const std::string Data_t
static const std::string End_t
static const std::string Start_t
bool isJSONFile(const char *file_name)
Check file format.