#include #include #include #include "JDB/JDB.hh" #include "JDB/JSelector.hh" #include "JDB/JSelectorSupportkit.hh" #include "JDB/JDBToolkit.hh" #include "JDetector/JDetector.hh" #include "JDetector/JDetectorToolkit.hh" #include "Jeep/JPrint.hh" #include "Jeep/JParser.hh" #include "Jeep/JMessage.hh" /** * \file * * Auxiliary program to print detector from database. * \author mdejong */ int main(int argc, char **argv) { using namespace std; using namespace JPP; JServer server; string usr; string pwd; string cookie; string id; string outputFile; int run; string variant; int debug; try { JParser<> zap("Auxiliary program to print detector from database."); zap['s'] = make_field(server) = getServernames(); zap['u'] = make_field(usr) = ""; zap['!'] = make_field(pwd) = ""; zap['C'] = make_field(cookie) = ""; zap['D'] = make_field(id, "detector identifier"); zap['r'] = make_field(run, "run number"); zap['o'] = make_field(outputFile) = ""; zap['V'] = make_field(variant, "detector version") = getDetectorVersions(), ""; zap['d'] = make_field(debug) = 2; zap(argc, argv); } catch(const exception &error) { FATAL(error.what() << endl); } try { JDB::reset(usr, pwd, cookie); JDetector detector; if (outputFile == "") { cout << (JDB::get()->DetX)(id.c_str(), run, getDetectorVersion(variant))->str() << endl; } else { *(JDB::get()->DetX)(id.c_str(), run, getDetectorVersion(variant)) >> detector; store(outputFile, detector); } } catch(const exception& error) { FATAL(error.what() << endl); } return 0; }