Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Related Pages

SctFitter::NagFitStrategy Class Reference

Concrete fit strategy uses the NAG C function e04fcc "Unconstrained nonlinear least squares (no derivatives required)". More...

#include <NagFitStrategy.h>

Inheritance diagram for SctFitter::NagFitStrategy:

Inheritance graph
[legend]
Collaboration diagram for SctFitter::NagFitStrategy:

Collaboration graph
[legend]

Public Member Functions

 NagFitStrategy (string opt=string("")) throw ()
 constuctor

 ~NagFitStrategy () throw ()
 destructor

virtual void fitTH1 (const TH1 &hist, TF1 &fit) const throw (LogicError, MathsError)
 http://wwwasd.web.cern.ch/wwwasd/lhc++/Nag_C/CL/doc/e/e04fcc.html

virtual void fitTGraph (const TGraph &graph, TF1 &fit) const throw (LogicError, MathsError)
 fit TGraph errors set to unity

virtual void fitTGraphErrors (const TGraphErrors &graph, TF1 &fit) const throw (LogicError, MathsError)
 fit TGraphErrors

virtual const string & getName () const throw ()
 Returns the name of the strategy.


Private Member Functions

 NagFitStrategy (const NagFitStrategy &)
 no copy constructor

const int getNumberFitPoints (TH1 &hist, const TF1 &fit, int &iFirstBin) const throw (LogicError)
 utility routine

void getFitPoints (TGraph &graph, const TF1 &fit, vector< bool > &active) const throw (LogicError)
 utility routine finds active points in graph

void nagFit (Cache *cache, TF1 &fit, bool quiet) const throw (MathsError)
 contains the NAG calls etc - the guts of the fit.

bool ranged () const throw ()
 Take range from TF1? true if options contain 'R' or 'r'.

bool quiet () const throw ()
 Fit in quiet mode? true if options contain 'Q' or 'q'.


Static Private Member Functions

void chiSquaredFunctionForNag (Integer m, Integer n, double x[], double fvec[], Nag_Comm *comm) throw ()
 NB set up cache first!


Private Attributes

const string name
 the name of the strategy


Static Private Attributes

bool inMap
 dummy variable used at static initialization.


Detailed Description

Concrete fit strategy uses the NAG C function e04fcc "Unconstrained nonlinear least squares (no derivatives required)".

At the time of writing, CERN licences are available to CERN collaborators from the ANAPHE site: http://anaphe.web.cern.ch/anaphe/download2.html

To use NagFitStrategy, define NAGDIR, and rebuild.

Author:
Alan Barr
Date:
16/5/03

Definition at line 25 of file NagFitStrategy.h.


Constructor & Destructor Documentation

SctFitter::NagFitStrategy::NagFitStrategy string  opt = string("")  )  throw ()
 

constuctor

Definition at line 8 of file NagFitStrategy.cpp.

SctFitter::NagFitStrategy::~NagFitStrategy  )  throw ()
 

destructor

Definition at line 11 of file NagFitStrategy.cpp.

SctFitter::NagFitStrategy::NagFitStrategy const NagFitStrategy  )  [private]
 

no copy constructor


Member Function Documentation

void SctFitter::NagFitStrategy::chiSquaredFunctionForNag Integer  m,
Integer  n,
double  x[],
double  fvec[],
Nag_Comm *  comm
throw () [static, private]
 

NB set up cache first!

Definition at line 235 of file NagFitStrategy.cpp.

References SctFitter::NagFitStrategy::Cache::convertPars(), SctFitter::NagFitStrategy::Cache::function, SctFitter::NagFitStrategy::Cache::m_ey, SctFitter::NagFitStrategy::Cache::m_x, SctFitter::NagFitStrategy::Cache::m_y, and SctFitter::NagFitStrategy::Cache::pars.

Here is the call graph for this function:

void SctFitter::NagFitStrategy::fitTGraph const TGraph &  graph,
TF1 &  fit
const throw (LogicError, MathsError) [virtual]
 

fit TGraph errors set to unity

Implements SctFitter::FitStrategy.

Definition at line 30 of file NagFitStrategy.cpp.

void SctFitter::NagFitStrategy::fitTGraphErrors const TGraphErrors &  graph,
TF1 &  fit
const throw (LogicError, MathsError) [virtual]
 

fit TGraphErrors

Implements SctFitter::FitStrategy.

Definition at line 42 of file NagFitStrategy.cpp.

void SctFitter::NagFitStrategy::fitTH1 const TH1 &  hist,
TF1 &  fit
const throw (LogicError, MathsError) [virtual]
 

http://wwwasd.web.cern.ch/wwwasd/lhc++/Nag_C/CL/doc/e/e04fcc.html

need to do this because ROOT hist.Fit() isn't const!

Implements SctFitter::FitStrategy.

Definition at line 15 of file NagFitStrategy.cpp.

void SctFitter::NagFitStrategy::getFitPoints TGraph &  graph,
const TF1 &  fit,
vector< bool > &  active
const throw (LogicError) [private]
 

utility routine finds active points in graph

Parameters:
graph the graph of points
fit the fit from which the range is taken
the vector of bools saying which points in the graph to fit.
Note:
if options does not contain 'R' whole histogram is used.

Definition at line 131 of file NagFitStrategy.cpp.

const string & SctFitter::NagFitStrategy::getName  )  const throw () [virtual]
 

Returns the name of the strategy.

Implements SctFitter::FitStrategy.

Definition at line 103 of file NagFitStrategy.cpp.

const int SctFitter::NagFitStrategy::getNumberFitPoints TH1 &  hist,
const TF1 &  fit,
int &  iFirstBin
const throw (LogicError) [private]
 

utility routine

Returns:
the number of points to fit

number of active bins

Parameters:
histogram (from which bin positions used)
fit function (from which limits found)
returns with the first bin from which to fit
Note:
if options does not contain 'R' whole histogram is used.

Definition at line 109 of file NagFitStrategy.cpp.

void SctFitter::NagFitStrategy::nagFit Cache cache,
TF1 &  fit,
bool  quiet
const throw (MathsError) [private]
 

contains the NAG calls etc - the guts of the fit.

Definition at line 54 of file NagFitStrategy.cpp.

References SctFitter::NagFitStrategy::Cache::m_x, and Sct::AbstractThrowable::sendToMrs().

Here is the call graph for this function:

bool SctFitter::NagFitStrategy::quiet  )  const throw () [private]
 

Fit in quiet mode? true if options contain 'Q' or 'q'.

Definition at line 246 of file NagFitStrategy.cpp.

bool SctFitter::NagFitStrategy::ranged  )  const throw () [private]
 

Take range from TF1? true if options contain 'R' or 'r'.

Definition at line 251 of file NagFitStrategy.cpp.


Field Documentation

bool SctFitter::NagFitStrategy::inMap [static, private]
 

dummy variable used at static initialization.

Definition at line 107 of file NagFitStrategy.cpp.

const string SctFitter::NagFitStrategy::name [private]
 

the name of the strategy

Definition at line 42 of file NagFitStrategy.h.


The documentation for this class was generated from the following files:
Generated on Thu Jul 15 09:54:00 2004 for SCT DAQ/DCS Software - C++ by doxygen 1.3.5