CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
sipixelobjects::LinearConversion Class Reference

#include <LinearConversion.h>

Public Member Functions

int convert (int item) const
 
int inverse (int item) const
 
 LinearConversion (int offset=0, int slope=1)
 
int offset () const
 
int slope () const
 

Private Attributes

int theOffset
 
int theSlope
 

Detailed Description

Definition at line 6 of file LinearConversion.h.

Constructor & Destructor Documentation

◆ LinearConversion()

sipixelobjects::LinearConversion::LinearConversion ( int  offset = 0,
int  slope = 1 
)
inline

Definition at line 8 of file LinearConversion.h.

Member Function Documentation

◆ convert()

int sipixelobjects::LinearConversion::convert ( int  item) const
inline

Definition at line 9 of file LinearConversion.h.

9 { return theOffset + theSlope * item; }

References B2GTnPMonitor_cfi::item, theOffset, and theSlope.

Referenced by sipixelobjects::PixelROC::toGlobal().

◆ inverse()

int sipixelobjects::LinearConversion::inverse ( int  item) const
inline

Definition at line 10 of file LinearConversion.h.

10 { return (item - theOffset) / theSlope; }

References B2GTnPMonitor_cfi::item, theOffset, and theSlope.

Referenced by sipixelobjects::PixelROC::toLocal().

◆ offset()

int sipixelobjects::LinearConversion::offset ( ) const
inline

Definition at line 11 of file LinearConversion.h.

11 { return theOffset; }

References theOffset.

◆ slope()

int sipixelobjects::LinearConversion::slope ( ) const
inline

Definition at line 12 of file LinearConversion.h.

12 { return theSlope; }

References theSlope.

Member Data Documentation

◆ theOffset

int sipixelobjects::LinearConversion::theOffset
private

Definition at line 15 of file LinearConversion.h.

Referenced by convert(), inverse(), and offset().

◆ theSlope

int sipixelobjects::LinearConversion::theSlope
private

Definition at line 15 of file LinearConversion.h.

Referenced by convert(), inverse(), and slope().

sipixelobjects::LinearConversion::theOffset
int theOffset
Definition: LinearConversion.h:15
sipixelobjects::LinearConversion::theSlope
int theSlope
Definition: LinearConversion.h:15
sipixelobjects::LinearConversion::offset
int offset() const
Definition: LinearConversion.h:11
B2GTnPMonitor_cfi.item
item
Definition: B2GTnPMonitor_cfi.py:147
sipixelobjects::LinearConversion::slope
int slope() const
Definition: LinearConversion.h:12