CMS 3D CMS Logo

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

#include <FrameConversion.h>

Public Member Functions

const sipixelobjects::LinearConversioncollumn () const
 
 FrameConversion ()
 
 FrameConversion (const PixelEndcapName &name, int rocIdInDetUnit)
 
 FrameConversion (const PixelBarrelName &name, int rocIdInDetUnit)
 
 FrameConversion (int rowOffset, int rowSlopeSign, int colOffset, int colSlopeSign)
 
 FrameConversion (bool bpix, int side, int rocIdInDetUnit)
 
const sipixelobjects::LinearConversionrow () const
 

Private Attributes

sipixelobjects::LinearConversion theCollumnConversion
 
sipixelobjects::LinearConversion theRowConversion
 

Detailed Description

Definition at line 13 of file FrameConversion.h.

Constructor & Destructor Documentation

sipixelobjects::FrameConversion::FrameConversion ( )
inline

Definition at line 15 of file FrameConversion.h.

References dataset::name.

Referenced by FrameConversion().

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

Definition at line 157 of file FrameConversion.cc.

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

158 {
159  int slopeRow =0;
160  int slopeCol = 0;
161  int rowOffset = 0;
162  int colOffset = 0;
163 
164  if (name.pannelName()==1) {
165  if (name.plaquetteName()==1) {
166  slopeRow = 1;
167  slopeCol = -1;
168  rowOffset = 0;
169  colOffset = (1+rocIdInDetUnit)*LocalPixel::numColsInRoc-1;
170  } else if (name.plaquetteName()==2) {
171  if (rocIdInDetUnit <3) {
172  slopeRow = -1;
173  slopeCol = 1;
174  rowOffset = 2*LocalPixel::numRowsInRoc-1;
175  colOffset = rocIdInDetUnit*LocalPixel::numColsInRoc;
176  } else {
177  slopeRow = 1;
178  slopeCol = -1;
179  rowOffset = 0;
180  colOffset = (6-rocIdInDetUnit)*LocalPixel::numColsInRoc-1;
181  }
182  } else if (name.plaquetteName()==3) {
183  if (rocIdInDetUnit <4) {
184  slopeRow = -1;
185  slopeCol = 1;
186  rowOffset = 2*LocalPixel::numRowsInRoc-1;
187  colOffset = rocIdInDetUnit*LocalPixel::numColsInRoc;
188  } else {
189  slopeRow = 1;
190  slopeCol = -1;
191  rowOffset = 0;
192  colOffset = (8-rocIdInDetUnit)*LocalPixel::numColsInRoc-1;
193  }
194  } else if (name.plaquetteName()==4) {
195  slopeRow = -1;
196  slopeCol = 1;
197  rowOffset = LocalPixel::numRowsInRoc-1;
198  colOffset = rocIdInDetUnit*LocalPixel::numColsInRoc;
199  }
200  } else {
201  if (name.plaquetteName()==1) {
202  if (rocIdInDetUnit <3) {
203  slopeRow = 1;
204  slopeCol = -1;
205  rowOffset = 0;
206  colOffset = (3-rocIdInDetUnit)*LocalPixel::numColsInRoc-1;
207  } else {
208  slopeRow = -1;
209  slopeCol = 1;
210  colOffset = (rocIdInDetUnit-3)*LocalPixel::numColsInRoc;
211  rowOffset = 2*LocalPixel::numRowsInRoc-1;
212  }
213  } else if (name.plaquetteName()==2) {
214  if (rocIdInDetUnit <4) {
215  slopeRow = 1;
216  slopeCol = -1;
217  rowOffset = 0;
218  colOffset = (4-rocIdInDetUnit)*LocalPixel::numColsInRoc-1;
219  } else {
220  slopeRow = -1;
221  slopeCol = 1;
222  colOffset = (rocIdInDetUnit-4)*LocalPixel::numColsInRoc;
223  rowOffset = 2*LocalPixel::numRowsInRoc-1;
224  }
225  } else if (name.plaquetteName()==3) {
226  if (rocIdInDetUnit <5) {
227  slopeRow = 1;
228  slopeCol = -1;
229  rowOffset = 0;
230  colOffset = (5-rocIdInDetUnit)*LocalPixel::numColsInRoc-1;
231  } else {
232  slopeRow = -1;
233  slopeCol = 1;
234  colOffset = (rocIdInDetUnit-5)*LocalPixel::numColsInRoc;
235  rowOffset = 2*LocalPixel::numRowsInRoc-1;
236  }
237  }
238  }
239 
240  theRowConversion = LinearConversion(rowOffset,slopeRow);
241  theCollumnConversion = LinearConversion(colOffset, slopeCol);
242 }
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 90 of file FrameConversion.cc.

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

