RooProjectedPdf.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * Project: RooFit                                                           *
00003  *                                                                           *
00004  * Copyright (c) 2000-2005, Regents of the University of California          *
00005  *                          and Stanford University. All rights reserved.    *
00006  *                                                                           *
00007  * Redistribution and use in source and binary forms,                        *
00008  * with or without modification, are permitted according to the terms        *
00009  * listed in LICENSE (http://roofit.sourceforge.net/license.txt)             *
00010  *****************************************************************************/
00011 
00012 #ifndef ROOPROJECTEDPDF
00013 #define ROOPROJECTEDPDF
00014 
00015 #include "RooAbsPdf.h"
00016 #include "RooRealProxy.h"
00017 #include "RooAbsReal.h"
00018 #include "RooObjCacheManager.h"
00019 #include "RooSetProxy.h" 
00020 
00021 class RooProjectedPdf : public RooAbsPdf {
00022 public:
00023 
00024   RooProjectedPdf() ;
00025   RooProjectedPdf(const char *name, const char *title,  RooAbsReal& _intpdf, const RooArgSet& intObs);
00026   RooProjectedPdf(const RooProjectedPdf& other, const char* name=0) ;
00027   virtual TObject* clone(const char* newname) const { return new RooProjectedPdf(*this,newname); }
00028   inline virtual ~RooProjectedPdf() { }
00029 
00030   // Analytical integration support
00031   virtual Int_t getAnalyticalIntegralWN(RooArgSet& allVars, RooArgSet& analVars, const RooArgSet* normSet, const char* rangeName=0) const ;
00032   virtual Double_t analyticalIntegralWN(Int_t code, const RooArgSet* normSet, const char* rangeName=0) const ;
00033   virtual Bool_t forceAnalyticalInt(const RooAbsArg& dep) const ;
00034 
00035   virtual Double_t getVal(const RooArgSet* set=0) const ;
00036 
00037   Int_t getGenerator(const RooArgSet& directVars, RooArgSet &generateVars, Bool_t staticInitOK=kTRUE) const;
00038   void initGenerator(Int_t /*code*/) {} ; // optional pre-generation initialization
00039   void generateEvent(Int_t code);
00040 
00041   virtual Bool_t selfNormalized() const { return kTRUE ; }
00042 
00043   // Handle projection of projection explicitly
00044   virtual RooAbsPdf* createProjection(const RooArgSet& iset) ;  
00045 
00046   void printMetaArgs(ostream& os) const ;
00047 
00048 
00049 protected:
00050 
00051   RooRealProxy intpdf ; // p.d.f that is integrated
00052   RooSetProxy intobs ;  // observables that p.d.f is integrated over
00053   RooSetProxy deps ;    // dependents of this p.d.f
00054 
00055   class CacheElem : public RooAbsCacheElement {
00056   public:
00057     virtual ~CacheElem() { delete _projection ; } ;
00058     // Payload
00059     RooAbsReal* _projection ;
00060     // Cache management functions
00061     virtual RooArgList containedArgs(Action) ; 
00062     virtual void printCompactTreeHook(std::ostream&, const char *, Int_t, Int_t) ;
00063   } ;
00064   mutable RooObjCacheManager _cacheMgr ; //! The cache manager
00065 
00066   Bool_t redirectServersHook(const RooAbsCollection& newServerList, Bool_t /*mustReplaceAll*/, Bool_t /*nameChange*/, Bool_t /*isRecursive*/) ;
00067   
00068   mutable RooArgSet* _curNormSet ; //!
00069 
00070   const RooAbsReal* getProjection(const RooArgSet* iset, const RooArgSet* nset, const char* rangeName, int& code) const ;
00071   Double_t evaluate() const ;
00072 
00073 private:
00074 
00075   ClassDef(RooProjectedPdf,1) // Operator p.d.f calculating projection of another p.d.f
00076 };
00077  
00078 #endif

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