CMS 3D CMS Logo

Public Member Functions | Private Attributes

sipixelobjects::FrameConversion Class Reference

#include <FrameConversion.h>

List of all members.

Public Member Functions

FrameConversionclone () const
const
sipixelobjects::LinearConversion
collumn () const
 FrameConversion (const PixelEndcapName &name, int rocIdInDetUnit)
 FrameConversion (const PixelBarrelName &name, int rocIdInDetUnit)
 FrameConversion (int rowOffset, int rowSlopeSign, int colOffset, int colSlopeSign)
const
sipixelobjects::LinearConversion
row () const

Private Attributes

sipixelobjects::LinearConversion theCollumnConversion
sipixelobjects::LinearConversion theRowConversion

Detailed Description

Definition at line 12 of file FrameConversion.h.


Constructor & Destructor Documentation

FrameConversion::FrameConversion ( const PixelEndcapName name,
int  rocIdInDetUnit 
)

Definition at line 78 of file FrameConversion.cc.

References PixelEndcapName::pannelName(), and PixelEndcapName::plaquetteName().

Referenced by clone().

{
  int slopeRow =0;
  int slopeCol = 0;
  int  rowOffset = 0;
  int  colOffset = 0; 

  if (name.pannelName()==1) {
    if (name.plaquetteName()==1) {
      slopeRow = 1;
      slopeCol = -1;
      rowOffset = 0;
      colOffset = (1+rocIdInDetUnit)*LocalPixel::numColsInRoc-1;
    } else if (name.plaquetteName()==2) {
      if (rocIdInDetUnit <3) {
        slopeRow = -1;
        slopeCol = 1;
        rowOffset = 2*LocalPixel::numRowsInRoc-1;
        colOffset = rocIdInDetUnit*LocalPixel::numColsInRoc;
      } else {
        slopeRow = 1;
        slopeCol = -1;
        rowOffset = 0;
        colOffset = (6-rocIdInDetUnit)*LocalPixel::numColsInRoc-1;
      }
    } else if (name.plaquetteName()==3) {
      if (rocIdInDetUnit <4) {
        slopeRow = -1;
        slopeCol = 1;
        rowOffset = 2*LocalPixel::numRowsInRoc-1;
        colOffset = rocIdInDetUnit*LocalPixel::numColsInRoc;
      } else {
        slopeRow = 1;
        slopeCol = -1;
        rowOffset = 0;
        colOffset = (8-rocIdInDetUnit)*LocalPixel::numColsInRoc-1;
      }
    } else if (name.plaquetteName()==4) {
      slopeRow = -1;
      slopeCol = 1;
      rowOffset = LocalPixel::numRowsInRoc-1;
      colOffset = rocIdInDetUnit*LocalPixel::numColsInRoc;
    }
  } else {
    if (name.plaquetteName()==1) {
      if (rocIdInDetUnit <3) {
        slopeRow = 1;
        slopeCol = -1;
        rowOffset = 0;
        colOffset = (3-rocIdInDetUnit)*LocalPixel::numColsInRoc-1;
      } else {
        slopeRow = -1;
        slopeCol = 1;
        colOffset = (rocIdInDetUnit-3)*LocalPixel::numColsInRoc;
        rowOffset = 2*LocalPixel::numRowsInRoc-1;
      } 
    } else if (name.plaquetteName()==2) {
      if (rocIdInDetUnit <4) {
        slopeRow = 1;
        slopeCol = -1;
        rowOffset = 0;
        colOffset = (4-rocIdInDetUnit)*LocalPixel::numColsInRoc-1;
      } else {
        slopeRow = -1;
        slopeCol = 1;
        colOffset = (rocIdInDetUnit-4)*LocalPixel::numColsInRoc;
        rowOffset = 2*LocalPixel::numRowsInRoc-1;
      } 
    } else if (name.plaquetteName()==3) {
      if (rocIdInDetUnit <5) {
        slopeRow = 1;
        slopeCol = -1;
        rowOffset = 0;
        colOffset = (5-rocIdInDetUnit)*LocalPixel::numColsInRoc-1;
      } else {
        slopeRow = -1;
        slopeCol = 1;
        colOffset = (rocIdInDetUnit-5)*LocalPixel::numColsInRoc;
        rowOffset = 2*LocalPixel::numRowsInRoc-1;
      } 
    }
  }

  theRowConversion =  LinearConversion(rowOffset,slopeRow);
  theCollumnConversion =  LinearConversion(colOffset, slopeCol);
}
FrameConversion::FrameConversion ( const PixelBarrelName name,
int  rocIdInDetUnit 
)

