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 /// Get the resolution model.
84 RooAbsReal const &getModel() const { return _model.arg(); }
85
86 std::unique_ptr<RooAbsArg> compileForNormSet(RooArgSet const &normSet, RooFit::Detail::CompileContext & ctx) const override;
87
88protected:
89 double getCoefNorm(Int_t coefIdx, const RooArgSet* nset, const TNamed* rangeName) const ;
90
91 bool _isCopy ;
92
93 double evaluate() const override ;
94
95 void makeCoefVarList(RooArgList&) const ;
96
97 friend class RooConvGenContext ;
98
99 RooRealProxy _model ; ///< Original model
100 RooRealProxy _convVar ; ///< Convolution variable
101
102 RooArgSet* parseIntegrationRequest(const RooArgSet& intSet, Int_t& coefCode, RooArgSet* analVars=nullptr) const ;
103
104 RooListProxy _convSet ; ///< Set of (resModel (x) basisFunc) convolution objects
105 RooArgList _basisList ; ///<! List of created basis functions
106
107
109 public:
112 l.add(_normList) ;
113 return l ;
114 }
115
118 } ;
119 mutable RooObjCacheManager _coefNormMgr ; ///<! Coefficient normalization manager
120
121 mutable RooAICRegistry _codeReg ; ///<! Registry of analytical integration codes
122
123 ClassDefOverride(RooAbsAnaConvPdf,3) // Abstract Composite Convoluted PDF
124};
125
126#endif
RooCollectionProxy< RooArgList > RooListProxy
Definition RooAbsArg.h:51
RooTemplateProxy< RooAbsReal > RooRealProxy
Compatibility typedef replacing the old RooRealProxy class.
int Int_t
Signed integer 4 bytes (int).
Definition RtypesCore.h:59
#define ClassDefOverride(name, id)
Definition Rtypes.h:348
static void indent(ostringstream &buf, int indent_level)
char name[80]
Definition TGX11.cxx:148
Utility class for operator p.d.f classes that keeps track of analytical integration codes and associa...
RooArgList containedArgs(Action) override
double getCoefNorm(Int_t coefIdx, const RooArgSet *nset=nullptr, const char *rangeName=nullptr) const
friend class RooConvGenContext
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().
RooAbsReal const & getModel() const
Get the resolution model.
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:76
friend class RooDataSet
Definition RooAbsArg.h:598
RooAbsArg()
Default constructor.
Abstract base class for generator contexts of RooAbsPdf objects.
RooAbsPdf()
Default constructor.
friend class RooAbsReal
Definition RooAbsPdf.h:342
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:24
Efficient implementation of the generator context specific for RooAbsAnaConvPdf objects.
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:138
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