00001 #ifndef TRIMRANGEALGORITHM_H
00002 #define TRIMRANGEALGORITHM_H
00003 #include "AnalysisAlgorithm.h"
00004 #include "SctData/TrimRangeTestResult.h"
00005 #include <vector>
00006
00007 using std::vector;
00008
00009 namespace SctAnalysis{
00016 class TrimRangeAlgorithm : public AnalysisAlgorithm{
00017 public:
00018 class TrimRange;
00019 class TrimPoint;
00020 virtual bool canAnalyze() const;
00021 virtual void analyze();
00022 virtual void loadData();
00023 virtual shared_ptr<SctData::TestResult> createTestResult() const;
00027 virtual ~TrimRangeAlgorithm() throw() {;}
00031 TrimRangeAlgorithm(shared_ptr<const TestData> testData, const string& moduleName, const AnalysisAlgorithm& alg) throw() : AnalysisAlgorithm(testData, moduleName, alg) {;}
00035 virtual boost::shared_ptr<AnalysisAlgorithm> clone(shared_ptr<const TestData> testData, const string& moduleName) const throw();
00036
00038 static void doTrimDataFit(SctData::TrimRangeTestResult::ChipTrimData& chipData) throw();
00040
00042 static unsigned nTargets() throw() {return 120;}
00044 static float firstTarget() throw() {return 2.5;}
00046 static float targetStep() throw() {return 2.5;}
00048
00049 vector<TrimRange> createRanges(const SctData::TestResult& r) throw();
00050
00052 bool allowTrimRangeVariation() const throw() {return s_rangeVariation;}
00054 bool allowTrimTargetVariation() const throw() {return s_targetVariation;}
00055
00056
00057 class TrimPoint{
00058 public:
00063 TrimPoint(int value, int scan) throw() : value(value), scan(scan) {;}
00064 TrimPoint() throw() : value(-2), scan(-2) {;}
00065 int value;
00066 int scan;
00067 };
00068
00070 class TrimRange{
00071 public:
00072 TrimRange() throw() : range(-2) {;}
00074 TrimRange(int range) throw() : range (range) {;}
00075 int range;
00076 vector< TrimPoint > points;
00078 bool operator<(const TrimRange& r) const throw() { return (range<r.range);}
00079 };
00080 private:
00081 TrimRangeAlgorithm() {}
00082 static shared_ptr<const SctData::TrimRangeTestResult::ChipTrim>
00083 getChipTrim(const SctData::TrimRangeTestResult::ChipTrimData& data,
00084 const float target,
00085 short unsigned irange) throw();
00086 static bool inMap;
00087
00088 static bool s_targetVariation;
00089 static bool s_rangeVariation;
00090 };
00091
00092 }
00093 #endif // #ifndef TRIMRANGEALGORITHM_H