Back to home page

EIC code displayed by LXR

 
 

    


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

0001 /*
0002  * Project: RooFit
0003  *
0004  * Copyright (c) 2022, 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_RooPowerSum_h
0012 #define RooFit_RooPowerSum_h
0013 
0014 #include <RooAbsPdf.h>
0015 #include <RooRealProxy.h>
0016 #include <RooListProxy.h>
0017 
0018 #include <vector>
0019 
0020 class RooPowerSum : public RooAbsPdf {
0021 public:
0022    RooPowerSum() {}
0023    RooPowerSum(const char *name, const char *title, RooAbsReal &x, const RooArgList &coefList, const RooArgList &expList);
0024 
0025    RooPowerSum(const RooPowerSum &other, const char *name = nullptr);
0026    TObject *clone(const char *newname) const override { return new RooPowerSum(*this, newname); }
0027 
0028    /// Get the base of the exponentiated terms (aka. x variable).
0029    RooAbsReal const &base() const { return *_x; }
0030 
0031    /// Get the list of coefficients.
0032    RooArgList const &coefList() const { return _coefList; }
0033 
0034    /// Get the list of exponents.
0035    RooArgList const &expList() const { return _expList; }
0036 
0037    std::string getFormulaExpression(bool expand) const;
0038 
0039    int getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName = nullptr) const override;
0040    double analyticalIntegral(int code, const char *rangeName = nullptr) const override;
0041 
0042 protected:
0043    RooRealProxy _x;
0044    RooListProxy _coefList;
0045    RooListProxy _expList;
0046 
0047    mutable std::vector<double> _wksp; //! do not persist
0048 
0049    // CUDA support
0050    void doEval(RooFit::EvalContext &) const override;
0051    inline bool canComputeBatchWithCuda() const override { return true; }
0052 
0053    /// Evaluation
0054    double evaluate() const override;
0055 
0056    ClassDefOverride(RooPowerSum, 1) // Power PDF
0057 };
0058 
0059 #endif