File indexing completed on 2025-01-18 10:11:25
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef ROO_POLY_VAR
0017 #define ROO_POLY_VAR
0018
0019 #include <RooAbsReal.h>
0020 #include <RooRealProxy.h>
0021 #include <RooListProxy.h>
0022
0023 #include <vector>
0024
0025 class RooPolyVar : public RooAbsReal {
0026 public:
0027 RooPolyVar() {}
0028 RooPolyVar(const char *name, const char *title, RooAbsReal &x);
0029 RooPolyVar(const char *name, const char *title, RooAbsReal &_x, const RooArgList &_coefList, Int_t lowestOrder = 0);
0030
0031 RooPolyVar(const RooPolyVar &other, const char *name = nullptr);
0032 TObject *clone(const char *newname) const override { return new RooPolyVar(*this, newname); }
0033
0034 Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName = nullptr) const override;
0035 double analyticalIntegral(Int_t code, const char *rangeName = nullptr) const override;
0036
0037 void translate(RooFit::Detail::CodeSquashContext &ctx) const override;
0038 std::string buildCallToAnalyticIntegral(Int_t code, const char *rangeName,
0039 RooFit::Detail::CodeSquashContext &ctx) const override;
0040
0041 protected:
0042 RooRealProxy _x;
0043 RooListProxy _coefList;
0044 Int_t _lowestOrder = 0;
0045
0046 mutable std::vector<double> _wksp;
0047
0048 double evaluate() const override;
0049 void doEval(RooFit::EvalContext &) const override;
0050
0051
0052 inline bool canComputeBatchWithCuda() const override { return !_coefList.empty(); }
0053
0054 private:
0055 friend class RooPolynomial;
0056
0057 static void doEvalImpl(RooAbsArg const* caller, RooFit::EvalContext &,
0058 RooAbsReal const &x, RooArgList const &coefs, int lowestOrder);
0059
0060 static void fillCoeffValues(std::vector<double> &wksp, RooListProxy const &coefList);
0061
0062 ClassDefOverride(RooPolyVar, 1)
0063 };
0064
0065 #endif