38 double averageBinContent,
double lastBinContent)
const {
40 const char* actionPath = std::getenv(
"TILE_DQ_ACTION_PATH");
41 if (actionPath !=
nullptr) action = std::string(actionPath) +
"/" + action;
44 std::regex expression (
".*([LE]B[AC]\\d\\d).*");
46 std::string module(
"UNKNOWN");
47 if (std::regex_search(histogramName,
match, expression) &&
match.size() > 1) {
48 module = match.str(1);
52 action += histogramName;
56 action += std::to_string(lastBinContent);
58 action += std::to_string(averageBinContent);
60 std::system(action.c_str());
80 const TObject&
object,
81 const dqm_core::AlgorithmConfig& config )
85 if(
object.
IsA()->InheritsFrom(
"TProfile" ) ) {
86 histogram =
static_cast<const TProfile*
>(&object);
88 throw dqm_core::BadConfig( ERS_HERE, name,
"dimension > 2 " );
91 throw dqm_core::BadConfig( ERS_HERE, name,
"does not inherit from TProfile" );
102 std::string action(
"");
103 std::map<std::string, std::string>::const_iterator itAction = config.getGenericParameters().find(actionStr);
104 if (itAction != config.getGenericParameters().end()) {
105 action = itAction->second;
108 if (
histogram->GetEntries() < minStat ) {
109 dqm_core::Result *result =
new dqm_core::Result(dqm_core::Result::Undefined);
110 result->tags_[
"InsufficientEntries"] =
histogram->GetEntries();
115 double greenThreshold;
121 }
catch ( dqm_core::Exception & ex ) {
122 throw dqm_core::BadConfig( ERS_HERE, name, ex.what(), ex );
125 dqm_core::Result* result =
new dqm_core::Result();
127 int nBinsOverThreshold = 0;
132 if (nBinsToWatch > 0) {
133 while ((
histogram->GetBinEntries(lastBin) == 0) && (lastBin > 1)) --lastBin;
134 firstBin = (lastBin > nBinsToWatch) ? (lastBin - nBinsToWatch + 1) : 1;
136 result->tags_[
"LastBinNumber"] = lastBin;
137 result->tags_[
"LastBinCenter"] =
histogram->GetBinCenter(lastBin);
140 double lastBinOverThresholdContent(0.0);
141 double binsOverThresholdContent(0.0);
143 for (
int bin = firstBin;
bin <= lastBin; ++
bin) {
144 if (ignoreEmpty && (
histogram->GetBinEntries(
bin) == 0)) {
148 if (
m_exceeds(content, binThreshold, fixedError)) {
149 ++nBinsOverThreshold;
150 lastBinOverThresholdContent = content;
151 binsOverThresholdContent += content;
152 if (publish && nBinsOverThreshold < maxPublish){
158 ERS_DEBUG(1,
"Number of bins exceeded threshold of " << binThreshold <<
" is " << nBinsOverThreshold );
159 ERS_DEBUG(1,
"Green threshold: "<< greenThreshold <<
" bin(s); Red threshold : " << redThreshold <<
" bin(s) ");
161 result->tags_[
"NBins"] = nBinsOverThreshold;
162 if (greenThreshold > redThreshold) {
163 if (nBinsOverThreshold >= greenThreshold) {
164 result->status_ = dqm_core::Result::Green;
165 }
else if (nBinsOverThreshold > redThreshold) {
166 result->status_ = dqm_core::Result::Yellow;
168 result->status_ = dqm_core::Result::Red;
171 if (nBinsOverThreshold <= greenThreshold) {
172 result->status_ = dqm_core::Result::Green;
173 }
else if (nBinsOverThreshold < redThreshold) {
174 result->status_ = dqm_core::Result::Yellow;
176 result->status_ = dqm_core::Result::Red;
180 if (!action.empty() && nBinsOverThreshold >= nBinsForAction && nBinsOverThreshold!=0) {
181 double averageBinContent = binsOverThresholdContent / nBinsOverThreshold;