50 long long int numberOfRows;
56 JParser<> zap(
"Auxiliary program to check HV.");
63 zap[
'D'] =
make_field(detid,
"Detector identifier");
65 zap[
'n'] =
make_field(numberOfRows,
"Maximal number of rows") = numeric_limits<long long int>::max();
71 catch(
const exception &error) {
72 FATAL(error.what() << endl);
77 JManager<JLocation_t, TH1D>
H1(
new TH1D(
"HV[%]", NULL, 201, -1500.0, +1500.0));
88 ID = to_value<int>(detid);
99 ResultSet& rs =
getResultSet(getTable<JDetectorIntegration>(), getSelector<JDetectorIntegration>(ID));
103 if (parameters.PMTUPI.getPBS() ==
PBS::PMT) {
104 detector[parameters.PMTUPI] = JLocation_t(parameters.DUID, parameters.FLOORID, parameters.CABLEPOS);
111 for (
const int run : runs) {
116 ResultSet& rs =
getResultSet(getTable<JPMTHVRunSettings>(), getSelector<JPMTHVRunSettings>(detid, run));
118 for (JPMTHVRunSettings parameters; rs >>
parameters; ) {
120 const JLocation_t location(parameters.DUID, parameters.FLOORID, parameters.CABLEPOS);
122 if (parameters.CABLEPOS != parameters.PMTINTID) {
123 WARNING(
"PMT " << location <<
" position " << parameters.PMTINTID << endl);
126 HV[location] = parameters.HV_VALUE;
134 cout <<
"HV settings " << setw(8) << run << endl;
137 cout << i->first <<
' ' <<
FIXED(6,1) << i->second << endl;
141 JSelector selection(&JDatalogNumbers::PARAMETER_NAME,
"pmt_highvolt@");
143 selection += getSelector<JDatalogNumbers>(detid, run, run);
145 ResultSet& rs =
getResultSet(getTable<JDatalogNumbers>(), selection);
147 long long int counter = 0;
149 for (JDatalogNumbers parameters; rs >> parameters && counter != numberOfRows; ++counter) {
153 const JUPI_t upi = parameters.SOURCE_NAME;
154 const JLocation_t location = detector[upi];
156 DEBUG(location <<
' ' <<
FIXED(7,1) << HV[location] <<
' ' <<
FIXED(7,1) << parameters.DATA_VALUE << endl);
158 if (location.is_valid()) {
160 G1[location].put(parameters.getTime(), parameters.DATA_VALUE);
162 H1[location]->Fill(HV[location] - parameters.DATA_VALUE);
164 if (fabs(HV[location] - parameters.DATA_VALUE) > precision) {
165 ERROR(
"HV " << location <<
" set/read " <<
FIXED(7,1) << HV[location] <<
"/" <<
FIXED(7,1) << parameters.DATA_VALUE << endl);
179 catch(
const exception& error) {
180 FATAL(error.what() << endl);
185 ERROR(
"Alien UPI " << setw(24) << i->first <<
' ' << i->second << endl);
191 out << JGraph(i->second,
MAKE_CSTRING(
"G[" << i->first <<
"].hv"));
Utility class to parse command line options.
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
#define MAKE_CSTRING(A)
Make C-string.
Auxiliary data structure for floating point format specification.
JDetectorsHelper getDetector
Function object for mapping serial number to object identifier of detector and vice versa...
Double_t G1(const Double_t x)
Integral of method g1.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
bool is_integer(const std::string &buffer)
Check if string is an integer.
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