NC::Fitter::MinFinderSimpleInt Class Reference

#include <NCFitter.h>

List of all members.

Public Member Functions

 MinFinderSimpleInt (const std::vector< NCParameter > &ps, const bool limits, const ICallableInt *f)
double FindMin (CoordInt *ret=0, std::vector< TGraph > *min_graphs=0) const

Protected Member Functions

CoordInt BeginSearchPos () const
CoordInt BeginScale () const
 Find a good step size to begin the search.

Protected Attributes

std::vector< NCParameterfParams
bool fRespectParameterLimits
CoordInt fPrevBest
const ICallableIntfFunc

Detailed Description

Definition at line 176 of file NCFitter.h.


Constructor & Destructor Documentation

NC::Fitter::MinFinderSimpleInt::MinFinderSimpleInt ( const std::vector< NCParameter > &  ps,
const bool  limits,
const ICallableInt f 
) [inline]

Definition at line 179 of file NCFitter.h.

00182       :fParams(ps), fRespectParameterLimits(limits), fFunc(f){}


Member Function Documentation

CoordInt NC::Fitter::MinFinderSimpleInt::BeginScale (  )  const [protected]

Find a good step size to begin the search.

Find a power of 2 step size in each direction that is larger than one quarter of the number of steps between max and min in that direction so that the first step will get at least halfway to the edge. If we are remembering a fPrevBest than assume it is nearly perfect and return all 1's for the step sizes.

Definition at line 468 of file NCFitter.cxx.

References fParams, fPrevBest, and n.

00469   {
00470     CoordInt ret(fParams.size());
00471     for(unsigned int n = 0; n < ret.size(); ++n) ret[n] = 1;
00472 
00473     if(!fPrevBest.empty()) return ret;
00474 
00475     for(unsigned int n = 0; n < fParams.size(); ++n){
00476       bool bigEnough = false;
00477       while(!bigEnough){
00478         ret[n] *= 2;
00479         bigEnough = ret[n] > .25*fParams[n].Steps();
00480       }
00481     }
00482 
00483     return ret;
00484   }

CoordInt NC::Fitter::MinFinderSimpleInt::BeginSearchPos (  )  const [protected]

Definition at line 441 of file NCFitter.cxx.

References fParams, fPrevBest, and n.

00442   {
00443     assert(fPrevBest.size() == fParams.size() || fPrevBest.empty());
00444 
00445     if(fPrevBest.empty()){
00446       CoordInt ret;
00447       for(unsigned int n = 0; n < fParams.size(); ++n){
00448         //      ret.push_back((fParams[n].Min()+fParams[n].Max())/2);
00449         //      ret.push_back(fParams[n].Min()+.25*(fParams[n].Max()-fParams[n].Min()));
00450         ret.push_back(int((fParams[n].Max()-fParams[n].Min())/
00451                           fParams[n].Precision())/2);
00452       }
00453       return ret;
00454     }
00455 
00456     return fPrevBest;
00457   }

double NC::Fitter::MinFinderSimpleInt::FindMin ( CoordInt ret = 0,
std::vector< TGraph > *  min_graphs = 0 
) const

Member Data Documentation

Definition at line 191 of file NCFitter.h.

Definition at line 188 of file NCFitter.h.

Referenced by BeginScale(), and BeginSearchPos().

Definition at line 190 of file NCFitter.h.

Referenced by BeginScale(), and BeginSearchPos().

Definition at line 189 of file NCFitter.h.


The documentation for this class was generated from the following files:

Generated on 25 Apr 2018 for loon by  doxygen 1.6.1