Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooPolyFunc.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitModels *
4 * File: $Id: RooPolyFunc.h,v 1.8 2007/05/11 09:13:07 verkerke Exp $
5 * Authors: *
6 * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu *
7 * DK, David Kirkby, UC Irvine, dkirkby@uci.edu *
8 * *
9 * Copyright (c) 2021: *
10 * CERN, Switzerland *
11 * *
12 * Redistribution and use in source and binary forms, *
13 * with or without modification, are permitted according to the terms *
14 * listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
15 *****************************************************************************/
16#ifndef RooFit_RooFit_RooPolyFunc_h
17#define RooFit_RooFit_RooPolyFunc_h
18
19#include "RooAbsReal.h"
20#include "RooListProxy.h"
21
22#include <vector>
23
24class RooRealVar;
25class RooArgList;
26
27class RooPolyFunc : public RooAbsReal {
28public:
30 RooPolyFunc(const char *name, const char *title, RooAbsReal &x, const RooAbsCollection &coefList);
31 RooPolyFunc(const char *name, const char *title, RooAbsReal &x, RooAbsReal &y, const RooAbsCollection &coefList);
32 RooPolyFunc(const char *name, const char *title, const RooAbsCollection &vars);
33 RooPolyFunc(const RooPolyFunc &other, const char *name = 0);
34 RooPolyFunc &operator=(const RooPolyFunc &other);
35 virtual TObject *clone(const char *newname) const { return new RooPolyFunc(*this, newname); }
36
37 void addTerm(double coefficient);
38 void addTerm(double coefficient, const RooAbsCollection &exponents);
39 void addTerm(double coefficient, const RooAbsReal &var1, int exp1);
40 void addTerm(double coefficient, const RooAbsReal &var1, int exp1, const RooAbsReal &var2, int exp2);
41
42 static std::unique_ptr<RooAbsReal>
43 taylorExpand(const char *name, const char *title, RooAbsReal &func, const RooAbsCollection &observables,
44 std::vector<double> const &observableValues, int order = 1, double eps1 = 1e-6, double eps2 = 1e-3);
45 static std::unique_ptr<RooAbsReal> taylorExpand(const char *name, const char *title, RooAbsReal &func,
46 const RooAbsCollection &observables, double observablesValue = 0.0,
47 int order = 1, double eps = 1e-6, double eps2 = 1e-3);
48
49protected:
50 void setCoordinate(const RooAbsCollection &observables, std::vector<double> const &observableValues);
52 std::vector<std::unique_ptr<RooListProxy>> _terms;
53
54 /// Evaluation
55 double evaluate() const;
56 // RooSpan<double> evaluateSpan(RooBatchCompute::RunContext& evalData, const RooArgSet* normSet) const;
57
58 ClassDef(RooPolyFunc, 1) // Polynomial Function
59};
60
61#endif
#define e(i)
Definition RSha256.hxx:103
#define ClassDef(name, id)
Definition Rtypes.h:325
char name[80]
Definition TGX11.cxx:110
RooAbsCollection is an abstract container object that can hold multiple RooAbsArg objects.
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition RooAbsReal.h:64
RooArgList is a container object that can hold multiple RooAbsArg objects.
Definition RooArgList.h:22
RooListProxy is the concrete proxy for RooArgList objects.
RooPolyFunc implements a polynomial function in multi-variables.
Definition RooPolyFunc.h:27
static std::unique_ptr< RooAbsReal > taylorExpand(const char *name, const char *title, RooAbsReal &func, const RooAbsCollection &observables, std::vector< double > const &observableValues, int order=1, double eps1=1e-6, double eps2=1e-3)
virtual TObject * clone(const char *newname) const
Definition RooPolyFunc.h:35
RooListProxy _vars
Definition RooPolyFunc.h:51
RooPolyFunc(const char *name, const char *title, RooAbsReal &x, const RooAbsCollection &coefList)
RooPolyFunc()
Default constructor.
RooPolyFunc(const char *name, const char *title, RooAbsReal &x, RooAbsReal &y, const RooAbsCollection &coefList)
void setCoordinate(const RooAbsCollection &observables, std::vector< double > const &observableValues)
void addTerm(double coefficient)
coverity[UNINIT_CTOR]
RooPolyFunc & operator=(const RooPolyFunc &other)
Assignment operator.
std::vector< std::unique_ptr< RooListProxy > > _terms
Definition RooPolyFunc.h:52
double evaluate() const
Evaluation.
RooRealVar represents a variable that can be changed from the outside.
Definition RooRealVar.h:39
Mother of all ROOT objects.
Definition TObject.h:41
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17