Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooPolyVar.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitCore *
4 * File: $Id: RooPolyVar.h,v 1.7 2007/05/11 09:11:30 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_POLY_VAR
17#define ROO_POLY_VAR
18
19#include <RooAbsReal.h>
20#include <RooRealProxy.h>
21#include <RooListProxy.h>
22
23#include <vector>
24
25class RooPolyVar : public RooAbsReal {
26public:
27
29 RooPolyVar(const char* name, const char* title, RooAbsReal& x) ;
30 RooPolyVar(const char *name, const char *title,
31 RooAbsReal& _x, const RooArgList& _coefList, Int_t lowestOrder=0) ;
32
33 RooPolyVar(const RooPolyVar& other, const char *name = nullptr);
34 TObject* clone(const char* newname) const override { return new RooPolyVar(*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
39protected:
40
44
45 mutable std::vector<double> _wksp; ///<! do not persist
46
47 double evaluate() const override;
48 void computeBatch(cudaStream_t*, double* output, size_t nEvents, RooFit::Detail::DataMap const&) const override;
49
50 // It doesn't make sense to use the GPU if the polynomial has no terms.
51 inline bool canComputeBatchWithCuda() const override { return !_coefList.empty(); }
52
53private:
54
55 friend class RooPolynomial;
56
57 static void computeBatchImpl(cudaStream_t *, double *output, size_t nEvents, RooFit::Detail::DataMap const &,
58 RooAbsReal const &x, RooArgList const &coefs, int lowestOrder);
59
60
61 ClassDefOverride(RooPolyVar,1); // Polynomial function
62};
63
64#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
Class RooPolyVar is a RooAbsReal implementing a polynomial in terms of a list of RooAbsReal coefficie...
Definition RooPolyVar.h:25
bool canComputeBatchWithCuda() const override
Definition RooPolyVar.h:51
double evaluate() const override
Calculate and return value of polynomial.
TObject * clone(const char *newname) const override
Definition RooPolyVar.h:34
static void computeBatchImpl(cudaStream_t *, double *output, size_t nEvents, RooFit::Detail::DataMap const &, RooAbsReal const &x, RooArgList const &coefs, int lowestOrder)
Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=nullptr) const override
Advertise that we can internally integrate over x.
std::vector< double > _wksp
! do not persist
Definition RooPolyVar.h:45
Int_t _lowestOrder
Definition RooPolyVar.h:43
double analyticalIntegral(Int_t code, const char *rangeName=nullptr) const override
Calculate and return analytical integral over x.
RooListProxy _coefList
Definition RooPolyVar.h:42
RooRealProxy _x
Definition RooPolyVar.h:41
void computeBatch(cudaStream_t *, double *output, size_t nEvents, RooFit::Detail::DataMap const &) const override
Compute multiple values of Polynomial.
RooPolynomial implements a polynomial p.d.f of the form.
Mother of all ROOT objects.
Definition TObject.h:41
Double_t x[n]
Definition legend1.C:17
static void output()