19 #ifndef CSCDQM_Utility_H
20 #define CSCDQM_Utility_H
30 #ifndef CSC_RENDER_PLUGIN
31 #include <xercesc/util/XMLString.hpp>
48 std::ostringstream st;
63 std::istringstream iss(s);
64 return !(iss >>
f >>
t).
fail();
90 static short checkOccupancy(
const unsigned int N,
const unsigned int n,
const double low_threshold,
const double high_threshold,
const double low_sigfail,
const double high_sigfail);
91 static bool checkError(
const unsigned int N,
const unsigned int n,
const double threshold,
const double sigfail);
100 #ifndef CSC_RENDER_PLUGIN
102 #define XERCES_TRANSCODE(str) cscdqm::XercesStringTranscoder(str).unicodeForm()
114 fUnicodeForm = XERCES_CPP_NAMESPACE::XMLString::transcode(toTranscode);
static void splitString(const std::string &str, const std::string &delim, std::vector< std::string > &results)
Split string according to delimiter.
static double SignificanceLevelHigh(const unsigned int N, const unsigned int n)
Calculate error significance alpha for the given number of events based on reference number of errors...
static std::string regexReplaceStr(const std::string &expression, const std::string &message, const std::string replace="")
Replace string part that matches RegExp expression with some string.
static int getRUIfromDDUId(unsigned ddu_id)
Get RUI Number from DDU source ID for post LS1 configuration.
static double SignificanceLevelLow(const unsigned int N, const unsigned int n, const double eps)
Calculate error significance alpha for the given number of errors based on reference number of errors...
static bool regexMatch(const std::string &expression, const std::string &message)
Match RegExp expression string against string message and return result.
General and CSCDQM Framework related utility routines.
static bool checkError(const unsigned int N, const unsigned int n, const double threshold, const double sigfail)
Check the hypothesis that error events (n) value above threshold comparing with the expected 0 and st...
static uint32_t fastHash(const char *data, int len)
Calculate super fast hash (from http://www.azillionmonkeys.com/qed/hash.html)
static void trimString(std::string &str)
Trim string.
This is a simple class that lets us do easy (though not terribly efficient) trancoding of char* data ...
~XercesStringTranscoder()
const std::string toString(T &t)
Converting from whatever to string (failsafe!)
static std::string getCSCTypeLabel(int endcap, int station, int ring)
Get CSC label from CSC parameters.
static uint32_t fastHash(const char *data)
static int getCSCTypeBin(const std::string &cstr)
Get CSC y-axis position from chamber string.
const XMLCh * unicodeForm() const
static short checkOccupancy(const unsigned int N, const unsigned int n, const double low_threshold, const double high_threshold, const double low_sigfail, const double high_sigfail)
Check the hypothesis that observed events (n) value is too low or too high comparing with the expecte...
XercesStringTranscoder(const char *const toTranscode)
char data[epos_bytes_allocation]
static void regexReplace(const std::string &expression, std::string &message, const std::string replace="")
Replace string part that matches RegExp expression with some string.
static int tokenize(const std::string &str, std::vector< std::string > &tokens, const std::string &delimiters=" ")
Break string into tokens.
bool stringToNumber(T &t, const std::string &s, std::ios_base &(*f)(std::ios_base &))
Converting from string to whatever number (failsafe!)