RooEffProd.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * Project: RooFit                                                           *
00003  * Package: RooFitModels                                                     *
00004  *    File: $Id: RooEffProd.h,v 1.2 2007/05/11 10:14:56 verkerke Exp $
00005  * Authors:                                                                  *
00006  *   GR, Gerhard Raven, NIKHEF/VU                                            *
00007  *                                                                           *
00008  * Redistribution and use in source and binary forms,                        *
00009  * with or without modification, are permitted according to the terms        *
00010  * listed in LICENSE (http://roofit.sourceforge.net/license.txt)             *
00011  *****************************************************************************/
00012 #ifndef ROO_EFF_PROD
00013 #define ROO_EFF_PROD
00014 
00015 #include "RooAbsPdf.h"
00016 #include "RooAbsReal.h"
00017 #include "RooRealProxy.h"
00018 #include "RooObjCacheManager.h"
00019 
00020 class RooEffProd: public RooAbsPdf {
00021 public:
00022   // Constructors, assignment etc
00023   inline RooEffProd() : _nset(0), _fixedNset(0) { };
00024   virtual ~RooEffProd();
00025   RooEffProd(const char *name, const char *title, RooAbsPdf& pdf, RooAbsReal& efficiency);
00026   RooEffProd(const RooEffProd& other, const char* name=0);
00027 
00028   virtual TObject* clone(const char* newname) const { return new RooEffProd(*this,newname); }
00029 
00030   virtual RooAbsGenContext* genContext(const RooArgSet &vars, const RooDataSet *prototype,
00031                                        const RooArgSet* auxProto, Bool_t verbose) const;
00032 
00033   virtual Double_t getVal(const RooArgSet* set=0) const ;
00034 
00035   virtual Bool_t forceAnalyticalInt(const RooAbsArg& /*dep*/) const { 
00036     // Return kTRUE to force RooRealIntegral to offer all observables for internal integration
00037     return kTRUE ; 
00038   }
00039   Int_t getAnalyticalIntegralWN(RooArgSet& allVars, RooArgSet& numVars, const RooArgSet* normSet, const char* rangeName=0) const ;
00040   Double_t analyticalIntegralWN(Int_t code, const RooArgSet* normSet, const char* rangeName=0) const ;
00041   
00042 protected:
00043   
00044   const RooAbsPdf* pdf() const { 
00045     // Return pointer to pdf in product
00046     return (RooAbsPdf*) _pdf.absArg() ; 
00047   }
00048   const RooAbsReal* eff() const { 
00049     // Return pointer to efficiency function in product
00050     return (RooAbsReal*) _eff.absArg() ; 
00051   }
00052 
00053   // Function evaluation
00054   virtual Double_t evaluate() const ;
00055 
00056   class CacheElem : public RooAbsCacheElement {
00057   public:
00058     CacheElem() : _clone(0), _int(0) {} 
00059     virtual ~CacheElem() { delete _int ; delete _clone ; }
00060     // Payload
00061     RooArgSet   _intObs ;
00062     RooEffProd* _clone ;
00063     RooAbsReal* _int ;    
00064     // Cache management functions
00065     virtual RooArgList containedArgs(Action) ;
00066   } ;
00067   mutable RooObjCacheManager _cacheMgr ; //! The cache manager
00068 
00069 
00070   // the real stuff...
00071   RooRealProxy _pdf ;               // Probability Density function
00072   RooRealProxy _eff;                // Efficiency function
00073   mutable const RooArgSet* _nset  ; //! Normalization set to be used in evaluation
00074 
00075   RooArgSet* _fixedNset ; //! Fixed normalization set overriding default normalization set (if provided)
00076 
00077   ClassDef(RooEffProd,2) // Product operator p.d.f of (PDF x efficiency) implementing optimized generator context
00078 };
00079 
00080 #endif

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