Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooEffProd.cxx
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitCore *
4 * @(#)root/roofitcore:$Id$
5 * Authors: *
6 * WV, Wouter Verkerke, NIKHEF
7 * GR, Gerhard Raven, NIKHEF/VU *
8 * *
9 * Redistribution and use in source and binary forms, *
10 * with or without modification, are permitted according to the terms *
11 * listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
12 *****************************************************************************/
13
14
15/////////////////////////////////////////////////////////////////////////////////////
16/// \class RooEffProd
17/// The class RooEffProd implements the product of a PDF with an efficiency function.
18/// The normalization integral of the product is calculated numerically, but the
19/// event generation is handled by a specialized generator context that implements
20/// the event generation in a more efficient for cases where the PDF has an internal
21/// generator that is smarter than accept reject.
22///
23
24#include "RooEffProd.h"
25#include "RooEffGenContext.h"
26
27
28////////////////////////////////////////////////////////////////////////////////
29/// Constructs the product of the PDF `inPdf` with the efficiency function
30/// `inEff`.
31
32RooEffProd::RooEffProd(const char *name, const char *title,
33 RooAbsPdf& inPdf, RooAbsReal& inEff) :
34 RooAbsPdf(name,title),
35 _pdf("pdf","pre-efficiency pdf", this,inPdf),
36 _eff("eff","efficiency function",this,inEff)
37{
38}
39
40
41////////////////////////////////////////////////////////////////////////////////
42/// Copy constructor
43
44RooEffProd::RooEffProd(const RooEffProd& other, const char* name) :
45 RooAbsPdf(other, name),
46 _pdf("pdf",this,other._pdf),
47 _eff("acc",this,other._eff)
48{
49}
50
51
52////////////////////////////////////////////////////////////////////////////////
53/// Calculate and return 'raw' unnormalized value of p.d.f
54
56{
57 return _eff * _pdf;
58}
59
60
61////////////////////////////////////////////////////////////////////////////////
62/// Return specialized generator context for RooEffProds that implements generation
63/// in a more efficient way than can be done for generic correlated products
64
66 const RooArgSet* auxProto, bool verbose) const
67{
68 return new RooEffGenContext(*this,
69 static_cast<RooAbsPdf const&>(_pdf.arg()),
70 static_cast<RooAbsReal const&>(_eff.arg()),
71 vars,prototype,auxProto,verbose) ;
72}
char name[80]
Definition TGX11.cxx:110
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:62
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition RooArgSet.h:55
RooDataSet is a container class to hold unbinned data.
Definition RooDataSet.h:57
RooEffGenContext is a specialized generator context for p.d.fs represented by class RooEffProd,...
The class RooEffProd implements the product of a PDF with an efficiency function.
Definition RooEffProd.h:19
RooAbsGenContext * genContext(const RooArgSet &vars, const RooDataSet *prototype, const RooArgSet *auxProto, bool verbose) const override
Return specialized generator context for RooEffProds that implements generation in a more efficient w...
RooRealProxy _pdf
Probability Density function.
Definition RooEffProd.h:36
RooRealProxy _eff
Efficiency function.
Definition RooEffProd.h:37
double evaluate() const override
Calculate and return 'raw' unnormalized value of p.d.f.
const T & arg() const
Return reference to object held in proxy.