47 if(
object.
IsA()->InheritsFrom(
"TH1" ) ) {
50 throw dqm_core::BadConfig( ERS_HERE, name,
"does not inherit from TH1" );
55 if (
histogram->GetEffectiveEntries() < minstat ) {
56 dqm_core::Result *
result =
new dqm_core::Result(dqm_core::Result::Undefined);
57 result->tags_[
"InsufficientEffectiveEntries"] =
histogram->GetEffectiveEntries();
63 TObject* ro =
config.getReference();
64 const TObject* firstReference=0;
65 TObject* secondReference=0;
69 catch ( dqm_core::Exception & ex ) {
70 throw dqm_core::BadRefHist(ERS_HERE,name,
" Could not retreive reference");
73 const TH1* refhist =
dynamic_cast<const TH1*
>(firstReference);
76 throw dqm_core::BadRefHist( ERS_HERE,
"Dimension", name );
78 if ((
histogram->GetDimension() != refhist->GetDimension()) ||
79 (
histogram->GetNbinsX() != refhist->GetNbinsX()) ||
80 (
histogram->GetNbinsY() != refhist->GetNbinsY()) ||
81 refhist->GetNbinsZ() !=
histogram->GetNbinsZ() )
83 throw dqm_core::BadRefHist( ERS_HERE,
"number of bins", name );
88 ERS_DEBUG(2,
"Running algorithm: "<<
m_name);
89 dqm_core::Algorithm* subalgorithm;
91 subalgorithm = dqm_core::AlgorithmManager::instance().getAlgorithm(
m_name );
93 catch ( dqm_core::AlgorithmNotFound& ex )
95 ERS_DEBUG(2,
"Cannot find algorithm:"+
m_name);
96 throw dqm_core::BadConfig(ERS_HERE,name,
"Cannot Find sub-algorithm:"+
m_name);
101 dqm_core::Result*
result = subalgorithm->execute( name , *
histogram , newConf);
102 ERS_DEBUG(2,
"Sub algorithm returns:"<<*
result);
104 TObject* robject =
result->getObject();
107 ERS_DEBUG(2,
"Adding modified histogram in result");
112 ERS_DEBUG(2,
"Result already have an associated TObject, appending modified histogram");
113 if ( robject->IsA()->InheritsFrom(
"TCollection") )
115 static_cast<TCollection*
>(robject)->Add(
histogram );
119 TObjArray* array =
new TObjArray( 2 );
120 array->AddAt( robject->Clone() , 0 );
123 result->object_.reset( array );
125 ERS_DEBUG(2,
"Result now have a TObjArray of size:"<<
static_cast<TObjArray*
>(
result->getObject())->GetEntries());