79 JParser<> zap(
"Auxiliary program to convert slow control data from the database to ROOT TTree.");
91 zap[
'P'] =
make_field(prescale,
"Prescale sampling of data") = 1;
98 catch(
const exception &error) {
104 if (
runs.getUpperLimit() <
runs.getLowerLimit()) {
105 runs.setUpperLimit(
runs.getLowerLimit());
153 DEBUG(
"Number of integrated products (before) " << right <<
detector.size() <<
endl);
157 DEBUG(
"Number of integrated products (after) " << right <<
detector.size() <<
endl);
166 for (
JAllParams parameters; rs >> parameters; ) {
173 if (
to_upper(parameters.TYPE) ==
"INTEGER" && parameters.INTEGER_UNIT_SCALE > 0.0) {
174 unit[
to_upper(parameters.NAME)] = parameters.INTEGER_UNIT_SCALE;
185 runs.getLowerLimit(),
186 runs.getUpperLimit());
190 long long int counter = 0;
196 const JUPI_t upi = parameters.SOURCE_NAME;
213 if (TString(parameters.PARAMETER_NAME).Contains(
regexp)) {
221 if (location.
string >= (
int) data.size()) {
222 data.resize(location.
string + 1);
225 if (location.
floor >= (
int) data[location.
string].size()) {
229 string buffer = parameters.PARAMETER_NAME;
231 if (
locate.count(buffer) != 0) {
235 JGraph_t&
g1 = data[location.
string][location.
floor][buffer];
244 errors[parameters.PARAMETER_NAME] += 1;
255 parameters.PARAMETER_NAME,
257 parameters.DATA_VALUE * factor));
261 g1.put(parameters.getTime(), parameters.DATA_VALUE * factor);
268 warnings[parameters.PARAMETER_NAME] += 1;
274 catch(
const exception& error) {
280 cout <<
endl <<
"Parameters without location in detector." <<
endl;
283 cout << left <<
setw(48) << i->first <<
' ' <<
setw(6) << i->second <<
endl;
292 cout << left <<
setw(48) << i->first <<
' ' <<
setw(6) << i->second <<
endl;
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) {
304 const JRange<double> range(i->second.Y.begin(), i->second.Y.end());
306 g1.SetMinimum(range.getLowerLimit());
307 g1.SetMaximum(range.getUpperLimit());
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;
323 os <<
"set_variable FIRST_FLOOR " <<
setw(4) << *
floors. begin() <<
";" <<
endl;
324 os <<
"set_variable LAST_FLOOR " <<
setw(4) << *
floors. rbegin() <<
";" <<
endl;
326 os <<
"set_array STRINGS ";
ROOT TTree parameter settings.
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Recording of objects on file according a format that follows from the file name extension.
General purpose messaging.
#define DEBUG(A)
Message macros.
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
I/O formatting auxiliaries.
#define MAKE_CSTRING(A)
Make C-string.
#define MAKE_STRING(A)
Make string.
Double_t g1(const Double_t x)
Function.
Auxiliary class to define a range between two values.
int main(int argc, char **argv)
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.
JLocation_t getLocation(const JUPI_t &upi) const
Get location of product with given UPI.
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.