Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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() = default;
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
34 double evaluate() const override { return _pdf ; }
35
36 bool forceAnalyticalInt(const RooAbsArg& /*dep*/) const override { return true ; }
37 /// Forward determination of analytical integration capabilities to input p.d.f
38 Int_t getAnalyticalIntegralWN(RooArgSet& allVars, RooArgSet& analVars, const RooArgSet* normSet, const char* rangeName=nullptr) const override {
39 return _pdf->getAnalyticalIntegralWN(allVars, analVars, normSet, rangeName) ;
40 }
41 /// Forward calculation of analytical integrals to input p.d.f
42 double analyticalIntegralWN(Int_t code, const RooArgSet* normSet, const char* rangeName=nullptr) const override {
43 return _pdf->analyticalIntegralWN(code, normSet, rangeName) ;
44 }
45
46 bool selfNormalized() const override { return true ; }
47 ExtendMode extendMode() const override { return CanBeExtended ; }
48 double expectedEvents(const RooArgSet* nset) const override ;
49 std::unique_ptr<RooAbsReal> createExpectedEventsFunc(const RooArgSet* nset) const override;
50
51 void translate(RooFit::Detail::CodeSquashContext &ctx) const override;
52
53protected:
54
56 RooTemplateProxy<RooAbsReal> _n; ///< Number of expected events
57 const TNamed* _rangeName = nullptr; ///< Name of subset range
58
59
60 ClassDefOverride(RooExtendPdf,2) // Wrapper p.d.f adding an extended likelihood term to an existing p.d.f
61};
62
63#endif
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
char name[80]
Definition TGX11.cxx:110
Common abstract base class for objects that represent a value and a "shape" in RooFit.
Definition RooAbsArg.h:79
Abstract interface for all probability density functions.
Definition RooAbsPdf.h:40
@ CanBeExtended
Definition RooAbsPdf.h:212
double analyticalIntegralWN(Int_t code, const RooArgSet *normSet, const char *rangeName=nullptr) const override
Analytical integral with normalization (see RooAbsReal::analyticalIntegralWN() for further informatio...
A RooAbsReal::Ref can be constructed from a RooAbsReal& or a double that will be implicitly converted...
Definition RooAbsReal.h:68
Abstract base class for objects that represent a real value and implements functionality common to al...
Definition RooAbsReal.h:59
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 ...
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition RooArgSet.h:55
RooExtendPdf is a wrapper around an existing PDF that adds a parameteric extended likelihood term to ...
std::unique_ptr< RooAbsReal > createExpectedEventsFunc(const RooArgSet *nset) const override
Returns an object that represents the expected number of events for a given normalization set,...
double evaluate() const override
Evaluate this PDF / function / constant. Needs to be overridden by all derived classes.
bool forceAnalyticalInt(const RooAbsArg &) const override
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.
double analyticalIntegralWN(Int_t code, const RooArgSet *normSet, const char *rangeName=nullptr) const override
Forward calculation of analytical integrals to input p.d.f.
ExtendMode extendMode() const override
Returns ability of PDF to provide extended likelihood terms.
RooTemplateProxy< RooAbsPdf > _pdf
Input p.d.f.
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.
RooExtendPdf()=default
bool selfNormalized() const override
Shows if a PDF is self-normalized, which means that no attempt is made to add a normalization term.
RooTemplateProxy< RooAbsReal > _n
Number of expected events.
void translate(RooFit::Detail::CodeSquashContext &ctx) const override
This function defines a translation for each RooAbsReal based object that can be used to express the ...
TObject * clone(const char *newname) const override
A class to maintain the context for squashing of RooFit models into code.
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