47 const TObject &
object,
48 const dqm_core::AlgorithmConfig &
config)
52 if(
object.
IsA()->InheritsFrom(
"TH1" ) ) {
55 throw dqm_core::BadConfig( ERS_HERE, name,
"dimension > 3 " );
58 throw dqm_core::BadConfig( ERS_HERE, name,
"does not inherit from TH1" );
64 dqm_core::Result *
result =
new dqm_core::Result(dqm_core::Result::Undefined);
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);
74 ERS_DEBUG(1,
"Histogram " <<
histogram->GetName()<<
" is Empty");
75 return new dqm_core::Result(dqm_core::Result::Red);
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;
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);
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);
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);
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);
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);
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);
121 throw dqm_core::BadConfig( ERS_HERE, name,
"Something is wrong with the Dimension of the Histogram");
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;
132 ERS_DEBUG(1,
"Histogram " <<
histogram->GetName()<<
" has UnderFlows X");
133 return new dqm_core::Result(dqm_core::Result::Red);
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);
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);
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);
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);
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);
169 throw dqm_core::BadConfig( ERS_HERE, name,
"Something is wrong with the Dimension of the Histogram");
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 ) {
180 double content=
histogram -> GetBinContent(i,j);
182 ERS_DEBUG(1,
"Histogram " <<
histogram->GetName()<<
" has empty bins");
183 return new dqm_core::Result(dqm_core::Result::Red);
189 ERS_DEBUG(1,
"Histogram " <<
histogram->GetName()<<
" has all filled bins");
190 return new dqm_core::Result(dqm_core::Result::Green);
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);
198 ERS_DEBUG(1,
"Histogram " <<
histogram->GetName()<<
" is Not Empty");
199 return new dqm_core::Result(dqm_core::Result::Red);
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);
206 ERS_DEBUG(1,
"Histogram " <<
histogram->GetName()<<
" is Not Empty");
207 return new dqm_core::Result(dqm_core::Result::Red);
212 return new dqm_core::Result();