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" );
76 std::vector<int> hotColumns, hotRows;
77 std::vector<std::vector<int>> hotBins;
81 bool vetoHotRows =
false;
if (hotRows.size() > 0) vetoHotRows =
true;
82 bool vetoHotBins =
false;
if (hotBins.size() > 0) vetoHotBins =
true;
83 bool vetoHotColumns =
false;
if (hotColumns.size() > 0) vetoHotColumns =
true;
99 catch ( dqm_core::Exception & ex ) {
100 throw dqm_core::BadConfig( ERS_HERE,
name, ex.what(), ex );
110 }
else if (
histogram->InheritsFrom(
"TH1")) {
113 throw dqm_core::BadConfig( ERS_HERE,
name,
"does not inherit from TH1" );
116 resulthisto->Reset();
117 if(
m_name.find(
"Median")!=std::string::npos){
118 std::vector<double> bin_vals;
120 for (
int j =
range[2]; j <=
range[3]; ++j ) {
121 if(
histogram -> GetBinContent(
i,j) > 0) bin_vals . push_back(
histogram -> GetBinContent(
i,j) );
124 std::sort(bin_vals.begin(), bin_vals.end());
125 unsigned bin_vals_size = bin_vals.size();
127 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;
128 else if(bin_vals_size%2==1 && bin_vals_size>1)
median = bin_vals.at(bin_vals_size/2-1);
129 else if(bin_vals_size==1)
median = bin_vals.at(0);
133 bin_threshold=
median*bin_threshold;
135 bin_threshold =
std::max(bin_threshold, min_bin_threshold);
136 if(max_bin_threshold > -1 ) bin_threshold =
std::min(bin_threshold, max_bin_threshold);
138 result->tags_[
"Effective_BinThreshold"] = bin_threshold;
142 bool skipColumn =
false;
143 bool skipRow =
false;
144 bool skipBin =
false;
148 for (
int column : hotColumns){
149 if (vetoHotColumns && (
column ==
i || skipColumn ==
true)) skipColumn =
true;
152 if (skipColumn)
continue;
158 for (
int j =
range[2]; j <=
range[3]; ++j ) {
159 skipRow =
false; skipBin =
false;
160 for (
int row : hotRows){
161 if (vetoHotRows && (
row == j || skipRow ==
true)) skipRow =
true;
163 for (
const auto& pair : hotBins){
164 if (vetoHotBins && ( (pair[0] ==
i && pair[1] == j) || skipBin ==
true)) skipBin =
true;
167 if (skipBin)
continue;
169 if (skipRow)
continue;
178 resulthisto->SetBinContent(
i,j,
content);
179 if (publish &&
count< maxpublish){
186 ERS_DEBUG(1,
"Number of bins " <<
m_name <<
" treshold of " << bin_threshold <<
" is " <<
count );
187 ERS_DEBUG(1,
"Green threshold: "<< gthreshold <<
" bin(s); Red threshold : " << rthreshold <<
" bin(s) ");
193 if(
m_name.find(
"LessThan")!=std::string::npos)
result->tags_[
"NBins_%"] = 100.*effectiveCount/TotalBins;
194 else result->tags_[
"NBins_%"] = 100.*
count/TotalBins;
198 result->object_ = (boost::shared_ptr<TObject>)(TObject*)(resulthisto);
199 if (gthreshold > rthreshold) {
200 if (
count >= gthreshold ) {
202 }
else if (
count > rthreshold ) {
203 result->status_ = dqm_core::Result::Yellow;
208 if (
count <= gthreshold ) {
210 }
else if (
count < rthreshold ) {
211 result->status_ = dqm_core::Result::Yellow;