49{
50 using namespace std;
51
53
54 if(
object.
IsA()->InheritsFrom(
"TH1" )) {
56 if (
hist->GetDimension() > 1 ){
57 throw dqm_core::BadConfig( ERS_HERE, name, "dimension > 1 " );
58 }
59 } else {
60 throw dqm_core::BadConfig( ERS_HERE, name, "does not inherit from TH1" );
61 }
62
63
65
66 try {
68 }
69 catch ( dqm_core::Exception & ex ) {
70 throw dqm_core::BadConfig( ERS_HERE, name, ex.what(), ex );
71 }
72
73
74 dqm_core::Result*
result =
new dqm_core::Result();
75 std::map<std::string,double>
tags;
76
77
78 result->status_ = dqm_core::Result::Green;
79 int nbinsx =
hist->GetXaxis()->GetNbins();
80 int badBins = 0;
81
82 for(int iBin = 1; iBin <= nbinsx-1; ++iBin)
83 {
84
85 if(
hist->GetBinContent(iBin) > threshold &&
hist->GetBinLowEdge(iBin) *
hist->GetBinLowEdge(iBin+1) > 0 )
86 {
87 result->status_ = dqm_core::Result::Red;
88 ++ badBins;
89 }
90 }
91 tags[
"# Bad bins"] = badBins;
92
93
95
96
98}
std::vector< std::string > tags
#define IsA
Declare the TObject style functions.