Logo ROOT  
Reference Guide
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 class TIterator ;
21 #include "RooAbsPdf.h"
22 #include "RooRealProxy.h"
23 #include "RooListProxy.h"
24 #include "RooDataSet.h"
25 #include "RooAICRegistry.h"
26 #include "RooObjCacheManager.h"
27 #include "RooAbsCacheElement.h"
28 
29 class RooResolutionModel ;
30 class RooRealVar ;
31 class RooAbsGenContext ;
32 class RooConvGenContext ;
33 
34 class RooAbsAnaConvPdf : public RooAbsPdf {
35 public:
36 
37  // Constructors, assignment etc
39  RooAbsAnaConvPdf(const char *name, const char *title,
40  const RooResolutionModel& model,
42 
43  RooAbsAnaConvPdf(const RooAbsAnaConvPdf& other, const char* name=0);
44  virtual ~RooAbsAnaConvPdf();
45 
46  Int_t declareBasis(const char* expression, const RooArgList& params) ;
47  virtual void printMultiline(std::ostream& stream, Int_t contents, Bool_t verbose=kFALSE, TString indent= "") const ;
48 
49  // Coefficient normalization access
50  inline Double_t getCoefNorm(Int_t coefIdx, const RooArgSet& nset, const char* rangeName) const {
51  // Returns normalization integral for coefficient coefIdx for observables nset in range rangeNae
52  return getCoefNorm(coefIdx,&nset,rangeName) ;
53  }
54  Double_t getCoefNorm(Int_t coefIdx, const RooArgSet* nset=0, const char* rangeName=0) const {
55  return getCoefNorm(coefIdx,nset,RooNameReg::ptr(rangeName));
56  }
57 
58  // Analytical integration support
59  virtual Int_t getAnalyticalIntegralWN(RooArgSet& allVars, RooArgSet& analVars, const RooArgSet* normSet, const char* rangeName=0) const ;
60  virtual Double_t analyticalIntegralWN(Int_t code, const RooArgSet* normSet, const char* rangeName=0) const ;
61 
62  // Coefficient Analytical integration support
63  virtual Int_t getCoefAnalyticalIntegral(Int_t coef, RooArgSet& allVars, RooArgSet& analVars, const char* rangeName=0) const ;
64  virtual Double_t coefAnalyticalIntegral(Int_t coef, Int_t code, const char* rangeName=0) const ;
65  virtual Bool_t forceAnalyticalInt(const RooAbsArg& dep) const ;
66 
67  virtual Double_t coefficient(Int_t basisIndex) const = 0 ;
68  virtual RooArgSet* coefVars(Int_t coefIdx) const ;
69 
70  virtual Bool_t isDirectGenSafe(const RooAbsArg& arg) const ;
71 
72  virtual void setCacheAndTrackHints(RooArgSet&) ;
73 
74  virtual RooAbsGenContext* genContext(const RooArgSet &vars, const RooDataSet *prototype=0,
75  const RooArgSet* auxProto=0, Bool_t verbose= kFALSE) const ;
76  virtual Bool_t changeModel(const RooResolutionModel& newModel) ;
77 
78  /// Retrieve the convolution variable.
80  /// Retrieve the convolution variable.
81  const RooAbsRealLValue* convVar() const {
82  return const_cast<RooAbsAnaConvPdf*>(this)->convVar();
83  }
84 
85 protected:
86  Double_t getCoefNorm(Int_t coefIdx, const RooArgSet* nset, const TNamed* rangeName) const ;
87 
89 
90  virtual Double_t evaluate() const ;
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=0) const ;
100 
101  RooListProxy _convSet ; // Set of (resModel (x) basisFunc) convolution objects
102  RooArgList _basisList ; //! List of created basis functions
103 
104 
105  class CacheElem : public RooAbsCacheElement {
106  public:
107  virtual ~CacheElem() {} ;
108 
111  l.add(_normList) ;
112  return l ;
113  }
114 
117  } ;
118  mutable RooObjCacheManager _coefNormMgr ; // Coefficient normalization manager
119 
120  mutable RooAICRegistry _codeReg ; //! Registry of analytical integration codes
121 
122  ClassDef(RooAbsAnaConvPdf,2) // Abstract Composite Convoluted PDF
123 };
124 
125 #endif
l
auto * l
Definition: textangle.C:4
RooAbsAnaConvPdf::convVar
RooAbsRealLValue * convVar()
Retrieve the convolution variable.
Definition: RooAbsAnaConvPdf.cxx:312
RooAbsAnaConvPdf::getCoefNorm
Double_t getCoefNorm(Int_t coefIdx, const RooArgSet &nset, const char *rangeName) const
Definition: RooAbsAnaConvPdf.h:50
RooAbsAnaConvPdf::getAnalyticalIntegralWN
virtual Int_t getAnalyticalIntegralWN(RooArgSet &allVars, RooArgSet &analVars, const RooArgSet *normSet, const char *rangeName=0) const
Advertise capability to perform (analytical) integrals internally.
Definition: RooAbsAnaConvPdf.cxx:364
RooNameReg::ptr
static const TNamed * ptr(const char *stringPtr)
Return a unique TNamed pointer for given C++ string.
Definition: RooNameReg.cxx:93
RooAbsAnaConvPdf::coefficient
virtual Double_t coefficient(Int_t basisIndex) const =0
RooAbsAnaConvPdf::declareBasis
Int_t declareBasis(const char *expression, const RooArgList &params)
Declare a basis function for use in this physics model.
Definition: RooAbsAnaConvPdf.cxx:158
RooAbsCacheElement.h
RooAbsAnaConvPdf::_basisList
RooArgList _basisList
Definition: RooAbsAnaConvPdf.h:102
RooAbsAnaConvPdf::~RooAbsAnaConvPdf
virtual ~RooAbsAnaConvPdf()
Destructor.
Definition: RooAbsAnaConvPdf.cxx:132
RooAbsAnaConvPdf::coefAnalyticalIntegral
virtual Double_t coefAnalyticalIntegral(Int_t coef, Int_t code, const char *rangeName=0) const
Default implementation of function implementing advertised integrals.
Definition: RooAbsAnaConvPdf.cxx:573
RooAICRegistry
RooAICRegistry is a utility class for operator p.d.f classes that keeps track of analytical integrati...
Definition: RooAICRegistry.h:26
RooAbsAnaConvPdf::changeModel
virtual Bool_t changeModel(const RooResolutionModel &newModel)
Change the current resolution model to newModel.
Definition: RooAbsAnaConvPdf.cxx:208
RooAbsAnaConvPdf::makeCoefVarList
void makeCoefVarList(RooArgList &) const
Build complete list of coefficient variables.
Definition: RooAbsAnaConvPdf.cxx:633
RooAbsAnaConvPdf::CacheElem
List of created basis functions.
Definition: RooAbsAnaConvPdf.h:105
RooArgList
RooArgList is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgList.h:21
RooAbsAnaConvPdf::CacheElem::_coefVarList
RooArgList _coefVarList
Definition: RooAbsAnaConvPdf.h:115
RooAbsAnaConvPdf::getCoefAnalyticalIntegral
virtual Int_t getCoefAnalyticalIntegral(Int_t coef, RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=0) const
Default implementation of function advertising integration capabilities.
Definition: RooAbsAnaConvPdf.cxx:562
indent
static void indent(ostringstream &buf, int indent_level)
Definition: TClingCallFunc.cxx:87
RooAbsCacheElement
RooAbsCacheElement is the abstract base class for objects to be stored in RooAbsCache cache manager o...
Definition: RooAbsCacheElement.h:26
TString
Basic string class.
Definition: TString.h:136
RooDataSet.h
bool
TIterator
Iterator abstract base class.
Definition: TIterator.h:30
RooAbsAnaConvPdf::_isCopy
Bool_t _isCopy
Definition: RooAbsAnaConvPdf.h:88
RooResolutionModel
RooResolutionModel is the base class for PDFs that represent a resolution model that can be convolute...
Definition: RooResolutionModel.h:26
RooAbsAnaConvPdf::_coefNormMgr
RooObjCacheManager _coefNormMgr
Definition: RooAbsAnaConvPdf.h:118
RooAbsAnaConvPdf::RooAbsAnaConvPdf
RooAbsAnaConvPdf()
Default constructor, required for persistence.
Definition: RooAbsAnaConvPdf.cxx:85
RooAICRegistry.h
RooAbsAnaConvPdf::_convSet
RooListProxy _convSet
Definition: RooAbsAnaConvPdf.h:101
RooAbsPdf.h
RooAbsAnaConvPdf::printMultiline
virtual void printMultiline(std::ostream &stream, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const
Print info about this object to the specified stream.
Definition: RooAbsAnaConvPdf.cxx:675
RooAbsAnaConvPdf::evaluate
virtual Double_t evaluate() const
Calculate the current unnormalized value of the PDF.
Definition: RooAbsAnaConvPdf.cxx:327
TNamed
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
RooConvGenContext
RooConvGenContext is an efficient implementation of the generator context specific for RooAbsAnaConvP...
Definition: RooConvGenContext.h:31
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
RooAbsAnaConvPdf::isDirectGenSafe
virtual Bool_t isDirectGenSafe(const RooAbsArg &arg) const
Return true if it is safe to generate the convolution observable from the internal generator (this is...
Definition: RooAbsAnaConvPdf.cxx:295
RooAbsAnaConvPdf::setCacheAndTrackHints
virtual void setCacheAndTrackHints(RooArgSet &)
Label OK'ed components with cache-and-track.
Definition: RooAbsAnaConvPdf.cxx:690
RooRealProxy.h
RooAbsGenContext
RooAbsGenContext is the abstract base class for generator contexts of RooAbsPdf objects.
Definition: RooAbsGenContext.h:26
RooAbsAnaConvPdf::CacheElem::_normList
RooArgList _normList
Definition: RooAbsAnaConvPdf.h:116
RooAbsAnaConvPdf::_codeReg
RooAICRegistry _codeReg
Definition: RooAbsAnaConvPdf.h:120
RooListProxy
RooListProxy is the concrete proxy for RooArgList objects.
Definition: RooListProxy.h:24
RooAbsAnaConvPdf::getCoefNorm
Double_t getCoefNorm(Int_t coefIdx, const RooArgSet *nset=0, const char *rangeName=0) const
Definition: RooAbsAnaConvPdf.h:54
RooObjCacheManager.h
RooListProxy.h
RooTemplateProxy< RooAbsReal >
Double_t
double Double_t
Definition: RtypesCore.h:59
RooAbsAnaConvPdf::CacheElem::containedArgs
RooArgList containedArgs(Action)
Definition: RooAbsAnaConvPdf.h:109
RooAbsAnaConvPdf::parseIntegrationRequest
RooArgSet * parseIntegrationRequest(const RooArgSet &intSet, Int_t &coefCode, RooArgSet *analVars=0) const
RooObjCacheManager
Class RooObjCacheManager is an implementation of class RooCacheManager<RooAbsCacheElement> and specia...
Definition: RooObjCacheManager.h:32
RooAbsCacheElement::Action
Action
Definition: RooAbsCacheElement.h:39
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
name
char name[80]
Definition: TGX11.cxx:110
RooAbsAnaConvPdf::convVar
const RooAbsRealLValue * convVar() const
Retrieve the convolution variable.
Definition: RooAbsAnaConvPdf.h:81
RooAbsAnaConvPdf::analyticalIntegralWN
virtual Double_t analyticalIntegralWN(Int_t code, const RooArgSet *normSet, const char *rangeName=0) const
Return analytical integral defined by given code, which is returned by getAnalyticalIntegralWN()
Definition: RooAbsAnaConvPdf.cxx:491
genreflex::verbose
bool verbose
Definition: rootcling_impl.cxx:133
RooDataSet
RooDataSet is a container class to hold unbinned data.
Definition: RooDataSet.h:33
make_cnn_model.model
model
Definition: make_cnn_model.py:6
RooAbsArg
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
Definition: RooAbsArg.h:73
RooAbsAnaConvPdf::CacheElem::~CacheElem
virtual ~CacheElem()
Definition: RooAbsAnaConvPdf.h:107
RooAbsAnaConvPdf::forceAnalyticalInt
virtual Bool_t forceAnalyticalInt(const RooAbsArg &dep) const
This function forces RooRealIntegral to offer all integration dependents to RooAbsAnaConvPdf::getAnal...
Definition: RooAbsAnaConvPdf.cxx:593
RooAbsPdf
Definition: RooAbsPdf.h:40
RooRealVar
RooRealVar represents a variable that can be changed from the outside.
Definition: RooRealVar.h:36
RooAbsAnaConvPdf::_model
RooRealProxy _model
Definition: RooAbsAnaConvPdf.h:96
RooAbsRealLValue
RooAbsRealLValue is the common abstract base class for objects that represent a real value that may a...
Definition: RooAbsRealLValue.h:31
RooAbsAnaConvPdf::coefVars
virtual RooArgSet * coefVars(Int_t coefIdx) const
Return set of parameters with are used exclusively by the coefficient functions.
Definition: RooAbsAnaConvPdf.cxx:649
RooAbsAnaConvPdf
RooAbsAnaConvPdf is the base class for PDFs that represent a physics model that can be analytically c...
Definition: RooAbsAnaConvPdf.h:34
RooAbsAnaConvPdf::_convVar
RooRealProxy _convVar
Definition: RooAbsAnaConvPdf.h:97
RooArgSet
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgSet.h:28
int
RooAbsAnaConvPdf::genContext
virtual RooAbsGenContext * genContext(const RooArgSet &vars, const RooDataSet *prototype=0, const RooArgSet *auxProto=0, Bool_t verbose=kFALSE) const
Create a generator context for this p.d.f.
Definition: RooAbsAnaConvPdf.cxx:252