34 const TObject &
object,
35 const dqm_core::AlgorithmConfig &
config )
38 if(
object.
IsA()->InheritsFrom(
"TH1" )) {
41 throw dqm_core::BadConfig( ERS_HERE, name,
"dimension > 2 " );
44 throw dqm_core::BadConfig( ERS_HERE, name,
"does not inherit from TH1" );
48 ERS_DEBUG(2,
"Minimum statistics required:"<<minstat);
49 if (
histogram->GetEffectiveEntries() < minstat ) {
50 dqm_core::Result *
result =
new dqm_core::Result(dqm_core::Result::Undefined);
51 result->tags_[
"InsufficientEffectiveEntries"] =
histogram->GetEffectiveEntries();
54 double gthresho,rthresho;
55 std::string thresholdname=
"JB";
56 if (
m_name ==
"Prob") thresholdname =
"P";
61 catch ( dqm_core::Exception & ex ) {
62 throw dqm_core::BadConfig( ERS_HERE, name, ex.what(), ex );
64 ERS_DEBUG(2,
"Green Threshold: "<<gthresho<<
" Red: "<<rthresho);
70 double n =
histogram->GetEffectiveEntries();
71 double jb = n/6*( s*s + (k*k)/4 );
74 double prob = TMath::Prob(
jb , 2 );
75 ERS_DEBUG(2,
" K="<<k<<
" S="<<s<<
" n="<<n<<
" jb="<<
jb<<
" prob="<<prob);
79 if (
m_name ==
"Prob" ) testValue = prob;
82 dqm_core::Result*
result =
new dqm_core::Result();
84 result->tags_[
"Prob"]=prob;
85 if ( TMath::IsNaN( testValue ) )
87 result->status_=dqm_core::Result::Undefined;
92 if ( testValue >= gthresho ) {
93 result->status_ = dqm_core::Result::Green;
94 }
else if ( testValue > rthresho ) {
95 result->status_ = dqm_core::Result::Yellow;
97 result->status_ = dqm_core::Result::Red;
102 if ( testValue <= gthresho ) {
103 result->status_ = dqm_core::Result::Green;
104 }
else if ( testValue < rthresho ) {
105 result->status_ = dqm_core::Result::Yellow;
107 result->status_ = dqm_core::Result::Red;