Logo ROOT  
Reference Guide
RooHist.cxx
Go to the documentation of this file.
1 /*****************************************************************************
2  * Project: RooFit *
3  * Package: RooFitCore *
4  * @(#)root/roofitcore:$Id$
5  * Authors: *
6  * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu *
7  * DK, David Kirkby, UC Irvine, dkirkby@uci.edu *
8  * *
9  * Copyright (c) 2000-2005, Regents of the University of California *
10  * and Stanford University. All rights reserved. *
11  * *
12  * Redistribution and use in source and binary forms, *
13  * with or without modification, are permitted according to the terms *
14  * listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
15  *****************************************************************************/
16 
17 /**
18 \file RooHist.cxx
19 \class RooHist
20 \ingroup Roofitcore
21 
22 A RooHist is a graphical representation of binned data based on the
23 TGraphAsymmErrors class. Error bars are calculated using either Poisson
24 or Binomial statistics. A RooHist is used to represent histograms in
25 a RooPlot.
26 **/
27 
28 #include "RooFit.h"
29 
30 #include "RooHist.h"
31 #include "RooHistError.h"
32 #include "RooCurve.h"
33 #include "RooScaledFunc.h"
34 #include "RooMsgService.h"
35 
36 #include "TH1.h"
37 #include "TClass.h"
38 #include "Riostream.h"
39 #include <iomanip>
40 
41 using namespace std;
42 
44  ;
45 
46 
47 ////////////////////////////////////////////////////////////////////////////////
48 /// Default constructor
49 
51  _nominalBinWidth(1),
52  _nSigma(1),
53  _entries(0),
54  _rawEntries(0)
55 {
56 }
57 
58 
59 
60 ////////////////////////////////////////////////////////////////////////////////
61 /// Create an empty histogram that can be filled with the addBin()
62 /// and addAsymmetryBin() methods. Use the optional parameter to
63 /// specify the confidence level in units of sigma to use for
64 /// calculating error bars. The nominal bin width specifies the
65 /// default used by addBin(), and is used to set the relative
66 /// normalization of bins with different widths.
67 
68  RooHist::RooHist(Double_t nominalBinWidth, Double_t nSigma, Double_t /*xErrorFrac*/, Double_t /*scaleFactor*/) :
69  TGraphAsymmErrors(), _nominalBinWidth(nominalBinWidth), _nSigma(nSigma), _rawEntries(-1)
70 {
71  initialize();
72 }
73 
74 
75 ////////////////////////////////////////////////////////////////////////////////
76 /// Create a histogram from the contents of the specified TH1 object
77 /// which may have fixed or variable bin widths. Error bars are
78 /// calculated using Poisson statistics. Prints a warning and rounds
79 /// any bins with non-integer contents. Use the optional parameter to
80 /// specify the confidence level in units of sigma to use for
81 /// calculating error bars. The nominal bin width specifies the
82 /// default used by addBin(), and is used to set the relative
83 /// normalization of bins with different widths. If not set, the
84 /// nominal bin width is calculated as range/nbins.
85 
86 RooHist::RooHist(const TH1 &data, Double_t nominalBinWidth, Double_t nSigma, RooAbsData::ErrorType etype, Double_t xErrorFrac,
87  Bool_t correctForBinWidth, Double_t scaleFactor) :
88  TGraphAsymmErrors(), _nominalBinWidth(nominalBinWidth), _nSigma(nSigma), _rawEntries(-1)
89 {
90  initialize();
91  // copy the input histogram's name and title
92  SetName(data.GetName());
93  SetTitle(data.GetTitle());
94  // calculate our nominal bin width if necessary
95  if(_nominalBinWidth == 0) {
96  const TAxis *axis= ((TH1&)data).GetXaxis();
97  if(axis->GetNbins() > 0) _nominalBinWidth= (axis->GetXmax() - axis->GetXmin())/axis->GetNbins();
98  }
99  setYAxisLabel(data.GetYaxis()->GetTitle());
100 
101  if (correctForBinWidth && etype == RooAbsData::Poisson) {
102  coutW(Plotting) << "Cannot apply a bin width correction and use Poisson errors. Not correcting for bin width." << std::endl;
103  }
104 
105  // initialize our contents from the input histogram's contents
106  Int_t nbin= data.GetNbinsX();
107  for(Int_t bin= 1; bin <= nbin; bin++) {
108  Axis_t x= data.GetBinCenter(bin);
109  Stat_t y= data.GetBinContent(bin);
110  Stat_t dy = data.GetBinError(bin) ;
111  if (etype==RooAbsData::Poisson) {
112  addBin(x,y,data.GetBinWidth(bin),xErrorFrac,scaleFactor);
113  } else if (etype==RooAbsData::SumW2) {
114  addBinWithError(x,y,dy,dy,data.GetBinWidth(bin),xErrorFrac,correctForBinWidth,scaleFactor);
115  } else {
116  addBinWithError(x,y,0,0,data.GetBinWidth(bin),xErrorFrac,correctForBinWidth,scaleFactor);
117  }
118  }
119  // add over/underflow bins to our event count
120  _entries+= data.GetBinContent(0) + data.GetBinContent(nbin+1);
121 }
122 
123 
124 
125 ////////////////////////////////////////////////////////////////////////////////
126 /// Create a histogram from the asymmetry between the specified TH1 objects
127 /// which may have fixed or variable bin widths, but which must both have
128 /// the same binning. The asymmetry is calculated as (1-2)/(1+2). Error bars are
129 /// calculated using Binomial statistics. Prints a warning and rounds
130 /// any bins with non-integer contents. Use the optional parameter to
131 /// specify the confidence level in units of sigma to use for
132 /// calculating error bars. The nominal bin width specifies the
133 /// default used by addAsymmetryBin(), and is used to set the relative
134 /// normalization of bins with different widths. If not set, the
135 /// nominal bin width is calculated as range/nbins.
136 
137 RooHist::RooHist(const TH1 &data1, const TH1 &data2, Double_t nominalBinWidth, Double_t nSigma,
138  RooAbsData::ErrorType etype, Double_t xErrorFrac, Bool_t efficiency, Double_t scaleFactor) :
139  TGraphAsymmErrors(), _nominalBinWidth(nominalBinWidth), _nSigma(nSigma), _rawEntries(-1)
140 {
141  initialize();
142  // copy the first input histogram's name and title
143  SetName(data1.GetName());
144  SetTitle(data1.GetTitle());
145  // calculate our nominal bin width if necessary
146  if(_nominalBinWidth == 0) {
147  const TAxis *axis= ((TH1&)data1).GetXaxis();
148  if(axis->GetNbins() > 0) _nominalBinWidth= (axis->GetXmax() - axis->GetXmin())/axis->GetNbins();
149  }
150 
151  if (!efficiency) {
152  setYAxisLabel(Form("Asymmetry (%s - %s)/(%s + %s)",
153  data1.GetName(),data2.GetName(),data1.GetName(),data2.GetName()));
154  } else {
155  setYAxisLabel(Form("Efficiency (%s)/(%s + %s)",
156  data1.GetName(),data1.GetName(),data2.GetName()));
157  }
158  // initialize our contents from the input histogram contents
159  Int_t nbin= data1.GetNbinsX();
160  if(data2.GetNbinsX() != nbin) {
161  coutE(InputArguments) << "RooHist::RooHist: histograms have different number of bins" << endl;
162  return;
163  }
164  for(Int_t bin= 1; bin <= nbin; bin++) {
165  Axis_t x= data1.GetBinCenter(bin);
166  if(fabs(data2.GetBinCenter(bin)-x)>1e-10) {
167  coutW(InputArguments) << "RooHist::RooHist: histograms have different centers for bin " << bin << endl;
168  }
169  Stat_t y1= data1.GetBinContent(bin);
170  Stat_t y2= data2.GetBinContent(bin);
171  if (!efficiency) {
172 
173  if (etype==RooAbsData::Poisson) {
174  addAsymmetryBin(x,roundBin(y1),roundBin(y2),data1.GetBinWidth(bin),xErrorFrac,scaleFactor);
175  } else if (etype==RooAbsData::SumW2) {
176  Stat_t dy1= data1.GetBinError(bin);
177  Stat_t dy2= data2.GetBinError(bin);
178  addAsymmetryBinWithError(x,y1,y2,dy1,dy2,data1.GetBinWidth(bin),xErrorFrac,scaleFactor);
179  } else {
180  addAsymmetryBinWithError(x,y1,y2,0,0,data1.GetBinWidth(bin),xErrorFrac,scaleFactor);
181  }
182 
183  } else {
184 
185  if (etype==RooAbsData::Poisson) {
186  addEfficiencyBin(x,roundBin(y1),roundBin(y2),data1.GetBinWidth(bin),xErrorFrac,scaleFactor);
187  } else if (etype==RooAbsData::SumW2) {
188  Stat_t dy1= data1.GetBinError(bin);
189  Stat_t dy2= data2.GetBinError(bin);
190  addEfficiencyBinWithError(x,y1,y2,dy1,dy2,data1.GetBinWidth(bin),xErrorFrac,scaleFactor);
191  } else {
192  addEfficiencyBinWithError(x,y1,y2,0,0,data1.GetBinWidth(bin),xErrorFrac,scaleFactor);
193  }
194 
195  }
196 
197  }
198  // we do not have a meaningful number of entries
199  _entries= -1;
200 }
201 
202 
203 
204 ////////////////////////////////////////////////////////////////////////////////
205 /// Create histogram as sum of two existing histograms. If Poisson errors are selected the histograms are
206 /// added and Poisson confidence intervals are calculated for the summed content. If wgt1 and wgt2 are not
207 /// 1 in this mode, a warning message is printed. If SumW2 errors are selected the histograms are added
208 /// and the histograms errors are added in quadrature, taking the weights into account.
209 
210 RooHist::RooHist(const RooHist& hist1, const RooHist& hist2, Double_t wgt1, Double_t wgt2,
211  RooAbsData::ErrorType etype, Double_t xErrorFrac) : _rawEntries(-1)
212 {
213  // Initialize the histogram
214  initialize() ;
215 
216  // Copy all non-content properties from hist1
217  SetName(hist1.GetName()) ;
218  SetTitle(hist1.GetTitle()) ;
220  _nSigma=hist1._nSigma ;
221  setYAxisLabel(hist1.getYAxisLabel()) ;
222 
223  if (!hist1.hasIdenticalBinning(hist2)) {
224  coutE(InputArguments) << "RooHist::RooHist input histograms have incompatible binning, combined histogram will remain empty" << endl ;
225  return ;
226  }
227 
228  if (etype==RooAbsData::Poisson) {
229  // Add histograms with Poisson errors
230 
231  // Issue warning if weights are not 1
232  if (wgt1!=1.0 || wgt2 != 1.0) {
233  coutW(InputArguments) << "RooHist::RooHist: WARNING: Poisson errors of weighted sum of two histograms is not well defined! " << endl
234  << " Summed histogram bins will rounded to nearest integer for Poisson confidence interval calculation" << endl ;
235  }
236 
237  // Add histograms, calculate Poisson confidence interval on sum value
238  Int_t i,n=hist1.GetN() ;
239  for(i=0 ; i<n ; i++) {
240  Double_t x1,y1,x2,y2,dx1 ;
241  hist1.GetPoint(i,x1,y1) ;
242  dx1 = hist1.GetErrorX(i) ;
243  hist2.GetPoint(i,x2,y2) ;
244  addBin(x1,roundBin(wgt1*y1+wgt2*y2),2*dx1/xErrorFrac,xErrorFrac) ;
245  }
246 
247  } else {
248  // Add histograms with SumW2 errors
249 
250  // Add histograms, calculate combined sum-of-weights error
251  Int_t i,n=hist1.GetN() ;
252  for(i=0 ; i<n ; i++) {
253  Double_t x1,y1,x2,y2,dx1,dy1,dy2 ;
254  hist1.GetPoint(i,x1,y1) ;
255  dx1 = hist1.GetErrorX(i) ;
256  dy1 = hist1.GetErrorY(i) ;
257  dy2 = hist2.GetErrorY(i) ;
258  hist2.GetPoint(i,x2,y2) ;
259  Double_t dy = sqrt(wgt1*wgt1*dy1*dy1+wgt2*wgt2*dy2*dy2) ;
260  addBinWithError(x1,wgt1*y1+wgt2*y2,dy,dy,2*dx1/xErrorFrac,xErrorFrac) ;
261  }
262  }
263 
264 }
265 
266 
267 ////////////////////////////////////////////////////////////////////////////////
268 /// Create histogram from a pdf or function. Errors are computed based on the fit result provided.
269 ///
270 /// This signature is intended for unfolding/deconvolution scenarios,
271 /// where a pdf is constructed as "data minus background" and is thus
272 /// intended to be displayed as "data" (or at least data-like).
273 /// Usage of this signature is triggered by the draw style "P" in RooAbsReal::plotOn.
274 ///
275 /// More details.
276 /// \param[in] f The function to be plotted.
277 /// \param[in] x The variable on the x-axis
278 /// \param[in] xErrorFrac Size of the errror in x as a fraction of the bin width
279 /// \param[in] scaleFactor arbitrary scaling of the y-values
280 /// \param[in] normVars variables over which to normalize
281 RooHist::RooHist(const RooAbsReal &f, RooAbsRealLValue &x, Double_t xErrorFrac, Double_t scaleFactor, const RooArgSet *normVars, const RooFitResult* fr) :
282  TGraphAsymmErrors(), _nSigma(1), _rawEntries(-1)
283 {
284  // grab the function's name and title
285  TString name(f.GetName());
286  SetName(name.Data());
287  TString title(f.GetTitle());
288  SetTitle(title.Data());
289  // append " ( [<funit> ][/ <xunit> ])" to our y-axis label if necessary
290  if(0 != strlen(f.getUnit()) || 0 != strlen(x.getUnit())) {
291  title.Append(" ( ");
292  if(0 != strlen(f.getUnit())) {
293  title.Append(f.getUnit());
294  title.Append(" ");
295  }
296  if(0 != strlen(x.getUnit())) {
297  title.Append("/ ");
298  title.Append(x.getUnit());
299  title.Append(" ");
300  }
301  title.Append(")");
302  }
303  setYAxisLabel(title.Data());
304 
305  RooAbsFunc *funcPtr = nullptr;
306  RooAbsFunc *rawPtr = nullptr;
307  funcPtr= f.bindVars(x,normVars,kTRUE);
308 
309  // apply a scale factor if necessary
310  if(scaleFactor != 1) {
311  rawPtr= funcPtr;
312  funcPtr= new RooScaledFunc(*rawPtr,scaleFactor);
313  }
314 
315  // apply a scale factor if necessary
316  assert(funcPtr);
317 
318  // calculate the points to add to our curve
319  int xbins = x.numBins();
320  RooArgSet nset;
321  if(normVars) nset.add(*normVars);
322  for(int i=0; i<xbins; ++i){
323  double xval = x.getBinning().binCenter(i);
324  double xwidth = x.getBinning().binWidth(i);
325  Axis_t xval_ax = xval;
326  double yval = (*funcPtr)(&xval);
327  double yerr = sqrt(yval);
328  if(fr) yerr = f.getPropagatedError(*fr,nset);
329  addBinWithError(xval_ax,yval,yerr,yerr,xwidth,xErrorFrac,false,scaleFactor) ;
330  _entries += yval;
331  }
332  _nominalBinWidth = 1.;
333 
334  // cleanup
335  delete funcPtr;
336  if(rawPtr) delete rawPtr;
337 }
338 
339 
340 ////////////////////////////////////////////////////////////////////////////////
341 /// Perform common initialization for all constructors.
342 
344 {
345  SetMarkerStyle(8);
346  _entries= 0;
347 }
348 
349 
350 ////////////////////////////////////////////////////////////////////////////////
351 /// Return the number of events of the dataset associated with this RooHist.
352 /// This is the number of events in the RooHist itself, unless a different
353 /// value was specified through setRawEntries()
354 
356 {
357  return (_rawEntries==-1 ? _entries : _rawEntries) ;
358 }
359 
360 
361 ////////////////////////////////////////////////////////////////////////////////
362 /// Calculate integral of histogram in given range
363 
365 {
366  Double_t sum(0) ;
367  for (int i=0 ; i<GetN() ; i++) {
368  Double_t x,y ;
369 
370  GetPoint(i,x,y) ;
371 
372  if (x>=xlo && x<=xhi) {
373  sum += y ;
374  }
375  }
376 
377  if (_rawEntries!=-1) {
378  coutW(Plotting) << "RooHist::getFitRangeNEvt() WARNING: The number of normalisation events associated to histogram " << GetName() << " is not equal to number of events in this histogram."
379  << "\n\t\t This is due a cut being applied while plotting the data. Automatic normalisation over a sub-range of a plot variable assumes"
380  << "\n\t\t that the effect of that cut is uniform across the plot, which may be an incorrect assumption. To obtain a correct normalisation, it needs to be passed explicitly:"
381  << "\n\t\t\t data->plotOn(frame01,CutRange(\"SB1\"));"
382  << "\n\t\t\t const double nData = data->sumEntries(\"\", \"SB1\"); //or the cut string such as sumEntries(\"x > 0.\");"
383  << "\n\t\t\t model.plotOn(frame01, RooFit::Normalization(nData, RooAbsReal::NumEvent), ProjectionRange(\"SB1\"));" << endl ;
384  sum *= _rawEntries / _entries ;
385  }
386 
387  return sum ;
388 }
389 
390 
391 
392 ////////////////////////////////////////////////////////////////////////////////
393 /// Return (average) bin width of this RooHist
394 
396 {
397  return _nominalBinWidth ;
398 }
399 
400 
401 
402 ////////////////////////////////////////////////////////////////////////////////
403 /// Return the nearest positive integer to the input value
404 /// and print a warning if an adjustment is required.
405 
407 {
408  if(y < 0) {
409  coutW(Plotting) << fName << "::roundBin: rounding negative bin contents to zero: " << y << endl;
410  return 0;
411  }
412  Int_t n= (Int_t)(y+0.5);
413  if(fabs(y-n)>1e-6) {
414  coutW(Plotting) << fName << "::roundBin: rounding non-integer bin contents: " << y << endl;
415  }
416  return n;
417 }
418 
419 
420 
421 ////////////////////////////////////////////////////////////////////////////////
422 /// Add a bin to this histogram with the specified integer bin contents
423 /// and using an error bar calculated with Poisson statistics. The bin width
424 /// is used to set the relative scale of bins with different widths.
425 
426 void RooHist::addBin(Axis_t binCenter, Double_t n, Double_t binWidth, Double_t xErrorFrac, Double_t scaleFactor)
427 {
428  if (n<0) {
429  coutW(Plotting) << "RooHist::addBin(" << GetName() << ") WARNING: negative entry set to zero when Poisson error bars are requested" << endl ;
430  }
431 
432  Double_t scale= 1;
433  if(binWidth > 0) {
434  scale= _nominalBinWidth/binWidth;
435  }
436  _entries+= n;
437  Int_t index= GetN();
438 
439  // calculate Poisson errors for this bin
440  Double_t ym,yp,dx(0.5*binWidth);
441 
442  if (fabs((double)((n-Int_t(n))>1e-5))) {
443  // need interpolation
444  Double_t ym1(0),yp1(0),ym2(0),yp2(0) ;
445  Int_t n1 = Int_t(n) ;
446  Int_t n2 = n1+1 ;
447  if(!RooHistError::instance().getPoissonInterval(n1,ym1,yp1,_nSigma) ||
448  !RooHistError::instance().getPoissonInterval(n2,ym2,yp2,_nSigma)) {
449  coutE(Plotting) << "RooHist::addBin: unable to add bin with " << n << " events" << endl;
450  }
451  ym = ym1 + (n-n1)*(ym2-ym1) ;
452  yp = yp1 + (n-n1)*(yp2-yp1) ;
453  coutW(Plotting) << "RooHist::addBin(" << GetName()
454  << ") WARNING: non-integer bin entry " << n << " with Poisson errors, interpolating between Poisson errors of adjacent integer" << endl ;
455  } else {
456  // integer case
457  if(!RooHistError::instance().getPoissonInterval(Int_t(n),ym,yp,_nSigma)) {
458  coutE(Plotting) << "RooHist::addBin: unable to add bin with " << n << " events" << endl;
459  return;
460  }
461  }
462 
463  SetPoint(index,binCenter,n*scale*scaleFactor);
464  SetPointError(index,dx*xErrorFrac,dx*xErrorFrac,scale*(n-ym)*scaleFactor,scale*(yp-n)*scaleFactor);
465  updateYAxisLimits(scale*yp);
466  updateYAxisLimits(scale*ym);
467 }
468 
469 
470 
471 ////////////////////////////////////////////////////////////////////////////////
472 /// Add a bin to this histogram with the specified bin contents
473 /// and error. The bin width is used to set the relative scale of
474 /// bins with different widths.
475 
476 void RooHist::addBinWithError(Axis_t binCenter, Double_t n, Double_t elow, Double_t ehigh, Double_t binWidth,
477  Double_t xErrorFrac, Bool_t correctForBinWidth, Double_t scaleFactor)
478 {
479  Double_t scale= 1;
480  if(binWidth > 0 && correctForBinWidth) {
481  scale= _nominalBinWidth/binWidth;
482  }
483  _entries+= n;
484  Int_t index= GetN();
485 
486  Double_t dx(0.5*binWidth) ;
487  SetPoint(index,binCenter,n*scale*scaleFactor);
488  SetPointError(index,dx*xErrorFrac,dx*xErrorFrac,elow*scale*scaleFactor,ehigh*scale*scaleFactor);
489  updateYAxisLimits(scale*(n-elow));
490  updateYAxisLimits(scale*(n+ehigh));
491 }
492 
493 
494 
495 
496 ////////////////////////////////////////////////////////////////////////////////
497 /// Add a bin to this histogram with the specified bin contents
498 /// and error. The bin width is used to set the relative scale of
499 /// bins with different widths.
500 
501 void RooHist::addBinWithXYError(Axis_t binCenter, Double_t n, Double_t exlow, Double_t exhigh, Double_t eylow, Double_t eyhigh,
502  Double_t scaleFactor)
503 {
504  _entries+= n;
505  Int_t index= GetN();
506 
507  SetPoint(index,binCenter,n*scaleFactor);
508  SetPointError(index,exlow,exhigh,eylow*scaleFactor,eyhigh*scaleFactor);
509  updateYAxisLimits(scaleFactor*(n-eylow));
510  updateYAxisLimits(scaleFactor*(n+eyhigh));
511 }
512 
513 
514 
515 
516 
517 ////////////////////////////////////////////////////////////////////////////////
518 /// Add a bin to this histogram with the value (n1-n2)/(n1+n2)
519 /// using an error bar calculated with Binomial statistics.
520 
521 void RooHist::addAsymmetryBin(Axis_t binCenter, Int_t n1, Int_t n2, Double_t binWidth, Double_t xErrorFrac, Double_t scaleFactor)
522 {
523  Double_t scale= 1;
524  if(binWidth > 0) scale= _nominalBinWidth/binWidth;
525  Int_t index= GetN();
526 
527  // calculate Binomial errors for this bin
528  Double_t ym,yp,dx(0.5*binWidth);
529  if(!RooHistError::instance().getBinomialIntervalAsym(n1,n2,ym,yp,_nSigma)) {
530  coutE(Plotting) << "RooHist::addAsymmetryBin: unable to calculate binomial error for bin with " << n1 << "," << n2 << " events" << endl;
531  return;
532  }
533 
534  Double_t a= (Double_t)(n1-n2)/(n1+n2);
535  SetPoint(index,binCenter,a*scaleFactor);
536  SetPointError(index,dx*xErrorFrac,dx*xErrorFrac,(a-ym)*scaleFactor,(yp-a)*scaleFactor);
537  updateYAxisLimits(scale*yp);
538  updateYAxisLimits(scale*ym);
539 }
540 
541 
542 
543 ////////////////////////////////////////////////////////////////////////////////
544 /// Add a bin to this histogram with the value (n1-n2)/(n1+n2)
545 /// using an error bar calculated with Binomial statistics.
546 
547 void RooHist::addAsymmetryBinWithError(Axis_t binCenter, Double_t n1, Double_t n2, Double_t en1, Double_t en2, Double_t binWidth, Double_t xErrorFrac, Double_t scaleFactor)
548 {
549  Double_t scale= 1;
550  if(binWidth > 0) scale= _nominalBinWidth/binWidth;
551  Int_t index= GetN();
552 
553  // calculate Binomial errors for this bin
554  Double_t ym,yp,dx(0.5*binWidth);
555  Double_t a= (Double_t)(n1-n2)/(n1+n2);
556 
557  Double_t error = 2*sqrt( pow(en1,2)*pow(n2,2) + pow(en2,2)*pow(n1,2) ) / pow(n1+n2,2) ;
558  ym=a-error ;
559  yp=a+error ;
560 
561  SetPoint(index,binCenter,a*scaleFactor);
562  SetPointError(index,dx*xErrorFrac,dx*xErrorFrac,(a-ym)*scaleFactor,(yp-a)*scaleFactor);
563  updateYAxisLimits(scale*yp);
564  updateYAxisLimits(scale*ym);
565 }
566 
567 
568 
569 ////////////////////////////////////////////////////////////////////////////////
570 /// Add a bin to this histogram with the value n1/(n1+n2)
571 /// using an error bar calculated with Binomial statistics.
572 
573 void RooHist::addEfficiencyBin(Axis_t binCenter, Int_t n1, Int_t n2, Double_t binWidth, Double_t xErrorFrac, Double_t scaleFactor)
574 {
575  Double_t scale= 1;
576  if(binWidth > 0) scale= _nominalBinWidth/binWidth;
577  Int_t index= GetN();
578 
579  Double_t a= (Double_t)(n1)/(n1+n2);
580 
581  // calculate Binomial errors for this bin
582  Double_t ym,yp,dx(0.5*binWidth);
583  if(!RooHistError::instance().getBinomialIntervalEff(n1,n2,ym,yp,_nSigma)) {
584  coutE(Plotting) << "RooHist::addEfficiencyBin: unable to calculate binomial error for bin with " << n1 << "," << n2 << " events" << endl;
585  return;
586  }
587 
588  SetPoint(index,binCenter,a*scaleFactor);
589  SetPointError(index,dx*xErrorFrac,dx*xErrorFrac,(a-ym)*scaleFactor,(yp-a)*scaleFactor);
590  updateYAxisLimits(scale*yp);
591  updateYAxisLimits(scale*ym);
592 }
593 
594 
595 
596 ////////////////////////////////////////////////////////////////////////////////
597 /// Add a bin to this histogram with the value n1/(n1+n2)
598 /// using an error bar calculated with Binomial statistics.
599 
600 void RooHist::addEfficiencyBinWithError(Axis_t binCenter, Double_t n1, Double_t n2, Double_t en1, Double_t en2, Double_t binWidth, Double_t xErrorFrac, Double_t scaleFactor)
601 {
602  Double_t scale= 1;
603  if(binWidth > 0) scale= _nominalBinWidth/binWidth;
604  Int_t index= GetN();
605 
606  Double_t a= (Double_t)(n1)/(n1+n2);
607 
608  Double_t error = sqrt( pow(en1,2)*pow(n2,2) + pow(en2,2)*pow(n1,2) ) / pow(n1+n2,2) ;
609 
610  // calculate Binomial errors for this bin
611  Double_t ym,yp,dx(0.5*binWidth);
612  ym=a-error ;
613  yp=a+error ;
614 
615 
616  SetPoint(index,binCenter,a*scaleFactor);
617  SetPointError(index,dx*xErrorFrac,dx*xErrorFrac,(a-ym)*scaleFactor,(yp-a)*scaleFactor);
618  updateYAxisLimits(scale*yp);
619  updateYAxisLimits(scale*ym);
620 }
621 
622 
623 
624 ////////////////////////////////////////////////////////////////////////////////
625 /// Destructor
626 
628 {
629 }
630 
631 
632 
633 ////////////////////////////////////////////////////////////////////////////////
634 /// Return kTRUE if binning of this RooHist is identical to that of 'other'
635 
637 {
638  // First check if number of bins is the same
639  if (GetN() != other.GetN()) {
640  return kFALSE ;
641  }
642 
643  // Next require that all bin centers are the same
644  Int_t i ;
645  for (i=0 ; i<GetN() ; i++) {
646  Double_t x1,x2,y1,y2 ;
647 
648  GetPoint(i,x1,y1) ;
649  other.GetPoint(i,x2,y2) ;
650 
651  if (fabs(x1-x2)>1e-10) {
652  return kFALSE ;
653  }
654 
655  }
656 
657  return kTRUE ;
658 }
659 
660 
661 
662 ////////////////////////////////////////////////////////////////////////////////
663 /// Return kTRUE if contents of this RooHist is identical within given
664 /// relative tolerance to that of 'other'
665 
666 Bool_t RooHist::isIdentical(const RooHist& other, Double_t tol) const
667 {
668  // Make temporary TH1s output of RooHists to perform Kolmogorov test
670  TH1F h_self("h_self","h_self",GetN(),0,1) ;
671  TH1F h_other("h_other","h_other",GetN(),0,1) ;
673 
674  for (Int_t i=0 ; i<GetN() ; i++) {
675  h_self.SetBinContent(i+1,GetY()[i]) ;
676  h_other.SetBinContent(i+1,other.GetY()[i]) ;
677  }
678 
679  Double_t M = h_self.KolmogorovTest(&h_other,"M") ;
680  if (M>tol) {
681  Double_t kprob = h_self.KolmogorovTest(&h_other) ;
682  cout << "RooHist::isIdentical() tolerance exceeded M=" << M << " (tol=" << tol << "), corresponding prob = " << kprob << endl ;
683  return kFALSE ;
684  }
685 
686  return kTRUE ;
687 }
688 
689 
690 
691 ////////////////////////////////////////////////////////////////////////////////
692 /// Print info about this histogram to the specified output stream.
693 ///
694 /// Standard: number of entries
695 /// Shape: error CL and maximum value
696 /// Verbose: print our bin contents and errors
697 
698 void RooHist::printMultiline(ostream& os, Int_t contents, Bool_t verbose, TString indent) const
699 {
701  os << indent << "--- RooHist ---" << endl;
702  Int_t n= GetN();
703  os << indent << " Contains " << n << " bins" << endl;
704  if(verbose) {
705  os << indent << " Errors calculated at" << _nSigma << "-sigma CL" << endl;
706  os << indent << " Bin Contents:" << endl;
707  for(Int_t i= 0; i < n; i++) {
708  os << indent << setw(3) << i << ") x= " << fX[i];
709  if(fEXhigh[i] > 0 || fEXlow[i] > 0) {
710  os << " +" << fEXhigh[i] << " -" << fEXlow[i];
711  }
712  os << " , y = " << fY[i] << " +" << fEYhigh[i] << " -" << fEYlow[i] << endl;
713  }
714  }
715 }
716 
717 
718 
719 ////////////////////////////////////////////////////////////////////////////////
720 /// Print name of RooHist
721 
722 void RooHist::printName(ostream& os) const
723 {
724  os << GetName() ;
725 }
726 
727 
728 
729 ////////////////////////////////////////////////////////////////////////////////
730 /// Print title of RooHist
731 
732 void RooHist::printTitle(ostream& os) const
733 {
734  os << GetTitle() ;
735 }
736 
737 
738 
739 ////////////////////////////////////////////////////////////////////////////////
740 /// Print class name of RooHist
741 
742 void RooHist::printClassName(ostream& os) const
743 {
744  os << IsA()->GetName() ;
745 }
746 
747 
748 
749 ////////////////////////////////////////////////////////////////////////////////
750 /// Create and return RooHist containing residuals w.r.t to given curve.
751 /// If normalize is true, the residuals are normalized by the histogram
752 /// errors creating a RooHist with pull values
753 
754 RooHist* RooHist::makeResidHist(const RooCurve& curve, bool normalize, bool useAverage) const
755 {
756 
757  // Copy all non-content properties from hist1
758  RooHist* hist = new RooHist(_nominalBinWidth) ;
759  if (normalize) {
760  hist->SetName(Form("pull_%s_%s",GetName(),curve.GetName())) ;
761  hist->SetTitle(Form("Pull of %s and %s",GetTitle(),curve.GetTitle())) ;
762  } else {
763  hist->SetName(Form("resid_%s_%s",GetName(),curve.GetName())) ;
764  hist->SetTitle(Form("Residual of %s and %s",GetTitle(),curve.GetTitle())) ;
765  }
766 
767  // Determine range of curve
768  Double_t xstart,xstop,y ;
769  curve.GetPoint(0,xstart,y) ;
770  curve.GetPoint(curve.GetN()-1,xstop,y) ;
771 
772  // Add histograms, calculate Poisson confidence interval on sum value
773  for(Int_t i=0 ; i<GetN() ; i++) {
774  Double_t x,point;
775  GetPoint(i,x,point) ;
776 
777  // Only calculate pull for bins inside curve range
778  if (x<xstart || x>xstop) continue ;
779 
780  Double_t yy ;
781  if (useAverage) {
782  Double_t exl = GetErrorXlow(i);
783  Double_t exh = GetErrorXhigh(i) ;
784  if (exl<=0 ) exl = GetErrorX(i);
785  if (exh<=0 ) exh = GetErrorX(i);
786  if (exl<=0 ) exl = 0.5*getNominalBinWidth();
787  if (exh<=0 ) exh = 0.5*getNominalBinWidth();
788  yy = point - curve.average(x-exl,x+exh) ;
789  } else {
790  yy = point - curve.interpolate(x) ;
791  }
792 
793  Double_t dyl = GetErrorYlow(i) ;
794  Double_t dyh = GetErrorYhigh(i) ;
795  if (normalize) {
796  Double_t norm = (yy>0?dyl:dyh);
797  if (norm==0.) {
798  coutW(Plotting) << "RooHist::makeResisHist(" << GetName() << ") WARNING: point " << i << " has zero error, setting residual to zero" << endl ;
799  yy=0 ;
800  dyh=0 ;
801  dyl=0 ;
802  } else {
803  yy /= norm;
804  dyh /= norm;
805  dyl /= norm;
806  }
807  }
808  hist->addBinWithError(x,yy,dyl,dyh);
809  }
810  return hist ;
811 }
RooHist::printName
virtual void printName(std::ostream &os) const
Print name of RooHist.
Definition: RooHist.cxx:722
TGraphAsymmErrors::GetErrorY
Double_t GetErrorY(Int_t bin) const
This function is called by GraphFitChisquare.
Definition: TGraphAsymmErrors.cxx:1131
TGraphAsymmErrors::GetErrorYhigh
Double_t GetErrorYhigh(Int_t i) const
Get high error on Y.
Definition: TGraphAsymmErrors.cxx:1167
TGraphAsymmErrors::fEYhigh
Double_t * fEYhigh
[fNpoints] array of Y high errors
Definition: TGraphAsymmErrors.h:32
RooHist::_nominalBinWidth
Double_t _nominalBinWidth
Definition: RooHist.h:89
n
const Int_t n
Definition: legend1.C:16
RooScaledFunc.h
TAxis
Class to manage histogram axis.
Definition: TAxis.h:30
RooHist::addEfficiencyBinWithError
void addEfficiencyBinWithError(Axis_t binCenter, Double_t n1, Double_t n2, Double_t en1, Double_t en2, Double_t binWidth=0, Double_t xErrorFrac=1.0, Double_t scaleFactor=1.0)
Add a bin to this histogram with the value n1/(n1+n2) using an error bar calculated with Binomial sta...
Definition: RooHist.cxx:600
TGraphAsymmErrors::SetPointError
virtual void SetPointError(Double_t exl, Double_t exh, Double_t eyl, Double_t eyh)
Set ex and ey values for point pointed by the mouse.
Definition: TGraphAsymmErrors.cxx:1322
RooPlotable::setYAxisLabel
void setYAxisLabel(const char *label)
Definition: RooPlotable.h:32
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:100
e
#define e(i)
Definition: RSha256.hxx:103
RooCurve::average
Double_t average(Double_t lo, Double_t hi) const
Return average curve value in [xFirst,xLast] by integrating curve between points and dividing by xLas...
Definition: RooCurve.cxx:606
TGraph::SetTitle
virtual void SetTitle(const char *title="")
Change (i.e.
Definition: TGraph.cxx:2339
RooMsgService.h
f
#define f(i)
Definition: RSha256.hxx:104
RooHist::~RooHist
virtual ~RooHist()
Destructor.
Definition: RooHist.cxx:627
RooHist::printClassName
virtual void printClassName(std::ostream &os) const
Print class name of RooHist.
Definition: RooHist.cxx:742
RooAbsData::SumW2
@ SumW2
Definition: RooAbsData.h:99
RooFit.h
RooFit::InputArguments
@ InputArguments
Definition: RooGlobalFunc.h:61
TString::Data
const char * Data() const
Definition: TString.h:369
RooHist::getFitRangeBinW
Double_t getFitRangeBinW() const
Return (average) bin width of this RooHist.
Definition: RooHist.cxx:395
RooPlotable::printMultiline
virtual void printMultiline(std::ostream &os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const
Print detailed information.
Definition: RooPlotable.cxx:42
Axis_t
double Axis_t
Definition: RtypesCore.h:85
ClassImp
#define ClassImp(name)
Definition: Rtypes.h:364
Form
char * Form(const char *fmt,...)
TNamed::GetTitle
virtual const char * GetTitle() const
Returns title of object.
Definition: TNamed.h:48
RooHist::RooHist
RooHist()
Default constructor.
Definition: RooHist.cxx:50
sum
static uint64_t sum(uint64_t i)
Definition: Factory.cxx:2345
TGraphAsymmErrors::fEXhigh
Double_t * fEXhigh
[fNpoints] array of X high errors
Definition: TGraphAsymmErrors.h:30
coutE
#define coutE(a)
Definition: RooMsgService.h:33
coutW
#define coutW(a)
Definition: RooMsgService.h:32
Int_t
int Int_t
Definition: RtypesCore.h:45
TH1::GetBinError
virtual Double_t GetBinError(Int_t bin) const
Return value of error associated to bin number bin.
Definition: TH1.cxx:8897
TH1::GetBinWidth
virtual Double_t GetBinWidth(Int_t bin) const
Return bin width for 1D histogram.
Definition: TH1.cxx:8997
TNamed::fName
TString fName
Definition: TNamed.h:32
TGraph::fX
Double_t * fX
[fNpoints] array of X points
Definition: TGraph.h:47
RooCurve.h
TH1::SetBinContent
virtual void SetBinContent(Int_t bin, Double_t content)
Set bin content see convention for numbering bins in TH1::GetBin In case the bin number is greater th...
Definition: TH1.cxx:9056
x
Double_t x[n]
Definition: legend1.C:17
TGraphAsymmErrors::GetErrorX
Double_t GetErrorX(Int_t bin) const
This function is called by GraphFitChisquare.
Definition: TGraphAsymmErrors.cxx:1116
TClass.h
indent
static void indent(ostringstream &buf, int indent_level)
Definition: TClingCallFunc.cxx:87
RooHist::addBin
void addBin(Axis_t binCenter, Double_t n, Double_t binWidth=0, Double_t xErrorFrac=1.0, Double_t scaleFactor=1.0)
Add a bin to this histogram with the specified integer bin contents and using an error bar calculated...
Definition: RooHist.cxx:426
RooAbsReal
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition: RooAbsReal.h:61
TString
Basic string class.
Definition: TString.h:136
RooAbsData::ErrorType
ErrorType
Definition: RooAbsData.h:99
bool
TH1::KolmogorovTest
virtual Double_t KolmogorovTest(const TH1 *h2, Option_t *option="") const
Statistical test of compatibility in shape between this histogram and h2, using Kolmogorov test.
Definition: TH1.cxx:8062
RooFitResult
RooFitResult is a container class to hold the input and output of a PDF fit to a dataset.
Definition: RooFitResult.h:40
RooAbsFunc
Abstract interface for evaluating a real-valued function of one real variable and performing numerica...
Definition: RooAbsFunc.h:27
TGraphAsymmErrors::GetErrorXhigh
Double_t GetErrorXhigh(Int_t i) const
Get high error on X.
Definition: TGraphAsymmErrors.cxx:1145
TAxis::GetTitle
const char * GetTitle() const
Returns title of object.
Definition: TAxis.h:129
x1
static const double x1[5]
Definition: RooGaussKronrodIntegrator1D.cxx:346
RooHistError::instance
static const RooHistError & instance()
Return a reference to a singleton object that is created the first time this method is called.
Definition: RooHistError.cxx:49
ROOT::Math::fabs
VecExpr< UnaryOp< Fabs< T >, VecExpr< A, T, D >, T >, T, D > fabs(const VecExpr< A, T, D > &rhs)
Definition: UnaryOperators.h:131
TH1::GetBinContent
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
Definition: TH1.cxx:4993
TAxis::GetXmin
Double_t GetXmin() const
Definition: TAxis.h:133
TH1::GetYaxis
TAxis * GetYaxis()
Definition: TH1.h:321
TGraph::SetName
virtual void SetName(const char *name="")
Set graph name.
Definition: TGraph.cxx:2323
TGraphAsymmErrors::GetErrorXlow
Double_t GetErrorXlow(Int_t i) const
Get low error on X.
Definition: TGraphAsymmErrors.cxx:1156
Double_t
a
auto * a
Definition: textangle.C:12
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:101
TString::Append
TString & Append(const char *cs)
Definition: TString.h:564
TGraphAsymmErrors::fEYlow
Double_t * fEYlow
[fNpoints] array of Y low errors
Definition: TGraphAsymmErrors.h:31
TH1::AddDirectory
static void AddDirectory(Bool_t add=kTRUE)
Sets the flag controlling the automatic add of histograms in memory.
Definition: TH1.cxx:1282
TH1::GetBinCenter
virtual Double_t GetBinCenter(Int_t bin) const
Return bin center for 1D histogram.
Definition: TH1.cxx:8975
RooFit::Plotting
@ Plotting
Definition: RooGlobalFunc.h:60
RooPlotable::getYAxisLabel
const char * getYAxisLabel() const
Definition: RooPlotable.h:31
RooAbsCollection::add
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
Definition: RooAbsCollection.cxx:455
RooCurve
A RooCurve is a one-dimensional graphical representation of a real-valued function.
Definition: RooCurve.h:32
RooHist::addEfficiencyBin
void addEfficiencyBin(Axis_t binCenter, Int_t n1, Int_t n2, Double_t binWidth=0, Double_t xErrorFrac=1.0, Double_t scaleFactor=1.0)
Add a bin to this histogram with the value n1/(n1+n2) using an error bar calculated with Binomial sta...
Definition: RooHist.cxx:573
RooHist::initialize
void initialize()
Perform common initialization for all constructors.
Definition: RooHist.cxx:343
RooHist::makeResidHist
RooHist * makeResidHist(const RooCurve &curve, bool normalize=false, bool useAverage=false) const
Create and return RooHist containing residuals w.r.t to given curve.
Definition: RooHist.cxx:754
TGraph::fY
Double_t * fY
[fNpoints] array of Y points
Definition: TGraph.h:48
y
Double_t y[n]
Definition: legend1.C:17
TGraph::GetY
Double_t * GetY() const
Definition: TGraph.h:132
sqrt
double sqrt(double)
RooHist::addAsymmetryBinWithError
void addAsymmetryBinWithError(Axis_t binCenter, Double_t n1, Double_t n2, Double_t en1, Double_t en2, Double_t binWidth=0, Double_t xErrorFrac=1.0, Double_t scaleFactor=1.0)
Add a bin to this histogram with the value (n1-n2)/(n1+n2) using an error bar calculated with Binomia...
Definition: RooHist.cxx:547
TGraphAsymmErrors
TGraph with asymmetric error bars.
Definition: TGraphAsymmErrors.h:26
RooHist::isIdentical
Bool_t isIdentical(const RooHist &other, Double_t tol=1e-6) const
Return kTRUE if contents of this RooHist is identical within given relative tolerance to that of 'oth...
Definition: RooHist.cxx:666
RooHist
A RooHist is a graphical representation of binned data based on the TGraphAsymmErrors class.
Definition: RooHist.h:27
TGraph::SetPoint
virtual void SetPoint(Int_t i, Double_t x, Double_t y)
Set x and y values for point number i.
Definition: TGraph.cxx:2284
RooAbsData::Poisson
@ Poisson
Definition: RooAbsData.h:99
RooHist.h
TGraph::GetPoint
virtual Int_t GetPoint(Int_t i, Double_t &x, Double_t &y) const
Get x and y values for point number i.
Definition: TGraph.cxx:1607
RooHist::addAsymmetryBin
void addAsymmetryBin(Axis_t binCenter, Int_t n1, Int_t n2, Double_t binWidth=0, Double_t xErrorFrac=1.0, Double_t scaleFactor=1.0)
Add a bin to this histogram with the value (n1-n2)/(n1+n2) using an error bar calculated with Binomia...
Definition: RooHist.cxx:521
RooHist::_rawEntries
Double_t _rawEntries
Definition: RooHist.h:92
Double_t
double Double_t
Definition: RtypesCore.h:59
RooHist::printTitle
virtual void printTitle(std::ostream &os) const
Print title of RooHist.
Definition: RooHist.cxx:732
RooPlotable::updateYAxisLimits
void updateYAxisLimits(Double_t y)
Definition: RooPlotable.h:33
TH1F
1-D histogram with a float per channel (see TH1 documentation)}
Definition: TH1.h:575
RooCurve::interpolate
Double_t interpolate(Double_t x, Double_t tolerance=1e-10) const
Return linearly interpolated value of curve at xvalue.
Definition: RooCurve.cxx:692
TH1
TH1 is the base class of all histogram classes in ROOT.
Definition: TH1.h:58
TGraphAsymmErrors::fEXlow
Double_t * fEXlow
[fNpoints] array of X low errors
Definition: TGraphAsymmErrors.h:29
TGraph::GetN
Int_t GetN() const
Definition: TGraph.h:124
name
char name[80]
Definition: TGX11.cxx:110
RooHist::_entries
Double_t _entries
Definition: RooHist.h:91
RooScaledFunc
Lightweight RooAbsFunction implementation that applies a constant scale factor to another RooAbsFunc.
Definition: RooScaledFunc.h:22
genreflex::verbose
bool verbose
Definition: rootcling_impl.cxx:133
x2
static const double x2[5]
Definition: RooGaussKronrodIntegrator1D.cxx:364
RooHist::roundBin
Int_t roundBin(Double_t y)
Return the nearest positive integer to the input value and print a warning if an adjustment is requir...
Definition: RooHist.cxx:406
RooHist::addBinWithError
void addBinWithError(Axis_t binCenter, Double_t n, Double_t elow, Double_t ehigh, Double_t binWidth=0, Double_t xErrorFrac=1.0, Bool_t correctForBinWidth=kTRUE, Double_t scaleFactor=1.0)
Add a bin to this histogram with the specified bin contents and error.
Definition: RooHist.cxx:476
RooHist::printMultiline
virtual void printMultiline(std::ostream &os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const
Print info about this histogram to the specified output stream.
Definition: RooHist.cxx:698
RooHist::getFitRangeNEvt
Double_t getFitRangeNEvt() const
Return the number of events of the dataset associated with this RooHist.
Definition: RooHist.cxx:355
TAttMarker::SetMarkerStyle
virtual void SetMarkerStyle(Style_t mstyle=1)
Set the marker style.
Definition: TAttMarker.h:40
TNamed::GetName
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:47
RooHist::getNominalBinWidth
Double_t getNominalBinWidth() const
Definition: RooHist.h:71
TAxis::GetXmax
Double_t GetXmax() const
Definition: TAxis.h:134
Stat_t
double Stat_t
Definition: RtypesCore.h:86
Riostream.h
pow
double pow(double, double)
RooHist::hasIdenticalBinning
Bool_t hasIdenticalBinning(const RooHist &other) const
Return kTRUE if binning of this RooHist is identical to that of 'other'.
Definition: RooHist.cxx:636
RooHistError.h
RooAbsRealLValue
RooAbsRealLValue is the common abstract base class for objects that represent a real value that may a...
Definition: RooAbsRealLValue.h:31
TH1.h
TAxis::GetNbins
Int_t GetNbins() const
Definition: TAxis.h:121
RooHist::_nSigma
Double_t _nSigma
Definition: RooHist.h:90
TGraphAsymmErrors::GetErrorYlow
Double_t GetErrorYlow(Int_t i) const
Get low error on Y.
Definition: TGraphAsymmErrors.cxx:1178
RooArgSet
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgSet.h:33
fw3dlego::xbins
const double xbins[xbins_n]
Definition: collection_proxies.C:48
TH1::GetNbinsX
virtual Int_t GetNbinsX() const
Definition: TH1.h:296
RooHist::addBinWithXYError
void addBinWithXYError(Axis_t binCenter, Double_t n, Double_t exlow, Double_t exhigh, Double_t eylow, Double_t eyhigh, Double_t scaleFactor=1.0)
Add a bin to this histogram with the specified bin contents and error.
Definition: RooHist.cxx:501
int