51 const TObject &
object,
52 const dqm_core::AlgorithmConfig &
config )
55 if(
object.
IsA()->InheritsFrom(
"TH1" ) ) {
58 throw dqm_core::BadConfig( ERS_HERE, name,
"dimension > 2 " );
61 throw dqm_core::BadConfig( ERS_HERE, name,
"does not inherit from TH1" );
63 const double minstat = 1;
65 ERS_INFO(
"Too few entries: " <<
histogram->GetEntries() );
66 dqm_core::Result *
result =
new dqm_core::Result(dqm_core::Result::Undefined);
76 std::pair<bool,double> grayValue;
84 catch ( dqm_core::Exception & ex ) {
85 throw dqm_core::BadConfig( ERS_HERE, name, ex.what(), ex );
91 catch ( dqm_core::Exception & ex ) {
92 grayValue.first=
false;
98 catch ( dqm_core::Exception & ex ) {
105 ERS_INFO(
"'EqualityPrecision cannot be negative: it will be re-set to its absolute value.");
109 ERS_INFO(
"You set search window size (WindowSize) <= 0: I will search the whole histogram.");
112 if(n_bins>window_size) {
113 ERS_INFO(
"You set the minimum number of bins for throwing error/warning (NBins) larger than the window size (WindowSize): in this way the algorithm can never return error/warning. Setting NBins=WindowSize.");
118 ERS_INFO(
"You set the minimum number of bins for throwing error/warning (NBins) <= 0: in this way the algorithm would always return error. Setting NBins=1 (default value).");
124 dqm_core::Result*
result =
new dqm_core::Result();
127 throw dqm_core::BadConfig( ERS_HERE, name,
"TH2 received. This algorithm only works with TH1" );
128 }
else if (
histogram->InheritsFrom(
"TH1")) {
131 throw dqm_core::BadConfig( ERS_HERE, name,
"does not inherit from TH1" );
134 resulthisto->Reset();
139 if(start_from_last>=0)
140 i_currentLB-=start_from_last;
143 while(i_currentLB>=1)
145 if(
histogram->GetBinContent(i_currentLB)!=0)
break;
150 if(i_currentLB<=0 || i_currentLB<n_bins)
152 ERS_DEBUG(1,
"start_from_last parameter >= total number of bins, I just cannot do the check. Do nothing.");
161 while(iLB>=1 && (window_size<0 || (i_currentLB-iLB)<window_size))
163 double content=
histogram->GetBinContent(iLB);
178 resulthisto->SetBinContent(iLB,content);
183 ERS_DEBUG(1,
"Found " << countRed <<
" red bins and " << countYellow <<
" red bins. In a window of size " << window_size <<
" bins, starting at bin " << i_currentLB);
184 ERS_DEBUG(1,
"To be compared with: " << n_bins);
185 ERS_DEBUG(1,
"Green treshold=" << gthreshold <<
" Red threshold=" << rthreshold );
187 result->tags_[
"NRedBins"] = countRed;
188 result->tags_[
"NYellowBins"] = countYellow;
189 result->object_ = boost::shared_ptr<TObject>(resulthisto);
192 result->status_ = dqm_core::Result::Red;
194 else if(countRed+countYellow>=n_bins)
196 result->status_ = dqm_core::Result::Yellow;
198 else if(countGray>=n_bins)
200 result->status_ = dqm_core::Result::Undefined;
204 result->status_ = dqm_core::Result::Green;
270 if(
type==
"GreaterThan")
272 if(bincontent>thresholdRed)
274 if(bincontent>thresholdGr)
280 if(bincontent<thresholdRed)
282 if(bincontent<thresholdGr)
286 if(
type==
"GreaterThanEqual")
294 if(
type==
"LessThanEqual")
302 if(
type==
"redEqual_yellowGreaterThan")
306 if(bincontent>thresholdGr)
310 if(
type==
"redEqual_yellowLessThan")
314 if(bincontent<thresholdGr)
void diff(const Jet &rJet1, const Jet &rJet2, std::map< std::string, double > varDiff)
Difference between jets - Non-Class function required by trigger.