Warning, file /include/root/RooGenericPdf.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef ROO_GENERIC_PDF
0017 #define ROO_GENERIC_PDF
0018
0019 #include "RooAbsPdf.h"
0020 #include "RooListProxy.h"
0021 #include "RooAbsBinning.h"
0022
0023 #include <map>
0024 #include <memory>
0025 #include <string>
0026
0027 class RooArgList ;
0028 class RooFormula ;
0029 class RooAbsRealLValue;
0030
0031 class RooGenericPdf : public RooAbsPdf {
0032 public:
0033
0034 RooGenericPdf();
0035 ~RooGenericPdf() override;
0036 RooGenericPdf(const char *name, const char *title, const char* formula, const RooArgList& dependents);
0037 RooGenericPdf(const char *name, const char *title, const RooArgList& dependents);
0038 RooGenericPdf(const RooGenericPdf& other, const char* name=nullptr);
0039 TObject* clone(const char* newname=nullptr) const override { return new RooGenericPdf(*this,newname); }
0040
0041
0042 bool readFromStream(std::istream& is, bool compact, bool verbose=false) override ;
0043 void writeToStream(std::ostream& os, bool compact) const override ;
0044
0045
0046 inline RooAbsArg* getParameter(const char* name) const {
0047 return _actualVars.find(name) ;
0048 }
0049
0050 inline RooAbsArg* getParameter(Int_t index) const {
0051 return _actualVars.at(index) ;
0052 }
0053
0054 inline size_t nParameters() const {
0055 return _actualVars.size();
0056 }
0057
0058
0059 void printMultiline(std::ostream& os, Int_t content, bool verbose=false, TString indent="") const override ;
0060 void printMetaArgs(std::ostream& os) const override ;
0061
0062
0063 void dumpFormula();
0064
0065 const char* expression() const { return _formExpr.Data(); }
0066 const RooArgList& dependents() const { return _actualVars; }
0067
0068 std::string getUniqueFuncName() const;
0069
0070 void setBinning(const RooAbsRealLValue &obs, const RooAbsBinning &binning, bool checkFlatness = true);
0071 const RooAbsBinning *getBinning(const RooAbsRealLValue &obs) const;
0072 bool removeBinning(const RooAbsRealLValue &obs);
0073
0074 bool isBinnedDistribution(const RooArgSet &obs) const override;
0075 std::list<double> *binBoundaries(RooAbsRealLValue &obs, double xlo, double xhi) const override;
0076 std::list<double> *plotSamplingHint(RooAbsRealLValue &obs, double xlo, double xhi) const override;
0077
0078 protected:
0079 RooFormula& formula() const ;
0080
0081
0082 RooListProxy _actualVars ;
0083 double evaluate() const override ;
0084 void doEval(RooFit::EvalContext &) const override;
0085
0086
0087 bool redirectServersHook(const RooAbsCollection& newServerList, bool mustReplaceAll, bool nameChange, bool isRecursive) override ;
0088
0089 bool isValidReal(double , bool ) const override { return true; }
0090
0091 mutable RooFormula * _formula = nullptr;
0092 TString _formExpr ;
0093
0094 std::map<int, std::unique_ptr<RooAbsBinning>> _binnings;
0095
0096
0097 ClassDefOverride(RooGenericPdf, 2)
0098 };
0099
0100 #endif