57 {
59
60 if(
object.
IsA()->InheritsFrom(
"TH1" ) ) {
63 throw dqm_core::BadConfig( ERS_HERE, name, "dimension > 2 " );
64 }
65 } else {
66 throw dqm_core::BadConfig( ERS_HERE, name, "does not inherit from TH1" );
67 }
68
69 int binStart, binEnd;
70 int CountsTh;
71 double gmin;
72 double rmin;
73 try {
79 }
80 catch ( dqm_core::Exception & ex ) {
81 throw dqm_core::BadConfig( ERS_HERE, name, ex.what(), ex );
82 }
83
84
86
88 if(binStart>binEnd) {
89 binStart= 1;
91 }
92 int binSize = binEnd-binStart+1;
93
96 for(
int i=0;
i<binSize;
i++) {
97 int binx = binStart+
i;
99 for ( int j = 1; j <= nbiny; ++j ) {
102 if(content>CountsTh)
count++;
103 }
104 }
105
106
107 ERS_DEBUG(1,
"Number of entries for bins is "<<
count );
108 ERS_DEBUG(1,"Green: "<< gmin << " entries; Red: " << rmin << " entries ");
109
110 dqm_core::Result*
result =
new dqm_core::Result();
111
112
113
114 if (
count >= gmin ) {
115 result->status_ = dqm_core::Result::Green;
116 }
else if (
count > rmin ) {
117 result->status_ = dqm_core::Result::Yellow;
118 } else {
119 result->status_ = dqm_core::Result::Red;
120 }
122
123
125 }
void contents(std::vector< std::string > &keys, TDirectory *td, const std::string &directory, const std::string &pattern, const std::string &path)
int count(std::string s, const std::string ®x)
count how many occurances of a regx are in a string
#define IsA
Declare the TObject style functions.