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/type_traits.hpp> 13 template<
typename X,
typename Expr>
18 std::cout <<
">>> making new RooFitFunction" << std::endl;
19 std::vector<std::pair<boost::shared_ptr<double>, RooRealProxy> >::const_iterator
21 for(; i !=
end; ++
i) {
22 std::cout <<
">>> adding par to RooFitFunction" << std::endl;
23 pars_.push_back(std::make_pair(i->first, RooRealProxy(i->second.GetName(),
this, i->second)));
27 const Expr &
e, RooAbsReal & x) :
28 RooAbsReal(name, title),
e_(e),
x_(
X::name(),
X::name(), this, x) {
31 const Expr &
e, RooAbsReal & x,
33 RooAbsReal(name, title),
e_(e),
x_(
X::name(),
X::name(), this, x) {
34 pars_.push_back(std::make_pair(a.
ptr(), RooRealProxy(a.
name().c_str(), a.
name().c_str(),
this, rA)));
37 const Expr &
e, RooAbsReal & x,
40 RooAbsReal(name, title),
e_(e),
x_(
X::name(),
X::name(), this, x) {
41 pars_.push_back(std::make_pair(a.
ptr(), RooRealProxy(a.
name().c_str(), a.
name().c_str(),
this, rA)));
42 pars_.push_back(std::make_pair(b.
ptr(), RooRealProxy(b.
name().c_str(), b.
name().c_str(),
this, rB)));
45 const Expr &
e, RooAbsReal & x,
49 RooAbsReal(name, title),
e_(e),
x_(
X::name(),
X::name(), this, x) {
50 pars_.push_back(std::make_pair(a.
ptr(), RooRealProxy(a.
name().c_str(), a.
name().c_str(),
this, rA)));
51 pars_.push_back(std::make_pair(b.
ptr(), RooRealProxy(b.
name().c_str(), b.
name().c_str(),
this, rB)));
52 pars_.push_back(std::make_pair(c.
ptr(), RooRealProxy(c.
name().c_str(), c.
name().c_str(),
this, rC)));
56 pars_.push_back(std::make_pair(a.
ptr(), RooRealProxy(a.
name().c_str(), a.
name().c_str(),
this, rA)));
64 std::vector<std::pair<boost::shared_ptr<double>, RooRealProxy> >
pars_;
67 std::vector<std::pair<boost::shared_ptr<double>, RooRealProxy> >::const_iterator
68 i = pars_.begin(),
end = pars_.end();
69 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