42using std::cout, std::endl, std::ostream;
61 cxcoutI(Generation) <<
"RooConvGenContext::ctor() setting up special generator context for analytical convolution p.d.f. " << model.
GetName()
62 <<
" for generation of observable(s) " << vars << endl ;
68 coutE(Generation) <<
"RooConvGenContext::RooConvGenContext(" <<
GetName() <<
") Couldn't deep-clone PDF, abort," << endl ;
77 throw std::runtime_error(
"RooConvGenContext only works with convolution variables of type RooRealVar.");
89 coutE(Generation) <<
"RooConvGenContext::RooConvGenContext(" <<
GetName() <<
") Couldn't deep-clone resolution model, abort," << std::endl;
94 convV =
dynamic_cast<RooRealVar*
>(&modelClone->convVar());
96 throw std::runtime_error(
"RooConvGenContext only works with convolution variables of type RooRealVar.");
101 _modelVars = std::unique_ptr<RooArgSet>{modelClone->getObservables(&vars)};
138 cxcoutI(Generation) <<
"RooConvGenContext::ctor() setting up special generator context for numeric convolution p.d.f. " << model.
GetName()
139 <<
" for generation of observable(s) " << vars << endl ;
187 cxcoutI(Generation) <<
"RooConvGenContext::ctor() setting up special generator context for fft convolution p.d.f. " << model.
GetName()
188 <<
" for generation of observable(s) " << vars << endl ;
237 pdfCommon->
remove(*cvPdf,
true,
true) ;
240 modelCommon->
remove(*cvModel,
true,
true) ;
309 _pdfGen->setProtoDataOrder(lut) ;
319 os <<
indent <<
"--- RooConvGenContext ---" << endl ;
320 os <<
indent <<
"List of component generators" << endl ;
325 _modelGen->printMultiline(os,content,verbose,indent2);
326 _pdfGen->printMultiline(os,content,verbose,indent2);
static void indent(ostringstream &buf, int indent_level)
Base class for PDFs that represent a physics model that can be analytically convolved with a resoluti...
virtual bool changeModel(const RooResolutionModel &newModel)
Change the current resolution model to newModel.
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.
RooAbsRealLValue * convVar()
Retrieve the convolution variable.
RooListProxy _convSet
Set of (resModel (x) basisFunc) convolution objects.
RooFit::OwningPtr< RooArgSet > getObservables(const RooArgSet &set, bool valueOnly=true) const
Given a set of possible observables, return the observables that this PDF depends on.
virtual bool remove(const RooAbsArg &var, bool silent=false, bool matchByNameOnly=false)
Remove the specified argument from our list.
void assign(const RooAbsCollection &other) const
Sets the value, cache and constant attribute of any argument in our set that also appears in the othe...
RooAbsArg * find(const char *name) const
Find object with given name in list.
Abstract base class for generator contexts of RooAbsPdf objects.
void printMultiline(std::ostream &os, Int_t contents, bool verbose=false, TString indent="") const override
Interface for multi-line printing.
virtual void setProtoDataOrder(Int_t *lut)
Set the traversal order of prototype data to that in the lookup tables passed as argument.
Abstract interface for all probability density functions.
virtual RooAbsGenContext * genContext(const RooArgSet &vars, const RooDataSet *prototype=nullptr, const RooArgSet *auxProto=nullptr, bool verbose=false) const
Interface function to create a generator context from a p.d.f.
bool isValidReal(double value, bool printError=false) const override
Check if given value is valid.
double getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
RooAbsArg * at(Int_t idx) const
Return object at given index, or nullptr if index is out of range.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
RooArgSet * snapshot(bool deepCopy=true) const
Use RooAbsCollection::snapshot(), but return as RooArgSet.
RooArgSet * selectCommon(const RooAbsCollection &refColl) const
Use RooAbsCollection::selecCommon(), but return as RooArgSet.
Efficient implementation of the generator context specific for RooAbsAnaConvPdf objects.
std::unique_ptr< RooAbsGenContext > _modelGen
Resolution model generator context.
RooConvGenContext(const RooFFTConvPdf &model, const RooArgSet &vars, const RooDataSet *prototype=nullptr, const RooArgSet *auxProto=nullptr, bool _verbose=false)
Constructor for specialized generator context for FFT numerical convolutions.
std::unique_ptr< RooArgSet > _pdfCloneSet
Owner of PDF clone.
void setProtoDataOrder(Int_t *lut) override
Set the traversal order for events in the prototype dataset The argument is a array of integers with ...
std::unique_ptr< RooArgSet > _pdfVars
Holder of PDF x truth event.
std::unique_ptr< RooArgSet > _modelVars
Holder of resModel event.
RooRealVar * _cvPdf
Convolution variable in PDFxTruth event.
std::unique_ptr< RooArgSet > _modelVarsOwned
Owning version of modelVars ;.
void attach(const RooArgSet ¶ms) override
Attach given set of arguments to internal clones of pdf and resolution model.
std::unique_ptr< RooArgSet > _modelCloneSet
Owner of resModel clone.
RooRealVar * _cvOut
Convolution variable in output event.
RooRealVar * _cvModel
Convolution variable in resModel event.
void generateEvent(RooArgSet &theEvent, Int_t remaining) override
Generate a single event.
void initGenerator(const RooArgSet &theEvent) override
One-time initialization of generator context, attaches the context to the supplied event container.
std::unique_ptr< RooArgSet > _pdfVarsOwned
Owning version of pdfVars ;.
TString _convVarName
Name of convolution variable.
void printMultiline(std::ostream &os, Int_t content, bool verbose=false, TString indent="") const override
Print the details of this generator context.
std::unique_ptr< RooAbsGenContext > _pdfGen
Physics model generator context.
Container class to hold unbinned data.
const RooArgSet * get(Int_t index) const override
Return RooArgSet with coordinates of event 'index'.
static void softAbort()
Soft abort function that interrupts macro execution but doesn't kill ROOT.
PDF for the numerical (FFT) convolution of two PDFs.
RooRealProxy _pdf1
First input p.d.f.
RooRealProxy _x
Convolution observable.
RooRealProxy _pdf2
Second input p.d.f.
Numeric 1-dimensional convolution operator PDF.
RooNumConvolution & conv() const
RooAbsReal & cloneModel() const
RooRealVar & cloneVar() const
RooAbsReal & clonePdf() const
Variable that can be changed from the outside.
void setVal(double value) override
Set value of variable to 'value'.
void removeRange(const char *name=nullptr)
Remove range limits for binning with given name. Empty name means default range.
RooResolutionModel is the base class for PDFs that represent a resolution model that can be convolute...
virtual void changeBasis(RooFormulaVar *basis)
Change the basis function we convolute with.
const T & arg() const
Return reference to object held in proxy.
Implements a RooResolution model that corresponds to a delta function.
const char * GetName() const override
Returns name of object.
TString & Append(const char *cs)