Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooPolynomial.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitModels *
4 * File: $Id: RooPolynomial.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) 2000-2005, Regents of the University of California *
10 * and Stanford University. All rights reserved. *
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 ROO_POLYNOMIAL
17#define ROO_POLYNOMIAL
18
19#include <RooAbsPdf.h>
20#include <RooRealProxy.h>
21#include <RooListProxy.h>
22
23#include <vector>
24
25class RooPolynomial : public RooAbsPdf {
26public:
27
29 RooPolynomial(const char* name, const char* title, RooAbsReal& x) ;
30 RooPolynomial(const char *name, const char *title,
32
33 RooPolynomial(const RooPolynomial& other, const char *name = nullptr);
34 TObject* clone(const char* newname) const override { return new RooPolynomial(*this, newname); }
35
36 Int_t getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& analVars, const char* rangeName=nullptr) const override ;
37 double analyticalIntegral(Int_t code, const char* rangeName=nullptr) const override ;
38
39 /// Get the x variable.
40 RooAbsReal const& x() const { return _x.arg(); }
41
42 /// Get the coefficient list.
43 RooArgList const& coefList() const { return _coefList; }
44
45 /// Return the order for the first coefficient in the list.
46 int lowestOrder() const { return _lowestOrder; }
47
48 // If this polynomial has no terms it's a uniform distribution, and a uniform
49 // pdf is a reducer node because it doesn't depend on the observables.
50 bool isReducerNode() const override { return _coefList.empty(); }
51
52protected:
53
57
58 mutable std::vector<double> _wksp; //! do not persist
59
60 /// Evaluation
61 double evaluate() const override;
62 void computeBatch(cudaStream_t*, double* output, size_t nEvents, RooFit::Detail::DataMap const&) const override;
63
64 // It doesn't make sense to use the GPU if the polynomial has no terms.
65 inline bool canComputeBatchWithCuda() const override { return !_coefList.empty(); }
66
67private:
68
69 ClassDefOverride(RooPolynomial,1); // Polynomial PDF
70};
71
72#endif
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
char name[80]
Definition TGX11.cxx:110
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition RooAbsReal.h:62
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
RooPolynomial implements a polynomial p.d.f of the form.
double evaluate() const override
do not persist
RooRealProxy _x
TObject * clone(const char *newname) const override
std::vector< double > _wksp
RooAbsReal const & x() const
Get the x variable.
bool isReducerNode() const override
RooListProxy _coefList
double analyticalIntegral(Int_t code, const char *rangeName=nullptr) const override
Do the analytical integral according to the code that was returned by getAnalyticalIntegral().
int lowestOrder() const
Return the order for the first coefficient in the list.
Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=nullptr) const override
Advertise to RooFit that this function can be analytically integrated.
RooArgList const & coefList() const
Get the coefficient list.
bool canComputeBatchWithCuda() const override
void computeBatch(cudaStream_t *, double *output, size_t nEvents, RooFit::Detail::DataMap const &) const override
Compute multiple values of Polynomial.
const T & arg() const
Return reference to object held in proxy.
Mother of all ROOT objects.
Definition TObject.h:41
static void output()