36 int main(
int argc,
char **argv)
47 long long int numberOfRows;
53 JParser<> zap(
"Auxiliary program to check HV.");
59 zap[
'D'] =
make_field(detid,
"Detector identifier");
61 zap[
'n'] =
make_field(numberOfRows,
"Maximal number of rows") = numeric_limits<long long int>::max();
67 catch(
const exception &error) {
68 FATAL(error.what() << endl);
72 JManager<JLocation_t, TH1D> manager(
new TH1D(
"HV[%]", NULL, 200, -1500.0, +1500.0));
85 DEBUG(
"Reading database table " << getTable<JDetectorIntegration_t>() << endl);
87 ResultSet& rs =
getResultSet(getTable<JDetectorIntegration_t>());
89 if (! (rs >> detector)) {
90 THROW(JDatabaseException,
"Error reading " << getTable<JDetectorIntegration_t>());
94 DEBUG(
"Number of integrated products (before) " << right << detector.size() << endl);
96 detector.configure(detid);
98 DEBUG(
"Number of integrated products (after) " << right << detector.size() << endl);
100 const JProductRouter router(detector);
105 ResultSet& rs =
getResultSet(getTable<JPMTHVRunSettings>(), getSelector<JPMTHVRunSettings>(detid, run));
109 const JLocation_t location(parameters.DUID, parameters.FLOORID, parameters.PMTINTID);
111 HV[location] = parameters.HV_VALUE;
119 cout <<
"HV settings:" << endl;
122 cout << i->first <<
' ' <<
FIXED(6,1) << i->second << endl;
126 JSelector selection(&JDatalogNumbers::PARAMETER_NAME,
"pmt_highvolt@");
128 selection += getSelector<JDatalogNumbers>(detid, run, run);
130 ResultSet& rs =
getResultSet(getTable<JDatalogNumbers>(), selection);
132 long long int counter = 0;
139 const JLocation_t& location = router.getLocation(upi);
143 if (location != JLocation_t()) {
145 const double hv = HV[location] -
parameters.DATA_VALUE ;
147 manager[location]->Fill(hv);
149 if (fabs(hv) > precision) {
156 catch(
const exception& error) {
157 FATAL(error.what() << endl);
Utility class to parse command line options.
#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
Dynamic ROOT object management.
Auxiliary data structure for floating point format specification.
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.
ROOT TTree parameter settings.
General purpose messaging.
static const JDetectorsHelper & getDetector
Function object for mapping serial number and object identifier of detectors.
Utility class to parse command line options.
ResultSet & getResultSet(const std::string &query)
Get result set.
#define DEBUG(A)
Message macros.
int main(int argc, char *argv[])