13 #include "dqm_core/exceptions.h"
14 #include "dqm_core/AlgorithmConfig.h"
16 #include "dqm_core/AlgorithmManager.h"
17 #include "dqm_core/Result.h"
34 : m_name(
"AlgCorrelationYX")
56 execute(
const std::string&
name,
const TObject&
object,
const dqm_core::AlgorithmConfig&
config)
60 if(
object.
IsA()->InheritsFrom(
"TH1" ) ) {
63 throw dqm_core::BadConfig( ERS_HERE,
name,
"dimension > 2 " );
66 throw dqm_core::BadConfig( ERS_HERE,
name,
"does not inherit from TH1" );
78 catch ( dqm_core::Exception & ex ) {
79 throw dqm_core::BadConfig( ERS_HERE,
name, ex.what(), ex );
98 int binSize = binEnd-binStart+1;
102 for(
int i=0;
i<binSize;
i++) {
103 int binx = binStart+
i;
105 for (
int j = 1; j <= nbiny; ++j ) {
127 sdX = std::sqrt(avX2-avX*avX) ;
128 sdY = std::sqrt(avY2-avY*avY) ;
129 if(sdX>0&&sdY>0)correlation=(avXY-avX*avY)/(sdX*sdY);
132 ERS_DEBUG(1,
"Number of entries for bins is "<<
count );
133 ERS_DEBUG(1,
"Correlation biny and binx is "<< correlation );
134 ERS_DEBUG(1,
"Green: "<< gmin <<
" entries; Red: " << rmin <<
" entries ");
140 if ( correlation >= gmin ) {
142 }
else if ( correlation > rmin ) {
143 result->status_ = dqm_core::Result::Yellow;
147 result->tags_[
"Correlation"] = correlation;
161 message +=
"Description: Counts the number of listed bins with entries above CountsTh\n";
162 message +=
"Parameters: BinStart first bin to be checked (1=first bin)\n";
163 message +=
" BinEnd last bin to be checked (nbin=last bin)\n";
164 message +=
" CorrMin minimum correlation Red/Green\n";