47 const TH2 * inputgraph;
49 if(
object.
IsA()->InheritsFrom(
"TH1" )) {
50 inputgraph =
static_cast<const TH2*
>( &
object );
53 throw dqm_core::BadConfig( ERS_HERE,
name,
"does not inherit from TH1" );
59 if (inputgraph->GetEntries() < minstat ) {
61 result->tags_[
"InsufficientEntries"] = inputgraph->GetEntries();
73 std::string thresholdname=
"NBins";
79 catch ( dqm_core::Exception & ex ) {
80 throw dqm_core::BadConfig( ERS_HERE,
name, ex.what(), ex );
86 refhist =
static_cast<TH2 *
>(
config.getReference() );
88 catch ( dqm_core::Exception & ex ) {
89 throw dqm_core::BadRefHist(ERS_HERE,
name,
" Could not retreive reference");
92 if (inputgraph->GetDimension() != refhist->GetDimension() ) {
93 throw dqm_core::BadRefHist( ERS_HERE,
"Dimension",
name );
96 if ((inputgraph->GetNbinsX() != refhist->GetNbinsX()) || (inputgraph->GetNbinsY() != refhist->GetNbinsY())) {
97 throw dqm_core::BadRefHist( ERS_HERE,
"number of bins",
name );
112 {
double ref_entries=refhist->GetEntries();
113 double input_entries=inputgraph->GetEntries();
115 const_cast<TH2*
>(inputgraph)->Sumw2();
118 refhist->Scale(input_entries/ref_entries);
128 std::vector<int>
range;
132 catch( dqm_core::Exception & ex ) {
133 throw dqm_core::BadConfig( ERS_HERE,
name, ex.what(), ex );
151 std::vector<double> ChisqValues;
152 std::map<double,int> mymap;
158 val=inputgraph->GetBinContent(
i,j);
159 refval=refhist->GetBinContent(
i,j);
160 inputerr=inputgraph->GetBinError(
i,j);
161 referr=refhist->GetBinError(
i,j);
162 errsquared=referr*referr+inputerr*inputerr;
163 if(errsquared > 0.000001)
165 partsum=((
val-refval)*(
val-refval))/errsquared;
172 { chisq=chisq+partsum;
175 if(partsum>=NSigma*NSigma)
176 { ChisqValues.push_back(std::sqrt(partsum));
177 mymap.insert(std::pair<double,int>(std::sqrt(partsum),inputgraph->GetBin(
i,j)));
187 double ndf=count_ndf-1;
196 std::sort(ChisqValues.begin(),ChisqValues.end());
216 int& xBin = xbinnumber;
217 int& yBin = ybinnumber;
218 int& zBin = zbinnumber;
229 {
result->tags_[
"No flagged bins were found"]=1.0;
233 while(mymap.size()>0)
241 { global_bin=
p2->second;
242 globalbinint= (
int) global_bin;
243 inputgraph->GetBinXYZ(globalbinint,xBin,yBin,zBin);
244 eta=inputgraph->GetXaxis()->GetBinCenter(xBin);
245 phi=inputgraph->GetYaxis()->GetBinCenter(yBin);
248 sprintf(ctag,
" (eta,phi)=(%f,%f) ",
eta,
phi);
258 sprintf(ctag,
"eta_%i_error",
k);
260 sprintf(ctag,
"phi_%i_error",
k);
265 if(
p==ChisqValues.begin()||
k>Num_to_print)
274 result->tags_[
"MaxSigma"]=MaxSigma;
275 result->tags_[
"NSigma"]=NSigma;
276 result->tags_[
"Max Bins to Publish"]=Num_to_print;
280 int BinsOver=ChisqValues.size();
281 result->tags_[
"NBinsOver"]=BinsOver;
285 if ( (BinsOver <= gthresho) &&
veto==0 ) {
287 }
else if ( (BinsOver < rthresho) &&
veto==0 ) {
288 result->status_ = dqm_core::Result::Yellow;
293 ERS_DEBUG(2,
"Result: "<<*
result);