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_MnContours
0011 #define ROOT_Minuit2_MnContours
0012 
0013 #include "Minuit2/MnConfig.h"
0014 #include "Minuit2/MnStrategy.h"
0015 
0016 #include <vector>
0017 #include <utility>
0018 
0019 namespace ROOT {
0020 
0021 namespace Minuit2 {
0022 
0023 class FCNBase;
0024 class FunctionMinimum;
0025 class ContoursError;
0026 
0027 //_____________________________________________________________
0028 /**
0029    API class for Contours Error analysis (2-dim errors);
0030    minimization has to be done before and Minimum must be valid;
0031    possibility to ask only for the points or the points and associated Minos
0032    errors;
0033  */
0034 
0035 class MnContours {
0036 
0037 public:
0038    /// construct from FCN + Minimum
0039    MnContours(const FCNBase &fcn, const FunctionMinimum &min) : fFCN(fcn), fMinimum(min), fStrategy(MnStrategy(1)) {}
0040 
0041    /// construct from FCN + Minimum + strategy
0042    MnContours(const FCNBase &fcn, const FunctionMinimum &min, unsigned int stra)
0043       : fFCN(fcn), fMinimum(min), fStrategy(MnStrategy(stra))
0044    {
0045    }
0046 
0047    /// construct from FCN + Minimum + strategy
0048    MnContours(const FCNBase &fcn, const FunctionMinimum &min, const MnStrategy &stra)
0049       : fFCN(fcn), fMinimum(min), fStrategy(stra)
0050    {
0051    }
0052 
0053    ~MnContours() {}
0054 
0055    /// ask for one Contour (points only) from number of points (>=4) and parameter indices
0056    std::vector<std::pair<double, double>> operator()(unsigned int, unsigned int, unsigned int npoints = 20) const;
0057 
0058    /// ask for one Contour ContoursError (MinosErrors + points)
0059    /// from number of points (>=4) and parameter indices
0060    /// can be printed via std::cout
0061    ContoursError Contour(unsigned int, unsigned int, unsigned int npoints = 20) const;
0062 
0063    const MnStrategy &Strategy() const { return fStrategy; }
0064 
0065 private:
0066    const FCNBase &fFCN;
0067    const FunctionMinimum &fMinimum;
0068    MnStrategy fStrategy;
0069 };
0070 
0071 } // namespace Minuit2
0072 
0073 } // namespace ROOT
0074 
0075 #endif // ROOT_Minuit2_MnContours