Logo ROOT   6.10/09
Reference Guide
RooEffProd.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Project: RooFit *
3  * Package: RooFitModels *
4  * File: $Id: RooEffProd.h,v 1.2 2007/05/11 10:14:56 verkerke Exp $
5  * Authors: *
6  * GR, Gerhard Raven, NIKHEF/VU *
7  * *
8  * Redistribution and use in source and binary forms, *
9  * with or without modification, are permitted according to the terms *
10  * listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
11  *****************************************************************************/
12 #ifndef ROO_EFF_PROD
13 #define ROO_EFF_PROD
14 
15 #include "RooAbsPdf.h"
16 #include "RooAbsReal.h"
17 #include "RooRealProxy.h"
18 #include "RooObjCacheManager.h"
19 
20 class RooEffProd: public RooAbsPdf {
21 public:
22  // Constructors, assignment etc
23  inline RooEffProd() : _nset(0), _fixedNset(0) { };
24  virtual ~RooEffProd();
25  RooEffProd(const char *name, const char *title, RooAbsPdf& pdf, RooAbsReal& efficiency);
26  RooEffProd(const RooEffProd& other, const char* name=0);
27 
28  virtual TObject* clone(const char* newname) const { return new RooEffProd(*this,newname); }
29 
30  virtual RooAbsGenContext* genContext(const RooArgSet &vars, const RooDataSet *prototype,
31  const RooArgSet* auxProto, Bool_t verbose) const;
32 
33  virtual Double_t getValV(const RooArgSet* set=0) const ;
34 
35  virtual Bool_t forceAnalyticalInt(const RooAbsArg& /*dep*/) const {
36  // Return kTRUE to force RooRealIntegral to offer all observables for internal integration
37  return kTRUE ;
38  }
39  Int_t getAnalyticalIntegralWN(RooArgSet& allVars, RooArgSet& numVars, const RooArgSet* normSet, const char* rangeName=0) const ;
40  Double_t analyticalIntegralWN(Int_t code, const RooArgSet* normSet, const char* rangeName=0) const ;
41 
42 protected:
43 
44  const RooAbsPdf* pdf() const {
45  // Return pointer to pdf in product
46  return (RooAbsPdf*) _pdf.absArg() ;
47  }
48  const RooAbsReal* eff() const {
49  // Return pointer to efficiency function in product
50  return (RooAbsReal*) _eff.absArg() ;
51  }
52 
53  // Function evaluation
54  virtual Double_t evaluate() const ;
55 
56  class CacheElem : public RooAbsCacheElement {
57  public:
58  CacheElem() : _clone(0), _int(0) {}
59  virtual ~CacheElem() { delete _int ; delete _clone ; }
60  // Payload
64  // Cache management functions
66  } ;
67  mutable RooObjCacheManager _cacheMgr ; //! The cache manager
68 
69 
70  // the real stuff...
71  RooRealProxy _pdf ; // Probability Density function
72  RooRealProxy _eff; // Efficiency function
73  mutable const RooArgSet* _nset ; //! Normalization set to be used in evaluation
74 
75  RooArgSet* _fixedNset ; //! Fixed normalization set overriding default normalization set (if provided)
76 
77  ClassDef(RooEffProd,2) // Product operator p.d.f of (PDF x efficiency) implementing optimized generator context
78 };
79 
80 #endif
RooRealProxy _pdf
The cache manager.
Definition: RooEffProd.h:71
virtual RooArgList containedArgs(Action)
Report all RooAbsArg derived objects contained in Cache Element (used in function optimization and an...
Definition: RooEffProd.cxx:205
const RooArgSet * _nset
Definition: RooEffProd.h:73
virtual ~RooEffProd()
Destructor.
Definition: RooEffProd.cxx:75
RooRealProxy _eff
Definition: RooEffProd.h:72
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
RooEffProd * _clone
Definition: RooEffProd.h:62
#define ClassDef(name, id)
Definition: Rtypes.h:297
virtual Double_t evaluate() const
Calculate and return 'raw' unnormalized value of p.d.f.
Definition: RooEffProd.cxx:96
const RooAbsPdf * pdf() const
Definition: RooEffProd.h:44
RooAbsGenContext is the abstract base class for generator contexts of RooAbsPdf objects.
RooAbsCacheElement is the abstract base class for objects to be stored in RooAbsCache cache manager o...
bool verbose
RooAbsArg * absArg() const
Definition: RooArgProxy.h:37
RooDataSet is a container class to hold unbinned data.
Definition: RooDataSet.h:29
virtual Bool_t forceAnalyticalInt(const RooAbsArg &) const
Definition: RooEffProd.h:35
RooObjCacheManager _cacheMgr
Definition: RooEffProd.h:67
virtual RooAbsGenContext * genContext(const RooArgSet &vars, const RooDataSet *prototype, const RooArgSet *auxProto, Bool_t verbose) const
Return specialized generator context for RooEffProds that implements generation in a more efficient w...
Definition: RooEffProd.cxx:107
double Double_t
Definition: RtypesCore.h:55
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition: RooAbsReal.h:53
RooAbsReal * _int
Definition: RooEffProd.h:63
Class RooObjCacheManager is an implementation of class RooCacheManager<RooAbsCacheElement> and specia...
RooArgSet * _fixedNset
Normalization set to be used in evaluation.
Definition: RooEffProd.h:75
Mother of all ROOT objects.
Definition: TObject.h:37
Int_t getAnalyticalIntegralWN(RooArgSet &allVars, RooArgSet &numVars, const RooArgSet *normSet, const char *rangeName=0) const
Return internal integration capabilities of the p.d.f.
Definition: RooEffProd.cxx:129
Double_t analyticalIntegralWN(Int_t code, const RooArgSet *normSet, const char *rangeName=0) const
Return value of integral identified by code, which should be a return value of getAnalyticalIntegralW...
Definition: RooEffProd.cxx:183
RooAbsPdf is the abstract interface for all probability density functions The class provides hybrid a...
Definition: RooAbsPdf.h:41
virtual Double_t getValV(const RooArgSet *set=0) const
Return p.d.f. value normalized over given set of observables.
Definition: RooEffProd.cxx:84
RooRealProxy is the concrete proxy for RooAbsReal objects A RooRealProxy is the general mechanism to ...
Definition: RooRealProxy.h:23
virtual TObject * clone(const char *newname) const
Definition: RooEffProd.h:28
virtual ~CacheElem()
Definition: RooEffProd.h:59
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
Definition: RooAbsArg.h:66
const Bool_t kTRUE
Definition: RtypesCore.h:91
const RooAbsReal * eff() const
Definition: RooEffProd.h:48