#include <string>
#include <iostream>
#include <iomanip>
#include "JDB/JDB.hh"
#include "JDB/JSelector.hh"
#include "JDB/JSelectorSupportkit.hh"
#include "JDB/JDetectorIntegration.hh"
#include "JDB/JProductRouter.hh"
#include "JDB/JDBToolkit.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"
Go to the source code of this file.
|
int | main (int argc, char **argv) |
|
Example program to build detector from database.
- Author
- mdejong
Definition in file JDetectorIntegration.cc.
◆ main()
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 22 of file JDetectorIntegration.cc.
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;