Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 10:22:12

0001 // @(#)root/minuit2:$Id$
0002 // Authors: M. Winkler, F. James, L. Moneta, A. Zsenei   2003-2005
0003 
0004 /**********************************************************************
0005  *                                                                    *
0006  * Copyright (c) 2005 LCG ROOT Math team,  CERN/PH-SFT                *
0007  *                                                                    *
0008  **********************************************************************/
0009 
0010 #ifndef ROOT_Minuit2_MinimumBuilder
0011 #define ROOT_Minuit2_MinimumBuilder
0012 
0013 #include "Minuit2/MnTraceObject.h"
0014 #include "Minuit2/MnPrint.h"
0015 
0016 namespace ROOT {
0017 
0018 namespace Minuit2 {
0019 
0020 class FunctionMinimum;
0021 class MnFcn;
0022 class GradientCalculator;
0023 class MinimumSeed;
0024 class MinimumState;
0025 class MnStrategy;
0026 
0027 class MinimumBuilder {
0028 
0029 public:
0030    MinimumBuilder();
0031 
0032    virtual ~MinimumBuilder() {}
0033 
0034    virtual FunctionMinimum Minimum(const MnFcn &, const GradientCalculator &, const MinimumSeed &, const MnStrategy &,
0035                                    unsigned int, double) const = 0;
0036 
0037    int StorageLevel() const { return fStorageLevel; }
0038    int PrintLevel() const { return fPrintLevel; }
0039 
0040    bool TraceIter() const { return (fTracer); }
0041    MnTraceObject *TraceObject() const { return (fTracer); }
0042 
0043    virtual void SetPrintLevel(int level) { fPrintLevel = level; }
0044    virtual void SetStorageLevel(int level) { fStorageLevel = level; }
0045 
0046    // set trace object (user manages it)
0047    virtual void SetTraceObject(MnTraceObject &obj) { fTracer = &obj; }
0048 
0049    void TraceIteration(int iter, const MinimumState &state) const
0050    {
0051       if (fTracer)
0052          (*fTracer)(iter, state);
0053    }
0054 
0055 private:
0056    int fPrintLevel;
0057    int fStorageLevel;
0058 
0059    MnTraceObject *fTracer; //! tracer object (it is managed by user)
0060 };
0061 
0062 } // namespace Minuit2
0063 
0064 } // namespace ROOT
0065 
0066 #endif // ROOT_Minuit2_MinimumBuilder