#include <MDTChi2.h>
Definition at line 17 of file MDTChi2.h.
◆ MDTChi2()
dqm_algorithms::MDTChi2::MDTChi2 |
( |
| ) |
|
◆ ~MDTChi2()
dqm_algorithms::MDTChi2::~MDTChi2 |
( |
| ) |
|
|
virtual |
◆ clone()
dqm_core::Algorithm * dqm_algorithms::MDTChi2::clone |
( |
| ) |
|
|
virtual |
◆ execute()
Definition at line 58 of file MDTChi2.cxx.
63 if(
object.
IsA()->InheritsFrom(
"TH1" ) ) {
65 if (
hist->GetDimension() >= 2 ){
66 throw dqm_core::BadConfig( ERS_HERE,
name,
"dimension >= 2 " );
69 throw dqm_core::BadConfig( ERS_HERE,
name,
"does not inherit from TH1" );
81 catch ( dqm_core::Exception & ex ) {
82 throw dqm_core::BadConfig( ERS_HERE,
name, ex.what(), ex );
88 ref =
static_cast<const TH1*
>(
config.getReference() );
90 catch ( dqm_core::Exception & ex ) {
91 throw dqm_core::BadRefHist(ERS_HERE,
name,
" Could not retreive reference");
93 if (
hist->GetDimension() !=
ref->GetDimension() ) {
94 throw dqm_core::BadRefHist( ERS_HERE,
name,
"Reference VS histo: Different dimension!" );
96 if (
hist->GetNbinsX() !=
ref->GetNbinsX() ) {
97 throw dqm_core::BadRefHist( ERS_HERE,
name,
"Reference VS histo: Different bin numbre in X axis!" );
101 if (
hist->GetEntries() < minstat ) {
102 ERS_INFO(
"Histogram does not satisfy MinStat requirement " <<
hist->GetName());
104 result->tags_[
"InsufficientEntries"] =
hist->GetEntries();
107 ERS_DEBUG(1,
"Statistics: "<<
hist->GetEntries()<<
" entries ");
117 int max_bin =
hist -> GetNbinsX();
122 ERS_INFO(
"Histogram has no entries" <<
hist->GetName());
124 result->tags_[
"InsufficientEntries"] =
hist->GetEntries();
129 ERS_INFO(
"Reference histogram has no entries" <<
hist->GetName());
131 result->tags_[
"InsufficientRefEntries"] =
ref->GetEntries();
139 if(N_ref != 0) norm_ref=1/N_ref;
141 for(
i=1;
i<=max_bin;
i++){
142 n =
hist->GetBinContent(
i);
143 n_ref =
ref->GetBinContent(
i);
144 if(
n != 0 || n_ref != 0)
chi2+=(
n*
norm-n_ref*norm_ref)*(
n*
norm-n_ref*norm_ref)/(
n*
norm*
norm+n_ref*norm_ref*norm_ref);
145 if(
n == 0 && n_ref == 0)
count++;
159 ERS_DEBUG(1,
"Green");
160 }
else if ( prob<=greenTh && prob>redTh ) {
161 result->status_ = dqm_core::Result::Yellow;
162 ERS_DEBUG(1,
"Yellow");
163 }
else if (
prob<=redTh) {
◆ printDescription()
void dqm_algorithms::MDTChi2::printDescription |
( |
std::ostream & |
out | ) |
|
|
virtual |
Definition at line 172 of file MDTChi2.cxx.
177 message +=
"Description: Perform a chi square check between input istogram and reference\n";
178 message +=
"Mandatory Green/Red Threshold: Limits: chi square probability limits\n";
179 message +=
"Optional Parameters: MinStat = Minimum histogram statistics needed to perform Algorithm\n";
◆ m_name
std::string dqm_algorithms::MDTChi2::m_name |
|
private |
The documentation for this class was generated from the following files: