57 if(
object.
IsA()->InheritsFrom(
"TH1" ) ) {
60 throw dqm_core::BadConfig( ERS_HERE,
name,
"dimension > 2 " );
63 throw dqm_core::BadConfig( ERS_HERE,
name,
"does not inherit from TH1" );
84 catch ( dqm_core::Exception & ex ) {
85 throw dqm_core::BadConfig( ERS_HERE,
name, ex.what(), ex );
95 }
else if (
histogram->InheritsFrom(
"TH1")) {
98 throw dqm_core::BadConfig( ERS_HERE,
name,
"does not inherit from TH1" );
101 resulthisto->Reset();
102 if(
m_name.find(
"Median")!=std::string::npos){
103 std::vector<double> bin_vals;
105 for (
int j =
range[2]; j <=
range[3]; ++j ) {
106 if(
histogram -> GetBinContent(
i,j) > 0) bin_vals . push_back(
histogram -> GetBinContent(
i,j) );
109 std::sort(bin_vals.begin(), bin_vals.end());
110 unsigned bin_vals_size = bin_vals.size();
112 if(bin_vals_size%2==0 && bin_vals_size>1)
median = (bin_vals.at(bin_vals_size/2-1)+bin_vals.at(bin_vals_size/2))/2;
113 else if(bin_vals_size%2==1 && bin_vals_size>1)
median = bin_vals.at(bin_vals_size/2-1);
114 else if(bin_vals_size==1)
median = bin_vals.at(0);
118 bin_threshold=
median*bin_threshold;
120 bin_threshold =
std::max(bin_threshold, min_bin_threshold);
121 if(max_bin_threshold > -1 ) bin_threshold =
std::min(bin_threshold, max_bin_threshold);
123 result->tags_[
"Effective_BinThreshold"] = bin_threshold;
127 for (
int j =
range[2]; j <=
range[3]; ++j ) {
131 resulthisto->SetBinContent(
i,j,
content);
132 if (publish &&
count< maxpublish){
139 ERS_DEBUG(1,
"Number of bins " <<
m_name <<
" treshold of " << bin_threshold <<
" is " <<
count );
140 ERS_DEBUG(1,
"Green threshold: "<< gthreshold <<
" bin(s); Red threshold : " << rthreshold <<
" bin(s) ");
146 if(
m_name.find(
"LessThan")!=std::string::npos)
result->tags_[
"NBins_%"] = 100.*effectiveCount/TotalBins;
147 else result->tags_[
"NBins_%"] = 100.*
count/TotalBins;
151 result->object_ = (boost::shared_ptr<TObject>)(TObject*)(resulthisto);
152 if (gthreshold > rthreshold) {
153 if (
count >= gthreshold ) {
155 }
else if (
count > rthreshold ) {
156 result->status_ = dqm_core::Result::Yellow;
161 if (
count <= gthreshold ) {
163 }
else if (
count < rthreshold ) {
164 result->status_ = dqm_core::Result::Yellow;