12 #ifndef ROOCFUNCTION3BINDING
13 #define ROOCFUNCTION3BINDING
49 template<
class VO,
class VI1,
class VI2,
class VI3>
54 void add(
const char* name, VO (*ptr)(VI1,VI2,VI3),
const char* arg1name=
"x",
const char* arg2name=
"y",
const char* arg3name=
"z") {
91 std::map<std::string,VO (*)(VI1,VI2,VI3)>
_ptrmap ;
92 std::map<VO (*)(VI1,VI2,VI3),std::string>
_namemap ;
93 std::map<VO (*)(VI1,VI2,VI3),std::vector<std::string> >
_argnamemap ;
99 template<
class VO,
class VI1,
class VI2,
class VI3>
117 if (result && strlen(result)) {
125 temp._funcptr =
_ptr;
126 return Form(
"(%p)",temp._ptr) ;
131 return fmap().lookupArgName(
_ptr,iarg) ;
161 template<
class VO,
class VI1,
class VI2,
class VI3>
173 typedef ::RooCFunction3Ref<VO,VI1,VI2,VI3> thisClass;
183 tmpName.Streamer(R__b) ;
185 if (tmpName==
"UNKNOWN" && R__v>0) {
187 coutW(
ObjectHandling) <<
"WARNING: Objected embeds function pointer to unknown function, object will not be functional" << std::endl ;
188 _ptr = dummyFunction ;
193 _ptr = fmap().lookupPtr(tmpName.
Data()) ;
197 <<
" but no such function is registered, object will not be functional" << std::endl ;
210 TString tmpName = fmap().lookupName(_ptr) ;
211 if (tmpName.
Length()==0) {
217 temp._funcptr = _ptr;
219 <<
" written object will not be functional when read back" << std::endl ;
224 tmpName.Streamer(R__b) ;
233 template<
class VO,
class VI1,
class VI2,
class VI3>
246 os <<
"[ function=" <<
func.name() <<
" " ;
276 template<
class VO,
class VI1,
class VI2,
class VI3>
281 x(
func.argName(0),
func.argName(0),this,_x),
282 y(
func.argName(1),
func.argName(1),this,_y),
283 z(
func.argName(2),
func.argName(2),this,_z)
292 template<
class VO,
class VI1,
class VI2,
class VI3>
304 template<
class VO,
class VI1,
class VI2,
class VI3>
317 os <<
"[ function=" <<
func.name() <<
" " ;
347 template<
class VO,
class VI1,
class VI2,
class VI3>
352 x(
func.argName(0),
func.argName(0),this,_x),
353 y(
func.argName(1),
func.argName(1),this,_y),
354 z(
func.argName(2),
func.argName(2),this,_z)
363 template<
class VO,
class VI1,
class VI2,
class VI3>
VO(*)(VI1, VI2, VI3) lookupPtr(const char *name)
virtual void print(std::ostream &os, Bool_t addContents=kFALSE) const
Print proxy name.
virtual ~RooCFunction3PdfBinding()
const char * name() const
static VO dummyFunction(VI1, VI2, VI3)
RooCFunction3Ref(VO(*ptr)(VI1, VI2, VI3)=0)
const char * argName(Int_t iarg)
Double_t(* CFUNCD3UDU)(UInt_t, Double_t, UInt_t)
RooCFunction3Ref< VO, VI1, VI2, VI3 > func
RooAbsPdf * bindPdf(const char *name, CFUNCD1D func, RooAbsReal &x)
std::map< VO(*)(VI1, VI2, VI3), std::string > _namemap
Double_t(* CFUNCD3DII)(Double_t, Int_t, Int_t)
virtual TObject * clone(const char *newname) const
Buffer base class used for serializing objects.
virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss)=0
RooCFunction3Ref< VO, VI1, VI2, VI3 > func
void printArgs(std::ostream &os) const
Print object arguments, ie its proxies.
const char * lookupName(VO(*ptr)(VI1, VI2, VI3))
virtual UInt_t WriteVersion(const TClass *cl, Bool_t useBcnt=kFALSE)=0
RooAbsProxy * getProxy(Int_t index) const
Return the nth proxy from the proxy list.
Double_t evaluate() const
std::map< std::string, VO(*)(VI1, VI2, VI3)> _ptrmap
RooAbsReal * bindFunction(const char *name, CFUNCD1D func, RooAbsReal &x)
VO(* func_t)(VI1, VI2, VI3)
const char * Data() const
const char * lookupArgName(VO(*ptr)(VI1, VI2, VI3), UInt_t iarg)
#define ClassDef(name, id)
std::map< VO(*)(VI1, VI2, VI3), std::vector< std::string > > _argnamemap
virtual TObject * clone(const char *newname) const
func_t _ptr
Pointer to embedded function.
RooCFunction3PdfBinding()
Double_t(* CFUNCD3UDD)(UInt_t, Double_t, Double_t)
virtual ~RooCFunction3Binding()
Int_t numProxies() const
Return the number of registered proxies.
void printArgs(std::ostream &os) const
Print object arguments, ie its proxies.
static RooCFunction3Map< VO, VI1, VI2, VI3 > * _fmap
Pointer to embedded function.
void add(const char *name, VO(*ptr)(VI1, VI2, VI3), const char *arg1name="x", const char *arg2name="y", const char *arg3name="z")
char * Form(const char *fmt,...)
virtual void SetByteCount(UInt_t cntpos, Bool_t packInVersion=kFALSE)=0
virtual const char * name() const
static RooCFunction3Map< VO, VI1, VI2, VI3 > & fmap()
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
double func(double *x, double *p)
RooCFunction3Map< double, double, double, bool > * _fmap
Mother of all ROOT objects.
Double_t(* CFUNCD3UUD)(UInt_t, UInt_t, Double_t)
RooAbsPdf is the abstract interface for all probability density functions The class provides hybrid a...
Double_t(* CFUNCD3DDD)(Double_t, Double_t, Double_t)
Double_t evaluate() const
VO operator()(VI1 x, VI2 y, VI3 z) const
Double_t(* CFUNCD3DDB)(Double_t, Double_t, Bool_t)
virtual Version_t ReadVersion(UInt_t *start=0, UInt_t *bcnt=0, const TClass *cl=0)=0