Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-16 09:08:16

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_MnMinos
0011 #define ROOT_Minuit2_MnMinos
0012 
0013 #include "Minuit2/MnStrategy.h"
0014 
0015 #include <utility>
0016 
0017 namespace ROOT {
0018 
0019 namespace Minuit2 {
0020 
0021 class FCNBase;
0022 class FunctionMinimum;
0023 class MinosError;
0024 class MnCross;
0025 
0026 //__________________________________________________________________
0027 /**
0028     API class for Minos Error analysis (asymmetric errors);
0029     minimization has to be done before and Minimum must be valid;
0030     possibility to ask only for one side of the Minos Error;
0031  */
0032 
0033 class MnMinos {
0034 
0035 public:
0036    /// construct from FCN + Minimum + strategy
0037    MnMinos(const FCNBase &fcn, const FunctionMinimum &min, unsigned int stra = 1);
0038 
0039    /// construct from FCN + Minimum + strategy
0040    MnMinos(const FCNBase &fcn, const FunctionMinimum &min, const MnStrategy &stra);
0041 
0042    /// returns the negative (pair.first) and the positive (pair.second)
0043    /// Minos Error of the Parameter
0044    std::pair<double, double> operator()(unsigned int, unsigned int maxcalls = 0, double toler = 0.1) const;
0045 
0046    /// calculate one side (negative or positive Error) of the Parameter
0047    /// give as input (optionally) maxcalls and tolerance
0048    double Lower(unsigned int, unsigned int maxcalls = 0, double toler = 0.1) const;
0049    double Upper(unsigned int, unsigned int maxcalls = 0, double toler = 0.1) const;
0050 
0051    MnCross Loval(unsigned int, unsigned int maxcalls = 0, double toler = 0.1) const;
0052    MnCross Upval(unsigned int, unsigned int maxcalls = 0, double toler = 0.1) const;
0053 
0054    /// ask for MinosError (Lower + Upper)
0055    /// can be printed via std::cout
0056    MinosError Minos(unsigned int, unsigned int maxcalls = 0, double toler = 0.1) const;
0057 
0058 protected:
0059    /// internal method to get crossing value via MnFunctionCross
0060    MnCross FindCrossValue(int dir, unsigned int, unsigned int maxcalls, double toler) const;
0061 
0062 private:
0063    const FCNBase &fFCN;
0064    const FunctionMinimum &fMinimum;
0065    MnStrategy fStrategy;
0066 };
0067 
0068 } // namespace Minuit2
0069 
0070 } // namespace ROOT
0071 
0072 #endif // ROOT_Minuit2_MnMinos