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);
54 JDetectorIntegration detector;
56 DEBUG(
"Reading database table " << getTable<JDetectorIntegration>() << endl);
66 ResultSet& rs =
getResultSet(getTable<JDetectorIntegration>());
68 if (! (rs >> detector)) {
69 THROW(JDatabaseException,
"Error reading " << getTable<JDetectorIntegration>());
72 catch(
const exception& error) {
73 FATAL(error.what() << endl);
77 detector.configure(detid);
79 const JProductRouter router(detector);
83 JDetectorIntegration::range_type range = detector.find(pbs);
85 for (JDetectorIntegration::range_const_iterator i = range.first; i != range.second; ++i) {
87 const JUPI upi = detector[i->second].content.getUPI();
89 cout << upi <<
' ' << router.getLocation(upi) << endl;
92 }
else if (upi != JUPI()) {
94 detector.print(cout, upi);
96 cout << router.getLocation(upi) << endl;
100 cout <<
"Enter UPI." << endl;
106 cout <<
"> " << flush;
109 detector.print(cout, upi);
111 cout << router.getLocation(upi) << endl;