65 {
67
68 if(
object.
IsA()->InheritsFrom(
"TH1" ) ) {
71 throw dqm_core::BadConfig( ERS_HERE,
name,
"dimension > 2 " );
72 }
73 } else {
74 throw dqm_core::BadConfig( ERS_HERE,
name,
"does not inherit from TH1" );
75 }
76
77 int binStart, binEnd;
78 int CountsTh;
80 double gmin;
81 double rmin;
82 try {
88 }
89 catch ( dqm_core::Exception & ex ) {
90 throw dqm_core::BadConfig( ERS_HERE,
name, ex.what(), ex );
91 }
92
93
95
98 if(binStart>binEnd) {
99 binStart= 1;
101 }
102 int binSize = binEnd-binStart+1;
103
106 for(
int i=0;
i<binSize;
i++) {
107 int binx = binStart+
i;
109 for ( int j = 1; j <= nbiny; ++j ) {
112 if(content>CountsTh)
count++;
113 }
114 }
115
116
117 ERS_DEBUG(1,
"Number of entries for bins is "<<
count );
118 ERS_DEBUG(1,"Green: "<< gmin << " entries; Red: " << rmin << " entries ");
119
120 dqm_core::Result*
result =
new dqm_core::Result();
121
122
123
124 if (
count >= gmin ) {
125 result->status_ = dqm_core::Result::Green;
126 }
else if (
count > rmin ) {
127 result->status_ = dqm_core::Result::Yellow;
128 } else {
129 result->status_ = dqm_core::Result::Red;
130 }
132
133
135 }
double GetFirstFromMap(const std::string &pname, const std::map< std::string, std::vector< double > > ¶ms)
double GetFromMap(const std::string &pname, const std::map< std::string, double > ¶ms)
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.