26 int main(
const int argc,
const char *
const argv[])
41 JParser<> zap(
"Utility program to test PMT HV settings.");
53 catch(
const exception& error) {
54 FATAL(error.what() << endl);
65 ID = to_value<int>(detid);
76 ResultSet& rs =
getResultSet(getTable<JDetectorIntegration>(), getSelector<JDetectorIntegration>(ID));
79 detector.push_back(parameters);
88 ResultSet& rs =
getResultSet(getTable<JPMTHVRunSettings>(), getSelector<JPMTHVRunSettings>(detid, run));
91 HV[parameters.DUID][parameters.FLOORID][parameters.CABLEPOS] =
parameters;
97 const JPMTHV pmt_hv(ID, run);
99 for (detector_type::const_iterator i = detector.begin(); i != detector.end(); ++i) {
101 if (i->PMTUPI.getPBS() ==
PBS::PMT) {
103 cout <<
FILL(4,
'0') << i->DUID <<
'.' <<
FILL(2,
'0') << i->FLOORID <<
"[" <<
FILL(2,
'0') << i->CABLEPOS <<
"] " <<
FILL()
104 << setw(4) << pmt_hv(i->PMTUPI).value <<
' '
105 << setw(4) << HV[i->DUID][i->FLOORID][i->CABLEPOS].HV_INDEX <<
' '
106 <<
FIXED(7,1) << HV[i->DUID][i->FLOORID][i->CABLEPOS].HV_VALUE <<
' '
107 << pmt_hv(i->PMTUPI).is_default
108 << (pmt_hv(i->PMTUPI).value != HV[i->DUID][i->FLOORID][i->CABLEPOS].HV_INDEX ?
"*" :
"") << 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)
*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
Auxiliary data structure for floating point format specification.
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.
Auxiliary data structure for sequence of same character.
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.
do set_variable DETECTOR_TXT $WORKDIR detector