49{
51
52 if(
object.
IsA()->InheritsFrom(
"TH1" ) ) {
55 throw dqm_core::BadConfig( ERS_HERE, name, "dimension > 3 " );
56 }
57 } else {
58 throw dqm_core::BadConfig( ERS_HERE, name, "does not inherit from TH1" );
59 }
60
62
64 dqm_core::Result *
result =
new dqm_core::Result(dqm_core::Result::Undefined);
67 }
68
69 if (
m_name ==
"Histogram_Not_Empty") {
71 ERS_DEBUG(1,
"Histogram " <<
histogram->GetName()<<
" is Not Empty");
72 return new dqm_core::Result(dqm_core::Result::Green);
73 }else {
74 ERS_DEBUG(1,
"Histogram " <<
histogram->GetName()<<
" is Empty");
75 return new dqm_core::Result(dqm_core::Result::Red);
76 }
77 }
else if (
m_name ==
"No_OverFlows" ) {
78 const unsigned int binsx =
histogram->GetNbinsX()+1;
79 const unsigned int binsy =
histogram->GetNbinsY()+1;
80 const unsigned int binsz =
histogram->GetNbinsZ()+1;
82 case 1:
83 if (
histogram->GetBinContent(binsx) != 0) {
84 ERS_DEBUG(1,
"Histogram " <<
histogram->GetName()<<
" has OverFlows X");
85 return new dqm_core::Result(dqm_core::Result::Red);
86 }
87 break;
88 case 2:
89 for (
unsigned int i(0);
i <= binsx; ++
i)
90 if (
histogram->GetBinContent(i,binsy) != 0) {
91 ERS_DEBUG(1,
"Histogram " <<
histogram->GetName()<<
" has OverFlows Y");
92 return new dqm_core::Result(dqm_core::Result::Red);
93 }
94 for (
unsigned int i(0);
i <= binsy; ++
i)
95 if (
histogram->GetBinContent(binsx,i) != 0) {
96 ERS_DEBUG(1,
"Histogram " <<
histogram->GetName()<<
" has OverFlows X");
97 return new dqm_core::Result(dqm_core::Result::Red);
98 }
99 break;
100 case 3:
101 for (
unsigned int i(0);
i <= binsx; ++
i)
102 for (unsigned int j(0); j <= binsy; ++j)
103 if (
histogram->GetBinContent(i,j,binsz) != 0) {
104 ERS_DEBUG(1,
"Histogram " <<
histogram->GetName()<<
" has OverFlows Z");
105 return new dqm_core::Result(dqm_core::Result::Red);
106 }
107 for (
unsigned int i(0);
i <= binsx; ++
i)
108 for (unsigned int j(0); j <= binsz; ++j)
109 if (
histogram->GetBinContent(i,binsy,j) != 0) {
110 ERS_DEBUG(1,
"Histogram " <<
histogram->GetName()<<
" has OverFlows Y");
111 return new dqm_core::Result(dqm_core::Result::Red);
112 }
113 for (
unsigned int i(0);
i <= binsz; ++
i)
114 for (unsigned int j(0); j <= binsy; ++j)
115 if (
histogram->GetBinContent(binsx,j,i) != 0) {
116 ERS_DEBUG(1,
"Histogram " <<
histogram->GetName()<<
" has OverFlows X");
117 return new dqm_core::Result(dqm_core::Result::Red);
118 }
119 break;
120 default:
121 throw dqm_core::BadConfig( ERS_HERE, name, "Something is wrong with the Dimension of the Histogram");
122 }
123 ERS_DEBUG(1,
"Histogram " <<
histogram->GetName()<<
" does NOT have OverFlows");
124 return new dqm_core::Result(dqm_core::Result::Green);
125 }
else if (
m_name ==
"No_UnderFlows") {
126 const unsigned int binsx =
histogram->GetNbinsX()+1;
127 const unsigned int binsy =
histogram->GetNbinsY()+1;
128 const unsigned int binsz =
histogram->GetNbinsZ()+1;
130 case 1:
132 ERS_DEBUG(1,
"Histogram " <<
histogram->GetName()<<
" has UnderFlows X");
133 return new dqm_core::Result(dqm_core::Result::Red);
134 }
135 break;
136 case 2:
137 for (
unsigned int i(0);
i <= binsx; ++
i)
138 if (
histogram->GetBinContent(i,0) != 0) {
139 ERS_DEBUG(1,
"Histogram " <<
histogram->GetName()<<
" has UnderFlows Y");
140 return new dqm_core::Result(dqm_core::Result::Red);
141 }
142 for (
unsigned int i(0);
i <= binsy; ++
i)
143 if (
histogram->GetBinContent(0,i) != 0) {
144 ERS_DEBUG(1,
"Histogram " <<
histogram->GetName()<<
" has UnderFlows X");
145 return new dqm_core::Result(dqm_core::Result::Red);
146 }
147 break;
148 case 3:
149 for (
unsigned int i(0);
i <= binsx; ++
i)
150 for (unsigned int j(0); j <= binsy; ++j)
151 if (
histogram->GetBinContent(i,j,0) != 0) {
152 ERS_DEBUG(1,
"Histogram " <<
histogram->GetName()<<
" has UnderFlows Z");
153 return new dqm_core::Result(dqm_core::Result::Red);
154 }
155 for (
unsigned int i(0);
i <= binsx; ++
i)
156 for (unsigned int j(0); j <= binsz; ++j)
157 if (
histogram->GetBinContent(i,0,j) != 0) {
158 ERS_DEBUG(1,
"Histogram " <<
histogram->GetName()<<
" has UnderFlows Y");
159 return new dqm_core::Result(dqm_core::Result::Red);
160 }
161 for (
unsigned int i(0);
i <= binsz; ++
i)
162 for (unsigned int j(0); j <= binsy; ++j)
163 if (
histogram->GetBinContent(0,j,i) != 0) {
164 ERS_DEBUG(1,
"Histogram " <<
histogram->GetName()<<
" has UnderFlows X");
165 return new dqm_core::Result(dqm_core::Result::Red);
166 }
167 break;
168 default:
169 throw dqm_core::BadConfig( ERS_HERE, name, "Something is wrong with the Dimension of the Histogram");
170 }
171 ERS_DEBUG(1,
"Histogram " <<
histogram->GetName()<<
" does NOT have UnderFlows");
172 return new dqm_core::Result(dqm_core::Result::Green);
173 }
else if (
m_name ==
"All_Bins_Filled" ) {
174 const unsigned int binsx =
histogram->GetNbinsX();
175 const unsigned int binsy =
histogram->GetNbinsY();
176 const unsigned int binsz =
histogram->GetNbinsZ();
177 for (
unsigned int i(1);
i <= binsx; ++
i ) {
178 for ( unsigned int j(1); j <= binsy; ++j ) {
179 for (
unsigned int k(1);
k<= binsz; ++
k ) {
181 if ( content == 0) {
182 ERS_DEBUG(1,
"Histogram " <<
histogram->GetName()<<
" has empty bins");
183 return new dqm_core::Result(dqm_core::Result::Red);
184 }
185 }
186 }
187 }
188
189 ERS_DEBUG(1,
"Histogram " <<
histogram->GetName()<<
" has all filled bins");
190 return new dqm_core::Result(dqm_core::Result::Green);
191
192
193 }
else if (
m_name ==
"Histogram_Empty") {
195 ERS_DEBUG(1,
"Histogram " <<
histogram->GetName()<<
" is Empty");
196 return new dqm_core::Result(dqm_core::Result::Green);
197 }else {
198 ERS_DEBUG(1,
"Histogram " <<
histogram->GetName()<<
" is Not Empty");
199 return new dqm_core::Result(dqm_core::Result::Red);
200 }
201 }
else if (
m_name ==
"Histogram_Effective_Empty") {
202 if (
histogram->GetEffectiveEntries() == 0) {
203 ERS_DEBUG(1,
"Histogram " <<
histogram->GetName()<<
" is Empty");
204 return new dqm_core::Result(dqm_core::Result::Green);
205 }else {
206 ERS_DEBUG(1,
"Histogram " <<
histogram->GetName()<<
" is Not Empty");
207 return new dqm_core::Result(dqm_core::Result::Red);
208 }
209
210
211 } else {
212 return new dqm_core::Result();
213 }
214
215
216}
#define IsA
Declare the TObject style functions.