53 if (!
object.
IsA()->InheritsFrom(
"TH1")) {
54 throw dqm_core::BadConfig(ERS_HERE, name,
"does not inherit from TH1");
56 const TH1 &
histogram =
dynamic_cast<const TH1 &
>(object);
58 throw dqm_core::BadConfig(ERS_HERE, name,
"has more than one dimension");
60 bool is_tProfile =
false;
61 if (
object.
IsA()->InheritsFrom(
"TProfile")) {
68 dqm_core::Result *result =
new dqm_core::Result();
74 while ((
histogram.GetBinContent(currentBin) == 0) && (currentBin > 0)) --currentBin;
79 result->tags_[
"LastBinNumber"] = currentBin;
80 result->tags_[
"LastBinCenter"] =
histogram.GetBinCenter(currentBin);
85 if (currentBin == 0)
break;
86 double content =
histogram.GetBinContent(currentBin);
89 else content =
histogram.GetXaxis()->GetBinLowEdge(currentBin);
92 const TProfile &profile =
dynamic_cast<const TProfile &
>(object);
103 result->tags_[
"GreenExceeded"] = grnExceeded;
104 result->tags_[
"RedExceeded"] = redExceeded;
105 if (grnExceeded < redExceeded)
106 throw dqm_core::BadConfig(ERS_HERE, name,
"more bins exceeded the red threshold than the green threshold, this shouldn't happen");
108 if (grnExceeded <
m_nBinsToExceed) result->status_ = dqm_core::Result::Green;
109 else if (redExceeded <
m_nBinsToExceed) result->status_ = dqm_core::Result::Yellow;
110 else result->status_ = dqm_core::Result::Red;
154 throw dqm_core::BadConfig(ERS_HERE, name,
"NBinsToWatch must be 1 or greater");
156 throw dqm_core::BadConfig(ERS_HERE, name,
"NBinsToExceed must be 1 or greater");
158 throw dqm_core::BadConfig(ERS_HERE, name,
"NBinsToExceed must not be greater than NBinsToWatch");
159 if ((par2 != 0) && (par2 != 1))
160 throw dqm_core::BadConfig(ERS_HERE, name,
"GreaterThan must be 0 or 1");
161 if ((par3 != 0) && (par3 != 1))
162 throw dqm_core::BadConfig(ERS_HERE, name,
"ValueThresholds must be 0 or 1");
163 if ((par4 != 0) && (par4 != 1) && (par4 != 2))
164 throw dqm_core::BadConfig(ERS_HERE, name,
"GetEntries must be 0, 1 or 2");
180 throw dqm_core::BadConfig(ERS_HERE, name,
"using greater-than comparison, but red threshold is less than green threshold");
182 throw dqm_core::BadConfig(ERS_HERE, name,
"using less-than comparison, but red threshold is greater than green threshold");