Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:11:24

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    void translate(RooFit::Detail::CodeSquashContext &ctx) const override;
0032    std::string
0033    buildCallToAnalyticIntegral(int code, const char *rangeName, RooFit::Detail::CodeSquashContext &ctx) const override;
0034 
0035    /// Get the x variable.
0036    RooAbsReal const &getX() const { return x.arg(); }
0037 
0038    /// Get the median parameter.
0039    RooAbsReal const &getMedian() const { return m0.arg(); }
0040 
0041    /// Get the shape parameter.
0042    RooAbsReal const &getShapeK() const { return k.arg(); }
0043 
0044    bool useStandardParametrization() const { return _useStandardParametrization; }
0045 
0046 protected:
0047    RooRealProxy x;  ///< the variable
0048    RooRealProxy m0; ///< the median, exp(mu)
0049    RooRealProxy k;  ///< the shape parameter, exp(sigma)
0050    bool _useStandardParametrization = false;
0051 
0052    double evaluate() const override;
0053    void doEval(RooFit::EvalContext &) const override;
0054    inline bool canComputeBatchWithCuda() const override { return true; }
0055 
0056 private:
0057    ClassDefOverride(RooLognormal, 2) // log-normal PDF
0058 };
0059 
0060 #endif