Logo ROOT  
Reference Guide
RooExtendPdf.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitCore *
4 * File: $Id: RooExtendPdf.h,v 1.12 2007/07/16 21:04:28 wouter Exp $
5 * Authors: *
6 * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu *
7 * DK, David Kirkby, UC Irvine, dkirkby@uci.edu *
8 * *
9 * Copyright (c) 2000-2005, Regents of the University of California *
10 * and Stanford University. All rights reserved. *
11 * *
12 * Redistribution and use in source and binary forms, *
13 * with or without modification, are permitted according to the terms *
14 * listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
15 *****************************************************************************/
16#ifndef ROO_EXTEND_PDF
17#define ROO_EXTEND_PDF
18
19#include "RooAbsPdf.h"
20#include "RooRealProxy.h"
21
22class RooExtendPdf : public RooAbsPdf {
23public:
24
25 RooExtendPdf() ;
26 // Original constructor without RooAbsReal::Ref for backwards compatibility.
27 RooExtendPdf(const char *name, const char *title, RooAbsPdf& pdf,
28 RooAbsReal& norm, const char* rangeName=nullptr);
29 RooExtendPdf(const char *name, const char *title, RooAbsPdf& pdf,
30 RooAbsReal::Ref norm, const char* rangeName=nullptr) ;
31 RooExtendPdf(const RooExtendPdf& other, const char* name=nullptr) ;
32 TObject* clone(const char* newname) const override { return new RooExtendPdf(*this,newname) ; }
33 ~RooExtendPdf() override ;
34
35 double evaluate() const override { return _pdf ; }
36
37 bool forceAnalyticalInt(const RooAbsArg& /*dep*/) const override { return true ; }
38 /// Forward determination of analytical integration capabilities to input p.d.f
39 Int_t getAnalyticalIntegralWN(RooArgSet& allVars, RooArgSet& analVars, const RooArgSet* normSet, const char* rangeName=nullptr) const override {
40 return _pdf->getAnalyticalIntegralWN(allVars, analVars, normSet, rangeName) ;
41 }
42 /// Forward calculation of analytical integrals to input p.d.f
43 double analyticalIntegralWN(Int_t code, const RooArgSet* normSet, const char* rangeName=nullptr) const override {
44 return _pdf->analyticalIntegralWN(code, normSet, rangeName) ;
45 }
46
47 bool selfNormalized() const override { return true ; }
48 ExtendMode extendMode() const override { return CanBeExtended ; }
49 double expectedEvents(const RooArgSet* nset) const override ;
50
51protected:
52
54 RooTemplateProxy<RooAbsReal> _n; ///< Number of expected events
55 const TNamed* _rangeName ; ///< Name of subset range
56
57
58 ClassDefOverride(RooExtendPdf,2) // Wrapper p.d.f adding an extended likelihood term to an existing p.d.f
59};
60
61#endif
#define ClassDefOverride(name, id)
Definition: Rtypes.h:339
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
@ CanBeExtended
Definition: RooAbsPdf.h:272
double analyticalIntegralWN(Int_t code, const RooArgSet *normSet, const char *rangeName=nullptr) const override
Analytical integral with normalization (see RooAbsReal::analyticalIntegralWN() for further informatio...
Definition: RooAbsPdf.cxx:437
A RooAbsReal::Ref can be constructed from a RooAbsReal& or a double that will be implicitly converted...
Definition: RooAbsReal.h:69
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition: RooAbsReal.h:60
virtual Int_t getAnalyticalIntegralWN(RooArgSet &allVars, RooArgSet &analVars, const RooArgSet *normSet, const char *rangeName=nullptr) const
Variant of getAnalyticalIntegral that is also passed the normalization set that should be applied to ...
Definition: RooAbsReal.cxx:341
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgSet.h:56
RooExtendPdf is a wrapper around an existing PDF that adds a parameteric extended likelihood term to ...
Definition: RooExtendPdf.h:22
double evaluate() const override
Evaluate this PDF / function / constant. Needs to be overridden by all derived classes.
Definition: RooExtendPdf.h:35
bool forceAnalyticalInt(const RooAbsArg &) const override
Definition: RooExtendPdf.h:37
Int_t getAnalyticalIntegralWN(RooArgSet &allVars, RooArgSet &analVars, const RooArgSet *normSet, const char *rangeName=nullptr) const override
Forward determination of analytical integration capabilities to input p.d.f.
Definition: RooExtendPdf.h:39
double analyticalIntegralWN(Int_t code, const RooArgSet *normSet, const char *rangeName=nullptr) const override
Forward calculation of analytical integrals to input p.d.f.
Definition: RooExtendPdf.h:43
ExtendMode extendMode() const override
Returns ability of PDF to provide extended likelihood terms.
Definition: RooExtendPdf.h:48
RooTemplateProxy< RooAbsPdf > _pdf
Input p.d.f.
Definition: RooExtendPdf.h:53
double expectedEvents(const RooArgSet *nset) const override
Return the number of expected events over the full range of all variables.
const TNamed * _rangeName
Name of subset range.
Definition: RooExtendPdf.h:55
~RooExtendPdf() override
bool selfNormalized() const override
Shows if a PDF is self-normalized, which means that no attempt is made to add a normalization term.
Definition: RooExtendPdf.h:47
RooTemplateProxy< RooAbsReal > _n
Number of expected events.
Definition: RooExtendPdf.h:54
TObject * clone(const char *newname) const override
Definition: RooExtendPdf.h:32
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
Mother of all ROOT objects.
Definition: TObject.h:41