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