Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooPower.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_RooPower_h
12#define RooFit_RooPower_h
13
14#include <RooAbsPdf.h>
15#include <RooRealProxy.h>
16#include <RooListProxy.h>
17
18#include <vector>
19
20class RooPower : public RooAbsPdf {
21public:
23 RooPower(const char *name, const char *title, RooAbsReal &x, const RooArgList &coefList, const RooArgList &expList);
24
25 RooPower(const RooPower &other, const char *name = nullptr);
26 TObject *clone(const char *newname) const override { return new RooPower(*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
56 ClassDefOverride(RooPower, 1) // Power PDF
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
RooPower implements a power law PDF of the form.
Definition RooPower.h:20
RooListProxy _expList
Definition RooPower.h:45
std::string getFormulaExpression(bool expand) const
Definition RooPower.cxx:177
void doEval(RooFit::EvalContext &) const override
do not persist
Definition RooPower.cxx:86
RooAbsReal const & base() const
Get the base of the exponentiated terms (aka. x variable).
Definition RooPower.h:29
RooPower()
Definition RooPower.h:22
RooArgList const & coefList() const
Get the list of coefficients.
Definition RooPower.h:32
std::vector< double > _wksp
Definition RooPower.h:47
RooListProxy _coefList
Definition RooPower.h:44
RooRealProxy _x
Definition RooPower.h:43
int getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=nullptr) const override
Advertise to RooFit that this function can be analytically integrated.
Definition RooPower.cxx:136
double analyticalIntegral(int code, const char *rangeName=nullptr) const override
Do the analytical integral according to the code that was returned by getAnalyticalIntegral().
Definition RooPower.cxx:145
TObject * clone(const char *newname) const override
Definition RooPower.h:26
bool canComputeBatchWithCuda() const override
Definition RooPower.h:51
double evaluate() const override
Evaluation.
Definition RooPower.cxx:106
RooArgList const & expList() const
Get the list of exponents.
Definition RooPower.h:35
Mother of all ROOT objects.
Definition TObject.h:41
Double_t x[n]
Definition legend1.C:17