00001 #ifndef MVTHRESHOLDVARIABLE_H 00002 #define MVTHRESHOLDVARIABLE_H 00003 00004 #include <string> 00005 #include "Sct/round.h" 00006 #include "ThresholdVariable.h" 00007 00008 using std::string; 00009 using namespace Sct; 00010 00011 namespace SctData { 00012 00013 class mVThresholdVariable : public ThresholdVariable { 00014 public: 00015 static const mVThresholdVariable& instance() throw(); 00016 00017 virtual double getLinkActualPoint(double logicalPt, const ModuleConfiguration& config, unsigned int link) const throw(); 00018 virtual double getChipActualPoint(double logicalPt, const ModuleConfiguration& config, unsigned int chip) const throw(); 00019 virtual double getChannelActualPoint(double logicalPt, const ModuleConfiguration& config, unsigned int channel) const throw(); 00020 00021 virtual double getLinkLogicalPoint(double actualPt, const ModuleConfiguration& config, unsigned int link) const throw(); 00022 virtual double getChipLogicalPoint(double actualPt, const ModuleConfiguration& config, unsigned int chip) const throw(); 00023 virtual double getChannelLogicalPoint(double actualPt, const ModuleConfiguration& config, unsigned int channel) const throw(); 00024 00025 private: 00026 mVThresholdVariable(); 00027 unsigned char getActualPoint(double logicalPt) const throw(); 00028 double getLogicalPoint(unsigned char actualPt) const throw(); 00029 }; 00030 00032 inline unsigned char mVThresholdVariable::getActualPoint(double logicalPt) const throw() { 00033 return roundToUChar(logicalPt/2.5); 00034 } 00035 00036 inline double mVThresholdVariable::getLogicalPoint(unsigned char actualPt) const throw() { 00037 return 2.5 * actualPt; 00038 } 00039 00040 00041 } 00042 00043 #endif //#ifndef MVTHRESHOLDVARIABLE_H