50{
53
55
58 string usr;
61 string detid;
66 int prescale;
70
76
77 try {
78
79 JParser<> zap(
"Auxiliary program to convert slow control data from the database to ROOT TTree.");
80
91 zap[
'P'] =
make_field(prescale,
"Prescale sampling of data") = 1;
95
97 }
98 catch(const exception &error) {
100 }
101
103
104 if (
runs.getUpperLimit() <
runs.getLowerLimit()) {
105 runs.setUpperLimit(
runs.getLowerLimit());
106 }
107
108 if (prescale < 1) {
110 prescale = 1;
111 }
112
113
115
121
124
128
130
133 }
134
135 try {
136
138
140
142
143 {
145
147
150 }
151 }
152
153 DEBUG(
"Number of integrated products (before) " << right <<
detector.size() <<
endl);
154
156
157 DEBUG(
"Number of integrated products (after) " << right <<
detector.size() <<
endl);
158
160
161 {
163
165
166 for (
JAllParams parameters; rs >> parameters; ) {
167
168
169
170
171
172
173 if (
to_upper(parameters.TYPE) ==
"INTEGER" && parameters.INTEGER_UNIT_SCALE > 0.0) {
174 unit[
to_upper(parameters.NAME)] = parameters.INTEGER_UNIT_SCALE;
175 }
176 }
177
178 rs.Close();
179 }
180
181 {
183
185 runs.getLowerLimit(),
186 runs.getUpperLimit());
187
189
190 long long int counter = 0;
191
193
195
196 const JUPI_t upi = parameters.SOURCE_NAME;
198
200
203
204 bool status = true;
205
207
208 if (*i != "") {
209
212
213 if (TString(parameters.PARAMETER_NAME).Contains(
regexp)) {
215 }
216 }
217 }
218
219 if (status) {
220
223 }
224
227 }
228
229 string buffer = parameters.PARAMETER_NAME;
230
231 if (
locate.count(buffer) != 0) {
233 }
234
236
237 double factor = 1.0;
238
240
242 factor = p->second;
243 else
244 errors[parameters.PARAMETER_NAME] += 1;
245
246
248
250
255 parameters.PARAMETER_NAME,
256 parameters.UNIXTIME,
257 parameters.DATA_VALUE * factor));
258
259 } else {
260
261 g1.put(parameters.getTime(), parameters.DATA_VALUE * factor);
262 }
263 }
264 }
265
266 } else {
267
268 warnings[parameters.PARAMETER_NAME] += 1;
269 }
270 }
272 }
273 }
274 catch(const exception& error) {
276 }
277
279
280 cout <<
endl <<
"Parameters without location in detector." <<
endl;
281
283 cout << left <<
setw(48) << i->first <<
' ' <<
setw(6) << i->second <<
endl;
284 }
285 }
286
288
290
292 cout << left <<
setw(48) << i->first <<
' ' <<
setw(6) << i->second <<
endl;
293 }
294 }
295
297
298 for (
size_t string = 0;
string !=
data.size(); ++string) {
299 for (
size_t floor = 0; floor !=
data[string].size(); ++floor) {
300 for (map_type::iterator i = data[
string][floor].begin(); i !=
data[string][floor].end(); ++i) {
301
303
304 const JRange<double> range(i->second.Y.begin(), i->second.Y.end());
305
306 g1.SetMinimum(range.getLowerLimit());
307 g1.SetMaximum(range.getUpperLimit());
308
310 }
311 }
312 }
313
314 ostringstream os;
315
316 os <<
"set_variable NUMBER_OF_STRINGS " <<
setw(4) << strings.size() <<
";" <<
endl;
317 os <<
"set_variable NUMBER_OF_FLOORS " <<
setw(4) <<
floors. size() <<
";" <<
endl;
318 if (!strings.empty()) {
319 os <<
"set_variable FIRST_STRING " <<
setw(4) << *strings. begin() <<
";" <<
endl;
320 os <<
"set_variable LAST_STRING " <<
setw(4) << *strings.rbegin() <<
";" <<
endl;
321 }
323 os <<
"set_variable FIRST_FLOOR " <<
setw(4) << *
floors. begin() <<
";" <<
endl;
324 os <<
"set_variable LAST_FLOOR " <<
setw(4) << *
floors. rbegin() <<
";" <<
endl;
325 }
326 os << "set_array STRINGS ";
329
331 }
332
334}
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
#define DEBUG(A)
Message macros.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
#define MAKE_CSTRING(A)
Make C-string.
#define MAKE_STRING(A)
Make string.
Double_t g1(const Double_t x)
Function.
Auxiliary class for specifying selection of database data.
Template definition of a multi-dimensional oscillation probability interpolation table.
void copy(const Head &from, JHead &to)
Copy header from from to to.
static const JPBSSequences CLB_SEQUENCES
PBS sequences for central-logic board.
ResultSet & getResultSet(const std::string &query)
Get result set.
std::vector< JServer > getServernames()
Get list of names of available database servers.
std::string to_upper(const std::string &value)
Convert all character to upper case.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
std::map< int, range_type > map_type
Auxiliary data structure for sequence of same character.
Type definition of range.
Auxiliary data structure for location of product in detector.
int string
position in detector
int floor
position in string
int position
position in floor
Auxiliary class to map UPI to location in detector.
Wrapper class for server name.
Universal product identifier (UPI).
Auxiliary data structure for streaming of STL containers.
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Auxiliary data structure to build TGraph.