91 {
92  int slopeRow =0;
93  int slopeCol = 0;
94  int rowOffset = 0;
95  int colOffset = 0;
96 
97  //
99  if (shell == PixelBarrelName::mO || shell == PixelBarrelName::mI) { // -Z side
100 
101  if (name.isHalfModule() ) {
102 
103  slopeRow = -1; // d.k. 23/10/08
104  slopeCol = 1; // d.k. 13/11/08
105  rowOffset = LocalPixel::numRowsInRoc-1;
106  colOffset = rocIdInDetUnit * LocalPixel::numColsInRoc; // d.k. 13/11/08
107 
108  } else {
109 
110  if (rocIdInDetUnit <8) {
111  slopeRow = 1;
112  slopeCol = -1;
113 
114  rowOffset = 0;
115  colOffset = (8-rocIdInDetUnit)*LocalPixel::numColsInRoc-1;
116 
117  } else {
118  slopeRow = -1;
119  slopeCol = 1;
120 
121  rowOffset = 2*LocalPixel::numRowsInRoc-1;
122  colOffset = (rocIdInDetUnit-8)*LocalPixel::numColsInRoc;
123 
124  }
125  }
126 
127 
128  } else { // +Z side
129 
130  if (name.isHalfModule() ) {
131  slopeRow = -1;
132  slopeCol = 1;
133  rowOffset = LocalPixel::numRowsInRoc-1;
134  colOffset = rocIdInDetUnit * LocalPixel::numColsInRoc;
135  } else { // Full modules
136  if (rocIdInDetUnit <8) {
137  slopeRow = -1;
138  slopeCol = 1;
139  rowOffset = 2*LocalPixel::numRowsInRoc-1;
140  colOffset = rocIdInDetUnit * LocalPixel::numColsInRoc;
141  } else {
142  slopeRow = 1;
143  slopeCol = -1;
144  rowOffset = 0;
145  colOffset = (16-rocIdInDetUnit)*LocalPixel::numColsInRoc-1;
146  }
147  } // if modules
148 
149 
150  } // end if +-Z
151 
152  theRowConversion = LinearConversion(rowOffset,slopeRow);
153  theCollumnConversion = LinearConversion(colOffset, slopeCol);
154 
155 }
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
Definition: shell.py:1
sipixelobjects::FrameConversion::FrameConversion ( int  rowOffset,
int  rowSlopeSign,
int  colOffset,
int  colSlopeSign 
)
inline

Definition at line 18 of file FrameConversion.h.

References FrameConversion().

19  : theRowConversion( LinearConversion(rowOffset,rowSlopeSign) ),
20  theCollumnConversion( LinearConversion(colOffset, colSlopeSign) ) {}
sipixelobjects::LinearConversion theRowConversion
sipixelobjects::LinearConversion theCollumnConversion
FrameConversion::FrameConversion ( bool  bpix,
int  side,
int  rocIdInDetUnit 
)

Definition at line 11 of file FrameConversion.cc.

11  {
12  int slopeRow =0;
13  int slopeCol = 0;
14  int rowOffset = 0;
15  int colOffset = 0;
16 
17  if (bpix ) { // bpix
18 
19  if (side==-1) { // -Z side
20 
21  if (rocIdInDetUnit <8) {
22  slopeRow = 1;
23  slopeCol = -1;
24  rowOffset = 0;
25  colOffset = (8-rocIdInDetUnit)*LocalPixel::numColsInRoc-1;
26  } else {
27  slopeRow = -1;
28  slopeCol = 1;
29  rowOffset = 2*LocalPixel::numRowsInRoc-1;
30  colOffset = (rocIdInDetUnit-8)*LocalPixel::numColsInRoc;
31  } // if roc
32 
33  } else { // +Z side
34 
35  if (rocIdInDetUnit <8) {
36  slopeRow = -1;
37  slopeCol = 1;
38  rowOffset = 2*LocalPixel::numRowsInRoc-1;
39  colOffset = rocIdInDetUnit * LocalPixel::numColsInRoc;
40  } else {
41  slopeRow = 1;
42  slopeCol = -1;
43  rowOffset = 0;
44  colOffset = (16-rocIdInDetUnit)*LocalPixel::numColsInRoc-1;
45  }
46 
47  } // end if +-Z
48 
49 
50 
51  } else { // fpix
52 
53  // for fpix follow Urs's code for pilot blade
54  // no difference between panels
55  if(side==-1) { // pannel 1
56  if (rocIdInDetUnit < 8) {
57  slopeRow = 1;
58  slopeCol = -1;
59  rowOffset = 0;
60  colOffset = (8-rocIdInDetUnit)*LocalPixel::numColsInRoc-1;
61  } else {
62  slopeRow = -1;
63  slopeCol = 1;
64  rowOffset = 2*LocalPixel::numRowsInRoc-1;
65  colOffset = (rocIdInDetUnit-8)*LocalPixel::numColsInRoc;
66  }
67  } else { // pannel 2
68  if (rocIdInDetUnit < 8) {
69  slopeRow = 1;
70  slopeCol = -1;
71  rowOffset = 0;
72  colOffset = (8-rocIdInDetUnit)*LocalPixel::numColsInRoc-1;
73  } else {
74  slopeRow = -1;
75  slopeCol = 1;
76  rowOffset = 2*LocalPixel::numRowsInRoc-1;
77  colOffset = (rocIdInDetUnit-8)*LocalPixel::numColsInRoc;
78  }
79 
80  } // side
81 
82  } // bpix/fpix
83 
84  theRowConversion = LinearConversion(rowOffset,slopeRow);
85  theCollumnConversion = LinearConversion(colOffset, slopeCol);
86 
87 }
static const int numColsInRoc
Definition: LocalPixel.h:12
static const int numRowsInRoc
Definition: LocalPixel.h:11
sipixelobjects::LinearConversion theRowConversion
sipixelobjects::LinearConversion theCollumnConversion

Member Function Documentation

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

Definition at line 25 of file FrameConversion.h.

References theCollumnConversion.

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

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

Definition at line 24 of file FrameConversion.h.

References theRowConversion.

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

24 { return theRowConversion; }
sipixelobjects::LinearConversion theRowConversion

Member Data Documentation

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

Definition at line 29 of file FrameConversion.h.

Referenced by collumn().

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

Definition at line 28 of file FrameConversion.h.

Referenced by row().