RooParamBinning.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * Project: RooFit                                                           *
00003  * Package: RooFitCore                                                       *
00004  *    File: $Id: RooParamBinning.h 28285 2009-04-20 14:33:36Z wouter $
00005  * Authors:                                                                  *
00006  *   WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu       *
00007  *   DK, David Kirkby,    UC Irvine,         dkirkby@uci.edu                 *
00008  *                                                                           *
00009  * Copyright (c) 2000-2005, Regents of the University of California          *
00010  *                          and Stanford University. All rights reserved.    *
00011  *                                                                           *
00012  * Redistribution and use in source and binary forms,                        *
00013  * with or without modification, are permitted according to the terms        *
00014  * listed in LICENSE (http://roofit.sourceforge.net/license.txt)             *
00015  *****************************************************************************/
00016 #ifndef ROO_PARAM_BINNING
00017 #define ROO_PARAM_BINNING
00018 
00019 #include "Rtypes.h"
00020 #include "RooAbsBinning.h"
00021 #include "RooRealVar.h"
00022 #include "RooListProxy.h"
00023 class TIterator ;
00024 
00025 class RooParamBinning : public RooAbsBinning {
00026 public:
00027 
00028   RooParamBinning(const char* name=0) ;
00029   RooParamBinning(RooAbsReal& xlo, RooAbsReal& xhi, Int_t nBins, const char* name=0) ;
00030   RooParamBinning(const RooParamBinning& other, const char* name=0) ;
00031   RooAbsBinning* clone(const char* name=0) const { return new RooParamBinning(*this,name?name:GetName()) ; }
00032   virtual ~RooParamBinning() ;
00033 
00034   virtual void setRange(Double_t xlo, Double_t xhi) ;
00035 
00036   virtual Int_t numBoundaries() const { return _nbins + 1 ; }
00037   virtual Int_t binNumber(Double_t x) const  ;
00038 
00039   virtual Double_t lowBound() const { return xlo()->getVal() ; }
00040   virtual Double_t highBound() const { return xhi()->getVal() ; }
00041 
00042   virtual Double_t binCenter(Int_t bin) const ;
00043   virtual Double_t binWidth(Int_t bin) const ;
00044   virtual Double_t binLow(Int_t bin) const ;
00045   virtual Double_t binHigh(Int_t bin) const ;
00046 
00047   virtual Double_t averageBinWidth() const { return _binw ; }
00048   virtual Double_t* array() const ;
00049 
00050   void printMultiline(ostream &os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const ;
00051 
00052   virtual void insertHook(RooAbsRealLValue&) const  ;
00053   virtual void removeHook(RooAbsRealLValue&) const  ;
00054 
00055   virtual Bool_t isShareable() const { return kFALSE ; } // parameterized binning cannot be shared across instances
00056   virtual Bool_t isParameterized() const { return kTRUE ; } // binning is parameterized, range will need special handling in integration
00057   virtual RooAbsReal* lowBoundFunc() const { return xlo() ; }
00058   virtual RooAbsReal* highBoundFunc() const { return xhi() ; }
00059 
00060 protected:
00061 
00062   mutable Double_t* _array ; //! do not persist
00063   mutable RooAbsReal* _xlo ; //!
00064   mutable RooAbsReal* _xhi ; //!
00065   Int_t    _nbins ;
00066   Double_t _binw ;
00067   mutable RooListProxy* _lp ; //
00068   mutable RooAbsArg* _owner ; //
00069 
00070   RooAbsReal* xlo() const { return _lp ? ((RooAbsReal*)_lp->at(0)) : _xlo ; }
00071   RooAbsReal* xhi() const { return _lp ? ((RooAbsReal*)_lp->at(1)) : _xhi ; }
00072 
00073   ClassDef(RooParamBinning,2) // Binning specification with ranges parameterized by external RooAbsReal functions
00074 };
00075 
00076 #endif

Generated on Tue Jul 5 14:26:15 2011 for ROOT_528-00b_version by  doxygen 1.5.1