12#ifndef ROOCFUNCTION3BINDING
13#define ROOCFUNCTION3BINDING
52template<
class VO,
class VI1,
class VI2,
class VI3>
57 void add(
const char*
name, VO (*ptr)(VI1,VI2,VI3),
const char* arg1name=
"x",
const char* arg2name=
"y",
const char* arg3name=
"z") {
94 std::map<std::string,VO (*)(VI1,VI2,VI3)>
_ptrmap ;
95 std::map<VO (*)(VI1,VI2,VI3),std::string>
_namemap ;
96 std::map<VO (*)(VI1,VI2,VI3),std::vector<std::string> >
_argnamemap ;
101template<
class VO,
class VI1,
class VI2,
class VI3>
126 temp._funcptr =
_ptr;
127 return Form(
"(%p)",temp._ptr) ;
132 return fmap().lookupArgName(
_ptr,iarg) ;
161template<
class VO,
class VI1,
class VI2,
class VI3>
166template<
class VO,
class VI1,
class VI2,
class VI3>
178 typedef ::RooCFunction3Ref<VO,VI1,VI2,VI3> thisClass;
190 if (tmpName==
"UNKNOWN" && R__v>0) {
192 coutW(ObjectHandling) <<
"WARNING: Objected embeds function pointer to unknown function, object will not be functional" << std::endl ;
193 _ptr = dummyFunction ;
198 _ptr = fmap().lookupPtr(tmpName.
Data()) ;
201 coutW(ObjectHandling) <<
"ERROR: Objected embeds pointer to function named " << tmpName
202 <<
" but no such function is registered, object will not be functional" << std::endl ;
215 TString tmpName = fmap().lookupName(_ptr) ;
216 if (tmpName.
Length()==0) {
222 temp._funcptr = _ptr;
223 coutW(ObjectHandling) <<
"WARNING: Cannot persist unknown function pointer " <<
Form(
"%p",temp._ptr)
224 <<
" written object will not be functional when read back" << std::endl ;
238template<
class VO,
class VI1,
class VI2,
class VI3>
250 os <<
"[ function=" <<
func.name() <<
" " ;
280template<
class VO,
class VI1,
class VI2,
class VI3>
285 x(func.argName(0),func.argName(0),this,_x),
286 y(func.argName(1),func.argName(1),this,_y),
287 z(func.argName(2),func.argName(2),this,_z)
296template<
class VO,
class VI1,
class VI2,
class VI3>
308template<
class VO,
class VI1,
class VI2,
class VI3>
320 os <<
"[ function=" <<
func.name() <<
" " ;
350template<
class VO,
class VI1,
class VI2,
class VI3>
355 x(func.argName(0),func.argName(0),this,_x),
356 y(func.argName(1),func.argName(1),this,_y),
357 z(func.argName(2),func.argName(2),this,_z)
366template<
class VO,
class VI1,
class VI2,
class VI3>
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
#define ClassDefOverride(name, id)
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
Int_t numProxies() const
Return the number of registered proxies.
RooAbsProxy * getProxy(Int_t index) const
Return the nth proxy from the proxy list.
Abstract interface for all probability density functions.
RooAbsProxy is the abstract interface for proxy classes.
Abstract base class for objects that represent a real value and implements functionality common to al...
RooCFunction3Binding is a templated implementation of class RooAbsReal that binds generic C(++) funct...
double evaluate() const override
Evaluate this PDF / function / constant. Needs to be overridden by all derived classes.
void printArgs(std::ostream &os) const override
Print object arguments, ie its proxies.
RooCFunction3Ref< VO, VI1, VI2, VI3 > func
TObject * clone(const char *newname) const override
const char * lookupArgName(VO(*ptr)(VI1, VI2, VI3), UInt_t iarg)
std::map< VO(*)(VI1, VI2, VI3), std::vector< std::string > > _argnamemap
const char * lookupName(VO(*ptr)(VI1, VI2, VI3))
VO(*)(VI1, VI2, VI3) lookupPtr(const char *name)
void add(const char *name, VO(*ptr)(VI1, VI2, VI3), const char *arg1name="x", const char *arg2name="y", const char *arg3name="z")
std::map< VO(*)(VI1, VI2, VI3), std::string > _namemap
std::map< std::string, VO(*)(VI1, VI2, VI3)> _ptrmap
RooCFunction3Ref< VO, VI1, VI2, VI3 > func
double evaluate() const override
Evaluate this PDF / function / constant. Needs to be overridden by all derived classes.
void printArgs(std::ostream &os) const override
Print object arguments, ie its proxies.
RooCFunction3PdfBinding()
TObject * clone(const char *newname) const override
const char * name() const
static RooCFunction3Map< VO, VI1, VI2, VI3 > * _fmap
Pointer to embedded function.
static RooCFunction3Map< VO, VI1, VI2, VI3 > & fmap()
void Streamer(TBuffer &) override
Stream an object of class TObject.
static VO dummyFunction(VI1, VI2, VI3)
VO(* func_t)(VI1, VI2, VI3)
const char * argName(Int_t iarg)
RooCFunction3Ref(VO(*ptr)(VI1, VI2, VI3)=nullptr)
VO operator()(VI1 x, VI2 y, VI3 z) const
func_t _ptr
Pointer to embedded function.
Buffer base class used for serializing objects.
virtual Version_t ReadVersion(UInt_t *start=nullptr, UInt_t *bcnt=nullptr, const TClass *cl=nullptr)=0
virtual void SetByteCount(UInt_t cntpos, Bool_t packInVersion=kFALSE)=0
virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss)=0
virtual UInt_t WriteVersion(const TClass *cl, Bool_t useBcnt=kFALSE)=0
Mother of all ROOT objects.
const char * Data() const
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
virtual void Streamer(TBuffer &)
Stream a string object.
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...
double(* CFUNCD3DDD)(double, double, double)
RooAbsPdf * bindPdf(const char *name, CFUNCD1D func, RooAbsReal &x)
double(* CFUNCD3DDB)(double, double, bool)
double(* CFUNCD3UDD)(UInt_t, double, double)
double(* CFUNCD3DII)(double, Int_t, Int_t)
RooAbsReal * bindFunction(const char *name, CFUNCD1D func, RooAbsReal &x)
double(* CFUNCD3UDU)(UInt_t, double, UInt_t)
double(* CFUNCD3UUD)(UInt_t, UInt_t, double)