20 #include "dqm_core/exceptions.h"
21 #include "dqm_core/AlgorithmConfig.h"
23 #include "dqm_core/AlgorithmManager.h"
24 #include "dqm_core/Result.h"
61 execute(
const std::string&
name,
const TObject&
object,
const dqm_core::AlgorithmConfig&
config)
65 if(
object.
IsA()->InheritsFrom(
"TH1" ) ) {
68 throw dqm_core::BadConfig( ERS_HERE,
name,
"dimension > 2 " );
71 throw dqm_core::BadConfig( ERS_HERE,
name,
"does not inherit from TH1" );
85 catch ( dqm_core::Exception & ex ) {
86 throw dqm_core::BadConfig( ERS_HERE,
name, ex.what(), ex );
100 int binSize = binEnd-binStart+1;
102 std::vector<double>
contents(binSize);
104 for(
int i=0;
i<binSize;
i++) {
105 int binx = binStart+
i;
107 for (
int j = 1; j <= nbiny; ++j ) {
114 ERS_DEBUG(1,
"Number of entries for bins is "
116 ERS_DEBUG(1,
"Green: "<< gmin <<
" entries; Red: " << rmin <<
" entries ");
122 for(
int i=0;
i<binSize;
i++) {
125 if(binStart+
i==0) sprintf(
tag,
"Underflows");
126 else if(binStart+
i==nbinx+1) sprintf(
tag,
"Overflows");
134 char *mylabel=
new char[
l+1];
139 if (mylabel[0]!=0) sprintf(
tag,
"%s",mylabel);
140 else sprintf(
tag,
"Bin%d",binStart+
i);
143 else sprintf(
tag,
"Bin%d",binStart+
i);
145 else sprintf(
tag,
"Bin%d",binStart+
i);
150 for(
int i=0;
i<binSize;
i++) {
152 if(binStart+
i==0) sprintf(
tag,
"Underflows");
153 else if(binStart+
i==nbinx+1) sprintf(
tag,
"Overflows");
154 else sprintf(
tag,
"Bin%d",binStart+
i);
160 if (
count <= gmin ) {
162 }
else if (
count > rmin ) {
165 result->status_ = dqm_core::Result::Yellow;
171 for(
int i=0;
i<binSize;
i++) {
174 if (
count <= gmin ) {
176 }
else if (
count > rmin ) {
179 result->status_ = dqm_core::Result::Yellow;
185 for(
int i=0;
i<binSize;
i++) {
188 if (
count <= gmin ) {
190 }
else if (
count > rmin ) {
193 result->status_ = dqm_core::Result::Yellow;
209 message +=
"Description: Check the number of entries in listed bins\n";
210 message +=
"Parameters: BinStart first bin to be checked (0=underflows)\n";
211 message +=
" BinEnd last bin to be checked (nbin+1=overflows)\n";
212 message +=
" Method=0 check is performed on bin sum\n";
213 message +=
" Method<0 check is performed on lowest bin\n";
214 message +=
" Method>0 check is performed on highest bin\n";
215 message +=
" Nentries Green/Red minimums";