Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooPowerSum.h
Go to the documentation of this file.
1/*
2 * Project: RooFit
3 *
4 * Copyright (c) 2022, CERN
5 *
6 * Redistribution and use in source and binary forms,
7 * with or without modification, are permitted according to the terms
8 * listed in LICENSE (http://roofit.sourceforge.net/license.txt)
9 */
10
11#ifndef RooFit_RooPowerSum_h
12#define RooFit_RooPowerSum_h
13
14#include <RooAbsPdf.h>
15#include <RooRealProxy.h>
16#include <RooListProxy.h>
17
18#include <vector>
19
20class RooPowerSum : public RooAbsPdf {
21public:
23 RooPowerSum(const char *name, const char *title, RooAbsReal &x, const RooArgList &coefList, const RooArgList &expList);
24
25 RooPowerSum(const RooPowerSum &other, const char *name = nullptr);
26 TObject *clone(const char *newname) const override { return new RooPowerSum(*this, newname); }
27
28 /// Get the base of the exponentiated terms (aka. x variable).
29 RooAbsReal const &base() const { return *_x; }
30
31 /// Get the list of coefficients.
32 RooArgList const &coefList() const { return _coefList; }
33
34 /// Get the list of exponents.
35 RooArgList const &expList() const { return _expList; }
36
37 std::string getFormulaExpression(bool expand) const;
38
39 int getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName = nullptr) const override;
40 double analyticalIntegral(int code, const char *rangeName = nullptr) const override;
41
42protected:
46
47 mutable std::vector<double> _wksp; //! do not persist
48
49 // CUDA support
50 void doEval(RooFit::EvalContext &) const override;
51 inline bool canComputeBatchWithCuda() const override { return true; }
52
53 /// Evaluation
54 double evaluate() const override;
55
57};
58
59#endif
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
char name[80]
Definition TGX11.cxx:110
Abstract interface for all probability density functions.
Definition RooAbsPdf.h:40
Abstract base class for objects that represent a real value and implements functionality common to al...
Definition RooAbsReal.h:59
RooArgList is a container object that can hold multiple RooAbsArg objects.
Definition RooArgList.h:22
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition RooArgSet.h:55
RooPowerSum implements a power law PDF of the form.
Definition RooPowerSum.h:20
RooAbsReal const & base() const
Get the base of the exponentiated terms (aka. x variable).
Definition RooPowerSum.h:29
RooArgList const & coefList() const
Get the list of coefficients.
Definition RooPowerSum.h:32
double evaluate() const override
Evaluation.
int getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=nullptr) const override
Advertise to RooFit that this function can be analytically integrated.
bool canComputeBatchWithCuda() const override
Definition RooPowerSum.h:51
TObject * clone(const char *newname) const override
Definition RooPowerSum.h:26
double analyticalIntegral(int code, const char *rangeName=nullptr) const override
Do the analytical integral according to the code that was returned by getAnalyticalIntegral().
RooRealProxy _x
Definition RooPowerSum.h:43
void doEval(RooFit::EvalContext &) const override
do not persist
RooListProxy _expList
Definition RooPowerSum.h:45
std::vector< double > _wksp
Definition RooPowerSum.h:47
RooArgList const & expList() const
Get the list of exponents.
Definition RooPowerSum.h:35
std::string getFormulaExpression(bool expand) const
RooListProxy _coefList
Definition RooPowerSum.h:44
Mother of all ROOT objects.
Definition TObject.h:41
Double_t x[n]
Definition legend1.C:17