26 int main(
int argc,
char **argv)
41 JParser<> zap(
"Auxiliary program to check detector integration.");
47 zap[
'D'] =
make_field(detid,
"Detector identifier");
52 catch(
const exception &error) {
53 FATAL(error.what() << endl);
64 ID = to_value<int>(detid);
73 detector_type detectorA;
76 ResultSet& rs =
getResultSet(getTable<JDetectorIntegration>(), getSelector<JDetectorIntegration>(ID));
80 if (parameters.PMTUPI.getPBS() ==
PBS::PMT) {
81 detectorA[parameters.PMTUPI] = JLocation_t(parameters.DUID, parameters.FLOORID, parameters.CABLEPOS);
89 JDetectorIntegration_t detectorB;
92 ResultSet& rs =
getResultSet(getTable<JDetectorIntegration_t>());
94 if (! (rs >> detectorB)) {
95 THROW(JDatabaseException,
"Error reading " << getTable<JDetectorIntegration_t>());
99 detectorB.configure(detid);
104 for (detector_type::const_iterator i = detectorA.begin(); i != detectorA.end(); ++i) {
106 const JLocation_t locationA = i->second;
107 const JLocation_t locationB = router.getLocation(i->first);
109 cout << locationA <<
' ' << locationB <<
' ' << (locationA != locationB ?
"*" :
"") << endl;
112 catch(
const exception& error) {
113 FATAL(error.what() << endl);
Utility class to parse command line options.
int main(int argc, char *argv[])
static const JPBS_t PMT(3, 4, 2, 3)
PBS of photo-multiplier tube (PMT)
static const JPBSSequences PMT_SEQUENCES
PBS sequences for PMT.
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
*fatal Wrong number of arguments esac JCookie sh typeset Z DETECTOR typeset Z SOURCE_RUN typeset Z TARGET_RUN set_variable PARAMETERS_FILE $WORKDIR parameters
JDetectorsHelper getDetector
Function object for mapping serial number to object identifier of detector and vice versa...
I/O formatting auxiliaries.
#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.
Utility class to parse command line options.
ResultSet & getResultSet(const std::string &query)
Get result set.
std::vector< JServer > getServernames()
Get list of names of available database servers.