Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooAbsAnaConvPdf.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitCore *
4 * File: $Id: RooAbsAnaConvPdf.h,v 1.8 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_ABS_ANA_CONV_PDF
17#define ROO_ABS_ANA_CONV_PDF
18
19
20#include "RooAbsPdf.h"
21#include "RooRealProxy.h"
22#include "RooListProxy.h"
23#include "RooDataSet.h"
24#include "RooAICRegistry.h"
25#include "RooObjCacheManager.h"
26#include "RooAbsCacheElement.h"
27
29class RooRealVar ;
31
33public:
34
35 // Constructors, assignment etc
37 RooAbsAnaConvPdf(const char *name, const char *title,
38 const RooResolutionModel& model,
40
41 RooAbsAnaConvPdf(const RooAbsAnaConvPdf& other, const char* name=nullptr);
42 ~RooAbsAnaConvPdf() override;
43
44 Int_t declareBasis(const char* expression, const RooArgList& params) ;
45 void printMultiline(std::ostream& stream, Int_t contents, bool verbose=false, TString indent= "") const override ;
46
47 // Coefficient normalization access
48 inline double getCoefNorm(Int_t coefIdx, const RooArgSet& nset, const char* rangeName) const {
49 // Returns normalization integral for coefficient coefIdx for observables nset in range rangeNae
50 return getCoefNorm(coefIdx,&nset,rangeName) ;
51 }
52 double getCoefNorm(Int_t coefIdx, const RooArgSet* nset=nullptr, const char* rangeName=nullptr) const {
53 return getCoefNorm(coefIdx,nset,RooNameReg::ptr(rangeName));
54 }
55
56 // Analytical integration support
57 Int_t getAnalyticalIntegralWN(RooArgSet& allVars, RooArgSet& analVars, const RooArgSet* normSet, const char* rangeName=nullptr) const override ;
58 double analyticalIntegralWN(Int_t code, const RooArgSet* normSet, const char* rangeName=nullptr) const override ;
59
60 // Coefficient Analytical integration support
61 virtual Int_t getCoefAnalyticalIntegral(Int_t coef, RooArgSet& allVars, RooArgSet& analVars, const char* rangeName=nullptr) const ;
62 virtual double coefAnalyticalIntegral(Int_t coef, Int_t code, const char* rangeName=nullptr) const ;
63 bool forceAnalyticalInt(const RooAbsArg& dep) const override ;
64
65 virtual double coefficient(Int_t basisIndex) const = 0 ;
66 virtual RooFit::OwningPtr<RooArgSet> coefVars(Int_t coefIdx) const ;
67
68 bool isDirectGenSafe(const RooAbsArg& arg) const override ;
69
70 void setCacheAndTrackHints(RooArgSet&) override ;
71
72 RooAbsGenContext* genContext(const RooArgSet &vars, const RooDataSet *prototype=nullptr,
73 const RooArgSet* auxProto=nullptr, bool verbose= false) const override ;
74 virtual bool changeModel(const RooResolutionModel& newModel) ;
75
76 /// Retrieve the convolution variable.
78 /// Retrieve the convolution variable.
79 const RooAbsRealLValue* convVar() const {
80 return const_cast<RooAbsAnaConvPdf*>(this)->convVar();
81 }
82
83 std::unique_ptr<RooAbsArg> compileForNormSet(RooArgSet const &normSet, RooFit::Detail::CompileContext & ctx) const override;
84
85protected:
86 double getCoefNorm(Int_t coefIdx, const RooArgSet* nset, const TNamed* rangeName) const ;
87
88 bool _isCopy ;
89
90 double evaluate() const override ;
91
92 void makeCoefVarList(RooArgList&) const ;
93
94 friend class RooConvGenContext ;
95
96 RooRealProxy _model ; ///< Original model
97 RooRealProxy _convVar ; ///< Convolution variable
98
99 RooArgSet* parseIntegrationRequest(const RooArgSet& intSet, Int_t& coefCode, RooArgSet* analVars=nullptr) const ;
100
101 RooListProxy _convSet ; ///< Set of (resModel (x) basisFunc) convolution objects
102 RooArgList _basisList ; ///<! List of created basis functions
103
104
106 public:
109 l.add(_normList) ;
110 return l ;
111 }
112
115 } ;
116 mutable RooObjCacheManager _coefNormMgr ; ///<! Coefficient normalization manager
117
118 mutable RooAICRegistry _codeReg ; ///<! Registry of analytical integration codes
119
120 ClassDefOverride(RooAbsAnaConvPdf,3) // Abstract Composite Convoluted PDF
121};
122
123#endif
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
static void indent(ostringstream &buf, int indent_level)
char name[80]
Definition TGX11.cxx:110
Utility class for operator p.d.f classes that keeps track of analytical integration codes and associa...
RooArgList containedArgs(Action) override
Base class for PDFs that represent a physics model that can be analytically convolved with a resoluti...
double getCoefNorm(Int_t coefIdx, const RooArgSet *nset=nullptr, const char *rangeName=nullptr) const
Int_t getAnalyticalIntegralWN(RooArgSet &allVars, RooArgSet &analVars, const RooArgSet *normSet, const char *rangeName=nullptr) const override
Advertise capability to perform (analytical) integrals internally.
double analyticalIntegralWN(Int_t code, const RooArgSet *normSet, const char *rangeName=nullptr) const override
Return analytical integral defined by given code, which is returned by getAnalyticalIntegralWN()
virtual double coefAnalyticalIntegral(Int_t coef, Int_t code, const char *rangeName=nullptr) const
Default implementation of function implementing advertised integrals.
virtual bool changeModel(const RooResolutionModel &newModel)
Change the current resolution model to newModel.
double getCoefNorm(Int_t coefIdx, const RooArgSet &nset, const char *rangeName) const
void setCacheAndTrackHints(RooArgSet &) override
Label OK'ed components with cache-and-track.
bool forceAnalyticalInt(const RooAbsArg &dep) const override
This function forces RooRealIntegral to offer all integration dependents to RooAbsAnaConvPdf::getAnal...
RooAbsGenContext * genContext(const RooArgSet &vars, const RooDataSet *prototype=nullptr, const RooArgSet *auxProto=nullptr, bool verbose=false) const override
Create a generator context for this p.d.f.
virtual double coefficient(Int_t basisIndex) const =0
RooArgSet * parseIntegrationRequest(const RooArgSet &intSet, Int_t &coefCode, RooArgSet *analVars=nullptr) const
RooArgList _basisList
! List of created basis functions
RooObjCacheManager _coefNormMgr
! Coefficient normalization manager
void makeCoefVarList(RooArgList &) const
Build complete list of coefficient variables.
RooAICRegistry _codeReg
! Registry of analytical integration codes
virtual Int_t getCoefAnalyticalIntegral(Int_t coef, RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=nullptr) const
Default implementation of function advertising integration capabilities.
~RooAbsAnaConvPdf() override
Destructor.
bool isDirectGenSafe(const RooAbsArg &arg) const override
Return true if it is safe to generate the convolution observable from the internal generator (this is...
RooAbsRealLValue * convVar()
Retrieve the convolution variable.
double evaluate() const override
Calculate the current unnormalized value of the PDF.
RooRealProxy _model
Original model.
void printMultiline(std::ostream &stream, Int_t contents, bool verbose=false, TString indent="") const override
Print info about this object to the specified stream.
RooRealProxy _convVar
Convolution variable.
RooAbsAnaConvPdf()
Default constructor, required for persistence.
Int_t declareBasis(const char *expression, const RooArgList &params)
Declare a basis function for use in this physics model.
RooListProxy _convSet
Set of (resModel (x) basisFunc) convolution objects.
virtual RooFit::OwningPtr< RooArgSet > coefVars(Int_t coefIdx) const
Return set of parameters with are used exclusively by the coefficient functions.
const RooAbsRealLValue * convVar() const
Retrieve the convolution variable.
std::unique_ptr< RooAbsArg > compileForNormSet(RooArgSet const &normSet, RooFit::Detail::CompileContext &ctx) const override
Common abstract base class for objects that represent a value and a "shape" in RooFit.
Definition RooAbsArg.h:77
Abstract base class for objects to be stored in RooAbsCache cache manager objects.
Abstract base class for generator contexts of RooAbsPdf objects.
Abstract interface for all probability density functions.
Definition RooAbsPdf.h:40
Abstract base class for objects that represent a real value that may appear on the left hand side of ...
RooArgList is a container object that can hold multiple RooAbsArg objects.
Definition RooArgList.h:22
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition RooArgSet.h:55
Efficient implementation of the generator context specific for RooAbsAnaConvPdf objects.
Container class to hold unbinned data.
Definition RooDataSet.h:57
static const TNamed * ptr(const char *stringPtr)
Return a unique TNamed pointer for given C++ string.
Implementation of a RooCacheManager<RooAbsCacheElement> that specializes in the storage of cache elem...
Variable that can be changed from the outside.
Definition RooRealVar.h:37
RooResolutionModel is the base class for PDFs that represent a resolution model that can be convolute...
The TNamed class is the base class for all named ROOT classes.
Definition TNamed.h:29
Basic string class.
Definition TString.h:139
T * OwningPtr
An alias for raw pointers for indicating that the return type of a RooFit function is an owning point...
Definition Config.h:35
TLine l
Definition textangle.C:4