Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-17 09:15:09

0001 /*
0002  * Project: RooFit
0003  *
0004  * Copyright (c) 2024, CERN
0005  *
0006  * Redistribution and use in source and binary forms,
0007  * with or without modification, are permitted according to the terms
0008  * listed in LICENSE (http://roofit.sourceforge.net/license.txt)
0009  */
0010 
0011 #ifndef RooFit_RooBernstein_h
0012 #define RooFit_RooBernstein_h
0013 
0014 #include <RooAbsPdf.h>
0015 #include <RooAbsRealLValue.h>
0016 #include <RooListProxy.h>
0017 #include <RooRealVar.h>
0018 #include <RooTemplateProxy.h>
0019 
0020 #include <string>
0021 
0022 class RooBernstein : public RooAbsPdf {
0023 public:
0024    RooBernstein() = default;
0025    RooBernstein(const char *name, const char *title, RooAbsRealLValue &_x, const RooArgList &_coefList);
0026 
0027    RooBernstein(const RooBernstein &other, const char *name = nullptr);
0028 
0029    TObject *clone(const char *newname) const override { return new RooBernstein(*this, newname); }
0030 
0031    Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName = nullptr) const override;
0032    double analyticalIntegral(Int_t code, const char *rangeName = nullptr) const override;
0033    void selectNormalizationRange(const char *rangeName = nullptr, bool force = false) override;
0034 
0035    RooAbsRealLValue const &x() const { return *_x; }
0036    RooArgList const &coefList() const { return _coefList; }
0037 
0038    // Implementation detail. Do not use.
0039    void fillBuffer() const;
0040    // Implementation detail. Do not use.
0041    inline double xmin() const { return _buffer[_coefList.size()]; }
0042    // Implementation detail. Do not use.
0043    inline double xmax() const { return _buffer[_coefList.size() + 1]; }
0044 
0045 private:
0046 
0047    RooTemplateProxy<RooAbsRealLValue> _x;
0048    RooListProxy _coefList;
0049    std::string _refRangeName;
0050    mutable std::vector<double> _buffer; ///<!
0051 
0052    double evaluate() const override;
0053    void doEval(RooFit::EvalContext &) const override;
0054    inline bool canComputeBatchWithCuda() const override { return true; }
0055 
0056    ClassDefOverride(RooBernstein, 2) // Bernstein polynomial PDF
0057 };
0058 
0059 #endif