154 _x(
"!x",
"Convolution Variable",this,convVar),
155 _xprime(
"!xprime",
"External Convolution Variable",this,0),
156 _pdf1(
"!pdf1",
"pdf1",this,pdf1,
kFALSE),
157 _pdf2(
"!pdf2",
"pdf2",this,pdf2,
kFALSE),
158 _params(
"!params",
"effective parameters",this),
163 _cacheObs(
"!cacheObs",
"Cached observables",this,
kFALSE,
kFALSE)
180 _x(
"!x",
"Convolution Variable",this,convVar,
kFALSE,
kFALSE),
181 _xprime(
"!xprime",
"External Convolution Variable",this,pdfConvVar),
182 _pdf1(
"!pdf1",
"pdf1",this,pdf1,
kFALSE),
183 _pdf2(
"!pdf2",
"pdf2",this,pdf2,
kFALSE),
184 _params(
"!params",
"effective parameters",this),
189 _cacheObs(
"!cacheObs",
"Cached observables",this,
kFALSE,
kFALSE)
205 _x(
"!x",this,other._x),
206 _xprime(
"!xprime",this,other._xprime),
207 _pdf1(
"!pdf1",this,other._pdf1),
208 _pdf2(
"!pdf2",this,other._pdf2),
209 _params(
"!params",this,other._params),
210 _bufFrac(other._bufFrac),
211 _bufStrat(other._bufStrat),
212 _shift1(other._shift1),
213 _shift2(other._shift2),
214 _cacheObs(
"!cacheObs",this,other._cacheObs)
241 <<
"' in FFT '" <<
fName <<
"'"
242 <<
" from " << varBinning.
numBins()
243 <<
" to " << optimal <<
" to improve the precision of the numerical FFT."
244 <<
" This can be done manually by setting an additional binning named 'cache'." << std::endl;
248 <<
" is not uniform. The numerical FFT will likely yield wrong results." << std::endl;
262 name.Append(
"_CONV_") ;
286 fftr2c1(0),fftr2c2(0),fftc2r(0)
297 string refName =
Form(
"refrange_fft_%s",self.
GetName()) ;
359 oocoutW(&self,
Eval) <<
"The FFT convolution '" << self.
GetName() <<
"' will run with " <<
N
360 <<
" bins. A decent accuracy for difficult convolutions is typically only reached with n >= 1000. Suggest to increase the number"
361 " of bins of the observable '" << convObs->
GetName() <<
"'." << std::endl;
394 ret.
add(*pdf1Clone) ;
395 ret.
add(*pdf2Clone) ;
396 if (pdf1Clone->ownedComponents()) {
397 ret.
add(*pdf1Clone->ownedComponents()) ;
399 if (pdf2Clone->ownedComponents()) {
400 ret.
add(*pdf2Clone->ownedComponents()) ;
488 while(binCur[curObs]==binMax[curObs]) {
533 Int_t N,N2,binShift1,binShift2 ;
561 for (
Int_t i=0 ; i<N2/2+1 ; i++) {
574 Int_t totalShift = binShift1 + (N2-
N)/2 ;
579 for (
Int_t i =0 ; i<
N ; i++) {
582 Int_t j = i + totalShift ;
584 while (j>=N2) j-= N2 ;
628 }
else if (histX->
getMin()>0) {
638 zeroBin += binShift ;
639 while(zeroBin>=N2) zeroBin-= N2 ;
640 while(zeroBin<0) zeroBin+= N2 ;
649 for (k=0 ; k<N2 ; k++) {
661 for (k=0 ; k<Nbuf ; k++) {
664 for (k=0 ; k<
N ; k++) {
670 for (k=0 ; k<Nbuf ; k++) {
671 tmp[
N+Nbuf+k] = val ;
679 for (k=0 ; k<
N ; k++) {
683 for (k=1 ; k<=Nbuf ; k++) {
693 for (
Int_t i=0 ; i<N2 ; i++) {
695 Int_t j = i - (zeroBin) ;
804 return histObservable ;
831 <<
" has internal generator that is safe to use in current context" << endl ;
835 <<
" has internal generator that is safe to use in current context" << endl ;
838 cxcoutI(
Generation) <<
"RooFFTConvPdf::genContext() generation requested for observables other than the convolution observable " <<
_x.
arg().
GetName() << endl ;
842 if (numAddDep>0 || !pdfCanDir || !resCanDir) {
845 cxcoutI(
Generation) <<
"RooFFTConvPdf::genContext() selecting accept/reject generator context because one or both of the input "
846 <<
"p.d.f.s cannot use internal generator and/or "
847 <<
"observables other than the convolution variable are requested for generation" << endl ;
852 cxcoutI(
Generation) <<
"RooFFTConvPdf::genContext() selecting specialized convolution generator context as both input "
853 <<
"p.d.fs are safe for internal generator and only "
854 <<
"the convolution observables is requested for generation" << endl ;
867 coutE(
InputArguments) <<
"RooFFTConvPdf::setBufferFraction(" <<
GetName() <<
") fraction should be greater than or equal to zero" << endl ;
static RooMathCoreReg dummy
char * Form(const char *fmt,...)
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
virtual RooAbsArg * cloneTree(const char *newname=0) const
Clone tree expression of objects.
RooArgSet * getObservables(const RooArgSet &set, Bool_t valueOnly=kTRUE) const
Return the observables of this pdf given a set of observables.
RooArgSet * getParameters(const RooAbsData *data, Bool_t stripDisconnected=kTRUE) const
Create a list of leaf nodes in the arg tree starting with ourself as top node that don't match any of...
RooArgSet * getVariables(Bool_t stripDisconnected=kTRUE) const
Return RooArgSet with all variables (tree leaf nodes of expresssion tree)
void setOperMode(OperMode mode, Bool_t recurseADirty=kTRUE)
Change cache operation mode to given mode.
Bool_t addOwnedComponents(const RooArgSet &comps)
Take ownership of the contents of 'comps'.
Bool_t recursiveRedirectServers(const RooAbsCollection &newServerList, Bool_t mustReplaceAll=kFALSE, Bool_t nameChange=kFALSE, Bool_t recurseInNewSet=kTRUE)
void attachDataSet(const RooAbsData &set)
Replace server nodes with names matching the dataset variable names with those data set variables,...
RooAbsBinning is the abstract base class for RooRealVar binning definitions This class defines the in...
virtual RooAbsBinning * clone(const char *name=0) const =0
virtual Bool_t isUniform() const
virtual Double_t highBound() const =0
virtual Int_t binNumber(Double_t x) const =0
virtual Double_t lowBound() const =0
virtual RooArgList containedArgs(Action)
Returns all RooAbsArg objects contained in the cache element.
RooAbsCachedPdf is the abstract base class for p.d.f.s that need or want to cache their evaluate() ou...
virtual const char * binningName() const
RooObjCacheManager _cacheMgr
RooAbsCollection is an abstract container object that can hold multiple RooAbsArg objects.
Bool_t contains(const RooAbsArg &var) const
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
TIterator * createIterator(Bool_t dir=kIterForward) const R__SUGGEST_ALTERNATIVE("begin()
TIterator-style iteration over contained elements.
virtual Bool_t remove(const RooAbsArg &var, Bool_t silent=kFALSE, Bool_t matchByNameOnly=kFALSE)
Remove the specified argument from our list.
RooAbsArg * find(const char *name) const
Find object with given name in list.
void setDirtyProp(Bool_t flag)
Control propagation of dirty flags from observables in dataset.
RooAbsGenContext is the abstract base class for generator contexts of RooAbsPdf objects.
Abstract base class for objects that are lvalues, i.e.
virtual Int_t numBins(const char *rangeName=0) const =0
virtual void setBin(Int_t ibin, const char *rangeName=0)=0
virtual Int_t getGenerator(const RooArgSet &directVars, RooArgSet &generateVars, Bool_t staticInitOK=kTRUE) const
Load generatedVars with the subset of directVars that we can generate events for, and return a code t...
virtual Bool_t isDirectGenSafe(const RooAbsArg &arg) const
Check if given observable can be safely generated using the pdfs internal generator mechanism (if tha...
virtual Double_t getMax(const char *name=0) const
Get maximum of currently defined range.
virtual void setBin(Int_t ibin, const char *rangeName=0)
Set value to center of bin 'ibin' of binning 'rangeName' (or of default binning if no range is specif...
virtual Int_t numBins(const char *rangeName=0) const
virtual Double_t getMin(const char *name=0) const
Get miniminum of currently defined range.
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
virtual void fixAddCoefRange(const char *rangeName=0, Bool_t force=kTRUE)
Fix the interpretation of the coefficient of any RooAddPdf component in the expression tree headed by...
Double_t getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
virtual void fixAddCoefNormalization(const RooArgSet &addNormSet=RooArgSet(), Bool_t force=kTRUE)
Fix the interpretation of the coefficient of any RooAddPdf component in the expression tree headed by...
RooArgList is a container object that can hold multiple RooAbsArg objects.
RooAbsArg * absArg() const
RooArgSet is a container object that can hold multiple RooAbsArg objects.
virtual Bool_t add(const RooAbsCollection &col, Bool_t silent=kFALSE)
Add a collection of arguments to this collection by calling add() for each element in the source coll...
RooCustomizer is a factory class to produce clones of a prototype composite PDF object with the same ...
void replaceArg(const RooAbsArg &orig, const RooAbsArg &subst)
Replace any occurence of arg 'orig' with arg 'subst'.
RooAbsArg * build(const char *masterCatState, Bool_t verbose=kFALSE)
Build a clone of the prototype executing all registered 'replace' rules and 'split' rules for the mas...
The RooDataHist is a container class to hold N-dimensional binned data.
void set(Double_t weight, Double_t wgtErr=-1)
Set the weight and weight error of the bin enclosing the current (i.e.
virtual const RooArgSet * get() const
RooDataSet is a container class to hold unbinned data.
virtual RooArgList containedArgs(Action)
Returns all RooAbsArg objects contained in the cache element.
RooAbsBinning * histBinning
FFTCacheElem(const RooFFTConvPdf &self, const RooArgSet *nset)
Clone input pdf and attach to dataset.
RooAbsBinning * scanBinning
PDF for the numerical (FFT) convolution of two PDFs.
Bool_t redirectServersHook(const RooAbsCollection &newServerList, Bool_t mustReplaceAll, Bool_t nameChange, Bool_t isRecursive)
calcParams() ;
void printMetaArgs(std::ostream &os) const
Customized printing of arguments of a RooNumConvPdf to more intuitively reflect the contents of the p...
virtual PdfCacheElem * createCache(const RooArgSet *nset) const
Return specialized cache subclass for FFT calculations.
friend class RooConvGenContext
virtual ~RooFFTConvPdf()
Destructor.
void calcParams()
(Re)calculate effective parameters of this p.d.f.
virtual void fillCacheObject(PdfCacheElem &cache) const
Fill the contents of the cache the FFT convolution output.
void prepareFFTBinning(RooRealVar &convVar) const
Try to improve the binning and inform user if possible.
virtual TString histNameSuffix() const
Suffix for cache histogram (added in addition to suffix for cache name)
void fillCacheSlice(FFTCacheElem &cache, const RooArgSet &slicePosition) const
Fill a slice of cachePdf with the output of the FFT convolution calculation.
Double_t * scanPdf(RooRealVar &obs, RooAbsPdf &pdf, const RooDataHist &hist, const RooArgSet &slicePos, Int_t &N, Int_t &N2, Int_t &zeroBin, Double_t shift) const
Scan the values of 'pdf' in observable 'obs' using the bin values stored in 'hist' at slice position ...
virtual RooAbsGenContext * genContext(const RooArgSet &vars, const RooDataSet *prototype=0, const RooArgSet *auxProto=0, Bool_t verbose=kFALSE) const
Create appropriate generator context for this convolution.
virtual const char * inputBaseName() const
Return base name component for cache components in this case 'PDF1_CONV_PDF2'.
void setBufferFraction(Double_t frac)
Change the size of the buffer on either side of the observable range to frac times the size of the ra...
virtual RooArgSet * actualObservables(const RooArgSet &nset) const
Return the observables to be cached given the normalization set nset.
virtual RooAbsArg & pdfObservable(RooAbsArg &histObservable) const
Return p.d.f.
void setBufferStrategy(BufStrat bs)
Change strategy to fill the overflow buffer on either side of the convolution observable range.
virtual RooArgSet * actualParameters(const RooArgSet &nset) const
Return the parameters on which the cache depends given normalization set nset.
Double_t bufferFraction() const
friend class FFTCacheElem
Class RooGenContext implement a universal generator context for all RooAbsPdf classes that do not hav...
RooLinearVar is the most general form of a derived real-valued object that can be used by RooRealInte...
void sterilize()
Clear the cache payload but retain slot mapping w.r.t to normalization and integration sets.
RooRealVar represents a variable that can be changed from the outside.
Bool_t hasBinning(const char *name) const
Returns true if variable has a binning with 'name'.
void setRange(const char *name, Double_t min, Double_t max)
Set range named 'name to [min,max].
const RooAbsBinning & getBinning(const char *name=0, Bool_t verbose=kTRUE, Bool_t createOnTheFly=kFALSE) const
Return binning definition with name.
void setBinning(const RooAbsBinning &binning, const char *name=0)
Add given binning under name 'name' with this variable.
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Overloaded RooArgSet::add() method inserts 'var' into set and registers 'var' as server to owner with...
virtual void removeAll()
Remove all argument inset using remove(const RooAbsArg&).
const T & arg() const
Return reference to object held in proxy.
Iterator abstract base class.
virtual TObject * Next()=0
virtual const char * GetName() const
Returns name of object.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
static TVirtualFFT * FFT(Int_t ndim, Int_t *n, Option_t *option)
Returns a pointer to the FFT of requested size and type.
virtual void SetPoints(const Double_t *data)=0
virtual void Transform()=0
virtual void GetPointComplex(Int_t ipoint, Double_t &re, Double_t &im, Bool_t fromInput=kFALSE) const =0
virtual void SetPointComplex(Int_t ipoint, TComplex &c)=0
virtual Double_t GetPointReal(Int_t ipoint, Bool_t fromInput=kFALSE) const =0
RooConstVar & RooConst(Double_t val)