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
20class RooEffProd: public RooAbsPdf {
21public:
22 // Constructors, assignment etc
23 inline RooEffProd() : _cacheMgr(this,10), _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
40protected:
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
55 public:
56 CacheElem() : _clone(0), _int(0) {}
57 virtual ~CacheElem() { delete _int ; delete _clone ; }
58 // Payload
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
int Int_t
Definition: RtypesCore.h:45
bool Bool_t
Definition: RtypesCore.h:63
double Double_t
Definition: RtypesCore.h:59
const Bool_t kTRUE
Definition: RtypesCore.h:100
#define ClassDef(name, id)
Definition: Rtypes.h:325
char name[80]
Definition: TGX11.cxx:110
RooAbsArg is the common abstract base class for objects that represent a value and a "shape" in RooFi...
Definition: RooAbsArg.h:72
RooAbsCacheElement is the abstract base class for objects to be stored in RooAbsCache cache manager o...
RooAbsGenContext is the abstract base class for generator contexts of RooAbsPdf objects.
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition: RooAbsReal.h:61
RooArgList is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgList.h:22
RooAbsArg * absArg() const
Definition: RooArgProxy.h:37
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgSet.h:35
RooDataSet is a container class to hold unbinned data.
Definition: RooDataSet.h:36
RooEffProd * _clone
Definition: RooEffProd.h:60
RooAbsReal * _int
Definition: RooEffProd.h:61
virtual ~CacheElem()
Definition: RooEffProd.h:57
virtual RooArgList containedArgs(Action)
Report all RooAbsArg derived objects contained in Cache Element (used in function optimization and an...
Definition: RooEffProd.cxx:193
The class RooEffProd implements the product of a PDF with an efficiency function.
Definition: RooEffProd.h:20
virtual ~RooEffProd()
Destructor.
Definition: RooEffProd.cxx:74
virtual Bool_t forceAnalyticalInt(const RooAbsArg &) const
Definition: RooEffProd.h:33
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
virtual Double_t evaluate() const
Calculate and return 'raw' unnormalized value of p.d.f.
Definition: RooEffProd.cxx:84
const RooAbsPdf * pdf() const
Definition: RooEffProd.h:42
const RooArgSet * _nset
Definition: RooEffProd.h:71
RooArgSet * _fixedNset
Normalization set to be used in evaluation.
Definition: RooEffProd.h:73
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
RooRealProxy _pdf
The cache manager.
Definition: RooEffProd.h:69
virtual TObject * clone(const char *newname) const
Definition: RooEffProd.h:28
RooRealProxy _eff
Definition: RooEffProd.h:70
RooObjCacheManager _cacheMgr
Definition: RooEffProd.h:65
const RooAbsReal * eff() const
Definition: RooEffProd.h:46
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
Class RooObjCacheManager is an implementation of class RooCacheManager<RooAbsCacheElement> and specia...
Mother of all ROOT objects.
Definition: TObject.h:37