RxThresholdBasedOnConfigRegisterAlgorithm.h

00001 #ifndef RXTHRESHOLDBASEDONCONFIGREGISTERALGORITHM_H
00002 #define RXTHRESHOLDBASEDONCONFIGREGISTERALGORITHM_H
00003 
00004 #include "AnalysisAlgorithm.h"
00005 
00006 namespace SctAnalysis {
00010 class RxThresholdBasedOnConfigRegisterAlgorithm : public AnalysisAlgorithm {
00011 public:
00012   // categorise the data from any particular RxThreshold value:
00013   typedef enum {undecided,white,black,blackAndWhite,meaningfulData,coloured} Category;
00014 public:
00015   static std::string categoryToString(const Category & category) {
00016     return
00017       category==undecided             ? "undecided" :
00018       category==white                 ? "white" :
00019       category==black                 ? "black" :
00020       category==blackAndWhite         ? "blackAndWhite" :
00021       category==meaningfulData        ? "meaningfulData" :
00022       category==coloured              ? "coloured" :
00023       "couldNotFigureCategoryOut";
00024   };
00025 public:
00026     virtual bool canAnalyze() const;
00027     virtual void analyze();
00028     virtual void loadData();
00029     virtual shared_ptr<SctData::TestResult> createTestResult() const;
00030     virtual boost::shared_ptr<AnalysisAlgorithm> clone(shared_ptr<const TestData> testData, const string& moduleName) const throw();
00034     RxThresholdBasedOnConfigRegisterAlgorithm(shared_ptr<const TestData> testData, const string& moduleName, const AnalysisAlgorithm& alg) throw(); 
00038     virtual ~RxThresholdBasedOnConfigRegisterAlgorithm() throw() {}
00039 
00040     /* fraction of the way from low to high at which to set optimum */
00041     void setFraction(float fraction) {m_fraction=fraction;}
00042     /* fraction of the way from low to high at which to set optimum */
00043     float getFraction() const {return m_fraction;}
00044  private:
00045     /*struct BitSearch {
00046       BitSearch(const char * p, const unsigned int elts) :
00047     m_pattern(p, p+elts) {
00048       };
00049       const std::vector<char> & pattern() const { return m_pattern; };
00050       private:
00051       std::vector<char> m_pattern;
00052     };*/
00053     bool canRead(const std::vector<char> & wanted, // what to look for
00054          const std::vector<bool> & have, // what to look in
00055          std::vector<bool>::const_iterator & pos, // where to start looking -- will be advanced on a successful read (i.e. when true is returned) otherwise left unchanged.
00056          const bool showDebug = false);
00057 private:
00058     float m_fraction;
00059     RxThresholdBasedOnConfigRegisterAlgorithm() {}
00060     static bool inMap;
00061 };
00062 }
00063 
00064 #endif //RXTHRESHOLDBASEDONCONFIGREGISTERALGORITHM_H

Generated on Mon Feb 6 14:01:26 2006 for SCT DAQ/DCS Software - C++ by  doxygen 1.4.6