20 #include "dqm_core/exceptions.h"
21 #include "dqm_core/AlgorithmConfig.h"
22 #include "dqm_core/AlgorithmManager.h"
23 #include "dqm_core/Result.h"
38 : m_name(
"MDTpercent_under_thresh")
61 if(
object.
IsA()->InheritsFrom(
"TH1" ) ) {
63 if (
hist->GetDimension() >= 2 ){
64 throw dqm_core::BadConfig( ERS_HERE,
name,
"dimension >= 2 " );
67 throw dqm_core::BadConfig( ERS_HERE,
name,
"does not inherit from TH1" );
81 catch ( dqm_core::Exception & ex ) {
82 throw dqm_core::BadConfig( ERS_HERE,
name, ex.what(), ex );
86 if (
hist->GetEntries() < minstat ) {
87 ERS_INFO(
"Histogram does not satisfy MinStat requirement " <<
hist->GetName());
89 result->tags_[
"InsufficientEntries"] =
hist->GetEntries();
92 ERS_DEBUG(1,
"Statistics: "<<
hist->GetEntries()<<
" entries ");
96 Double_t hit_under_th=0;
98 Double_t
N =
hist->GetEntries();
102 result->tags_[
"Empty_Histogram_found_N_Entries"] =
N;
111 if(
i>
hist->GetNbinsX()){
113 result->tags_[
"Config_error_maximum_bin_exceed_looking_for_bin_number"] =
i;
117 hit_under_th +=
hist->GetBinContent(
i);
130 else if( percent <greenTh && percent>redTh ) {
131 result->status_ = dqm_core::Result::Yellow;
147 message +=
"Description: Compute the percent of entries above a threshold and and compare it with user defined green and red Threshold\n";
148 message +=
"Mandatory Parameters: Green/Red Threshold: Percent: Percent of the entries above threshold requested";
149 message +=
"Optional Parameters: MinStat = Minimum histogram statistics needed to perform Algorithm\n";
150 message +=
" thresh = threshold\n";