37 double averageBinContent,
double lastBinContent)
const {
39 const char* actionPath = std::getenv(
"TILE_DQ_ACTION_PATH");
40 if (actionPath !=
nullptr) action = std::string(actionPath) +
"/" + action;
43 std::regex expression (
".*([LE]B[AC]\\d\\d).*");
45 std::string module(
"UNKNOWN");
46 if (std::regex_search(histogramName,
match, expression) &&
match.size() > 1) {
47 module = match.str(1);
51 action += histogramName;
55 action += std::to_string(lastBinContent);
57 action += std::to_string(averageBinContent);
59 std::system(action.c_str());
79 const TObject&
object,
80 const dqm_core::AlgorithmConfig&
config )
84 if(
object.
IsA()->InheritsFrom(
"TProfile" ) ) {
87 throw dqm_core::BadConfig( ERS_HERE, name,
"dimension > 2 " );
90 throw dqm_core::BadConfig( ERS_HERE, name,
"does not inherit from TProfile" );
101 std::string action(
"");
102 std::map<std::string, std::string>::const_iterator itAction =
config.getGenericParameters().find(
"Action");
103 if (itAction !=
config.getGenericParameters().end()) {
104 action = itAction->second;
107 if (
histogram->GetEntries() < minStat ) {
108 dqm_core::Result *
result =
new dqm_core::Result(dqm_core::Result::Undefined);
114 double greenThreshold;
120 }
catch ( dqm_core::Exception & ex ) {
121 throw dqm_core::BadConfig( ERS_HERE, name, ex.what(), ex );
124 dqm_core::Result*
result =
new dqm_core::Result();
126 int nBinsOverThreshold = 0;
131 if (nBinsToWatch > 0) {
132 while ((
histogram->GetBinEntries(lastBin) == 0) && (lastBin > 1)) --lastBin;
133 firstBin = (lastBin > nBinsToWatch) ? (lastBin - nBinsToWatch + 1) : 1;
135 result->tags_[
"LastBinNumber"] = lastBin;
139 double lastBinOverThresholdContent(0.0);
140 double binsOverThresholdContent(0.0);
142 for (
int bin = firstBin;
bin <= lastBin; ++
bin) {
143 if (ignoreEmpty && (
histogram->GetBinEntries(
bin) == 0)) {
147 if (
m_exceeds(content, binThreshold, fixedError)) {
148 ++nBinsOverThreshold;
149 lastBinOverThresholdContent = content;
150 binsOverThresholdContent += content;
151 if (publish && nBinsOverThreshold < maxPublish){
157 ERS_DEBUG(1,
"Number of bins exceeded threshold of " << binThreshold <<
" is " << nBinsOverThreshold );
158 ERS_DEBUG(1,
"Green threshold: "<< greenThreshold <<
" bin(s); Red threshold : " << redThreshold <<
" bin(s) ");
160 result->tags_[
"NBins"] = nBinsOverThreshold;
161 if (greenThreshold > redThreshold) {
162 if (nBinsOverThreshold >= greenThreshold) {
163 result->status_ = dqm_core::Result::Green;
164 }
else if (nBinsOverThreshold > redThreshold) {
165 result->status_ = dqm_core::Result::Yellow;
167 result->status_ = dqm_core::Result::Red;
170 if (nBinsOverThreshold <= greenThreshold) {
171 result->status_ = dqm_core::Result::Green;
172 }
else if (nBinsOverThreshold < redThreshold) {
173 result->status_ = dqm_core::Result::Yellow;
175 result->status_ = dqm_core::Result::Red;
179 if (!action.empty() && nBinsOverThreshold >= nBinsForAction && nBinsOverThreshold!=0) {
180 double averageBinContent = binsOverThresholdContent / nBinsOverThreshold;