Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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"
21
23public:
24
25 RooUniformBinning(const char* name=nullptr) ;
26 RooUniformBinning(double xlo, double xhi, Int_t nBins, const char* name=nullptr) ;
27 RooUniformBinning(const RooUniformBinning& other, const char* name=nullptr) ;
28 RooAbsBinning* clone(const char* name=nullptr) const override { return new RooUniformBinning(*this,name?name:GetName()) ; }
29 ~RooUniformBinning() override ;
30
31 void setRange(double xlo, double xhi) override ;
32
33 Int_t numBoundaries() const override { return _nbins + 1 ; }
34 void binNumbers(double const * x, int * bins, std::size_t n, int coef) const override;
35 bool isUniform() const override { return true ; }
36
37 double lowBound() const override { return _xlo ; }
38 double highBound() const override { return _xhi ; }
39
40 double binCenter(Int_t bin) const override ;
41 double binWidth(Int_t bin) const override ;
42 double binLow(Int_t bin) const override ;
43 double binHigh(Int_t bin) const override ;
44
45 double averageBinWidth() const override { return _binw ; }
46 double* array() const override ;
47
48protected:
49
50 mutable double* _array ; ///<! do not persist
51 double _xlo ;
52 double _xhi ;
54 double _binw ;
55
56
57 ClassDefOverride(RooUniformBinning,1) // Uniform binning specification
58};
59
60#endif
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
char name[80]
Definition TGX11.cxx:110
RooAbsBinning is the abstract base class for RooRealVar binning definitions.
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.
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
void binNumbers(double const *x, int *bins, std::size_t n, int coef) const override
Return the index of the bin that encloses 'x'.
double averageBinWidth() const override
Int_t numBoundaries() const override
RooAbsBinning * clone(const char *name=nullptr) const override
double binWidth(Int_t bin) const override
Return the bin width (same for all bins)
bool isUniform() const override
const char * GetName() const override
Returns name of object.
Definition TNamed.h:47
Double_t x[n]
Definition legend1.C:17
const Int_t n
Definition legend1.C:16