Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-15 10:29:25

0001 /*
0002  * Project: RooFit
0003  *
0004  * Copyright (c) 2023, CERN
0005  *
0006  * Redistribution and use in source and binary forms,
0007  * with or without modification, are permitted according to the terms
0008  * listed in LICENSE (http://roofit.sourceforge.net/license.txt)
0009  */
0010 
0011 #ifndef ROOTFNBINDING
0012 #define ROOTFNBINDING
0013 
0014 #include "RooAbsReal.h"
0015 #include "RooListProxy.h"
0016 class TF1 ;
0017 class TF2 ;
0018 class TF3 ;
0019 
0020 class RooTFnBinding : public RooAbsReal {
0021 public:
0022   RooTFnBinding() = default;
0023   RooTFnBinding(const char *name, const char *title, TF1* func, const RooArgList& list);
0024   RooTFnBinding(const char *name, const char *title, TF1* func, const RooArgList& list, const RooArgList& plist);
0025   RooTFnBinding(const RooTFnBinding& other, const char* name=nullptr) ;
0026   TObject* clone(const char* newname=nullptr) const override { return new RooTFnBinding(*this,newname); }
0027 
0028   void printArgs(std::ostream& os) const override ;
0029 
0030   const RooArgList& observables() const { return _olist;}
0031   const RooArgList& parameters() const { return _plist; }
0032   const TF1& function() const { return *_func; }
0033 
0034 protected:
0035 
0036   RooListProxy _olist ;
0037   RooListProxy _plist ;
0038   TF1* _func = nullptr;
0039 
0040   double evaluate() const override ;
0041 
0042 private:
0043 
0044   ClassDefOverride(RooTFnBinding,1) // RooAbsReal binding to ROOT TF[123] functions
0045 };
0046 
0047 
0048 namespace RooFit {
0049 
0050 RooAbsReal* bindFunction(TF1* func,RooAbsReal& x) ;
0051 RooAbsReal* bindFunction(TF2* func,RooAbsReal& x, RooAbsReal& y) ;
0052 RooAbsReal* bindFunction(TF3* func,RooAbsReal& x, RooAbsReal& y, RooAbsReal& z) ;
0053 
0054 RooAbsReal* bindFunction(TF1* func,RooAbsReal& x, const RooArgList& params) ;
0055 RooAbsReal* bindFunction(TF2* func,RooAbsReal& x, RooAbsReal& y, const RooArgList& params) ;
0056 RooAbsReal* bindFunction(TF3* func,RooAbsReal& x, RooAbsReal& y, RooAbsReal& z, const RooArgList& params) ;
0057 
0058 }
0059 
0060 
0061 #endif