|
ROOT
Reference Guide |
|
Go to the documentation of this file.
100 _convVar(
"!convVar",
"Convolution variable",this,cVar,
kFALSE,
kFALSE),
101 _convSet(
"!convSet",
"Set of resModel X basisFunc convolutions",this),
102 _coefNormMgr(this,10),
114 _model(
"!model",this,other._model),
115 _convVar(
"!convVar",this,other._convVar),
116 _convSet(
"!convSet",this,other._convSet),
117 _coefNormMgr(other._coefNormMgr,this),
118 _codeReg(other._codeReg)
137 for (
auto arg : tmp) {
163 <<
" declare basis functions in a copied RooAbsAnaConvPdf" << endl ;
171 <<
" doesn't support basis function " << expression << endl ;
177 basisArgs.
add(params) ;
179 TString basisName(expression) ;
180 for (
const auto arg : basisArgs) {
182 basisName.
Append(arg->GetName()) ;
194 coutE(
InputArguments) <<
"RooAbsAnaConvPdf::declareBasis(" <<
GetName() <<
"): unable to construct convolution with basis function '"
195 << expression <<
"'" << endl ;
217 if (!newConvSet.
add(*newConv)) {
226 std::for_each(newConvSet.
begin(), newConvSet.
end(), [](
RooAbsArg* arg){delete arg;});
269 if (numAddDep>0 || !pdfCanDir || !resCanDir) {
273 if (numAddDep>0) reason +=
"Resolution model has more observables than the convolution variable. " ;
274 if (!pdfCanDir) reason +=
"PDF does not support internal generation of convolution observable. " ;
275 if (!resCanDir) reason +=
"Resolution model does not support internal generation of convolution observable. " ;
277 coutI(
Generation) <<
"RooAbsAnaConvPdf::genContext(" <<
GetName() <<
") Using regular accept/reject generator for convolution p.d.f because: " << reason.c_str() << endl ;
282 if (context)
return context;
315 if (!conv)
return 0 ;
333 auto conv =
static_cast<RooAbsPdf*
>(convArg);
338 cxcoutD(
Eval) <<
"RooAbsAnaConvPdf::evaluate(" <<
GetName() <<
") val += coef*conv [" << index-1 <<
"/"
340 result += conv->getVal(0)*coef ;
368 if (allVars.
getSize()==0)
return 0 ;
395 intCoefSet->
add(*arg) ;
397 intConvSet->
add(*arg) ;
418 normCoefSet->
add(*arg) ;
420 normConvSet->
add(*arg) ;
428 if (intCoefSet->
getSize()==0) {
429 delete intCoefSet ; intCoefSet=0 ;
431 if (intConvSet->
getSize()==0) {
432 delete intConvSet ; intConvSet=0 ;
434 if (normCoefSet->
getSize()==0) {
435 delete normCoefSet ; normCoefSet=0 ;
437 if (normConvSet->
getSize()==0) {
438 delete normConvSet ; normConvSet=0 ;
444 Int_t masterCode(0) ;
445 std::vector<Int_t> tmp(1, 0) ;
447 masterCode =
_codeReg.
store(tmp, intCoefSet, intConvSet, normCoefSet, normConvSet) + 1 ;
449 analVars.
add(*allDeps) ;
451 if (normSet)
delete normSet ;
452 if (normSetAll)
delete normSetAll ;
496 if (code==0)
return getVal(normSet) ;
499 RooArgSet *intCoefSet, *intConvSet, *normCoefSet, *normConvSet ;
505 if (normCoefSet==0&&normConvSet==0) {
515 integral += coef*(_rangeName ? conv->getNormObj(0,intConvSet,_rangeName)->getVal() : conv->getNorm(intConvSet) ) ;
516 cxcoutD(
Eval) <<
"RooAbsAnaConv::aiWN(" <<
GetName() <<
") [" << index-1 <<
"] integral += " << conv->getNorm(intConvSet) << endl ;
534 Double_t term = (_rangeName ? conv->getNormObj(0,intConvSet,_rangeName)->getVal() : conv->getNorm(intConvSet) ) ;
535 integral += coefInt*term ;
541 Double_t term = conv->getNorm(normConvSet) ;
542 norm += coefNorm*term ;
547 answer = integral/norm ;
576 coutE(
InputArguments) <<
"RooAbsAnaConvPdf::coefAnalyticalIntegral(" <<
GetName() <<
") ERROR: unrecognized integration code: " << code << endl ;
652 std::vector<RooAbsArg*> tmp;
653 for (
auto arg : *cVars) {
655 if (convSetArg->dependsOn(*arg)) {
661 cVars->remove(tmp.begin(), tmp.end(),
true,
true);
679 os <<
indent <<
"--- RooAbsAnaConvPdf ---" << endl;
694 while ((carg=citer.
next())) {
696 trackNodes.
add(*carg) ;
Int_t setObj(const RooArgSet *nset, T *obj, const TNamed *isetRangeName=0)
RooAbsRealLValue * convVar()
Retrieve the convolution variable.
OperMode operMode() const
Query the operation mode of this node.
friend class RooConvGenContext
Double_t getCoefNorm(Int_t coefIdx, const RooArgSet &nset, const char *rangeName) const
virtual Int_t getAnalyticalIntegralWN(RooArgSet &allVars, RooArgSet &analVars, const RooArgSet *normSet, const char *rangeName=0) const
Advertise capability to perform (analytical) integrals internally.
static const TNamed * ptr(const char *stringPtr)
Return a unique TNamed pointer for given C++ string.
RooConvCoefVar is an auxilary class that represents the coefficient of a RooAbsAnaConvPdf implementat...
virtual Double_t coefficient(Int_t basisIndex) const =0
Int_t declareBasis(const char *expression, const RooArgList ¶ms)
Declare a basis function for use in this physics model.
const T & arg() const
Return reference to object held in proxy.
T * getObj(const RooArgSet *nset, Int_t *sterileIndex=0, const TNamed *isetRangeName=0)
RooAbsRealLValue & convVar() const
Return the convolution variable of the resolution model.
virtual ~RooAbsAnaConvPdf()
Destructor.
virtual Double_t coefAnalyticalIntegral(Int_t coef, Int_t code, const char *rangeName=0) const
Default implementation of function implementing advertised integrals.
RooAbsReal * createIntegral(const RooArgSet &iset, const RooCmdArg &arg1, const RooCmdArg &arg2=RooCmdArg::none(), const RooCmdArg &arg3=RooCmdArg::none(), const RooCmdArg &arg4=RooCmdArg::none(), const RooCmdArg &arg5=RooCmdArg::none(), const RooCmdArg &arg6=RooCmdArg::none(), const RooCmdArg &arg7=RooCmdArg::none(), const RooCmdArg &arg8=RooCmdArg::none()) const
Create an object that represents the integral of the function over one or more observables listed in ...
char * Form(const char *fmt,...)
virtual Bool_t changeModel(const RooResolutionModel &newModel)
Change the current resolution model to newModel.
void makeCoefVarList(RooArgList &) const
Build complete list of coefficient variables.
RooFIter fwdIterator() const
One-time forward iterator.
List of created basis functions.
RooArgList is a container object that can hold multiple RooAbsArg objects.
Class RooGenContext implement a universal generator context for all RooAbsPdf classes that do not hav...
Double_t getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
virtual void printMultiline(std::ostream &os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const
Print multi line detailed information of this RooAbsPdf.
virtual Bool_t remove(const RooAbsArg &var, Bool_t silent=kFALSE, Bool_t matchByNameOnly=kFALSE)
Remove the specified argument from our list.
void setOperMode(OperMode mode, Bool_t recurseADirty=kTRUE)
Set the operation mode of this node.
virtual Int_t getCoefAnalyticalIntegral(Int_t coef, RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=0) const
Default implementation of function advertising integration capabilities.
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...
static void indent(ostringstream &buf, int indent_level)
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
RooAbsArg * at(Int_t idx) const
Return object at given index, or nullptr if index is out of range.
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 Bool_t remove(const RooAbsArg &var, Bool_t silent=kFALSE, Bool_t matchByNameOnly=kFALSE) override
Reimplementation of standard RooArgList::remove()
Iterator abstract base class.
virtual RooResolutionModel * convolution(RooFormulaVar *basis, RooAbsArg *owner) const
Instantiate a clone of this resolution model representing a convolution with given basis function.
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...
virtual void printMultiline(std::ostream &os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const
Print info about this object to the specified stream.
Int_t store(const std::vector< Int_t > &codeList, RooArgSet *set1=0, RooArgSet *set2=0, RooArgSet *set3=0, RooArgSet *set4=0)
Store given arrays of integer codes, and up to four RooArgSets in the registry (each setX pointer may...
RooResolutionModel is the base class for PDFs that represent a resolution model that can be convolute...
void replaceServer(RooAbsArg &oldServer, RooAbsArg &newServer, Bool_t valueProp, Bool_t shapeProp)
Replace 'oldServer' with 'newServer'.
RooObjCacheManager _coefNormMgr
RooAbsAnaConvPdf()
Default constructor, required for persistence.
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.
virtual Double_t evaluate() const
Calculate the current unnormalized value of the PDF.
The TNamed class is the base class for all named ROOT classes.
A one-time forward iterator working on RooLinkedList or RooAbsCollection.
RooAbsArg * absArg() const
TString & Append(const char *cs)
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...
Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE) override
Add element to non-owning set.
virtual void setCacheAndTrackHints(RooArgSet &)
Label OK'ed components with cache-and-track.
TIterator * createIterator(Bool_t dir=kIterForward) const
TIterator-style iteration over contained elements.
RooAbsArg * next()
Return next element or nullptr if at end.
RooAbsGenContext is the abstract base class for generator contexts of RooAbsPdf objects.
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
virtual RooAbsGenContext * modelGenContext(const RooAbsAnaConvPdf &, const RooArgSet &, const RooDataSet *, const RooArgSet *, Bool_t) const
bool setArg(T &newRef)
Change object held in proxy into newRef.
const_iterator end() const
virtual Bool_t addOwned(RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
virtual TObject * Next()=0
const_iterator begin() const
int CompareTo(const char *cs, ECaseCompare cmp=kExact) const
Compare a string to char *cs2.
RooArgSet * getObservables(const RooArgSet &set, Bool_t valueOnly=kTRUE) const
Return the observables of this pdf given a set of observables.
void setAttribute(const Text_t *name, Bool_t value=kTRUE)
Set (default) or clear a named boolean attribute of this object.
static const char * str(const TNamed *ptr)
Return C++ string corresponding to given TNamed pointer.
virtual Bool_t addOwned(RooAbsArg &var, Bool_t silent=kFALSE) override
Reimplementation of standard RooArgList::addOwned()
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()
Bool_t dependsOn(const RooAbsCollection &serverList, const RooAbsArg *ignoreArg=0, Bool_t valueOnly=kFALSE) const
Test whether we depend on (ie, are served by) any object in the specified collection.
RooDataSet is a container class to hold unbinned data.
RooAbsArg is the common abstract base class for objects that represent a value and a "shape" in RooFi...
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE) override
Reimplementation of standard RooArgList::add()
virtual CacheMode canNodeBeCached() const
virtual Bool_t forceAnalyticalInt(const RooAbsArg &dep) const
This function forces RooRealIntegral to offer all integration dependents to RooAbsAnaConvPdf::getAnal...
virtual const char * GetName() const
Returns name of object.
const std::vector< Int_t > & retrieve(Int_t masterCode) const
Retrieve the array of integer codes associated with the given master code.
RooRealVar represents a variable that can be changed from the outside.
RooAbsRealLValue is the common abstract base class for objects that represent a real value that may a...
virtual RooArgSet * coefVars(Int_t coefIdx) const
Return set of parameters with are used exclusively by the coefficient functions.
RooAbsAnaConvPdf is the base class for PDFs that represent a physics model that can be analytically c...
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Int_t index(const RooAbsArg *arg) const
Returns index of given arg, or -1 if arg is not in the collection.
RooAbsCollection * snapshot(Bool_t deepCopy=kTRUE) const
Take a snap shot of current collection contents.
RooTruthModel is an implementation of RooResolution model that provides a delta-function resolution m...
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.
virtual void removeAll() override
Reimplementation of standard RooArgList::removeAll()