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 (shared_ptr< 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 (shared_ptr< const TestData > testData, const string &moduleName) const throw ()
 Must be overridden by sub-classes.

Static Public Member Functions

static boost::shared_ptr<
ResponseCurve
getResponseCurve (unsigned int nPts=4) throw (LogicError)
 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).
static 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

 NPtGainAlgorithm ()
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.
void doSlopes (NPtGainTestResult &test)
 check for slopes in the test
void doSlopes (shared_ptr< TGraph > graph, Sct::RangedVector< float > &result)
 check for slopes on a particular result
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
SctConfiguration::MURType m_mur_type
 barrel/endcap?
SctConfiguration::EndcapType m_endcap_type
 short? middle? inner?

Static Private Attributes

static boost::shared_ptr<
ResponseCurve
s_responseCurve
 prototype used in virtual constuctor idiom to make rc's.
static bool inMap
static unsigned s_configurationWarnings
 counter for warning MRS messages

Detailed Description

Encodes how to do a response curve fit thing.

Definition at line 42 of file NPtGainAlgorithm.h.


Constructor & Destructor Documentation

SctAnalysis::NPtGainAlgorithm::NPtGainAlgorithm shared_ptr< const TestData testData,
const string &  moduleName,
const AnalysisAlgorithm alg
throw ()
 

Constructor.

Definition at line 33 of file NPtGainAlgorithm.cpp.

References SctAnalysis::AnalysisService::getConfiguration(), SctConfiguration::getEndcapType(), SctAnalysis::AnalysisService::instance(), and Sct::SctNames::Mrs().

Here is the call graph for this function:

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

Destructor.

Definition at line 51 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 109 of file NPtGainAlgorithm.cpp.

References doFit(), SctAnalysis::AnalysisAlgorithm::getFit(), SctAnalysis::AnalysisAlgorithm::getTestResult(), Sct::nChipModule, nOnePointTrimmed, nTwoPointTrimmed, Sct::Throwable::sendToMrs(), 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 105 of file NPtGainAlgorithm.cpp.

References SctAnalysis::AnalysisAlgorithm::hasAllFits().

Here is the call graph for this function:

shared_ptr< AnalysisAlgorithm > SctAnalysis::NPtGainAlgorithm::clone shared_ptr< 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 29 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 93 of file NPtGainAlgorithm.cpp.

References Sct::nChannelModule, and Sct::nChipModule.

void SctAnalysis::NPtGainAlgorithm::doDefect const ModuleElement e,
DefectList defects,
const NPtGainTestResultData data,
const NPtGainTestResultData comparisonData
throw (LogicError) [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 267 of file NPtGainAlgorithm.cpp.

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 250 of file NPtGainAlgorithm.cpp.

References SctFitter::FitStrategy::fitTGraph(), SctAnalysis::AnalysisService::getFitStrategy(), and SctAnalysis::AnalysisService::instance().

Referenced by analyze().

Here is the call graph for this function:

void SctAnalysis::NPtGainAlgorithm::doSlopes shared_ptr< TGraph >  graph,
Sct::RangedVector< float > &  result
[private]
 

check for slopes on a particular result

Definition at line 331 of file NPtGainAlgorithm.cpp.

References Sct::nChannelChip, and Sct::nChipModule.

void SctAnalysis::NPtGainAlgorithm::doSlopes NPtGainTestResult test  )  [private]
 

check for slopes in the test

Definition at line 303 of file NPtGainAlgorithm.cpp.

References SctData::DefectList::addDefect(), SctData::NPtGainTestResult::gainSlope, SctData::TestResult::getDefects(), SctData::NPtGainTestResult::getGainGraph(), SctData::NPtGainTestResult::getNoiseGraph(), SctData::NPtGainTestResult::getOffsetGraph(), Sct::nChipModule, SctData::NPtGainTestResult::noiseSlope, and SctData::NPtGainTestResult::offsetSlope.

Here is the call graph for this function:

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 79 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 101 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 240 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 87 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 177 of file NPtGainAlgorithm.cpp.

Referenced by analyze().


Field Documentation

SctConfiguration::EndcapType SctAnalysis::NPtGainAlgorithm::m_endcap_type [private]
 

short? middle? inner?

Definition at line 109 of file NPtGainAlgorithm.h.

SctConfiguration::MURType SctAnalysis::NPtGainAlgorithm::m_mur_type [private]
 

barrel/endcap?

Definition at line 108 of file NPtGainAlgorithm.h.

unsigned SctAnalysis::NPtGainAlgorithm::s_configurationWarnings [static, private]
 

counter for warning MRS messages

Definition at line 107 of file NPtGainAlgorithm.h.

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

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

Definition at line 74 of file NPtGainAlgorithm.h.


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