Logo ROOT  
Reference Guide
RooUniformBinning.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitCore *
4 * File: $Id: RooUniformBinning.h,v 1.10 2007/05/11 09:11:30 verkerke Exp $
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#ifndef ROO_UNIFORM_BINNING
17#define ROO_UNIFORM_BINNING
18
19#include "Rtypes.h"
20#include "RooAbsBinning.h"
21class TIterator ;
22
24public:
25
26 RooUniformBinning(const char* name=0) ;
27 RooUniformBinning(double xlo, double xhi, Int_t nBins, const char* name=0) ;
28 RooUniformBinning(const RooUniformBinning& other, const char* name=0) ;
29 RooAbsBinning* clone(const char* name=0) const override { return new RooUniformBinning(*this,name?name:GetName()) ; }
30 ~RooUniformBinning() override ;
31
32 void setRange(double xlo, double xhi) override ;
33
34 Int_t numBoundaries() const override { return _nbins + 1 ; }
35 Int_t binNumber(double x) const override ;
36 bool isUniform() const override { return true ; }
37
38 double lowBound() const override { return _xlo ; }
39 double highBound() const override { return _xhi ; }
40
41 double binCenter(Int_t bin) const override ;
42 double binWidth(Int_t bin) const override ;
43 double binLow(Int_t bin) const override ;
44 double binHigh(Int_t bin) const override ;
45
46 double averageBinWidth() const override { return _binw ; }
47 double* array() const override ;
48
49protected:
50
51 mutable double* _array ; ///<! do not persist
52 double _xlo ;
53 double _xhi ;
55 double _binw ;
56
57
58 ClassDefOverride(RooUniformBinning,1) // Uniform binning specification
59};
60
61#endif
#define ClassDefOverride(name, id)
Definition: Rtypes.h:339
char name[80]
Definition: TGX11.cxx:110
RooAbsBinning is the abstract base class for RooRealVar binning definitions.
Definition: RooAbsBinning.h:26
RooUniformBinning is an implementation of RooAbsBinning that provides a uniform binning in 'n' bins b...
double * array() const override
Return an array of doubles with the bin boundaries.
void setRange(double xlo, double xhi) override
Change range to [xlo,xhi].
double binLow(Int_t bin) const override
Return the low edge of the 'i'-th fit bin.
Int_t binNumber(double x) const override
Return the index of the bin that encloses 'x'.
double highBound() const override
~RooUniformBinning() override
Destructor.
double binHigh(Int_t bin) const override
Return the high edge of the 'i'-th fit bin.
double lowBound() const override
double binCenter(Int_t bin) const override
Return the central value of the 'i'-th fit bin.
double * _array
! do not persist
RooUniformBinning(const char *name=0)
Default Constructor coverity[UNINIT_CTOR].
RooAbsBinning * clone(const char *name=0) const override
double averageBinWidth() const override
Int_t numBoundaries() const override
double binWidth(Int_t bin) const override
Return the bin width (same for all bins)
bool isUniform() const override
Iterator abstract base class.
Definition: TIterator.h:30
const char * GetName() const override
Returns name of object.
Definition: TNamed.h:47
Double_t x[n]
Definition: legend1.C:17