00001 #ifndef TRIMRANGEALGORITHM_H 00002 #define TRIMRANGEALGORITHM_H 00003 #include "AnalysisAlgorithm.h" 00004 #include "SctData/TrimRangeTestResult.h" 00005 #include <vector> 00006 00007 namespace SctAnalysis{ 00014 class TrimRangeAlgorithm : public AnalysisAlgorithm{ 00015 public: 00016 class TrimRange; 00017 class TrimPoint; 00021 virtual void canAddFitScanResult(const string& name) throw(Sct::LogicError, Sct::IoError); 00025 virtual ~TrimRangeAlgorithm() throw() {;} 00029 TrimRangeAlgorithm(const TestData& testData, const string& moduleName) throw() : AnalysisAlgorithm(testData, moduleName) {;} 00033 virtual boost::shared_ptr<AnalysisAlgorithm> clone(const TestData& testData, const string& moduleName) const throw(); 00034 00036 static void doTrimDataFit(SctData::TrimRangeTestResult::ChipTrimData& chipData) throw(); 00038 //@name Target setting 00040 static unsigned nTargets() throw() {return 120;} 00042 static float firstTarget() throw() {return 2.5;} 00044 static float targetStep() throw() {return 2.5;} 00046 00047 static vector<TrimRange> createRanges(const SctData::TestResult& r) throw(); 00048 00050 bool allowTrimRangeVariation() const throw() {return s_rangeVariation;} 00052 bool allowTrimTargetVariation() const throw() {return s_targetVariation;} 00053 00054 // holds data about points in a trim range. 00055 class TrimPoint{ 00056 public: 00061 TrimPoint(int value, int scan) throw() : value(value), scan(scan) {;} 00062 TrimPoint() throw() : value(-2), scan(-2) {;} 00063 int value; 00064 int scan; 00065 }; 00066 00068 class TrimRange{ 00069 public: 00070 TrimRange() throw() : range(-2) {;} 00072 TrimRange(int range) throw() : range (range) {;} 00073 int range; 00074 vector< TrimPoint > points; 00076 bool operator<(const TrimRange& r) const throw() { return (range<r.range);} 00077 }; 00078 private: 00079 TrimRangeAlgorithm() {} 00080 static shared_ptr<const SctData::TrimRangeTestResult::ChipTrim> 00081 getChipTrim(const SctData::TrimRangeTestResult::ChipTrimData& data, 00082 const float target, 00083 short unsigned irange) throw(); 00084 static bool inMap; 00085 00086 static bool s_targetVariation; 00087 static bool s_rangeVariation; 00088 }; 00089 00090 } // end of namespace SctAnalysis 00091 #endif // #ifndef TRIMRANGEALGORITHM_H