Jpp  16.0.3
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JRunQuality.cc
Go to the documentation of this file.
1 #include <string>
2 #include <exception>
3 
6 #include "JLang/JNullStream.hh"
7 #include "JLang/JLangToolkit.hh"
8 
10 #include "JROOT/JRootStreamer.hh"
11 
12 #include "JDB/JDB.hh"
13 #include "JDB/JDBToolkit.hh"
14 #include "JDB/JRunQuality.hh"
15 
16 
17 namespace JDATABASE {
18 
19  /**
20  * Put value at given key.
21  *
22  * \param key key
23  * \param value value
24  */
25  void JRunQuality::put(const std::string& key,
26  const std::string& value)
27  {
28  using namespace std;
29  using namespace JPP;
30 
31  const JEquationParameters parameters(":", "\n", "", "");
32 
33  JRootReader reader(null, parameters, JRootDictionary::getInstance());
34  JRootReadableClass cls(*this);
35 
36  const string buffer = replace(key, "-", "_");
37 
38  for (string::size_type il = 0, ir = 0; ir != string::npos && cls.is_valid(); il = ir + 1) {
39  ir = buffer.substr(il).find(parameters.getDefaultDivision());
40  cls = cls.find(buffer.substr(il, ir - il).c_str());
41  }
42 
43  if (cls.is_valid()) {
44 
45  JRedirectString redirect(reader, value);
46 
47  reader.getObject(cls);
48  }
49  }
50 }
TString replace(const TString &target, const TRegexp &regexp, const T &replacement)
Replace regular expression in input by given replacement.
Definition: JPrintResult.cc:63
*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
Definition: diff-Tuna.sh:38
Implementation for ASCII input of objects with ROOT dictionary.
ASCII I/O of objects with ROOT dictionary.
T & getInstance(const T &object)
Get static instance from temporary object.
Definition: JObject.hh:75
JRootReader & getObject(T &object)
Read object.
std::string JPP
Jpp version used to take data (see JPrintMeta.cc)
Definition: JRunQuality.hh:119
void put(const std::string &key, const std::string &value)
Put value at given key.
Definition: JRunQuality.cc:25
esac $JPP_BIN JLogger sh $LOGGER until pgrep JGetMessage</dev/null > dev null