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

SctAnalysis::NPtGainAlgorithm Class Reference

Encodes how to do a response curve fit thing. More...

#include <NPtGainAlgorithm.h>

Inheritance diagram for SctAnalysis::NPtGainAlgorithm:

Inheritance graph
[legend]
Collaboration diagram for SctAnalysis::NPtGainAlgorithm:

Collaboration graph
[legend]

Public Member Functions

 NPtGainAlgorithm (const TestData &testData, const string &moduleName, const AnalysisAlgorithm &alg) throw ()
 Constructor.

virtual ~NPtGainAlgorithm () throw ()
 Destructor.

virtual void analyze ()
 Does the analysis.

virtual void loadData ()
 Called to indicate the algorithm should try and load as much data as it can - perhaps by calling loadAllFits or loadAllRaws().

virtual bool canAnalyze () const
 Should check to see if the analysis can be performed.

virtual shared_ptr< SctData::TestResultcreateTestResult () const
 Called if the TestResult needs to be created.

virtual boost::shared_ptr<
AnalysisAlgorithm
clone (const TestData &testData, const string &moduleName) const throw ()
 Must be overridden by sub-classes.


Static Public Member Functions

boost::shared_ptr< ResponseCurvegetResponseCurve (unsigned int nPts=4) throw (LogicError)
 Source of response curves of type given by setResponseCurve.

void setResponseCurve (auto_ptr< ResponseCurve > rc) throw ()
 Method of setting response curve type.


Private Types

typedef FitObject &(FitScanResult::* getFitFunction )(unsigned int) const

Private Member Functions

void setupGraph (unsigned int id, const ModuleElement &element, getFitFunction fitFunc, NPtGainTestResult &test, NPtGainTestResultData &testData, bool trimPoints=false) throw (LogicError)
 does what it says on the tin

void doFit (unsigned int id, getFitFunction fitFunc, NPtGainTestResult &test, NPtGainTestResultData &testData) throw (LogicError)
 Does a fit given a way of getting the data.

void mergeDefects (NPtGainTestResult &test, const ModuleElement &element, unsigned int lastPoint)
 Merges defects from the FitScanResults that effect element up to and including scan: lastPoint.


Static Private Member Functions

void doDefect (const ModuleElement &e, DefectList &defects, const NPtGainTestResultData &data, const NPtGainTestResultData &comparisonData) throw (LogicError)
 Once the fits are done, we need to figure out any defects.


Private Attributes

unsigned int nOnePointTrimmed
unsigned int nTwoPointTrimmed

Static Private Attributes

boost::shared_ptr< ResponseCurves_responseCurve
 prototype used in virtual constuctor idiom to make rc's.

bool inMap

Detailed Description

Encodes how to do a response curve fit thing.

Definition at line 37 of file NPtGainAlgorithm.h.


Constructor & Destructor Documentation

SctAnalysis::NPtGainAlgorithm::NPtGainAlgorithm const TestData testData,
const string &  moduleName,
const AnalysisAlgorithm alg
throw () [inline]
 

Constructor.

Definition at line 42 of file NPtGainAlgorithm.h.

virtual SctAnalysis::NPtGainAlgorithm::~NPtGainAlgorithm  )  throw () [inline, virtual]
 

Destructor.

Definition at line 46 of file NPtGainAlgorithm.h.


Member Function Documentation

void SctAnalysis::NPtGainAlgorithm::analyze  )  [virtual]
 

Does the analysis.

Should only be called after canAnalyze() returns true. Should not be called is isDone() returns true. It should also do any final initialization of the TestResult which requires data to be present

Exceptions:
any Exception

Implements SctAnalysis::AnalysisAlgorithm.

Definition at line 57 of file NPtGainAlgorithm.cpp.

References SctData::ModuleConfiguration::channelIsMasked(), doDefect(), doFit(), SctAnalysis::AnalysisAlgorithm::getFit(), SctAnalysis::AnalysisAlgorithm::getTestResult(), and setupGraph().

Here is the call graph for this function:

bool SctAnalysis::NPtGainAlgorithm::canAnalyze  )  const [virtual]
 

Should check to see if the analysis can be performed.

Probably wants to call hasAllRaws() or hasAllFits().

Exceptions:
no exceotions.

