57 execute(
const std::string& name,
const TObject&
object,
const dqm_core::AlgorithmConfig&
config)
60 dqm_core::Result*
result =
new dqm_core::Result();
61 result->status_ = dqm_core::Result::Undefined;
64 if(
object.
IsA()->InheritsFrom(
"TH2" ) ) {
67 throw dqm_core::BadConfig( ERS_HERE, name,
"dimension > 2 " );
70 throw dqm_core::BadConfig( ERS_HERE, name,
"does not inherit from TH2" );
74 int Xbins =
histogram->GetXaxis()->GetNbins();
75 int Ybins =
histogram->GetYaxis()->GetNbins();
77 double mean_global =
histogram->GetMean(1);
86 }
else if (Xbins < 15) {
96 std::vector<float> MeanX(Ybins, 0.0);
99 bool yellowflag =
false;
100 bool greenflag =
false;
102 for (
int i = 1; i <= Ybins; i++) {
103 MeanX[i]=h2->GetBinContent(i);
108 if (MeanX[i] > Meanlow && MeanX[i] < Meanhigh) Passed = Passed +1;
109 if (abs(MeanX[i]-mean_global) > abs(redMean-mean_global)) redflag=
true;
117 catch ( dqm_core::Exception & ex ) {
118 throw dqm_core::BadConfig( ERS_HERE, name, ex.what(), ex );
120 if (Passed >= (Ybins-gthreshold) && not redflag) greenflag=
true;
121 else if (Passed >= (Ybins-rthreshold) && not redflag) yellowflag=
true;
124 result->status_ = dqm_core::Result::Green;
125 }
else if ( yellowflag ) {
126 result->status_ = dqm_core::Result::Yellow;
128 result->status_ = dqm_core::Result::Red;
130 result->tags_[
"Xbins"] = Xbins;
131 result->tags_[
"Passed"] = Passed;
132 result->tags_[
"MeanGlobal"] = mean_global;