22 int main(
int argc,
char **argv)
37 JParser<> zap(
"Example program to build detector from database.");
49 catch(
const exception &error) {
50 FATAL(error.what() << endl);
56 DEBUG(
"Reading database table " << getTable<JDetectorIntegration_t>() << endl);
66 ResultSet& rs =
getResultSet(getTable<JDetectorIntegration_t>());
69 THROW(JDatabaseException,
"Error reading " << getTable<JDetectorIntegration_t>());
72 catch(
const exception& error) {
73 FATAL(error.what() << endl);
79 const JProductRouter router(
detector);
83 JDetectorIntegration_t::range_type range =
detector.find(pbs);
85 for (JDetectorIntegration_t::range_const_iterator i = range.first; i != range.second; ++i) {
87 const JUPI upi =
detector[i->second].content.getUPI();
89 cout <<
LEFT(24) << upi << right <<
' ' << router.getLocation(upi) << endl;
92 }
else if (upi != JUPI()) {
96 cout << router.getLocation(upi) << endl;
100 cout <<
"Enter UPI." << endl;
106 cout <<
"> " << flush;
111 cout << router.getLocation(upi) << endl;
Utility class to parse command line options.
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
bool is_integer(const std::string &buffer)
Check if string is an integer.
General purpose messaging.
static const JDetectorsHelper & getDetector
Function object for mapping serial number and object identifier of detectors.
Utility class to parse command line options.
ResultSet & getResultSet(const std::string &query)
Get result set.
#define DEBUG(A)
Message macros.
int main(int argc, char *argv[])