Implements SctAnalysis::AnalysisAlgorithm.

Definition at line 53 of file NPtGainAlgorithm.cpp.

References SctAnalysis::AnalysisAlgorithm::hasAllFits().

Here is the call graph for this function:

shared_ptr< AnalysisAlgorithm > SctAnalysis::NPtGainAlgorithm::clone const TestData testData,
const string &  moduleName
const throw () [virtual]
 

Must be overridden by sub-classes.

Returns a shared pointer to a concrete AnalysisAlgorithm of the correct type. Primarily used by the map to get an AnalysisAlgorithm of the correct type.

Implements SctAnalysis::AnalysisAlgorithm.

Definition at line 23 of file NPtGainAlgorithm.cpp.

shared_ptr< SctData::TestResult > SctAnalysis::NPtGainAlgorithm::createTestResult  )  const [virtual]
 

Called if the TestResult needs to be created.

Exceptions:
nothing. 

Implements SctAnalysis::AnalysisAlgorithm.

Definition at line 41 of file NPtGainAlgorithm.cpp.

void SctAnalysis::NPtGainAlgorithm::doDefect const ModuleElement e,
DefectList defects,
const NPtGainTestResultData data,
const NPtGainTestResultData comparisonData
throw (LogicError) [static, private]
 

Once the fits are done, we need to figure out any defects.

These are worked out by conparison with some other data.

Definition at line 196 of file NPtGainAlgorithm.cpp.

Referenced by analyze().

void SctAnalysis::NPtGainAlgorithm::doFit unsigned int  id,
getFitFunction  fitFunc,
NPtGainTestResult test,
NPtGainTestResultData testData
throw (LogicError) [private]
 

Does a fit given a way of getting the data.

Definition at line 179 of file NPtGainAlgorithm.cpp.

Referenced by analyze().

shared_ptr< ResponseCurve > SctAnalysis::NPtGainAlgorithm::getResponseCurve unsigned int  nPts = 4  )  throw (LogicError) [static]
 

Source of response curves of type given by setResponseCurve.

nPts The number of points in the response curve (default such that large number of points response curve is returned)

Definition at line 27 of file NPtGainAlgorithm.cpp.

void SctAnalysis::NPtGainAlgorithm::loadData  )  [virtual]
 

Called to indicate the algorithm should try and load as much data as it can - perhaps by calling loadAllFits or loadAllRaws().

This is guarenteed to be called shortly before analyze().

Implements SctAnalysis::AnalysisAlgorithm.

Definition at line 49 of file NPtGainAlgorithm.cpp.

References SctAnalysis::AnalysisAlgorithm::loadAllFits().

Here is the call graph for this function:

void SctAnalysis::NPtGainAlgorithm::mergeDefects NPtGainTestResult test,
const ModuleElement element,
unsigned int  lastPoint
[private]
 

Merges defects from the FitScanResults that effect element up to and including scan: lastPoint.

Definition at line 169 of file NPtGainAlgorithm.cpp.

References SctData::DefectList::addDefect(), SctData::TestResult::getDefects(), and SctAnalysis::AnalysisAlgorithm::getFit().

Here is the call graph for this function:

void SctAnalysis::NPtGainAlgorithm::setResponseCurve auto_ptr< ResponseCurve rc  )  throw () [static]
 

Method of setting response curve type.

Parameters:
smart pointer to prototype response curve
Note:
parameter is sunk.

Always uses linear response curve if number of points is <= 3

Definition at line 35 of file NPtGainAlgorithm.cpp.

void SctAnalysis::NPtGainAlgorithm::setupGraph unsigned int  id,
const ModuleElement element,
getFitFunction  fitFunc,
NPtGainTestResult test,
NPtGainTestResultData testData,
bool  trimPoints = false
throw (LogicError) [private]
 

does what it says on the tin

Definition at line 120 of file NPtGainAlgorithm.cpp.

References SctData::DefectList::defectSeverityAffectingElement(), and SctData::SERIOUS.

Referenced by analyze().

Here is the call graph for this function:


Field Documentation

boost::shared_ptr<ResponseCurve> SctAnalysis::NPtGainAlgorithm::s_responseCurve [static, private]
 

prototype used in virtual constuctor idiom to make rc's.

Definition at line 69 of file NPtGainAlgorithm.h.


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