42 const TObject &
object,
43 const dqm_core::AlgorithmConfig &
config )
47 if(
object.
IsA()->InheritsFrom(
"TH1" )) {
50 throw dqm_core::BadConfig( ERS_HERE, name,
"dimension > 1 " );
53 throw dqm_core::BadConfig( ERS_HERE, name,
"does not inherit from TH1");
61 dqm_core::Result *
result =
new dqm_core::Result(dqm_core::Result::Undefined);
72 catch( dqm_core::Exception & ex ) {
73 throw dqm_core::BadConfig( ERS_HERE, name, ex.what(), ex );
80 dqm_core::Result*
result =
new dqm_core::Result();
84 }
else if (
histogram->InheritsFrom(
"TH1")) {
87 throw dqm_core::BadConfig( ERS_HERE, name,
"does not inherit from TH1" );
92 for (
int i = 1; i < range[0]; ++i ) {
93 double content =
histogram -> GetBinContent(i);
96 resulthisto->SetBinContent(i,content);
97 if (publish &&
count<maxpublish) {
102 for (
int j = range[1]; j <= nbins; ++j ) {
103 double content=
histogram -> GetBinContent(j);
104 if ( content != 0 ) {
106 resulthisto->SetBinContent(j,content);
107 if (publish &&
count<maxpublish) {
113 ERS_DEBUG(1,
"Number of bins with content != 0 is " <<
count );
114 ERS_DEBUG(1,
"Green threshold: "<< gthreshold <<
" bin(s); Red threshold : " << rthreshold <<
" bin(s) ");
118 result->object_ = boost::shared_ptr<TObject>(resulthisto);
120 if (gthreshold > rthreshold) {
121 if (
count >= gthreshold ) {
122 result->status_ = dqm_core::Result::Green;
123 }
else if (
count > rthreshold ) {
124 result->status_ = dqm_core::Result::Yellow;
126 result->status_ = dqm_core::Result::Red;
129 if (
count <= gthreshold ) {
130 result->status_ = dqm_core::Result::Green;
131 }
else if (
count < rthreshold ) {
132 result->status_ = dqm_core::Result::Yellow;
134 result->status_ = dqm_core::Result::Red;
static dqm_algorithms::BinContentComp myInstance