1 #ifndef PhysicsTools_Utilities_RooFitFunction_h
2 #define PhysicsTools_Utilities_RooFitFunction_h
4 #include "RooAbsReal.h"
5 #include "RooRealProxy.h"
6 #include "RooAbsReal.h"
8 #include <boost/static_assert.hpp>
9 #include <boost/type_traits.hpp>
14 template<
typename X,
typename Expr>
19 std::cout <<
">>> making new RooFitFunction" << std::endl;
20 std::vector<std::pair<boost::shared_ptr<double>, RooRealProxy> >::const_iterator
22 for(; i !=
end; ++
i) {
23 std::cout <<
">>> adding par to RooFitFunction" << std::endl;
24 pars_.push_back(std::make_pair(i->first, RooRealProxy(i->second.GetName(),
this, i->second)));
28 const Expr &
e, RooAbsReal & x) :
29 RooAbsReal(name, title),
e_(e),
x_(
X::name(),
X::name(), this, x) {
32 const Expr &
e, RooAbsReal & x,
34 RooAbsReal(name, title),
e_(e),
x_(
X::name(),
X::name(), this, x) {
35 pars_.push_back(std::make_pair(a.
ptr(), RooRealProxy(a.
name().c_str(), a.
name().c_str(),
this, rA)));
38 const Expr &
e, RooAbsReal & x,
41 RooAbsReal(name, title),
e_(e),
x_(
X::name(),
X::name(), this, x) {
42 pars_.push_back(std::make_pair(a.
ptr(), RooRealProxy(a.
name().c_str(), a.
name().c_str(),
this, rA)));
43 pars_.push_back(std::make_pair(b.
ptr(), RooRealProxy(b.
name().c_str(), b.
name().c_str(),
this, rB)));
46 const Expr &
e, RooAbsReal & x,
50 RooAbsReal(name, title),
e_(e),
x_(
X::name(),
X::name(), this, x) {
51 pars_.push_back(std::make_pair(a.
ptr(), RooRealProxy(a.
name().c_str(), a.
name().c_str(),
this, rA)));
52 pars_.push_back(std::make_pair(b.
ptr(), RooRealProxy(b.
name().c_str(), b.
name().c_str(),
this, rB)));
53 pars_.push_back(std::make_pair(c.
ptr(), RooRealProxy(c.
name().c_str(), c.
name().c_str(),
this, rC)));
57 pars_.push_back(std::make_pair(a.
ptr(), RooRealProxy(a.
name().c_str(), a.
name().c_str(),
this, rA)));
59 virtual TObject*
clone(
const char* newName)
const {
65 std::vector<std::pair<boost::shared_ptr<double>, RooRealProxy> >
pars_;
68 std::vector<std::pair<boost::shared_ptr<double>, RooRealProxy> >::const_iterator
70 for(; i !=
end; ++
i) *(i->first) = i->second;
const std::string & name() const
void add(RooAbsReal &rA, funct::Parameter &a)
RooFitFunction(const char *name, const char *title, const Expr &e, RooAbsReal &x, RooAbsReal &rA, funct::Parameter &a, RooAbsReal &rB, funct::Parameter &b)
boost::shared_ptr< double > ptr() const
RooFitFunction(const char *name, const char *title, const Expr &e, RooAbsReal &x)
Double_t evaluate() const
RooFitFunction(const char *name, const char *title, const Expr &e, RooAbsReal &x, RooAbsReal &rA, funct::Parameter &a, RooAbsReal &rB, funct::Parameter &b, RooAbsReal &rC, funct::Parameter &c)
RooFitFunction(const char *name, const char *title, const Expr &e, RooAbsReal &x, RooAbsReal &rA, funct::Parameter &a)
RooFitFunction(const RooFitFunction< X, Expr > &other, const char *name=0)
virtual ~RooFitFunction()
std::vector< std::pair< boost::shared_ptr< double >, RooRealProxy > > pars_
virtual TObject * clone(const char *newName) const