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();
81 timer.sub(elapsedTime);
86 JDBAPIVersion DBAPIVersion;
88 string metaInfoStr =
MAKE_STRING(JMeta(argc, argv));
94 NOTICE(
"Merging " << (*fileIt) << endl);
99 ifstream ifs(fileIt->c_str());
108 if (i0 != js.cend()) {
110 istringstream iss(i0->get<
string>());
117 json::const_iterator i1 = js.find(
Data_t);
119 if ( (DBAPIVersion.getMajorVersion() == 2) &&
120 (i1 != js.cend() && i1->size() > 0) ) {
140 for (JHVCalibration::const_iterator cal = HVcals.cbegin(); cal != HVcals.cend(); ++cal) {
142 if (find_if(merged.cbegin(), merged.cend(),
make_predicate(&JHVCalibration_t::getNumber, cal->getNumber())) == merged.cend()) {
143 merged.push_back(*cal);
149 WARNING(*fileIt <<
" is not a JSON file; skip" << endl);
154 if (testTypes.size() > 1) {
156 WARNING(
"Ambiguous database test types; Assuming " << *testTypes.crbegin() << endl);
158 }
else if (testTypes.size() == 0) {
160 FATAL(
"No database test type specified.");
166 if (DBAPIVersion.getMajorVersion() == 2) {
187 js[
Start_t] = timer.toString();
188 js[
End_t] = timer().toString();
203 ofs << setw(2) << setprecision(8);
static JDBTestTypesTuneHV & getDBVersionTuneHV
Function object for looking up the HV-tuning database version number corresponding to a specific test...
static const std::string Arguments_t
Utility class to parse command line options.
static const std::string Start_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 Location_t
static const std::string Code_t
static const std::string Encoding_t
#define gmake_property(A)
macro to convert (template) parameter to JPropertiesElement object
static const std::string Error_t
Utility class to parse parameter values.
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
#define MAKE_STRING(A)
Make string.
static const std::string Time_t
static const std::string APIVersion_t
static const std::string Configuration_t
static const std::string Test_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 End_t
static const std::string Info_t
static const std::string Message_t
static const std::string Data_t
static const std::string Type_t
static const std::string Provenance_t
static const std::string UUID_t
static const std::string Tests_t
bool isJSONFile(const char *file_name)
Check file format.
static const std::string OK_t
static const std::string User_t