Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooExponential.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitModels *
4 * File: $Id: RooExponential.h,v 1.10 2007/07/12 20:30:49 wouter 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_EXPONENTIAL
17#define ROO_EXPONENTIAL
18
19#include <RooAbsPdf.h>
20#include <RooRealProxy.h>
21
22class RooExponential : public RooAbsPdf {
23public:
25 RooExponential(const char *name, const char *title, RooAbsReal &variable, RooAbsReal &coefficient,
26 bool negateCoefficient = false);
27 RooExponential(const RooExponential &other, const char *name = nullptr);
28 TObject *clone(const char *newname) const override { return new RooExponential(*this, newname); }
29
30 Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName = nullptr) const override;
31 double analyticalIntegral(Int_t code, const char *rangeName = nullptr) const override;
32
33 /// Get the x variable.
34 RooAbsReal const &variable() const { return x.arg(); }
35
36 /// Get the coefficient "c".
37 RooAbsReal const &coefficient() const { return c.arg(); }
38
39 bool negateCoefficient() const { return _negateCoefficient; }
40
41 void translate(RooFit::Detail::CodeSquashContext &ctx) const override;
42 std::string buildCallToAnalyticIntegral(Int_t code, const char *rangeName,
43 RooFit::Detail::CodeSquashContext &ctx) const override;
44
45protected:
48 bool _negateCoefficient = false;
49
50 double evaluate() const override;
51 void doEval(RooFit::EvalContext &) const override;
52 inline bool canComputeBatchWithCuda() const override { return true; }
53
54private:
55 ClassDefOverride(RooExponential, 2) // Exponential PDF
56};
57
58#endif
#define ClassDefOverride(name, id)
Definition Rtypes.h:346
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
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition RooArgSet.h:24
Exponential PDF.
void doEval(RooFit::EvalContext &) const override
Compute multiple values of Exponential distribution.
RooRealProxy c
bool negateCoefficient() const
void translate(RooFit::Detail::CodeSquashContext &ctx) const override
This function defines a translation for each RooAbsReal based object that can be used to express the ...
RooAbsReal const & coefficient() const
Get the coefficient "c".
bool canComputeBatchWithCuda() const override
TObject * clone(const char *newname) const override
RooAbsReal const & variable() const
Get the x variable.
double analyticalIntegral(Int_t code, const char *rangeName=nullptr) const override
Implements the actual analytical integral(s) advertised by getAnalyticalIntegral.
std::string buildCallToAnalyticIntegral(Int_t code, const char *rangeName, RooFit::Detail::CodeSquashContext &ctx) const override
This function defines the analytical integral translation for the class.
double evaluate() const override
Evaluate this PDF / function / constant. Needs to be overridden by all derived classes.
RooRealProxy x
Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=nullptr) const override
Interface function getAnalyticalIntergral advertises the analytical integrals that are supported.
A class to maintain the context for squashing of RooFit models into code.
Mother of all ROOT objects.
Definition TObject.h:41