RooHistFunc.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * Project: RooFit                                                           *
00003  * Package: RooFitCore                                                       *
00004  *    File: $Id: RooHistFunc.h 25209 2008-08-22 13:08:40Z 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_HIST_FUNC
00017 #define ROO_HIST_FUNC
00018 
00019 #include "RooAbsReal.h"
00020 #include "RooRealProxy.h"
00021 #include "RooSetProxy.h"
00022 #include "RooAICRegistry.h"
00023 
00024 class RooRealVar;
00025 class RooAbsReal;
00026 class RooDataHist ;
00027 
00028 class RooHistFunc : public RooAbsReal {
00029 public:
00030   RooHistFunc() ; 
00031   RooHistFunc(const char *name, const char *title, const RooArgSet& vars, const RooDataHist& dhist, Int_t intOrder=0);
00032   RooHistFunc(const RooHistFunc& other, const char* name=0);
00033   virtual TObject* clone(const char* newname) const { return new RooHistFunc(*this,newname); }
00034   inline virtual ~RooHistFunc() { }
00035 
00036   RooDataHist& dataHist()  { 
00037     // Return RooDataHist that is represented
00038     return *_dataHist ; 
00039   }
00040   const RooDataHist& dataHist() const { 
00041     // Return RooDataHist that is represented
00042     return *_dataHist ; 
00043   }
00044   
00045   void setInterpolationOrder(Int_t order) { 
00046     // Set histogram interpolation order 
00047     _intOrder = order ; 
00048   }
00049 
00050   Int_t getInterpolationOrder() const { 
00051     // Return histogram interpolation order
00052     return _intOrder ; 
00053   }
00054 
00055   Int_t getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& analVars, const char* rangeName=0) const ;
00056   Double_t analyticalIntegral(Int_t code, const char* rangeName=0) const ;
00057 
00058   void setCdfBoundaries(Bool_t flag) { 
00059     // Set use of special boundary conditions for c.d.f.s
00060     _cdfBoundaries = flag ; 
00061   }
00062 
00063   Bool_t getCdfBoundaries() const { 
00064     // If true, special boundary conditions for c.d.f.s are used
00065     return _cdfBoundaries ; 
00066   }
00067 
00068   virtual std::list<Double_t>* plotSamplingHint(RooAbsRealLValue& obs, Double_t xlo, Double_t xhi) const ; 
00069 
00070 protected:
00071 
00072   Double_t evaluate() const;
00073   Double_t totalVolume() const ;
00074   friend class RooAbsCachedReal ;
00075   Double_t totVolume() const ;
00076 
00077   RooSetProxy       _depList ;   // List of dependents defining dimensions of histogram
00078   RooDataHist*      _dataHist ;  // Unowned pointer to underlying histogram
00079   mutable RooAICRegistry _codeReg ; //! Auxiliary class keeping tracking of analytical integration code
00080   Int_t             _intOrder ; // Interpolation order
00081   Bool_t            _cdfBoundaries ; // Use boundary conditions for CDFs.
00082   mutable Double_t  _totVolume ; //! Total volume of space (product of ranges of observables)
00083   Bool_t            _unitNorm  ; //! Assume contents is unit normalized (for use as pdf cache)
00084 
00085   ClassDef(RooHistFunc,1) // Histogram based function
00086 };
00087 
00088 #endif

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