15 #include "dqm_core/exceptions.h"
16 #include "dqm_core/AlgorithmManager.h"
17 #include "dqm_core/Result.h"
43 const TH1*
h =
dynamic_cast<const TH1*
>( &
data );
45 throw dqm_core::BadConfig( ERS_HERE,
name,
"Cannot cast data to type TH1" );
47 const TH1*
ref =
dynamic_cast<const TH1*
>(
config.getReference() );
49 throw dqm_core::BadConfig( ERS_HERE,
name,
"Cannot obtain reference of type TH1" );
51 double greenThr, redThr;
53 std::string thrName=
"MaxDist";
59 catch ( dqm_core::Exception & ex ) {
60 throw dqm_core::BadConfig( ERS_HERE,
name, ex.what(), ex );
77 result->status_ = dqm_core::Result::Yellow;
84 for (
int ibin=1; ibin<
hist->GetNbinsX()+1; ibin++ ){
85 float ref = (
hist->GetBinContent(ibin-1) +
hist->GetBinContent(ibin+1))*0.5;
87 ref = (
hist->GetBinContent(
hist->GetNbinsX()) +
hist->GetBinContent(ibin+1))*0.5;
89 if ( ibin==
hist->GetNbinsX() ){
90 ref = (
hist->GetBinContent(1) +
hist->GetBinContent(ibin-1))*0.5;
92 float test =
hist->GetBinContent(ibin);
97 detectedBin =
hist->GetXaxis()->GetBinCenter(
bin);
104 message +=
"Description: Checks if the maximum ratio between bins in a TH1F\n";
105 message +=
" is above a given threshold. Useful for peak detection\n";
106 message +=
"Parameters: none\n";