62{
64
65 if(
object.
IsA()->InheritsFrom(
"TH1" ) ) {
68 throw dqm_core::BadConfig( ERS_HERE, name, "dimension > 2 " );
69 }
70 } else {
71 throw dqm_core::BadConfig( ERS_HERE, name, "does not inherit from TH1" );
72 }
73
74 int binStart, binEnd;
76 double gmin;
77 double rmin;
78 try {
84 }
85 catch ( dqm_core::Exception & ex ) {
86 throw dqm_core::BadConfig( ERS_HERE, name, ex.what(), ex );
87 }
88
89 if (rmin < gmin) {
91 }
92
96 if(binStart>binEnd) {
97 binStart= 1;
99 }
100 int binSize = binEnd-binStart+1;
101
102 std::vector<double>
contents(binSize);
103
104 for(
int i=0;
i<binSize;
i++) {
105 int binx = binStart+
i;
107 for ( int j = 1; j <= nbiny; ++j ) {
111 }
112 }
113
114 ERS_DEBUG(1,"Number of entries for bins is "
116 ERS_DEBUG(1,"Green: "<< gmin << " entries; Red: " << rmin << " entries ");
117
118
120 dqm_core::Result*
result =
new dqm_core::Result();
121 if(axis) {
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");
127 else {
129
132 int j=0;
133
134 char *mylabel=
new char[
l+1];
135 if(mylabel) {
138 mylabel[j]='\0';
139 if (mylabel[0]!=0) sprintf(tag,"%s",mylabel);
140 else sprintf(tag,"Bin%d",binStart+i);
141 delete[] mylabel;
142 }
143 else sprintf(tag,"Bin%d",binStart+i);
144 }
145 else sprintf(tag,"Bin%d",binStart+i);
146 }
148 }
149 } else {
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);
156 }
157 }
158
159 if(method==0) {
160 if (
count <= gmin ) {
161 result->status_ = dqm_core::Result::Green;
162 }
else if (
count > rmin ) {
163 result->status_ = dqm_core::Result::Red;
164 } else {
165 result->status_ = dqm_core::Result::Yellow;
166 }
168 }
169 else if(method>0) {
171 for(
int i=0;
i<binSize;
i++) {
173 }
174 if (
count <= gmin ) {
175 result->status_ = dqm_core::Result::Green;
176 }
else if (
count > rmin ) {
177 result->status_ = dqm_core::Result::Red;
178 } else {
179 result->status_ = dqm_core::Result::Yellow;
180 }
182 }
183 else if(method<0) {
185 for(
int i=0;
i<binSize;
i++) {
187 }
188 if (
count <= gmin ) {
189 result->status_ = dqm_core::Result::Green;
190 }
else if (
count > rmin ) {
191 result->status_ = dqm_core::Result::Red;
192 } else {
193 result->status_ = dqm_core::Result::Yellow;
194 }
196 }
197
199}
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
std::string label(const std::string &format, int i)
l
Printing final latex table to .tex output file.
void swap(ElementLinkVector< DOBJ > &lhs, ElementLinkVector< DOBJ > &rhs)
#define IsA
Declare the TObject style functions.