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 "RooFit.h"
25#include "RooEffProd.h"
26#include "RooEffGenContext.h"
27
28
29////////////////////////////////////////////////////////////////////////////////
30/// Constructor of a a production of p.d.f inPdf with efficiency
31/// function inEff.
32
33RooEffProd::RooEffProd(const char *name, const char *title,
34 RooAbsPdf& inPdf, RooAbsReal& inEff) :
35 RooAbsPdf(name,title),
36 _pdf("pdf","pre-efficiency pdf", this,inPdf),
37 _eff("eff","efficiency function",this,inEff)
38{
39}
40
41
42////////////////////////////////////////////////////////////////////////////////
43/// Copy constructor
44
45RooEffProd::RooEffProd(const RooEffProd& other, const char* name) :
46 RooAbsPdf(other, name),
47 _pdf("pdf",this,other._pdf),
48 _eff("acc",this,other._eff)
49{
50}
51
52
53////////////////////////////////////////////////////////////////////////////////
54/// Calculate and return 'raw' unnormalized value of p.d.f
55
57{
58 return _eff * _pdf;
59}
60
61
62////////////////////////////////////////////////////////////////////////////////
63/// Return specialized generator context for RooEffProds that implements generation
64/// in a more efficient way than can be done for generic correlated products
65
67 const RooArgSet* auxProto, Bool_t verbose) const
68{
69 return new RooEffGenContext(*this,
70 static_cast<RooAbsPdf const&>(_pdf.arg()),
71 static_cast<RooAbsReal const&>(_eff.arg()),
72 vars,prototype,auxProto,verbose) ;
73}
double Double_t
Definition RtypesCore.h:59
char name[80]
Definition TGX11.cxx:110
RooAbsGenContext is the abstract base class for generator contexts of RooAbsPdf objects.
friend class RooEffGenContext
Definition RooAbsPdf.h:329
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition RooAbsReal.h:64
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
The class RooEffProd implements the product of a PDF with an efficiency function.
Definition RooEffProd.h:19
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...
virtual Double_t evaluate() const
Calculate and return 'raw' unnormalized value of p.d.f.
RooRealProxy _pdf
Probability Density function.
Definition RooEffProd.h:36
RooRealProxy _eff
Efficiency function.
Definition RooEffProd.h:37
const T & arg() const
Return reference to object held in proxy.