26 int main(
int argc,
char **argv)
43 JParser<> zap(
"Example program to build detector from database.");
49 zap[
'f'] =
make_field(inputFile,
"output of JPrintDB -q \"integration\" -c \";\" -W1") =
"";
57 catch(
const exception &error) {
58 FATAL(error.what() << endl);
64 if (inputFile !=
"") {
66 ifstream
in(inputFile.c_str());
74 DEBUG(
"Reading database table " << getTable<JDetectorIntegration_t>() << endl);
80 detid = getDetector<string>(detid);
82 ResultSet& rs =
getResultSet(getTable<JDetectorIntegration_t>());
85 THROW(JDatabaseException,
"Error reading " << getTable<JDetectorIntegration_t>());
88 catch(
const exception& error) {
89 FATAL(error.what() << endl);
94 FATAL(
"Detector identifier must be object identifier." << endl);
100 if (pbs != JPBS_t()) {
104 JDetectorIntegration_t::range_type
range =
detector.find(pbs);
106 for (JDetectorIntegration_t::range_const_iterator i = range.first; i != range.second; ++i) {
108 const JUPI_t upi =
detector[i->second].content.getUPI();
110 cout <<
LEFT(32) << upi << right <<
' ' << router.getLocation(upi) << endl;
113 }
else if (upi != JUPI_t()) {
119 const JLocation_t location = router.getLocation(upi);
121 if (location.is_valid()) {
122 cout << location << endl;
127 cout <<
"Enter UPI." << endl;
133 cout <<
"> " << flush;
140 const JLocation_t location = router.getLocation(upi);
142 if (location.is_valid()) {
143 cout << location << endl;
Utility class to parse command line options.
int main(int argc, char *argv[])
static JGetPBSSequences getPBSSequences
Function object to get PBS sequences as a function of PBS.
#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.
z range($ZMAX-$ZMIN)< $MINIMAL_DZ." fi fi typeset -Z 4 STRING typeset -Z 2 FLOOR JPlot1D -f $
Utility class to parse command line options.
then usage $script< input_file >< detector_file > fi set_variable OUTPUT_DIR set_variable SELECTOR JDAQTimesliceL1 set_variable DEBUG case set_variable DEBUG
ResultSet & getResultSet(const std::string &query)
Get result set.
std::vector< JServer > getServernames()
Get list of names of available database servers.
do set_variable DETECTOR_TXT $WORKDIR detector
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY source JAcoustics sh $DETECTOR_ID CHECK_EXIT_CODE typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in