22 #include <dqm_core/AlgorithmConfig.h>
31 #include <dqm_core/AlgorithmManager.h>
51 const TObject &
object,
52 const dqm_core::AlgorithmConfig &
config)
56 if(
object.
IsA()->InheritsFrom(
"TH1" ) ) {
59 throw dqm_core::BadConfig( ERS_HERE,
name,
"dimension > 2 " );
62 throw dqm_core::BadConfig( ERS_HERE,
name,
"does not inherit from TH1" );
66 double grThr = 0.05, reThr = 0.1;
70 }
catch ( dqm_core::Exception & ex ) {
71 throw dqm_core::BadConfig(ERS_HERE,
name,
"Paramter: 'Threshold' is mandatory, cannot continue");
75 if ((grThr>1.0 || reThr>1.0) ) {
76 throw dqm_core::BadConfig(ERS_HERE,m_name,
"Configuration Error: Threshold should be between [0.0, 1.0] 10% => 0.1");
82 size_t ntotBins = (size_t)
histogram -> GetNbinsX();
96 colflags[0] = ((colflags[0] > 0) && (colflags[0] <= ntotBins)) ? colflags[0] : 1;
97 colflags[1] = ((colflags[1] >= colflags[0]) && (colflags[1] <= ntotBins)) ? colflags[1] : ntotBins;
98 colflags[2] = ((colflags[2] > 0) && (colflags[2] <= ntotBins)) ? colflags[2] : 1;
99 colflags[3] = ((colflags[3] >= colflags[2]) && (colflags[3] <= ntotBins)) ? colflags[3] : ntotBins;
100 bool yellowLo2HiEmpty =
true, redLo2HiEmpty =
true;
101 int ycnt = 0, rcnt = 0;
107 double nevtstot = 1.;
111 double theYFracMax = -9., theRFracMax = -9.;
113 for(
size_t j = colflags[0]; j <= colflags[1]; j++ ) {
115 double thebinc =
histogram -> GetBinContent(j);
117 double thefrac = thebinc / nevtstot;
123 if(thefrac > grThr) {
124 if(theYFracMax < thefrac) theYFracMax = thefrac;
125 yellowLo2HiEmpty =
false;
133 for(
size_t j = colflags[2]; j <= colflags[3]; j++ ) {
135 double thebinc =
histogram -> GetBinContent(j);
137 double thefrac = thebinc / nevtstot;
138 if(thefrac > reThr) {
139 if(theRFracMax < thefrac) theRFracMax = thefrac;
140 redLo2HiEmpty =
false;
149 if(doflags[0] && !yellowLo2HiEmpty) {
150 result->status_ = dqm_core::Result::Yellow;
153 if(doflags[1] && !redLo2HiEmpty) {
157 result->tags_[
"NumOfStatusBitsYellow"] = ycnt;
158 result->tags_[
"EventFractionYellow"] = theYFracMax;
159 result->tags_[
"NumOfStatusBitsRed"] = rcnt;
160 result->tags_[
"EventFractionRed"] = theRFracMax;
171 out<<
"HLT MET Status: Of the 32 status bits, check if any subset of bits are set. If so, flag YELLOW" << std::endl;
172 out<<
"Bit #32 is global error bit, if set flag RED." << std::endl;
174 out<<
"Mandatory parameter: XBin: The label of the X bin that you would like to check\n"<<std::endl;