Definition at line 12 of file FrameConversion.cc.

References PixelBarrelName::isHalfModule(), PixelBarrelName::mI, PixelBarrelName::mO, and PixelBarrelName::shell().

{
  int slopeRow =0;
  int slopeCol = 0;
  int  rowOffset = 0;
  int  colOffset = 0; 

  //
  PixelBarrelName::Shell shell = name.shell();
  if (shell == PixelBarrelName::mO || shell == PixelBarrelName::mI) {  // -Z side

    if (name.isHalfModule() ) {

      slopeRow = -1;  // d.k. 23/10/08 
      slopeCol = 1;   // d.k. 13/11/08
      rowOffset = LocalPixel::numRowsInRoc-1;
      colOffset = rocIdInDetUnit * LocalPixel::numColsInRoc;  // d.k. 13/11/08

    } else {

      if (rocIdInDetUnit <8) {
        slopeRow = 1;
        slopeCol = -1;

        rowOffset = 0;
        colOffset = (8-rocIdInDetUnit)*LocalPixel::numColsInRoc-1;

      } else {
        slopeRow = -1;
        slopeCol = 1;

        rowOffset = 2*LocalPixel::numRowsInRoc-1;
        colOffset = (rocIdInDetUnit-8)*LocalPixel::numColsInRoc;

      }
    } 
    

  } else {  // +Z side

    if (name.isHalfModule() ) {
      slopeRow = -1; 
      slopeCol = 1;
      rowOffset = LocalPixel::numRowsInRoc-1;
      colOffset = rocIdInDetUnit * LocalPixel::numColsInRoc; 
    } else {  // Full modules
      if (rocIdInDetUnit <8) {
        slopeRow = -1;
        slopeCol = 1;
        rowOffset = 2*LocalPixel::numRowsInRoc-1;
        colOffset = rocIdInDetUnit * LocalPixel::numColsInRoc; 
      } else {
        slopeRow = 1;
        slopeCol = -1;
        rowOffset = 0;
        colOffset = (16-rocIdInDetUnit)*LocalPixel::numColsInRoc-1; 
      }
    } // if modules 
    

  } // end if +-Z

  theRowConversion      = LinearConversion(rowOffset,slopeRow);
  theCollumnConversion =  LinearConversion(colOffset, slopeCol);

}
sipixelobjects::FrameConversion::FrameConversion ( int  rowOffset,
int  rowSlopeSign,
int  colOffset,
int  colSlopeSign 
) [inline]

Definition at line 16 of file FrameConversion.h.

    : theRowConversion( LinearConversion(rowOffset,rowSlopeSign) ),
    theCollumnConversion( LinearConversion(colOffset, colSlopeSign) ) {}

Member Function Documentation

FrameConversion* sipixelobjects::FrameConversion::clone ( void  ) const [inline]

Definition at line 20 of file FrameConversion.h.

References FrameConversion().

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

{ return new FrameConversion(*this); }
const sipixelobjects::LinearConversion& sipixelobjects::FrameConversion::collumn ( ) const [inline]
const sipixelobjects::LinearConversion& sipixelobjects::FrameConversion::row ( ) const [inline]

Member Data Documentation

Definition at line 27 of file FrameConversion.h.

Referenced by collumn().

Definition at line 26 of file FrameConversion.h.

Referenced by row().