Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooLognormal.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * @(#)root/roofit:$Id$ *
4 * *
5 * RooFit Lognormal PDF *
6 * *
7 * Author: Gregory Schott and Stefan Schmitz *
8 * *
9 *****************************************************************************/
10
11#ifndef ROO_LOGNORMAL
12#define ROO_LOGNORMAL
13
14#include <RooAbsPdf.h>
15#include <RooRealProxy.h>
16
17class RooLognormal : public RooAbsPdf {
18public:
20 RooLognormal(const char *name, const char *title, RooAbsReal &_x, RooAbsReal &_m0, RooAbsReal &_k,
21 bool useStandardParametrization = false);
22 RooLognormal(const RooLognormal &other, const char *name = nullptr);
23 TObject *clone(const char *newname) const override { return new RooLognormal(*this, newname); }
24
25 Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName = nullptr) const override;
26 double analyticalIntegral(Int_t code, const char *rangeName = nullptr) const override;
27
28 Int_t getGenerator(const RooArgSet &directVars, RooArgSet &generateVars, bool staticInitOK = true) const override;
29 void generateEvent(Int_t code) override;
30
31 void translate(RooFit::Detail::CodeSquashContext &ctx) const override;
32 std::string
33 buildCallToAnalyticIntegral(int code, const char *rangeName, RooFit::Detail::CodeSquashContext &ctx) const override;
34
35 /// Get the x variable.
36 RooAbsReal const &getX() const { return x.arg(); }
37
38 /// Get the median parameter.
39 RooAbsReal const &getMedian() const { return m0.arg(); }
40
41 /// Get the shape parameter.
42 RooAbsReal const &getShapeK() const { return k.arg(); }
43
45
46protected:
47 RooRealProxy x; ///< the variable
48 RooRealProxy m0; ///< the median, exp(mu)
49 RooRealProxy k; ///< the shape parameter, exp(sigma)
51
52 double evaluate() const override;
53 void doEval(RooFit::EvalContext &) const override;
54 inline bool canComputeBatchWithCuda() const override { return true; }
55
56private:
57 ClassDefOverride(RooLognormal, 2) // log-normal PDF
58};
59
60#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
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition RooArgSet.h:55
A class to maintain the context for squashing of RooFit models into code.
RooFit Lognormal PDF.
void doEval(RooFit::EvalContext &) const override
Compute multiple values of Lognormal distribution.
Int_t getGenerator(const RooArgSet &directVars, RooArgSet &generateVars, bool staticInitOK=true) const override
Load generatedVars with the subset of directVars that we can generate events for, and return a code t...
std::string buildCallToAnalyticIntegral(int code, const char *rangeName, RooFit::Detail::CodeSquashContext &ctx) const override
This function defines the analytical integral translation for the class.
TObject * clone(const char *newname) const override
RooRealProxy k
the shape parameter, exp(sigma)
void generateEvent(Int_t code) override
Interface for generation of an event using the algorithm corresponding to the specified code.
bool _useStandardParametrization
double analyticalIntegral(Int_t code, const char *rangeName=nullptr) const override
Implements the actual analytical integral(s) advertised by getAnalyticalIntegral.
bool canComputeBatchWithCuda() const override
bool useStandardParametrization() const
Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=nullptr) const override
Interface function getAnalyticalIntergral advertises the analytical integrals that are supported.
RooAbsReal const & getMedian() const
Get the median parameter.
RooRealProxy x
the variable
RooRealProxy m0
the median, exp(mu)
double evaluate() const override
ln(k)<1 would correspond to sigma < 0 in the parameterization resulting by transforming a normal rand...
RooAbsReal const & getShapeK() const
Get the shape parameter.
RooAbsReal const & getX() const
Get the x variable.
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 ...
const T & arg() const
Return reference to object held in proxy.
Mother of all ROOT objects.
Definition TObject.h:41