NC::Fitter::ConstrainRange Class Reference

This class supports the function flipping in MinFinderSimple. More...

#include <NCFitter.h>

Inheritance diagram for NC::Fitter::ConstrainRange:
NC::Fitter::ICallableND

List of all members.

Public Member Functions

 ConstrainRange (const ICallableND *f, int pn, double min, double max)
virtual double EvalAtEx (const CoordNDim &r, CoordNDim *ret) const
 Find the value of the function and return additional information.

Protected Attributes

const ICallableNDfFunc
int fParamNum
double fMin
double fMax

Detailed Description

This class supports the function flipping in MinFinderSimple.

I am aware that a similar penalizing scheme is implemented elsewhere. Hopefully this construct is only temporary.

Definition at line 44 of file NCFitter.h.


Constructor & Destructor Documentation

NC::Fitter::ConstrainRange::ConstrainRange ( const ICallableND f,
int  pn,
double  min,
double  max 
) [inline]

Definition at line 47 of file NCFitter.h.

00048       : fFunc(f), fParamNum(pn), fMin(min), fMax(max){}


Member Function Documentation

double NC::Fitter::ConstrainRange::EvalAtEx ( const CoordNDim r,
CoordNDim ret 
) const [virtual]

Find the value of the function and return additional information.

Parameters:
r Coordinate at which to evaluate the function
[out] ret Return additional information. By convention, the true underlying coordinates evaluated.
Returns:
Value of the function at the point r

Implementations must be prepared for ret to be null

Todo:
Rename to just EvalAt

Implements NC::Fitter::ICallableND.

Definition at line 1403 of file NCFitter.cxx.

References NC::Fitter::ICallableND::EvalAtEx(), fFunc, fMax, fMin, and fParamNum.

01404   {
01405     CoordNDim r2 = r;
01406     double pen = 0;
01407     if(r2[fParamNum] > fMax){
01408       // TODO - there should be some scaling based on the width,
01409       // but we happen to know all these variables are approx 0-1
01410       pen += 1e3*(r2[fParamNum]-fMax)*(r2[fParamNum]-fMax);
01411       r2[fParamNum] = fMax;
01412     }
01413     if(r2[fParamNum] < fMin){
01414       pen += 1e3*(r2[fParamNum]-fMin)*(r2[fParamNum]-fMin);
01415       r2[fParamNum] = fMin;
01416     }
01417     return fFunc->EvalAtEx(r2, ret)+pen;
01418   }


Member Data Documentation

Definition at line 51 of file NCFitter.h.

Referenced by EvalAtEx().

Definition at line 53 of file NCFitter.h.

Referenced by EvalAtEx().

Definition at line 53 of file NCFitter.h.

Referenced by EvalAtEx().

Definition at line 52 of file NCFitter.h.

Referenced by EvalAtEx().


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

Generated on 16 Jan 2018 for loon by  doxygen 1.6.1