CMS 3D CMS Logo

LinearConversion.h

Go to the documentation of this file.
00001 #ifndef SiPixelObjects_LinearConversion_H
00002 #define SiPixelObjects_LinearConversion_H
00003 
00004 namespace sipixelobjects {
00005 
00006 class LinearConversion {
00007 
00008 public:
00009   LinearConversion(int offset =0, int slope =1) : theOffset(offset), theSlope(slope) { }
00010   int convert( int item) const { return theOffset+theSlope*item; }
00011   int inverse( int item) const { return (item - theOffset)/theSlope; } 
00012   int offset() const { return theOffset; }
00013   int slope() const { return theSlope; }
00014 
00015 private:
00016   int theOffset, theSlope;
00017 };
00018 
00019 }
00020 #endif

Generated on Tue Jun 9 17:26:45 2009 for CMSSW by  doxygen 1.5.4