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) : RooAbsBinning{name} {}
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
30 void setRange(double xlo, double xhi) override ;
31
32 Int_t numBoundaries() const override { return _nbins + 1 ; }
33 void binNumbers(double const * x, int * bins, std::size_t n, int coef) const override;
34 bool isUniform() const override { return true ; }
35
36 double lowBound() const override { return _xlo ; }
37 double highBound() const override { return _xhi ; }
38
39 double binCenter(Int_t bin) const override ;
40 double binWidth(Int_t bin) const override ;
41 double binLow(Int_t bin) const override ;
42 double binHigh(Int_t bin) const override ;
43
44 double averageBinWidth() const override { return _binw ; }
45 double* array() const override ;
46
47protected:
48 mutable std::vector<double> _array; ///<! do not persist
49 double _xlo;
50 double _xhi;
52 double _binw;
53
54 ClassDefOverride(RooUniformBinning, 1) // Uniform binning specification
55};
56
57#endif
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
char name[80]
Definition TGX11.cxx:110
Abstract base class for RooRealVar binning definitions.
Implementation of RooAbsBinning that provides a uniform binning in 'n' bins between the range end poi...
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].
std::vector< double > _array
! do not persist
double binLow(Int_t bin) const override
Return the low edge of the 'i'-th fit bin.
double highBound() const override
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.
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
RooUniformBinning(const char *name=nullptr)
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