Logo ROOT  
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 Bool_t forceAnalyticalInt(const RooAbsArg& /*dep*/) const {
34  // Return kTRUE to force RooRealIntegral to offer all observables for internal integration
35  return kTRUE ;
36  }
37  Int_t getAnalyticalIntegralWN(RooArgSet& allVars, RooArgSet& numVars, const RooArgSet* normSet, const char* rangeName=0) const ;
38  Double_t analyticalIntegralWN(Int_t code, const RooArgSet* normSet, const char* rangeName=0) const ;
39 
40 protected:
41 
42  const RooAbsPdf* pdf() const {
43  // Return pointer to pdf in product
44  return (RooAbsPdf*) _pdf.absArg() ;
45  }
46  const RooAbsReal* eff() const {
47  // Return pointer to efficiency function in product
48  return (RooAbsReal*) _eff.absArg() ;
49  }
50 
51  // Function evaluation
52  virtual Double_t evaluate() const ;
53 
54  class CacheElem : public RooAbsCacheElement {
55  public:
56  CacheElem() : _clone(0), _int(0) {}
57  virtual ~CacheElem() { delete _int ; delete _clone ; }
58  // Payload
61  RooAbsReal* _int ;
62  // Cache management functions
64  } ;
65  mutable RooObjCacheManager _cacheMgr ; //! The cache manager
66 
67 
68  // the real stuff...
69  RooRealProxy _pdf ; // Probability Density function
70  RooRealProxy _eff; // Efficiency function
71  mutable const RooArgSet* _nset ; //! Normalization set to be used in evaluation
72 
73  RooArgSet* _fixedNset ; //! Fixed normalization set overriding default normalization set (if provided)
74 
75  ClassDef(RooEffProd,2) // Product operator p.d.f of (PDF x efficiency) implementing optimized generator context
76 };
77 
78 #endif
RooEffProd::_cacheMgr
RooObjCacheManager _cacheMgr
Definition: RooEffProd.h:75
RooEffProd::forceAnalyticalInt
virtual Bool_t forceAnalyticalInt(const RooAbsArg &) const
Definition: RooEffProd.h:43
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
RooAbsReal.h
RooEffProd::genContext
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:95
RooEffProd::getAnalyticalIntegralWN
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:117
RooArgList
Definition: RooArgList.h:21
RooEffProd::CacheElem
Definition: RooEffProd.h:64
RooAbsReal
Definition: RooAbsReal.h:61
RooEffProd::_fixedNset
RooArgSet * _fixedNset
Normalization set to be used in evaluation.
Definition: RooEffProd.h:83
RooEffProd
Definition: RooEffProd.h:20
RooAbsCacheElement
Definition: RooAbsCacheElement.h:26
RooEffProd::clone
virtual TObject * clone(const char *newname) const
Definition: RooEffProd.h:38
RooEffProd::CacheElem::_clone
RooEffProd * _clone
Definition: RooEffProd.h:70
bool
RooEffProd::analyticalIntegralWN
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:171
RooAbsPdf.h
RooEffProd::eff
const RooAbsReal * eff() const
Definition: RooEffProd.h:56
RooArgProxy::absArg
RooAbsArg * absArg() const
Definition: RooArgProxy.h:51
RooEffProd::~RooEffProd
virtual ~RooEffProd()
Destructor.
Definition: RooEffProd.cxx:74
RooEffProd::_pdf
RooRealProxy _pdf
The cache manager.
Definition: RooEffProd.h:79
RooEffProd::_nset
const RooArgSet * _nset
Definition: RooEffProd.h:81
RooRealProxy.h
RooAbsGenContext
Definition: RooAbsGenContext.h:26
RooObjCacheManager.h
RooTemplateProxy< RooAbsReal >
Double_t
double Double_t
Definition: RtypesCore.h:59
RooEffProd::_eff
RooRealProxy _eff
Definition: RooEffProd.h:80
RooEffProd::CacheElem::_int
RooAbsReal * _int
Definition: RooEffProd.h:71
RooObjCacheManager
Definition: RooObjCacheManager.h:32
RooAbsCacheElement::Action
Action
Definition: RooAbsCacheElement.h:39
TObject
Definition: TObject.h:37
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
name
char name[80]
Definition: TGX11.cxx:110
genreflex::verbose
bool verbose
Definition: rootcling_impl.cxx:133
RooDataSet
Definition: RooDataSet.h:33
RooAbsArg
Definition: RooAbsArg.h:73
RooAbsPdf
Definition: RooAbsPdf.h:40
RooEffProd::CacheElem::_intObs
RooArgSet _intObs
Definition: RooEffProd.h:69
RooEffProd::RooEffProd
RooEffProd()
Definition: RooEffProd.h:33
RooEffProd::evaluate
virtual Double_t evaluate() const
Calculate and return 'raw' unnormalized value of p.d.f.
Definition: RooEffProd.cxx:84
RooEffProd::CacheElem::CacheElem
CacheElem()
Definition: RooEffProd.h:66
RooEffProd::pdf
const RooAbsPdf * pdf() const
Definition: RooEffProd.h:52
RooEffProd::CacheElem::~CacheElem
virtual ~CacheElem()
Definition: RooEffProd.h:67
RooEffProd::CacheElem::containedArgs
virtual RooArgList containedArgs(Action)
Report all RooAbsArg derived objects contained in Cache Element (used in function optimization and an...
Definition: RooEffProd.cxx:193
RooArgSet
Definition: RooArgSet.h:28
int