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