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() : _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
42protected:
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
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
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
double Double_t
Definition: RtypesCore.h:55
const Bool_t kTRUE
Definition: RtypesCore.h:87
#define ClassDef(name, id)
Definition: Rtypes.h:326
char name[80]
Definition: TGX11.cxx:109
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
Definition: RooAbsArg.h:71
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:59
RooArgList is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgList.h:21
RooAbsArg * absArg() const
Definition: RooArgProxy.h:37
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgSet.h:28
RooDataSet is a container class to hold unbinned data.
Definition: RooDataSet.h:31
RooEffProd * _clone
Definition: RooEffProd.h:62
RooAbsReal * _int
Definition: RooEffProd.h:63
virtual ~CacheElem()
Definition: RooEffProd.h:59
virtual RooArgList containedArgs(Action)
Report all RooAbsArg derived objects contained in Cache Element (used in function optimization and an...
Definition: RooEffProd.cxx:204
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:35
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:106
virtual Double_t evaluate() const
Calculate and return 'raw' unnormalized value of p.d.f.
Definition: RooEffProd.cxx:95
const RooAbsPdf * pdf() const
Definition: RooEffProd.h:44
const RooArgSet * _nset
Definition: RooEffProd.h:73
RooArgSet * _fixedNset
Normalization set to be used in evaluation.
Definition: RooEffProd.h:75
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:128
RooRealProxy _pdf
The cache manager.
Definition: RooEffProd.h:71
virtual TObject * clone(const char *newname) const
Definition: RooEffProd.h:28
RooRealProxy _eff
Definition: RooEffProd.h:72
RooObjCacheManager _cacheMgr
Definition: RooEffProd.h:67
const RooAbsReal * eff() const
Definition: RooEffProd.h:48
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:182
virtual Double_t getValV(const RooArgSet *set=0) const
Return p.d.f. value normalized over given set of observables.
Definition: RooEffProd.cxx:83
Class RooObjCacheManager is an implementation of class RooCacheManager<RooAbsCacheElement> and specia...
Mother of all ROOT objects.
Definition: TObject.h:37