CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
sipixelobjects::FrameConversion Class Reference

#include <FrameConversion.h>

Public Member Functions

const
sipixelobjects::LinearConversion
collumn () const
 
 FrameConversion ()
 
 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

sipixelobjects::FrameConversion::FrameConversion ( )
inline

Definition at line 14 of file FrameConversion.h.

14 {}
FrameConversion::FrameConversion ( const PixelEndcapName name,
int  rocIdInDetUnit 
)

Definition at line 78 of file FrameConversion.cc.

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

79 {
80  int slopeRow =0;
81  int slopeCol = 0;
82  int rowOffset = 0;
83  int colOffset = 0;
84 
85  if (name.pannelName()==1) {
86  if (name.plaquetteName()==1) {
87  slopeRow = 1;
88  slopeCol = -1;
89  rowOffset = 0;
90  colOffset = (1+rocIdInDetUnit)*LocalPixel::numColsInRoc-1;
91  } else if (name.plaquetteName()==2) {
92  if (rocIdInDetUnit <3) {
93  slopeRow = -1;
94  slopeCol = 1;
95  rowOffset = 2*LocalPixel::numRowsInRoc-1;
96  colOffset = rocIdInDetUnit*LocalPixel::numColsInRoc;
97  } else {
98  slopeRow = 1;
99  slopeCol = -1;
100  rowOffset = 0;
101  colOffset = (6-rocIdInDetUnit)*LocalPixel::numColsInRoc-1;
102  }
103  } else if (name.plaquetteName()==3) {
104  if (rocIdInDetUnit <4) {
105  slopeRow = -1;
106  slopeCol = 1;
107  rowOffset = 2*LocalPixel::numRowsInRoc-1;
108  colOffset = rocIdInDetUnit*LocalPixel::numColsInRoc;
109  } else {
110  slopeRow = 1;
111  slopeCol = -1;
112  rowOffset = 0;
113  colOffset = (8-rocIdInDetUnit)*LocalPixel::numColsInRoc-1;
114  }
115  } else if (name.plaquetteName()==4) {
116  slopeRow = -1;
117  slopeCol = 1;
118  rowOffset = LocalPixel::numRowsInRoc-1;
119  colOffset = rocIdInDetUnit*LocalPixel::numColsInRoc;
120  }
121  } else {
122  if (name.plaquetteName()==1) {
123  if (rocIdInDetUnit <3) {
124  slopeRow = 1;
125  slopeCol = -1;
126  rowOffset = 0;
127  colOffset = (3-rocIdInDetUnit)*LocalPixel::numColsInRoc-1;
128  } else {
129  slopeRow = -1;
130  slopeCol = 1;
131  colOffset = (rocIdInDetUnit-3)*LocalPixel::numColsInRoc;
132  rowOffset = 2*LocalPixel::numRowsInRoc-1;
133  }
134  } else if (name.plaquetteName()==2) {
135  if (rocIdInDetUnit <4) {
136  slopeRow = 1;
137  slopeCol = -1;
138  rowOffset = 0;
139  colOffset = (4-rocIdInDetUnit)*LocalPixel::numColsInRoc-1;
140  } else {
141  slopeRow = -1;
142  slopeCol = 1;
143  colOffset = (rocIdInDetUnit-4)*LocalPixel::numColsInRoc;
144  rowOffset = 2*LocalPixel::numRowsInRoc-1;
145  }
146  } else if (name.plaquetteName()==3) {
147  if (rocIdInDetUnit <5) {
148  slopeRow = 1;
149  slopeCol = -1;
150  rowOffset = 0;
151  colOffset = (5-rocIdInDetUnit)*LocalPixel::numColsInRoc-1;
152  } else {
153  slopeRow = -1;
154  slopeCol = 1;
155  colOffset = (rocIdInDetUnit-5)*LocalPixel::numColsInRoc;
156  rowOffset = 2*LocalPixel::numRowsInRoc-1;
157  }
158  }
159  }
160 
161  theRowConversion = LinearConversion(rowOffset,slopeRow);
162  theCollumnConversion = LinearConversion(colOffset, slopeCol);
163 }
int plaquetteName() const
plaquetteId (in pannel)
static const int numColsInRoc
Definition: LocalPixel.h:12
static const int numRowsInRoc
Definition: LocalPixel.h:11
sipixelobjects::LinearConversion theRowConversion
sipixelobjects::LinearConversion theCollumnConversion
int pannelName() const
pannel id
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().

