RooHistPdf.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * Project: RooFit                                                           *
00003  * Package: RooFitCore                                                       *
00004  *    File: $Id: RooHistPdf.h 37219 2010-12-03 12:51: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_HIST_PDF
00017 #define ROO_HIST_PDF
00018 
00019 #include "RooAbsPdf.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 RooHistPdf : public RooAbsPdf {
00029 public:
00030   RooHistPdf() ; 
00031   RooHistPdf(const char *name, const char *title, const RooArgSet& vars, const RooDataHist& dhist, Int_t intOrder=0);
00032   RooHistPdf(const char *name, const char *title, const RooArgList& pdfObs, const RooArgList& histObs, const RooDataHist& dhist, Int_t intOrder=0);
00033   RooHistPdf(const RooHistPdf& other, const char* name=0);
00034   virtual TObject* clone(const char* newname) const { return new RooHistPdf(*this,newname); }
00035   virtual ~RooHistPdf() ;
00036 
00037   RooDataHist& dataHist()  { 
00038     // Return RooDataHist that is represented
00039     return *_dataHist ; 
00040   }
00041   const RooDataHist& dataHist() const { 
00042     // Return RooDataHist that is represented
00043     return *_dataHist ; 
00044   }
00045   
00046   void setInterpolationOrder(Int_t order) { 
00047     // Set histogram interpolation order 
00048     _intOrder = order ; 
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   Bool_t getCdfBoundaries() const { 
00063     // If true, special boundary conditions for c.d.f.s are used
00064     return _cdfBoundaries ; 
00065   }
00066 
00067   void setUnitNorm(Bool_t flag) { 
00068     // Declare contents to have unit normalization
00069     _unitNorm = flag ; 
00070   }
00071   Bool_t haveUnitNorm() const { 
00072     // Return true if contents is declared to be unit normalized
00073     return _unitNorm ; 
00074   }
00075 
00076   virtual Bool_t selfNormalized() const { return _unitNorm ; }
00077 
00078   virtual Int_t getMaxVal(const RooArgSet& vars) const ;
00079   virtual Double_t maxVal(Int_t code) const ;
00080 
00081   virtual std::list<Double_t>* plotSamplingHint(RooAbsRealLValue& obs, Double_t xlo, Double_t xhi) const ; 
00082 
00083 protected:
00084 
00085   Bool_t importWorkspaceHook(RooWorkspace& ws) ;
00086   
00087   Double_t evaluate() const;
00088   Double_t totalVolume() const ;
00089   friend class RooAbsCachedPdf ;
00090   Double_t totVolume() const ;
00091 
00092   RooArgSet         _histObsList ; // List of observables defining dimensions of histogram
00093   RooSetProxy       _pdfObsList ;  // List of observables mapped onto histogram observables
00094   RooDataHist*      _dataHist ;  // Unowned pointer to underlying histogram
00095   TIterator*         _histObsIter ; //! 
00096   TIterator*         _pdfObsIter ; //! 
00097   mutable RooAICRegistry _codeReg ; //! Auxiliary class keeping tracking of analytical integration code
00098   Int_t             _intOrder ; // Interpolation order
00099   Bool_t            _cdfBoundaries ; // Use boundary conditions for CDFs.
00100   mutable Double_t  _totVolume ; //! Total volume of space (product of ranges of observables)
00101   Bool_t            _unitNorm  ; // Assume contents is unit normalized (for use as pdf cache)
00102 
00103   ClassDef(RooHistPdf,4) // Histogram based PDF
00104 };
00105 
00106 #endif

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