00001 #ifndef NPTGAINALGORITHM_H
00002 #define NPTGAINALGORITHM_H
00003
00004 #include "AnalysisAlgorithm.h"
00005 #include "Sct/Exception.h"
00006 #include <boost/scoped_ptr.hpp>
00007 #include "SctData/ModuleElement.h"
00008 #include <memory>
00009
00010 namespace SctData {
00011 class NPtGainTestResult;
00012 class NPtGainTestResultData;
00013 class TestResult;
00014 class FitScanResult;
00015 class FitObject;
00016 class ModuleDefectList;
00017 class ResponseCurve;
00018 }
00019
00020 using std::auto_ptr;
00021 using boost::scoped_ptr;
00022 using SctData::NPtGainTestResult;
00023 using SctData::NPtGainTestResultData;
00024 using SctData::FitScanResult;
00025 using SctData::FitObject;
00026 using SctData::ModuleElement;
00027 using SctData::ModuleDefectList;
00028 using SctData::ResponseCurve;
00029 using namespace Sct;
00030
00031 namespace SctAnalysis {
00032
00036 class NPtGainAlgorithm : public AnalysisAlgorithm {
00037 public:
00041 NPtGainAlgorithm(const TestData& testData, const string& moduleName) throw() : AnalysisAlgorithm(testData, moduleName) {}
00045 virtual ~NPtGainAlgorithm() throw() {}
00051 static boost::shared_ptr<ResponseCurve> getResponseCurve(unsigned int nPts=4) throw(LogicError);
00057 static void setResponseCurve( auto_ptr<ResponseCurve> rc) throw();
00061 virtual void canAddFitScanResult(const string& name) throw(LogicError, IoError);
00065 virtual boost::shared_ptr<AnalysisAlgorithm> clone(const TestData& testData, const string& moduleName) const throw();
00066 private:
00067 NPtGainAlgorithm() {}
00068
00070 static boost::shared_ptr<ResponseCurve> s_responseCurve;
00071 static bool inMap;
00072 typedef FitObject& (FitScanResult::*getFitFunction) (unsigned int) const;
00074 static void setupGraph(unsigned int id, getFitFunction fitFunc, NPtGainTestResult& test, NPtGainTestResultData& testData, bool trimPoints = false) throw(LogicError);
00075
00077 static void doFit(unsigned int id, getFitFunction fitFunc, NPtGainTestResult& test, NPtGainTestResultData& testData) throw(LogicError) ;
00078
00083 static void doDefect(const ModuleElement& e, ModuleDefectList& defects,
00084 const NPtGainTestResultData& data,
00085 const NPtGainTestResultData& comparisonData) throw(LogicError);
00086
00087 };
00088
00089 }
00090
00091 #endif //#ifndef NPTGAINALGORITHM_H