Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/RooUniformBinning.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /*****************************************************************************
0002  * Project: RooFit                                                           *
0003  * Package: RooFitCore                                                       *
0004  *    File: $Id: RooUniformBinning.h,v 1.10 2007/05/11 09:11:30 verkerke Exp $
0005  * Authors:                                                                  *
0006  *   WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu       *
0007  *   DK, David Kirkby,    UC Irvine,         dkirkby@uci.edu                 *
0008  *                                                                           *
0009  * Copyright (c) 2000-2005, Regents of the University of California          *
0010  *                          and Stanford University. All rights reserved.    *
0011  *                                                                           *
0012  * Redistribution and use in source and binary forms,                        *
0013  * with or without modification, are permitted according to the terms        *
0014  * listed in LICENSE (http://roofit.sourceforge.net/license.txt)             *
0015  *****************************************************************************/
0016 #ifndef ROO_UNIFORM_BINNING
0017 #define ROO_UNIFORM_BINNING
0018 
0019 #include "Rtypes.h"
0020 #include "RooAbsBinning.h"
0021 
0022 class RooUniformBinning : public RooAbsBinning {
0023 public:
0024 
0025   RooUniformBinning(const char* name=nullptr) : RooAbsBinning{name} {}
0026   RooUniformBinning(double xlo, double xhi, Int_t nBins, const char* name=nullptr) ;
0027   RooUniformBinning(const RooUniformBinning& other, const char* name=nullptr) ;
0028   RooAbsBinning* clone(const char* name=nullptr) const override { return new RooUniformBinning(*this,name?name:GetName()) ; }
0029 
0030   void setRange(double xlo, double xhi) override ;
0031 
0032   Int_t numBoundaries() const override { return _nbins + 1 ; }
0033   void binNumbers(double const * x, int * bins, std::size_t n, int coef) const override;
0034   bool isUniform() const override { return true ; }
0035 
0036   double lowBound() const override { return _xlo ; }
0037   double highBound() const override { return _xhi ; }
0038 
0039   double binCenter(Int_t bin) const override ;
0040   double binWidth(Int_t bin) const override ;
0041   double binLow(Int_t bin) const override ;
0042   double binHigh(Int_t bin) const override ;
0043 
0044   double averageBinWidth() const override { return _binw ; }
0045   double* array() const override ;
0046 
0047 protected:
0048    mutable std::vector<double> _array; ///<! do not persist
0049    double _xlo;
0050    double _xhi;
0051    Int_t _nbins;
0052    double _binw;
0053 
0054    ClassDefOverride(RooUniformBinning, 1) // Uniform binning specification
0055 };
0056 
0057 #endif