Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooMinimizerFcn.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitCore *
4 * @(#)root/roofitcore:$Id$
5 * Authors: *
6 * AL, Alfio Lazzaro, INFN Milan, alfio.lazzaro@mi.infn.it *
7 * PB, Patrick Bos, Netherlands eScience Center, p.bos@esciencecenter.nl *
8 * *
9 * *
10 * Redistribution and use in source and binary forms, *
11 * with or without modification, are permitted according to the terms *
12 * listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
13 *****************************************************************************/
14
15#ifndef ROO_MINIMIZER_FCN
16#define ROO_MINIMIZER_FCN
17
18#include "Math/IFunction.h"
19
20#include "RooAbsReal.h"
21#include "RooArgList.h"
22
23#include <fstream>
24#include <vector>
25
26#include "RooAbsMinimizerFcn.h"
27
28// forward declaration
29class RooMinimizer;
30
32
33public:
34 RooMinimizerFcn(RooAbsReal *funct, RooMinimizer *context);
35
36 std::string getFunctionName() const override;
37 std::string getFunctionTitle() const override;
38
39 void setOptimizeConstOnFunction(RooAbsArg::ConstOpCode opcode, bool doAlsoTrackingOpt) override;
40
41 void setOffsetting(bool flag) override;
43
44 double operator()(const double *x) const;
45 void evaluateGradient(const double *x, double *out) const;
46
47private:
48 RooAbsReal *_funct = nullptr;
49 std::unique_ptr<ROOT::Math::IBaseFunctionMultiDim> _multiGenFcn;
50 mutable std::vector<double> _gradientOutput;
51};
52
53#endif
Documentation for the abstract class IBaseFunctionMultiDim.
Definition IFunction.h:61
Abstract base class for objects that represent a real value and implements functionality common to al...
Definition RooAbsReal.h:59
RooMinimizerFcn is an interface to the ROOT::Math::IBaseFunctionMultiDim, a function that ROOT's mini...
void evaluateGradient(const double *x, double *out) const
std::string getFunctionName() const override
RooMinimizer sometimes needs the name of the minimized function. Implement this in the derived class.
void setOffsetting(bool flag) override
Enable or disable offsetting on the function to be minimized, which enhances numerical precision.
void setOptimizeConstOnFunction(RooAbsArg::ConstOpCode opcode, bool doAlsoTrackingOpt) override
This function must be overridden in the derived class to pass on constant term optimization configura...
std::unique_ptr< ROOT::Math::IBaseFunctionMultiDim > _multiGenFcn
std::vector< double > _gradientOutput
RooAbsReal * _funct
double operator()(const double *x) const
Evaluate function given the parameters in x.
std::string getFunctionTitle() const override
RooMinimizer sometimes needs the title of the minimized function. Implement this in the derived class...
ROOT::Math::IMultiGenFunction * getMultiGenFcn() override
Wrapper class around ROOT::Math::Minimizer that provides a seamless interface between the minimizer f...
Double_t x[n]
Definition legend1.C:17