CMS 3D CMS Logo

LinearConversion.h
Go to the documentation of this file.
1 #ifndef SiPixelObjects_LinearConversion_H
2 #define SiPixelObjects_LinearConversion_H
3 
4 namespace sipixelobjects {
5 
7  public:
9  int convert(int item) const { return theOffset + theSlope * item; }
10  int inverse(int item) const { return (item - theOffset) / theSlope; }
11  int offset() const { return theOffset; }
12  int slope() const { return theSlope; }
13 
14  private:
16  };
17 
18 } // namespace sipixelobjects
19 #endif
LinearConversion(int offset=0, int slope=1)