13 {
14  int slopeRow =0;
15  int slopeCol = 0;
16  int rowOffset = 0;
17  int colOffset = 0;
18 
19  //
20  PixelBarrelName::Shell shell = name.shell();
21  if (shell == PixelBarrelName::mO || shell == PixelBarrelName::mI) { // -Z side
22 
23  if (name.isHalfModule() ) {
24 
25  slopeRow = -1; // d.k. 23/10/08
26  slopeCol = 1; // d.k. 13/11/08
27  rowOffset = LocalPixel::numRowsInRoc-1;
28  colOffset = rocIdInDetUnit * LocalPixel::numColsInRoc; // d.k. 13/11/08
29 
30  } else {
31 
32  if (rocIdInDetUnit <8) {
33  slopeRow = 1;
34  slopeCol = -1;
35 
36  rowOffset = 0;
37  colOffset = (8-rocIdInDetUnit)*LocalPixel::numColsInRoc-1;
38 
39  } else {
40  slopeRow = -1;
41  slopeCol = 1;
42 
43  rowOffset = 2*LocalPixel::numRowsInRoc-1;
44  colOffset = (rocIdInDetUnit-8)*LocalPixel::numColsInRoc;
45 
46  }
47  }
48 
49 
50  } else { // +Z side
51 
52  if (name.isHalfModule() ) {
53  slopeRow = -1;
54  slopeCol = 1;
55  rowOffset = LocalPixel::numRowsInRoc-1;
56  colOffset = rocIdInDetUnit * LocalPixel::numColsInRoc;
57  } else { // Full modules
58  if (rocIdInDetUnit <8) {
59  slopeRow = -1;
60  slopeCol = 1;
61  rowOffset = 2*LocalPixel::numRowsInRoc-1;
62  colOffset = rocIdInDetUnit * LocalPixel::numColsInRoc;
63  } else {
64  slopeRow = 1;
65  slopeCol = -1;
66  rowOffset = 0;
67  colOffset = (16-rocIdInDetUnit)*LocalPixel::numColsInRoc-1;
68  }
69  } // if modules
70 
71 
72  } // end if +-Z
73 
74  theRowConversion = LinearConversion(rowOffset,slopeRow);
75  theCollumnConversion = LinearConversion(colOffset, slopeCol);
76 
77 }
bool isHalfModule() const
full or half module
static const int numColsInRoc
Definition: LocalPixel.h:12
static const int numRowsInRoc
Definition: LocalPixel.h:11
sipixelobjects::LinearConversion theRowConversion
Shell shell() const
sipixelobjects::LinearConversion theCollumnConversion
sipixelobjects::FrameConversion::FrameConversion ( int  rowOffset,
int  rowSlopeSign,
int  colOffset,
int  colSlopeSign 
)
inline

Definition at line 17 of file FrameConversion.h.

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

Member Function Documentation

const sipixelobjects::LinearConversion& sipixelobjects::FrameConversion::collumn ( ) const
inline

Definition at line 22 of file FrameConversion.h.

References theCollumnConversion.

Referenced by sipixelobjects::PixelROC::toGlobal(), and sipixelobjects::PixelROC::toLocal().

22 { return theCollumnConversion;}
sipixelobjects::LinearConversion theCollumnConversion
const sipixelobjects::LinearConversion& sipixelobjects::FrameConversion::row ( ) const
inline

Definition at line 21 of file FrameConversion.h.

References theRowConversion.

Referenced by sipixelobjects::PixelROC::toGlobal(), and sipixelobjects::PixelROC::toLocal().

21 { return theRowConversion; }
sipixelobjects::LinearConversion theRowConversion

Member Data Documentation

sipixelobjects::LinearConversion sipixelobjects::FrameConversion::theCollumnConversion
private

Definition at line 26 of file FrameConversion.h.

Referenced by collumn().

sipixelobjects::LinearConversion sipixelobjects::FrameConversion::theRowConversion
private

Definition at line 25 of file FrameConversion.h.

Referenced by row().