18 #ifdef CSC_RENDER_PLUGIN 82 std::ostringstream st;
107 while (std::string::npos !=
pos || std::string::npos != lastPos) {
108 tokens.push_back(
str.substr(lastPos,
pos - lastPos));
109 lastPos =
str.find_first_not_of(delimiters,
pos);
110 pos =
str.find_first_of(delimiters, lastPos);
112 return tokens.size();
125 while (std::string::npos !=
pos || std::string::npos != lastPos) {
127 lastPos =
str.find_first_not_of(delim,
pos);
128 pos =
str.find_first_of(delim, lastPos);
138 if (
pos != std::string::npos) {
140 pos =
str.find_first_not_of(
' ');
141 if (
pos != std::string::npos) {
156 TPRegexp* re =
const_cast<TPRegexp*
>(&re_expression);
157 return re->MatchB(message);
190 TPRegexp* re =
const_cast<TPRegexp*
>(&re_expression);
192 message =
static_cast<const char*
>(
s);
221 TPRegexp* re =
const_cast<TPRegexp*
>(&re_expression);
227 #if (defined(__GNUC__) && defined(__i386__)) || defined(__WATCOMC__) || defined(_MSC_VER) || defined(__BORLANDC__) || \ 229 #define get16bits(d) (*((const uint16_t*)(d))) 232 #if !defined(get16bits) 233 #define get16bits(d) ((((uint32_t)(((const uint8_t*)(d))[1])) << 8) + (uint32_t)(((const uint8_t*)(d))[0])) 246 if (len <= 0 ||
data ==
nullptr)
252 for (; len > 0; len--) {
256 data += 2 *
sizeof(uint16_t);
265 hash ^=
data[
sizeof(uint16_t)] << 18;
303 const unsigned int n,
304 const double low_threshold,
305 const double high_threshold,
306 const double low_sigfail,
307 const double high_sigfail) {
309 double eps_meas = (1.0 *
n) / (1.0 *
N);
310 if (eps_meas < low_threshold) {
314 }
else if (eps_meas > high_threshold) {
316 if (
S > high_sigfail)
333 const double eps_meas = (1.0 *
n) / (1.0 *
N);
361 double eps_meas = (1.0 *
n) / (1.0 *
N);
362 double a = 1.0,
b = 1.0;
365 for (
unsigned int r = 0; r <
n; r++)
366 a =
a * (eps_meas / l_eps);
370 for (
unsigned int r = 0; r < (
N -
n); r++)
371 b =
b * (1 - eps_meas) / (1 - l_eps);
389 double no = 1.0 *
n,
ne = 1.0 *
N;
399 const unsigned postLS1_map[] = {841, 842, 843, 844, 845, 846, 847, 848, 849, 831, 832, 833,
400 834, 835, 836, 837, 838, 839, 861, 862, 863, 864, 865, 866,
401 867, 868, 869, 851, 852, 853, 854, 855, 856, 857, 858, 859};
403 for (
int i = 0;
i < 36;
i++) {
404 if (ddu_id == postLS1_map[
i]) {
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...
def replace(string, replacements)
static bool regexMatch(const std::string &expression, const std::string &message)
Match RegExp expression string against string message and return result.
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.
static std::string getCSCTypeLabel(int endcap, int station, int ring)
Get CSC label from CSC parameters.
static int getCSCTypeBin(const std::string &cstr)
Get CSC y-axis position from chamber string.
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...
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.