Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooFormulaEvaluator.h
Go to the documentation of this file.
1/// \cond ROOFIT_INTERNAL
2
3/*
4 * Project: RooFit
5 *
6 * Copyright (c) 2026, CERN
7 *
8 * Redistribution and use in source and binary forms,
9 * with or without modification, are permitted according to the terms
10 * listed in LICENSE (http://roofit.sourceforge.net/license.txt)
11 */
12
13#ifndef ROO_FORMULA_EVALUATOR
14#define ROO_FORMULA_EVALUATOR
15
16#include <memory>
17
18class TFormula;
19
20/// Abstract interface for evaluating a processed formula expression, i.e. one
21/// normalized by RooFormulaUtils::processFormula() to the `x[i]`-only dialect,
22/// so an implementation doesn't need any name resolution.
24public:
25 virtual ~RooFormulaEvaluator() = default;
26
27 /// Evaluate the formula, with `vars[i]` providing the value of `x[i]`.
28 virtual double eval(const double *vars) const = 0;
29
30 /// Return a deep copy of this evaluator.
31 virtual std::unique_ptr<RooFormulaEvaluator> clone() const = 0;
32
33 /// Return the underlying TFormula. Only the TFormula-backed evaluator
34 /// returns a non-nullptr. This accessor only exists to support the
35 /// getUniqueFuncName() functions used by the codegen backend and will be
36 /// removed together with them.
37 virtual TFormula *getTFormula() const { return nullptr; }
38};
39
40#endif
41
42/// \endcond
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
The Formula class.
Definition TFormula.h:89