Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-10-31 09:16:34

0001 /*****************************************************************************
0002  * Project: RooFit                                                           *
0003  * @(#)root/roofit:$Id$ *
0004  *                                                                           *
0005  * RooFit Lognormal PDF                                                      *
0006  *                                                                           *
0007  * Author: Gregory Schott and Stefan Schmitz                                 *
0008  *                                                                           *
0009  *****************************************************************************/
0010 
0011 #ifndef ROO_LOGNORMAL
0012 #define ROO_LOGNORMAL
0013 
0014 #include <RooAbsPdf.h>
0015 #include <RooRealProxy.h>
0016 
0017 class RooLognormal : public RooAbsPdf {
0018 public:
0019    RooLognormal() {}
0020    RooLognormal(const char *name, const char *title, RooAbsReal &_x, RooAbsReal &_m0, RooAbsReal &_k,
0021                 bool useStandardParametrization = false);
0022    RooLognormal(const RooLognormal &other, const char *name = nullptr);
0023    TObject *clone(const char *newname) const override { return new RooLognormal(*this, newname); }
0024 
0025    Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName = nullptr) const override;
0026    double analyticalIntegral(Int_t code, const char *rangeName = nullptr) const override;
0027 
0028    Int_t getGenerator(const RooArgSet &directVars, RooArgSet &generateVars, bool staticInitOK = true) const override;
0029    void generateEvent(Int_t code) override;
0030 
0031    /// Get the x variable.
0032    RooAbsReal const &getX() const { return x.arg(); }
0033 
0034    /// Get the median parameter.
0035    RooAbsReal const &getMedian() const { return m0.arg(); }
0036 
0037    /// Get the shape parameter.
0038    RooAbsReal const &getShapeK() const { return k.arg(); }
0039 
0040    bool useStandardParametrization() const { return _useStandardParametrization; }
0041 
0042 protected:
0043    RooRealProxy x;  ///< the variable
0044    RooRealProxy m0; ///< the median, exp(mu)
0045    RooRealProxy k;  ///< the shape parameter, exp(sigma)
0046    bool _useStandardParametrization = false;
0047 
0048    double evaluate() const override;
0049    void doEval(RooFit::EvalContext &) const override;
0050    inline bool canComputeBatchWithCuda() const override { return true; }
0051 
0052 private:
0053    ClassDefOverride(RooLognormal, 2) // log-normal PDF
0054 };
0055 
0056 #endif