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
virtual void fitTGraphErrors (const TGraphErrors &graph, TF1 &fit) const throw (LogicError, MathsError)
 fit TGraphErrors
virtual void fitTGraphAsymmErrors (const TGraphAsymmErrors &graph, TF1 &fit) const throw (LogicError, MathsError)
 fit TGraphAsymmErrors
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?
bool quiet () const throw ()
 Fit in quiet mode?

Static Private Member Functions

static 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

static bool inMap
 dummy variable used at static initialization.

Data Structures

class  Cache
 Interal class caches the information needed for the fit. More...

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 9 of file NagFitStrategy.cpp.

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

destructor

Definition at line 12 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 266 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

Note:
errors set to unity

Implements SctFitter::FitStrategy.

Definition at line 31 of file NagFitStrategy.cpp.

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

fit TGraphAsymmErrors

Implements SctFitter::FitStrategy.

Definition at line 55 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 43 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 16 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 144 of file NagFitStrategy.cpp.

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

Returns the name of the strategy.

Implements SctFitter::FitStrategy.

Definition at line 116 of file NagFitStrategy.cpp.

References name.

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 122 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.

make the Nag variables

Definition at line 67 of file NagFitStrategy.cpp.

References Sct::AbstractThrowable::sendToMrs().

Here is the call graph for this function:

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

Fit in quiet mode?

Returns:
true if options contain 'Q' or 'q'

Definition at line 277 of file NagFitStrategy.cpp.

References SctFitter::FitStrategy::getOptions().

Here is the call graph for this function:

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

Take range from TF1?

Returns:
true if options contain 'R' or 'r'

Definition at line 282 of file NagFitStrategy.cpp.

References SctFitter::FitStrategy::getOptions().

Here is the call graph for this function:


Field Documentation

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

dummy variable used at static initialization.

Definition at line 45 of file NagFitStrategy.h.

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

the name of the strategy

Definition at line 44 of file NagFitStrategy.h.

Referenced by getName().


The documentation for this class was generated from the following files:
Generated on Mon Feb 6 14:09:53 2006 for SCT DAQ/DCS Software - C++ by  doxygen 1.4.6