General and CSCDQM Framework related utility routines. More...
#include <CSCDQM_Utility.h>
Static Public Member Functions | |
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 statistics is enough. More... | |
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 expected N. More... | |
static uint32_t | fastHash (const char *data, int len) |
Calculate super fast hash (from http://www.azillionmonkeys.com/qed/hash.html) More... | |
static uint32_t | fastHash (const char *data) |
static int | getCSCTypeBin (const std::string &cstr) |
Get CSC y-axis position from chamber string. More... | |
static std::string | getCSCTypeLabel (int endcap, int station, int ring) |
Get CSC label from CSC parameters. More... | |
static int | getRUIfromDDUId (unsigned ddu_id) |
Get RUI Number from DDU source ID for post LS1 configuration. More... | |
static bool | regexMatch (const std::string &expression, const std::string &message) |
Match RegExp expression string against string message and return result. More... | |
static bool | regexMatch (const TPRegexp &re_expression, const std::string &message) |
Match RegExp expression against string message and return result. More... | |
static void | regexReplace (const std::string &expression, std::string &message, const std::string replace="") |
Replace string part that matches RegExp expression with some string. More... | |
static void | regexReplace (const TPRegexp &re_expression, std::string &message, const std::string replace="") |
Replace string part that matches RegExp expression with some string. More... | |
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. More... | |
static std::string | regexReplaceStr (const TPRegexp &re_expression, const std::string &message, const std::string replace="") |
Replace string part that matches RegExp expression with some string. More... | |
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 for "hot" elements: actual number of events have to be larger then the reference. More... | |
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 for "cold" elements: actual number of events have to be less then the reference. More... | |
static void | splitString (const std::string &str, const std::string &delim, std::vector< std::string > &results) |
Split string according to delimiter. More... | |
static int | tokenize (const std::string &str, std::vector< std::string > &tokens, const std::string &delimiters=" ") |
Break string into tokens. More... | |
static void | trimString (std::string &str) |
Trim string. More... | |
General and CSCDQM Framework related utility routines.
Definition at line 67 of file CSCDQM_Utility.h.
|
static |
Check the hypothesis that error events (n) value above threshold comparing with the expected 0 and statistics is enough.
N | Number of total events |
n | Actual (observed) number of events errors |
threshold | Rate of tolerance (<1) |
sigfail | Significance threshold for low value |
Definition at line 331 of file CSCDQM_Utility.cc.
References N, dqmiodumpmetadata::n, SignificanceLevelLow(), and remoteMonitoring_LASER_era2018_cfg::threshold.
Referenced by cscdqm::Summary::ReadErrorChambers().
|
static |
Check the hypothesis that observed events (n) value is too low or too high comparing with the expected N.
N | Expected number of events |
n | Actual (observed) number of events |
low_threshold | Rate of lower boundary of tolerance (< 1) |
high_threshold | Rate of higher boundary of tolerance (> 1) |
low_sigfail | Significance threshold for low value |
high_sigfail | Significance threshold for high value |
Definition at line 302 of file CSCDQM_Utility.cc.
References N, dqmiodumpmetadata::n, SignificanceLevelHigh(), and SignificanceLevelLow().
Referenced by cscdqm::Summary::ReadReportingChambersRef().
|
static |
Calculate super fast hash (from http://www.azillionmonkeys.com/qed/hash.html)
data | Source Data |
length | of data |
Definition at line 242 of file CSCDQM_Utility.cc.
References data, get16bits, cond::hash, and createJobs::tmp.
|
inlinestatic |
Definition at line 86 of file CSCDQM_Utility.h.
References data, and fastHash().
Referenced by fastHash().
|
static |
Get CSC y-axis position from chamber string.
cstr | Chamber string |
Definition at line 33 of file CSCDQM_Utility.cc.
Referenced by cscdqm::EventProcessor::getCSCFromMap().
|
static |
Get CSC label from CSC parameters.
endcap | Endcap number |
station | Station number |
ring | Ring number |
Definition at line 80 of file CSCDQM_Utility.cc.
References makeMuonMisalignmentScenario::endcap, label, relativeConstraints::ring, relativeConstraints::station, and AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by cscdqm::EventProcessor::getCSCFromMap().
|
static |
Get RUI Number from DDU source ID for post LS1 configuration.
ddu_id | DDI Source ID |
Definition at line 397 of file CSCDQM_Utility.cc.
References mps_fire::i, FEDNumbering::MAXCSCDDUFEDID, and FEDNumbering::MINCSCDDUFEDID.
Referenced by cscdqm::EventProcessor::processDDU(), and cscdqm::EventProcessor::processExaminer().
|
static |
Match RegExp expression string against string message and return result.
expression | RegExp expression in string to match |
message | value to check |
Definition at line 166 of file CSCDQM_Utility.cc.
References l1tGTMenu_hadr_metSeeds_cff::expression.
Referenced by CSCOfflineClient::bookMonitorObject(), CSCMonitorModule::bookMonitorObject(), cscdqm::Collection::load(), cscdqm::Configuration::needBookMO(), and cscdqm::HistoDef::processName().
|
static |
Match RegExp expression against string message and return result.
re_expression | RegExp expression to match |
message | value to check |
Definition at line 155 of file CSCDQM_Utility.cc.
|
static |
Replace string part that matches RegExp expression with some string.
expression | RegExp expression in string to match |
message | value to check |
replace | string to replace matched part |
Definition at line 177 of file CSCDQM_Utility.cc.
References l1tGTMenu_hadr_metSeeds_cff::expression, and python.rootplot.root2matplotlib::replace().
|
static |
Replace string part that matches RegExp expression with some string.
re_expression | RegExp expression to match |
message | value to check |
replace | string to replace matched part |
Definition at line 188 of file CSCDQM_Utility.cc.
References python.rootplot.root2matplotlib::replace(), and alignCSCRings::s.
|
static |
Replace string part that matches RegExp expression with some string.
expression | RegExp expression in string to match |
message | value to check |
replace | string to replace matched part |
Definition at line 203 of file CSCDQM_Utility.cc.
References l1tGTMenu_hadr_metSeeds_cff::expression, and python.rootplot.root2matplotlib::replace().
|
static |
Replace string part that matches RegExp expression with some string.
re_expression | RegExp expression to match |
message | value to check |
replace | string to replace matched part |
Definition at line 217 of file CSCDQM_Utility.cc.
References python.rootplot.root2matplotlib::replace(), and alignCSCRings::s.
|
static |
Calculate error significance alpha for the given number of events based on reference number of errors for "hot" elements: actual number of events have to be larger then the reference.
N | number of reference events |
n | number of actual events |
no - n observed, ne - n expected
Definition at line 385 of file CSCDQM_Utility.cc.
References dqm-mbProfile::log, N, dqmiodumpmetadata::n, compareTotals::ne, and mathSSE::sqrt().
Referenced by checkOccupancy().
|
static |
Calculate error significance alpha for the given number of errors based on reference number of errors for "cold" elements: actual number of events have to be less then the reference.
N | Number of events |
n | Number of errors |
eps | Rate of tolerance |
std::cout << "N = " << N << ", n = " << n << ", eps = " << eps << "\n";
Definition at line 352 of file CSCDQM_Utility.cc.
References a, b, HLT_2023v12_cff::eps, dqm-mbProfile::log, N, dqmiodumpmetadata::n, and mathSSE::sqrt().
Referenced by checkError(), and checkOccupancy().
|
static |
Split string according to delimiter.
str | String to split |
delim | Delimiter |
results | Vector to write results to |
Definition at line 122 of file CSCDQM_Utility.cc.
References mysort::results, and str.
Referenced by cscdqm::Detector::AddressFromString().
|
static |
Break string into tokens.
str | source string to break |
tokens | pointer to result vector |
delimiters | delimiter string, default " " |
Definition at line 104 of file CSCDQM_Utility.cc.
References str.
Referenced by cscdqm::Collection::book().
|
static |
Trim string.
str | string to trim |
Definition at line 136 of file CSCDQM_Utility.cc.
References str.
Referenced by cscdqm::Detector::AddressFromString().