#include <AnalysisAlgorithm.h>
Inheritance diagram for SctAnalysis::AnalysisAlgorithm:
Public Member Functions | |
virtual | ~AnalysisAlgorithm () throw () |
Destructor. | |
const TestData & | getTestData () const throw () |
get a pointer to the cached TestData; | |
const std::string | getModuleName () const throw () |
Get the name of the module which this algorithm is working on. | |
virtual boost::shared_ptr< AnalysisAlgorithm > | clone (const TestData &testData, const string &moduleName) const=0 throw () |
Must be overridden by sub-classes. | |
void | addFitScanResult (shared_ptr< Sct::IOName > name) |
Add a named FitScanResult. | |
void | addRawScanResult (shared_ptr< Sct::IOName > name) |
Add a named RawScanResult. | |
void | checkTestResultExists () |
Used by other methods to ensure that a TestResult has been made. | |
bool | isDone () const throw () |
Method indicates when a particular analysis is finished. | |
void | finish () |
Publishes the TestResult, and sets `done'. | |
boost::shared_ptr< SctData::TestResult > | getTestResult () const |
Access to the TestResult if required. | |
boost::recursive_mutex & | getMutex () const |
Access the mutex. | |
virtual bool | canAnalyze () const=0 |
Should check to see if the analysis can be performed. | |
virtual void | analyze ()=0 |
Does the analysis. | |
virtual void | loadData ()=0 |
Called to indicate the algorithm should try and load as much data as it can - perhaps by calling loadAllFits or loadAllRaws(). | |
Status and timing methods | |
| |
void | addFailure () |
Adds a pass for this test. | |
void | addPass () |
Adds a failure for this test. | |
void | addIOTime (double ioTime) |
Adds some time spent doing I/O. | |
void | addAnalysisTime (double time) |
Adds to the analysis time, and increments the number of analyses successfully done. | |
void | addOverheadTime (double time) |
Adds to the overhead time. | |
string | getStatus () const |
Returns a string giving the status of this algorithm including some info how long things are taking. | |
Protected Member Functions | |
AnalysisAlgorithm (const TestData &testData, const string &moduleName, const AnalysisAlgorithm &prototype) throw () | |
Default constructor, to be used in creation of map. | |
virtual shared_ptr< SctData::TestResult > | createTestResult () const=0 |
Called if the TestResult needs to be created. | |
void | loadAllFits () |
Loads all the fits it can. | |
void | loadAllRaws () |
Loads all the raws it can. | |
bool | hasAllRaws () const |
Returns true if all the RawScanResult objects are available in IS. | |
bool | hasAllFits () const |
Returns true if all the FitScanResult objects are available in IS. | |
shared_ptr< SctData::RawScanResult > | getRaw (unsigned int index) const |
Returns a shared pointer to the RawScanResult at index. | |
shared_ptr< SctData::FitScanResult > | getFit (unsigned int index) const |
Returns a shared pointer to the RawScanResult at index. | |
void | mergeDefects () |
Merges all the defects from the FitScanResults into the TestResult. | |
Private Member Functions | |
void | initializeTestResult () |
Useful function that initializes TestResult from Test and module name. | |
Private Attributes | |
const string | m_modulename |
name of the module being worked on. | |
shared_ptr< SctData::TestResult > | m_result |
pointer to the result. it is up to the Concrete class to make one! | |
const TestData & | m_test |
pointer to the testdata. | |
vector< ScanData > | scanData |
bool | m_done |
true if finish() has been called. | |
boost::recursive_mutex | m_access |
access to the algorithm can be locked for thread-safeness. | |
boost::recursive_mutex | m_status_access |
access to the status information | |
const AnalysisAlgorithm & | prototype |
A reference to the prototype. | |
double | ioTime |
The total time spent doing I/O. | |
double | analysisTime |
The total time spent doing analysis. | |
double | overheadTime |
The time spent just getting stuff, checking it etc. | |
unsigned int | nCalls |
The number of times this alg has been accessed. | |
unsigned int | nAnalyses |
The number of analyses performed. | |
unsigned int | nPassed |
The number of tests which passed. | |
unsigned int | nFailed |
The number of analyses which failed. |
Definition at line 33 of file AnalysisAlgorithm.h.
|
Destructor.
Definition at line 39 of file AnalysisAlgorithm.cpp. |
|
Default constructor, to be used in creation of map.
Definition at line 34 of file AnalysisAlgorithm.cpp. |
|
Adds to the analysis time, and increments the number of analyses successfully done.
Definition at line 259 of file AnalysisAlgorithm.h. References analysisTime, m_status_access, nAnalyses, and prototype. |
|
Adds a pass for this test.
Definition at line 249 of file AnalysisAlgorithm.h. References m_status_access, nFailed, and prototype. Referenced by finish(). |
|
Add a named FitScanResult.
Definition at line 67 of file AnalysisAlgorithm.cpp. References SctData::UniqueID::getScanNumber(), getTestData(), and TestData::startScanNumber. |
Here is the call graph for this function:
|
Adds some time spent doing I/O. The number of IO operations is assumed to be the same as the number of analyses
Definition at line 254 of file AnalysisAlgorithm.h. References ioTime, m_status_access, and prototype. |
|
Adds to the overhead time. It is assumed there is 1 overhead time per Fit or Raw ScanResult
Definition at line 265 of file AnalysisAlgorithm.h. References m_status_access, nCalls, overheadTime, and prototype. |
|
Adds a failure for this test.
Definition at line 244 of file AnalysisAlgorithm.h. References m_status_access, nPassed, and prototype. Referenced by finish(). |
|
Add a named RawScanResult.
Definition at line 74 of file AnalysisAlgorithm.cpp. References SctData::UniqueID::getScanNumber(), getTestData(), and TestData::startScanNumber. |
Here is the call graph for this function:
|
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
Implemented in SctAnalysis::FullBypassAlgorithm, SctAnalysis::NMaskAlgorithm, SctAnalysis::NPtGainAlgorithm, SctAnalysis::PipelineAlgorithm, SctAnalysis::RxDelayAlgorithm, SctAnalysis::RxThresholdAlgorithm, SctAnalysis::StrobeDelayAlgorithm, SctAnalysis::TimeWalkAlgorithm, and SctAnalysis::TrimRangeAlgorithm. |
|
Should check to see if the analysis can be performed. Probably wants to call hasAllRaws() or hasAllFits().
Implemented in SctAnalysis::FullBypassAlgorithm, SctAnalysis::NMaskAlgorithm, SctAnalysis::NPtGainAlgorithm, SctAnalysis::PipelineAlgorithm, SctAnalysis::RxDelayAlgorithm, SctAnalysis::RxThresholdAlgorithm, SctAnalysis::StrobeDelayAlgorithm, SctAnalysis::TimeWalkAlgorithm, and SctAnalysis::TrimRangeAlgorithm. |
|
Used by other methods to ensure that a TestResult has been made. Call createTestResult if it doesn't then initializes it.
Definition at line 45 of file AnalysisAlgorithm.cpp. References createTestResult(), initializeTestResult(), and m_result. Referenced by finish(). |
Here is the call graph for this function:
|
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. Implemented in SctAnalysis::FullBypassAlgorithm, SctAnalysis::NMaskAlgorithm, SctAnalysis::NPtGainAlgorithm, SctAnalysis::PipelineAlgorithm, SctAnalysis::RxDelayAlgorithm, SctAnalysis::RxThresholdAlgorithm, SctAnalysis::StrobeDelayAlgorithm, SctAnalysis::TimeWalkAlgorithm, and SctAnalysis::TrimRangeAlgorithm. |
|
Called if the TestResult needs to be created.
Implemented in SctAnalysis::FullBypassAlgorithm, SctAnalysis::NMaskAlgorithm, SctAnalysis::NPtGainAlgorithm, SctAnalysis::PipelineAlgorithm, SctAnalysis::RxDelayAlgorithm, SctAnalysis::RxThresholdAlgorithm, SctAnalysis::StrobeDelayAlgorithm, SctAnalysis::TimeWalkAlgorithm, and SctAnalysis::TrimRangeAlgorithm. Referenced by checkTestResultExists(). |
|
Publishes the TestResult, and sets `done'.
Definition at line 130 of file AnalysisAlgorithm.cpp. References addFailure(), addPass(), checkTestResultExists(), TestSummaryIS::dataString, SctData::TestSummary::SummaryManager::instance(), m_done, and m_result. |
Here is the call graph for this function:
|
Returns a shared pointer to the RawScanResult at index. Guarenteed not to run a null pointer
Definition at line 115 of file AnalysisAlgorithm.cpp. Referenced by SctAnalysis::TrimRangeAlgorithm::analyze(), SctAnalysis::TimeWalkAlgorithm::analyze(), SctAnalysis::StrobeDelayAlgorithm::analyze(), SctAnalysis::NPtGainAlgorithm::analyze(), and SctAnalysis::NPtGainAlgorithm::mergeDefects(). |
|
Get the name of the module which this algorithm is working on.
Definition at line 47 of file AnalysisAlgorithm.h. References m_modulename. |
|
Access the mutex.
Definition at line 91 of file AnalysisAlgorithm.h. References m_access. |
|
Returns a shared pointer to the RawScanResult at index. Guarenteed not to run a null pointer
Definition at line 110 of file AnalysisAlgorithm.cpp. Referenced by SctAnalysis::RxThresholdAlgorithm::analyze(), SctAnalysis::RxDelayAlgorithm::analyze(), SctAnalysis::PipelineAlgorithm::analyze(), SctAnalysis::NMaskAlgorithm::analyze(), and SctAnalysis::FullBypassAlgorithm::analyze(). |
|
Returns a string giving the status of this algorithm including some info how long things are taking.
Definition at line 171 of file AnalysisAlgorithm.cpp. References analysisTime, ioTime, m_status_access, nAnalyses, nCalls, nFailed, nPassed, overheadTime, and prototype. |
|
get a pointer to the cached TestData;
Definition at line 42 of file AnalysisAlgorithm.h. References m_test. Referenced by addFitScanResult(), and addRawScanResult(). |
|
Access to the TestResult if required.
Definition at line 86 of file AnalysisAlgorithm.h. References m_result. Referenced by SctAnalysis::TrimRangeAlgorithm::analyze(), SctAnalysis::TimeWalkAlgorithm::analyze(), SctAnalysis::StrobeDelayAlgorithm::analyze(), SctAnalysis::RxThresholdAlgorithm::analyze(), SctAnalysis::RxDelayAlgorithm::analyze(), SctAnalysis::PipelineAlgorithm::analyze(), SctAnalysis::NPtGainAlgorithm::analyze(), SctAnalysis::NMaskAlgorithm::analyze(), and SctAnalysis::FullBypassAlgorithm::analyze(). |
|
Returns true if all the FitScanResult objects are available in IS.
Definition at line 88 of file AnalysisAlgorithm.cpp. Referenced by SctAnalysis::TrimRangeAlgorithm::canAnalyze(), SctAnalysis::TimeWalkAlgorithm::canAnalyze(), SctAnalysis::StrobeDelayAlgorithm::canAnalyze(), and SctAnalysis::NPtGainAlgorithm::canAnalyze(). |
|
Returns true if all the RawScanResult objects are available in IS.
Definition at line 81 of file AnalysisAlgorithm.cpp. Referenced by SctAnalysis::RxThresholdAlgorithm::canAnalyze(), SctAnalysis::RxDelayAlgorithm::canAnalyze(), SctAnalysis::NMaskAlgorithm::canAnalyze(), and SctAnalysis::FullBypassAlgorithm::canAnalyze(). |
|
Useful function that initializes TestResult from Test and module name. Sets up stuff that can be done here. Anything else must be done by the algorithm in analyze.
Definition at line 54 of file AnalysisAlgorithm.cpp. References m_modulename, m_result, m_test, TestData::runNumber, TestData::startScanNumber, TestData::startTime, TestData::testPoints, TestData::testPoints_size, and TestData::testVariable. Referenced by checkTestResultExists(). |
|
Method indicates when a particular analysis is finished.
Definition at line 75 of file AnalysisAlgorithm.h. References m_done. |
|
Loads all the fits it can.
Definition at line 103 of file AnalysisAlgorithm.cpp. Referenced by SctAnalysis::TrimRangeAlgorithm::loadData(), SctAnalysis::TimeWalkAlgorithm::loadData(), SctAnalysis::StrobeDelayAlgorithm::loadData(), and SctAnalysis::NPtGainAlgorithm::loadData(). |
|
Loads all the raws it can.
Definition at line 95 of file AnalysisAlgorithm.cpp. Referenced by SctAnalysis::RxThresholdAlgorithm::loadData(), SctAnalysis::RxDelayAlgorithm::loadData(), SctAnalysis::PipelineAlgorithm::loadData(), SctAnalysis::NMaskAlgorithm::loadData(), and SctAnalysis::FullBypassAlgorithm::loadData(). |
|
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(). Implemented in SctAnalysis::FullBypassAlgorithm, SctAnalysis::NMaskAlgorithm, SctAnalysis::NPtGainAlgorithm, SctAnalysis::PipelineAlgorithm, SctAnalysis::RxDelayAlgorithm, SctAnalysis::RxThresholdAlgorithm, SctAnalysis::StrobeDelayAlgorithm, SctAnalysis::TimeWalkAlgorithm, and SctAnalysis::TrimRangeAlgorithm. |
|
Merges all the defects from the FitScanResults into the TestResult. Utility method for algorithms. Ignores FitScanResults that don't exist. Does nothing if the TestResult doesn't exist. Definition at line 120 of file AnalysisAlgorithm.cpp. References m_result. |
|
The total time spent doing analysis.
Definition at line 236 of file AnalysisAlgorithm.h. Referenced by addAnalysisTime(), and getStatus(). |
|
The total time spent doing I/O.
Definition at line 235 of file AnalysisAlgorithm.h. Referenced by addIOTime(), and getStatus(). |
|
access to the algorithm can be locked for thread-safeness.
Definition at line 230 of file AnalysisAlgorithm.h. Referenced by getMutex(). |
|
true if finish() has been called.
Definition at line 229 of file AnalysisAlgorithm.h. |
|
name of the module being worked on.
Definition at line 225 of file AnalysisAlgorithm.h. Referenced by getModuleName(), and initializeTestResult(). |
|
pointer to the result. it is up to the Concrete class to make one!
Definition at line 226 of file AnalysisAlgorithm.h. Referenced by checkTestResultExists(), finish(), getTestResult(), initializeTestResult(), and mergeDefects(). |
|
access to the status information
Definition at line 233 of file AnalysisAlgorithm.h. Referenced by addAnalysisTime(), addFailure(), addIOTime(), addOverheadTime(), addPass(), and getStatus(). |
|
pointer to the testdata.
Definition at line 227 of file AnalysisAlgorithm.h. Referenced by getTestData(), and initializeTestResult(). |
|
The number of analyses performed.
Definition at line 239 of file AnalysisAlgorithm.h. Referenced by addAnalysisTime(), and getStatus(). |
|
The number of times this alg has been accessed.
Definition at line 238 of file AnalysisAlgorithm.h. Referenced by addOverheadTime(), and getStatus(). |
|
The number of analyses which failed.
Definition at line 241 of file AnalysisAlgorithm.h. Referenced by addFailure(), and getStatus(). |
|
The number of tests which passed.
Definition at line 240 of file AnalysisAlgorithm.h. Referenced by addPass(), and getStatus(). |
|
The time spent just getting stuff, checking it etc.
Definition at line 237 of file AnalysisAlgorithm.h. Referenced by addOverheadTime(), and getStatus(). |
|
A reference to the prototype.
Definition at line 234 of file AnalysisAlgorithm.h. Referenced by addAnalysisTime(), addFailure(), addIOTime(), addOverheadTime(), addPass(), and getStatus(). |