Warning, file /include/root/RooFormulaVar.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_FORMULA_VAR
0017 #define ROO_FORMULA_VAR
0018
0019 #include "RooAbsReal.h"
0020 #include "RooArgList.h"
0021 #include "RooListProxy.h"
0022 #include "RooTrace.h"
0023
0024 #include <memory>
0025 #include <list>
0026
0027 class RooArgSet ;
0028 class RooFormula ;
0029
0030 class RooFormulaVar : public RooAbsReal {
0031 public:
0032
0033 RooFormulaVar();
0034 ~RooFormulaVar() override;
0035 RooFormulaVar(const char *name, const char *title, const char* formula, const RooArgList& dependents, bool checkVariables = true);
0036 RooFormulaVar(const char *name, const char *title, const RooArgList& dependents, bool checkVariables = true);
0037 RooFormulaVar(const RooFormulaVar& other, const char* name=nullptr);
0038 TObject* clone(const char* newname) const override { return new RooFormulaVar(*this,newname); }
0039
0040 bool ok() const;
0041 const char* expression() const { return _formExpr.Data(); }
0042 const RooArgList& dependents() const { return _actualVars; }
0043
0044
0045 inline RooAbsArg* getParameter(const char* name) const {
0046 return _actualVars.find(name) ;
0047 }
0048
0049 inline RooAbsArg* getParameter(Int_t index) const {
0050 return _actualVars.at(index) ;
0051 }
0052
0053 inline size_t nParameters() const {
0054 return _actualVars.size();
0055 }
0056
0057
0058 bool readFromStream(std::istream& is, bool compact, bool verbose=false) override ;
0059 void writeToStream(std::ostream& os, bool compact) const override ;
0060
0061
0062 void printMultiline(std::ostream& os, Int_t contents, bool verbose=false, TString indent= "") const override ;
0063 void printMetaArgs(std::ostream& os) const override ;
0064
0065
0066
0067 void dumpFormula();
0068
0069 double defaultErrorLevel() const override ;
0070
0071 std::list<double>* binBoundaries(RooAbsRealLValue& , double , double ) const override ;
0072 std::list<double>* plotSamplingHint(RooAbsRealLValue& , double , double ) const override ;
0073
0074
0075 double evaluate() const override ;
0076 void doEval(RooFit::EvalContext &ctx) const override;
0077 void translate(RooFit::Detail::CodeSquashContext &ctx) const override;
0078
0079 protected:
0080
0081 bool redirectServersHook(const RooAbsCollection& newServerList, bool mustReplaceAll, bool nameChange, bool isRecursive) override ;
0082
0083 bool isValidReal(double , bool ) const override {return true;}
0084
0085 private:
0086 RooFormula& getFormula() const;
0087
0088 RooListProxy _actualVars ;
0089 mutable RooFormula *_formula = nullptr;
0090 mutable RooArgSet* _nset{nullptr};
0091 TString _formExpr ;
0092
0093 ClassDefOverride(RooFormulaVar,1)
0094 };
0095
0096 #endif