31{
34
36 string usr;
39 string detid;
40 int run;
42 string formula;
44
45 try {
46
47 JParser<> zap(
"Auxiliary program to set PMT thresholds according DAQ configuration of a given data taking run.");
48
56 zap[
'F'] =
make_field(formula,
"transfer function") =
"((x * 1.0)/255.0 * 1.6 + 0.8 - 0.989) / 0.44";
58
60 }
61 catch(const exception& error) {
63 }
64
65
67
70 }
71
72
73 TF1 f1("user", formula.c_str());
74
75 if (!f1.IsValid()) {
76 FATAL(
"Formula <" << formula <<
"> invalid." <<
endl);
77 }
78
79
81
84
85
86 try {
87
89
91
93
95
97
100 }
101
102 rs.Close();
103 }
104 catch(const exception& error) {
106 }
107
108
110
111 if (i->PMTID != -1) {
112
113 try {
114
115 const JPMTThreshold::result_type threshold =
getPMTThreshold(i->PMTUPI);
116
117 const double value = f1.Eval((double) threshold.value);
118
119 if (
debug >= debug_t) {
120
122 <<
FILL(2,
'0') << i->FLOORID <<
FILL() <<
'['
123 <<
FILL(2,
'0') << i->CABLEPOS <<
FILL() <<
']'
124 << ' '
125 <<
setw(3) << threshold.value <<
' '
126 <<
FIXED(5,2) << value <<
' ';
127
128 if (threshold.is_default) {
130 }
131
133 }
134
135 if (!threshold.is_default) {
136
138
139 parameters[id].threshold = value;
140 }
141 }
142 catch(const exception& error) {
144 <<
FILL(4,
'0') << i->DUID <<
FILL() <<
'.'
145 <<
FILL(2,
'0') << i->FLOORID <<
FILL() <<
'['
146 <<
FILL(2,
'0') << i->CABLEPOS <<
FILL() <<
']'
147 << ' '
148 << error.what() <<
endl);
149 }
150 }
151 }
152
154
156
157 parameters.store(
pmtFile.c_str());
158
159 } else {
160
162 }
163}
#define DEBUG(A)
Message macros.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Auxiliary class for PMT thresholds.
Auxiliary class for map of PMT parameters.
Data structure for PMT parameters.
double threshold
threshold [npe]
Template definition of a multi-dimensional oscillation probability interpolation table.
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.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary data structure for sequence of same character.
Auxiliary data structure for floating point format specification.
Wrapper class for server name.
void load(const char *file_name)
Load from input file.