12 #include "dqm_core/exceptions.h"
13 #include "dqm_core/AlgorithmManager.h"
14 #include "dqm_core/AlgorithmConfig.h"
15 #include "dqm_core/Result.h"
33 message +=
"Description: Checks the Ymeans per sector of every histogram\n";
34 message +=
"If the Ymeans are outside the range the sector is flagged red. If one of the sectors is very far from the Ymean the whole histogram is flagged red\n";
35 message +=
" Overflow (and Underflow) bins are not included\n";
43 : m_name(
"STG_YMeansperSector")
65 execute(
const std::string&
name,
const TObject&
object,
const dqm_core::AlgorithmConfig&
config)
72 if(
object.
IsA()->InheritsFrom(
"TH2" ) ) {
75 throw dqm_core::BadConfig( ERS_HERE,
name,
"dimension > 2 " );
78 throw dqm_core::BadConfig( ERS_HERE,
name,
"does not inherit from TH2" );
81 int Xbins =
histogram->GetXaxis()->GetNbins();
82 int Ybins =
histogram->GetYaxis()->GetNbins();
93 }
else if (Ybins > 100) {
100 bool redflag =
false;
101 bool yellowflag =
false;
102 bool greenflag =
false;
104 for (
int i = 1;
i <= Xbins;
i++) {
105 MeanY[
i]=h2->GetBinContent(
i);
110 if (MeanY[
i] > Meanlow && MeanY[
i] < Meanhigh) Passed = Passed +1;
111 if (abs(MeanY[
i]) > abs(redMean)) redflag=
true;
119 catch ( dqm_core::Exception & ex ) {
120 throw dqm_core::BadConfig( ERS_HERE,
name, ex.what(), ex );
122 if (Passed -2 > gthreshold && not redflag) greenflag=
true;
123 else if (Passed -2 > rthreshold && not redflag) yellowflag=
true;
127 }
else if ( yellowflag ) {
128 result->status_ = dqm_core::Result::Yellow;