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

SctFitter::FitAlgorithm Class Reference

This class is an abstract base class which describes how a fit is done. More...

#include <FitAlgorithm.h>

Inheritance diagram for SctFitter::FitAlgorithm:

noncopyable SctFitter::StrobeDelayFitAlgorithm SctFitter::ThresholdFitAlgorithm SctFitter::ThresholdFitAlgorithm2

Utility functions

{

float findLevel (const TH1 &h, const float fraction, const bool forward) throw (MathsError)
 Associated histogram utility routine.

int findBin (const TH1 &h, const float fraction, const bool forward) throw (MathsError)
 Associated histogram utility routine.

 FitAlgorithm () throw ()
 }

virtual void doFit (const TH1 &hist, FitObject &fitObject, const ModuleElement &element, ModuleDefectList &defects) const throw (LogicError)
 Attempts to do an individual fit.


Public Member Functions

virtual ~FitAlgorithm () throw ()
virtual auto_ptr< FitScanResult > doFit (const RawScanResult &raw) const throw (Sct::LogicError)
 This is the entry point for the FittingService.

const FitterModegetMode () const throw ()
FitterModegetMode () throw ()
void setMode (const FitterMode &mode) throw ()

Protected Member Functions

virtual void createSummaryHistograms (FitScanResult &fits) const=0 throw ()
 Makes set of summary histograms from the fitObject results.

Utility functions
{

virtual auto_ptr< FitObject > getPrototype () const=0 throw ()
 Returns a prototypical FitObject for this algorithm.

virtual void guessParameters (const TH1 &hist, FitObject &fitOb) const=0 throw (LogicError, MathsError)
 guess the initial fit parameters from histogram prior to doing a fit : put them in FitObject.

virtual void checkForDefects (const TH1 &hist, const ModuleElement &element, ModuleDefectList &defects) const=0 throw (LogicError)
 checks the element for defects.


Private Attributes

FitterMode mode
 The FitterMode used by this algorithm.


Detailed Description

This class is an abstract base class which describes how a fit is done.

Specific sub-classes register themselves with the FitAlgorithmMap which is used to determine which FitAlgorithm to use given a ConfigurationVariable. Each FitAlgorithm has its own mode that is used to determine whether to fit links, chip, channels (and indeed if that is even meaningful!)

Author:
Matthew Palmer based on original code by Alan Barr (!)
Date:
7 June 2003

Definition at line 41 of file FitAlgorithm.h.


Constructor & Destructor Documentation

virtual SctFitter::FitAlgorithm::~FitAlgorithm   throw () [inline, virtual]
 

Definition at line 43 of file FitAlgorithm.h.

SctFitter::FitAlgorithm::FitAlgorithm   throw () [protected]
 

}

Definition at line 17 of file FitAlgorithm.cpp.


Member Function Documentation

virtual void SctFitter::FitAlgorithm::checkForDefects const TH1 &    hist,
const ModuleElement &    element,
ModuleDefectList &    defects
const throw (LogicError) [protected, pure virtual]
 

checks the element for defects.

Add them to the ModuleDefectList.

Implemented in SctFitter::StrobeDelayFitAlgorithm, SctFitter::ThresholdFitAlgorithm, and SctFitter::ThresholdFitAlgorithm2.

virtual void SctFitter::FitAlgorithm::createSummaryHistograms FitScanResult &    fits const throw () [protected, pure virtual]
 

Makes set of summary histograms from the fitObject results.

Default implementation does nothing for convenience.

Implemented in SctFitter::StrobeDelayFitAlgorithm, SctFitter::ThresholdFitAlgorithm, and SctFitter::ThresholdFitAlgorithm2.

void SctFitter::FitAlgorithm::doFit const TH1 &    hist,
FitObject &    fitObject,
const ModuleElement &    element,
ModuleDefectList &    defects
const throw (LogicError) [protected, virtual]
 

Attempts to do an individual fit.

Default implementation calls guessParameters and checkForDefects then uses the Fitter's FitStrategy to actually do the fit.

Reimplemented in SctFitter::ThresholdFitAlgorithm2.

Definition at line 72 of file FitAlgorithm.cpp.

References SctFitter::FitStrategy::fitTH1(), SctFitter::Fitter::getFitStrategy(), SctFitter::Fitter::incrementFitErrors(), and SctFitter::Fitter::incrementFitsDone().

auto_ptr< FitScanResult > SctFitter::FitAlgorithm::doFit const RawScanResult &    raw const throw (Sct::LogicError) [virtual]
 

This is the entry point for the FittingService.

The default implementation checks the mode then call doFit for each link/chip/channel as appropriate. If any throw a ModuleDefect, they are added appropriately. Finally, if the mode says, then createSummaryHistograms is called.

Definition at line 32 of file FitAlgorithm.cpp.

Referenced by SctFitter::FitterWorkerGroup::work().

int SctFitter::FitAlgorithm::findBin const TH1 &    h,
const float    fraction,
const bool    forward
throw (MathsError) [static]
 

Associated histogram utility routine.

If `forward' is true then returns the bin for which the bin content first is greater than `fraction' of its maximum

If `forward' is false then returns bin for which the cell content is last greater than `fraction' of its maximum.

Throws an exception if the bin is not found.

Definition at line 102 of file FitAlgorithm.cpp.

float SctFitter::FitAlgorithm::findLevel const TH1 &    h,
const float    fraction,
const bool    forward
throw (MathsError) [static]
 

Associated histogram utility routine.

If `last' is true then returns the value of x for which the bin content first is greater than `fraction' of its maximum

If `last' is false then returns the value of x for which the cell content first is greater than `fraction' of its maximum.

Uses findBin function

Definition at line 126 of file FitAlgorithm.cpp.

FitterMode & SctFitter::FitAlgorithm::getMode   throw ()
 

Definition at line 23 of file FitAlgorithm.cpp.

const FitterMode & SctFitter::FitAlgorithm::getMode   const throw ()
 

Definition at line 19 of file FitAlgorithm.cpp.

virtual auto_ptr<FitObject> SctFitter::FitAlgorithm::getPrototype   const throw () [protected, pure virtual]
 

Returns a prototypical FitObject for this algorithm.

Implemented in SctFitter::StrobeDelayFitAlgorithm, SctFitter::ThresholdFitAlgorithm, and SctFitter::ThresholdFitAlgorithm2.

virtual void SctFitter::FitAlgorithm::guessParameters const TH1 &    hist,
FitObject &    fitOb
const throw (LogicError, MathsError) [protected, pure virtual]
 

guess the initial fit parameters from histogram prior to doing a fit : put them in FitObject.

Implemented in SctFitter::StrobeDelayFitAlgorithm, SctFitter::ThresholdFitAlgorithm, and SctFitter::ThresholdFitAlgorithm2.

void SctFitter::FitAlgorithm::setMode const FitterMode   mode throw ()
 

Definition at line 27 of file FitAlgorithm.cpp.


Field Documentation

FitterMode SctFitter::FitAlgorithm::mode [private]
 

The FitterMode used by this algorithm.

Definition at line 120 of file FitAlgorithm.h.


The documentation for this class was generated from the following files:
Generated on Mon Dec 15 19:38:02 2003 for SCT DAQ/DCS Software by doxygen1.3-rc3