41 const TObject &
object,
42 const dqm_core::AlgorithmConfig &
config )
49 if(
object.
IsA()->InheritsFrom(
"TH1" )) {
52 throw dqm_core::BadConfig( ERS_HERE, name,
"dimension > 2 " );
55 throw dqm_core::BadConfig( ERS_HERE, name,
"does not inherit from TH1" );
61 dqm_core::Result *
result =
new dqm_core::Result(dqm_core::Result::Undefined);
67 refhist =
dynamic_cast<const TH1*
>(
config.getReference() );
69 catch ( dqm_core::Exception & ex ) {
70 throw dqm_core::BadRefHist(ERS_HERE,name,
" Could not retreive reference");
74 throw dqm_core::BadRefHist(ERS_HERE, name,
"Reference is not a histogram");
77 if (
histogram->GetDimension() != refhist->GetDimension() ) {
78 throw dqm_core::BadRefHist( ERS_HERE, name,
"Dimension" );
81 if ((
histogram->GetNbinsX() != refhist->GetNbinsX()) || (
histogram->GetNbinsY() != refhist->GetNbinsY())) {
82 throw dqm_core::BadRefHist( ERS_HERE, name,
"number of bins" );
86 throw dqm_core::BadConfig( ERS_HERE, name,
"MaxDist option cannot be used on 2D histograms" );
95 }
else if (
m_name ==
"MaxDist") {
98 }
else if (
m_name ==
"Norm") {
101 }
else if (
m_name ==
"MaxDistPlusNorm") {
105 throw dqm_core::BadConfig( ERS_HERE,
"None",
m_name );
112 catch ( dqm_core::Exception & ex ) {
113 throw dqm_core::BadConfig( ERS_HERE, name, ex.what(), ex );
117 double value =
histogram->KolmogorovTest( refhist, option.c_str());
119 ERS_DEBUG(1,
"Kolmogorov Test with Option " <<
m_name <<
" is " << value );
120 ERS_DEBUG(1,
"Green threshold: "<< gthresho <<
"; Red threshold: " << rthresho );
122 dqm_core::Result*
result =
new dqm_core::Result();
125 if ( value >= gthresho ) {
126 result->status_ = dqm_core::Result::Green;
127 }
else if ( value > rthresho ) {
128 result->status_ = dqm_core::Result::Yellow;
130 result->status_ = dqm_core::Result::Red;
133 if ( value <= gthresho ) {
134 result->status_ = dqm_core::Result::Green;
135 }
else if ( value < rthresho ) {
136 result->status_ = dqm_core::Result::Yellow;
138 result->status_ = dqm_core::Result::Red;