Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/RooBernstein.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

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    void translate(RooFit::Detail::CodeSquashContext &ctx) const override;
0036    std::string buildCallToAnalyticIntegral(Int_t code, const char *rangeName,
0037                                            RooFit::Detail::CodeSquashContext &ctx) const override;
0038 
0039 private:
0040    void fillBuffer() const;
0041    inline double xmin() const { return _buffer[_coefList.size()]; }
0042    inline double xmax() const { return _buffer[_coefList.size() + 1]; }
0043 
0044    RooTemplateProxy<RooAbsRealLValue> _x;
0045    RooListProxy _coefList;
0046    std::string _refRangeName;
0047    mutable std::vector<double> _buffer; ///<!
0048 
0049    double evaluate() const override;
0050    void doEval(RooFit::EvalContext &) const override;
0051    inline bool canComputeBatchWithCuda() const override { return true; }
0052 
0053    ClassDefOverride(RooBernstein, 2) // Bernstein polynomial PDF
0054 };
0055 
0056 #endif