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 layer, int rocIdInDetUnit)
 
 FrameConversion (bool bpix, int side, int rocIdInDetUnit)
 
const sipixelobjects::LinearConversionrow () const
 

Private Attributes

sipixelobjects::LinearConversion theCollumnConversion
 
sipixelobjects::LinearConversion theRowConversion
 

Detailed Description

Definition at line 12 of file FrameConversion.h.

Constructor & Destructor Documentation

◆ FrameConversion() [1/6]

sipixelobjects::FrameConversion::FrameConversion ( )
inline

Definition at line 14 of file FrameConversion.h.

14 {}

◆ FrameConversion() [2/6]

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

Definition at line 222 of file FrameConversion.cc.

References Skims_PA_cff::name, pixelgpudetails::numColsInRoc, and pixelgpudetails::numRowsInRoc.

222  {
223  int slopeRow = 0;
224  int slopeCol = 0;
225  int rowOffset = 0;
226  int colOffset = 0;
227 
228  if (name.pannelName() == 1) {
229  if (name.plaquetteName() == 1) {
230  slopeRow = 1;
231  slopeCol = -1;
232  rowOffset = 0;
233  colOffset = (1 + rocIdInDetUnit) * LocalPixel::numColsInRoc - 1;
234  } else if (name.plaquetteName() == 2) {
235  if (rocIdInDetUnit < 3) {
236  slopeRow = -1;
237  slopeCol = 1;
238  rowOffset = 2 * LocalPixel::numRowsInRoc - 1;
239  colOffset = rocIdInDetUnit * LocalPixel::numColsInRoc;
240  } else {
241  slopeRow = 1;
242  slopeCol = -1;
243  rowOffset = 0;
244  colOffset = (6 - rocIdInDetUnit) * LocalPixel::numColsInRoc - 1;
245  }
246  } else if (name.plaquetteName() == 3) {
247  if (rocIdInDetUnit < 4) {
248  slopeRow = -1;
249  slopeCol = 1;
250  rowOffset = 2 * LocalPixel::numRowsInRoc - 1;
251  colOffset = rocIdInDetUnit * LocalPixel::numColsInRoc;
252  } else {
253  slopeRow = 1;
254  slopeCol = -1;
255  rowOffset = 0;
256  colOffset = (8 - rocIdInDetUnit) * LocalPixel::numColsInRoc - 1;
257  }
258  } else if (name.plaquetteName() == 4) {
259  slopeRow = -1;
260  slopeCol = 1;
261  rowOffset = LocalPixel::numRowsInRoc - 1;
262  colOffset = rocIdInDetUnit * LocalPixel::numColsInRoc;
263  }
264  } else {
265  if (name.plaquetteName() == 1) {
266  if (rocIdInDetUnit < 3) {
267  slopeRow = 1;
268  slopeCol = -1;
269  rowOffset = 0;
270  colOffset = (3 - rocIdInDetUnit) * LocalPixel::numColsInRoc - 1;
271  } else {
272  slopeRow = -1;
273  slopeCol = 1;
274  colOffset = (rocIdInDetUnit - 3) * LocalPixel::numColsInRoc;
275  rowOffset = 2 * LocalPixel::numRowsInRoc - 1;
276  }
277  } else if (name.plaquetteName() == 2) {
278  if (rocIdInDetUnit < 4) {
279  slopeRow = 1;
280  slopeCol = -1;
281  rowOffset = 0;
282  colOffset = (4 - rocIdInDetUnit) * LocalPixel::numColsInRoc - 1;
283  } else {
284  slopeRow = -1;
285  slopeCol = 1;
286  colOffset = (rocIdInDetUnit - 4) * LocalPixel::numColsInRoc;
287  rowOffset = 2 * LocalPixel::numRowsInRoc - 1;
288  }
289  } else if (name.plaquetteName() == 3) {
290  if (rocIdInDetUnit < 5) {
291  slopeRow = 1;
292  slopeCol = -1;
293  rowOffset = 0;
294  colOffset = (5 - rocIdInDetUnit) * LocalPixel::numColsInRoc - 1;
295  } else {
296  slopeRow = -1;
297  slopeCol = 1;
298  colOffset = (rocIdInDetUnit - 5) * LocalPixel::numColsInRoc;
299  rowOffset = 2 * LocalPixel::numRowsInRoc - 1;
300  }
301  }
302  }
303 
304  theRowConversion = LinearConversion(rowOffset, slopeRow);
305  theCollumnConversion = LinearConversion(colOffset, slopeCol);
306 }
static const int numColsInRoc
Definition: LocalPixel.h:10
static const int numRowsInRoc
Definition: LocalPixel.h:9
sipixelobjects::LinearConversion theRowConversion
sipixelobjects::LinearConversion theCollumnConversion

◆ FrameConversion() [3/6]

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

Definition at line 162 of file FrameConversion.cc.

References PixelBarrelName::mI, PixelBarrelName::mO, Skims_PA_cff::name, pixelgpudetails::numColsInRoc, and pixelgpudetails::numRowsInRoc.

162  {
163  int slopeRow = 0;
164  int slopeCol = 0;
165  int rowOffset = 0;
166  int colOffset = 0;
167 
168  //
170  if (shell == PixelBarrelName::mO || shell == PixelBarrelName::mI) { // -Z side
171 
172  if (name.isHalfModule()) {
173  slopeRow = -1; // d.k. 23/10/08
174  slopeCol = 1; // d.k. 13/11/08
175  rowOffset = LocalPixel::numRowsInRoc - 1;
176  colOffset = rocIdInDetUnit * LocalPixel::numColsInRoc; // d.k. 13/11/08
177 
178  } else {
179  if (rocIdInDetUnit < 8) {
180  slopeRow = 1;
181  slopeCol = -1;
182 
183  rowOffset = 0;
184  colOffset = (8 - rocIdInDetUnit) * LocalPixel::numColsInRoc - 1;
185 
186  } else {
187  slopeRow = -1;
188  slopeCol = 1;
189 
190  rowOffset = 2 * LocalPixel::numRowsInRoc - 1;
191  colOffset = (rocIdInDetUnit - 8) * LocalPixel::numColsInRoc;
192  }
193  }
194 
195  } else { // +Z side
196 
197  if (name.isHalfModule()) {
198  slopeRow = -1;
199  slopeCol = 1;
200  rowOffset = LocalPixel::numRowsInRoc - 1;
201  colOffset = rocIdInDetUnit * LocalPixel::numColsInRoc;
202  } else { // Full modules
203  if (rocIdInDetUnit < 8) {
204  slopeRow = -1;
205  slopeCol = 1;
206  rowOffset = 2 * LocalPixel::numRowsInRoc - 1;
207  colOffset = rocIdInDetUnit * LocalPixel::numColsInRoc;
208  } else {
209  slopeRow = 1;
210  slopeCol = -1;
211  rowOffset = 0;
212  colOffset = (16 - rocIdInDetUnit) * LocalPixel::numColsInRoc - 1;
213  }
214  } // if modules
215 
216  } // end if +-Z
217 
218  theRowConversion = LinearConversion(rowOffset, slopeRow);
219  theCollumnConversion = LinearConversion(colOffset, slopeCol);
220 }
static const int numColsInRoc
Definition: LocalPixel.h:10
static const int numRowsInRoc
Definition: LocalPixel.h:9
sipixelobjects::LinearConversion theRowConversion
sipixelobjects::LinearConversion theCollumnConversion
Definition: shell.py:1

◆ FrameConversion() [4/6]

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

◆ FrameConversion() [5/6]

FrameConversion::FrameConversion ( bool  bpix,
int  side,
int  layer,
int  rocIdInDetUnit 
)

Definition at line 11 of file FrameConversion.cc.

References pixelgpudetails::numColsInRoc, and pixelgpudetails::numRowsInRoc.

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 && layer != 1) { // -Z side: 4 non-flipped modules oriented like 'dddd', except Layer 1
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: 4 non-flipped modules oriented like 'pppp', but all 8 in Layer 1
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  } else { // fpix
50 
51  // for fpix follow Urs's code for pilot blade
52  // no difference between panels
53  if (side == -1) { // pannel 1
54  if (rocIdInDetUnit < 8) {
55  slopeRow = 1;
56  slopeCol = -1;
57  rowOffset = 0;
58  colOffset = (8 - rocIdInDetUnit) * LocalPixel::numColsInRoc - 1;
59  } else {
60  slopeRow = -1;
61  slopeCol = 1;
62  rowOffset = 2 * LocalPixel::numRowsInRoc - 1;
63  colOffset = (rocIdInDetUnit - 8) * LocalPixel::numColsInRoc;
64  }
65  } else { // pannel 2
66  if (rocIdInDetUnit < 8) {
67  slopeRow = 1;
68  slopeCol = -1;
69  rowOffset = 0;
70  colOffset = (8 - rocIdInDetUnit) * LocalPixel::numColsInRoc - 1;
71  } else {
72  slopeRow = -1;
73  slopeCol = 1;
74  rowOffset = 2 * LocalPixel::numRowsInRoc - 1;
75  colOffset = (rocIdInDetUnit - 8) * LocalPixel::numColsInRoc;
76  }
77 
78  } // side
79 
80  } // bpix/fpix
81 
82  theRowConversion = LinearConversion(rowOffset, slopeRow);
83  theCollumnConversion = LinearConversion(colOffset, slopeCol);
84 }
static const int numColsInRoc
Definition: LocalPixel.h:10
static const int numRowsInRoc
Definition: LocalPixel.h:9
sipixelobjects::LinearConversion theRowConversion
sipixelobjects::LinearConversion theCollumnConversion

◆ FrameConversion() [6/6]

FrameConversion::FrameConversion ( bool  bpix,
int  side,
int  rocIdInDetUnit 
)

Definition at line 86 of file FrameConversion.cc.

References pixelgpudetails::numColsInRoc, and pixelgpudetails::numRowsInRoc.

86  {
87  int slopeRow = 0;
88  int slopeCol = 0;
89  int rowOffset = 0;
90  int colOffset = 0;
91 
92  if (bpix) { // bpix
93 
94  if (side == -1) { // -Z side
95 
96  if (rocIdInDetUnit < 8) {
97  slopeRow = 1;
98  slopeCol = -1;
99  rowOffset = 0;
100  colOffset = (8 - rocIdInDetUnit) * LocalPixel::numColsInRoc - 1;
101  } else {
102  slopeRow = -1;
103  slopeCol = 1;
104  rowOffset = 2 * LocalPixel::numRowsInRoc - 1;
105  colOffset = (rocIdInDetUnit - 8) * LocalPixel::numColsInRoc;
106  } // if roc
107 
108  } else { // +Z side
109 
110  if (rocIdInDetUnit < 8) {
111  slopeRow = -1;
112  slopeCol = 1;
113  rowOffset = 2 * LocalPixel::numRowsInRoc - 1;
114  colOffset = rocIdInDetUnit * LocalPixel::numColsInRoc;
115  } else {
116  slopeRow = 1;
117  slopeCol = -1;
118  rowOffset = 0;
119  colOffset = (16 - rocIdInDetUnit) * LocalPixel::numColsInRoc - 1;
120  }
121 
122  } // end if +-Z
123 
124  } else { // fpix
125 
126  // for fpix follow Urs's code for pilot blade
127  // no difference between panels
128  if (side == -1) { // pannel 1
129  if (rocIdInDetUnit < 8) {
130  slopeRow = 1;
131  slopeCol = -1;
132  rowOffset = 0;
133  colOffset = (8 - rocIdInDetUnit) * LocalPixel::numColsInRoc - 1;
134  } else {
135  slopeRow = -1;
136  slopeCol = 1;
137  rowOffset = 2 * LocalPixel::numRowsInRoc - 1;
138  colOffset = (rocIdInDetUnit - 8) * LocalPixel::numColsInRoc;
139  }
140  } else { // pannel 2
141  if (rocIdInDetUnit < 8) {
142  slopeRow = 1;
143  slopeCol = -1;
144  rowOffset = 0;
145  colOffset = (8 - rocIdInDetUnit) * LocalPixel::numColsInRoc - 1;
146  } else {
147  slopeRow = -1;
148  slopeCol = 1;
149  rowOffset = 2 * LocalPixel::numRowsInRoc - 1;
150  colOffset = (rocIdInDetUnit - 8) * LocalPixel::numColsInRoc;
151  }
152 
153  } // side
154 
155  } // bpix/fpix
156 
157  theRowConversion = LinearConversion(rowOffset, slopeRow);
158  theCollumnConversion = LinearConversion(colOffset, slopeCol);
159 }
static const int numColsInRoc
Definition: LocalPixel.h:10
static const int numRowsInRoc
Definition: LocalPixel.h:9
sipixelobjects::LinearConversion theRowConversion
sipixelobjects::LinearConversion theCollumnConversion

Member Function Documentation

◆ collumn()

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

Definition at line 26 of file FrameConversion.h.

References theCollumnConversion.

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

26 { return theCollumnConversion; }
sipixelobjects::LinearConversion theCollumnConversion

◆ row()

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

Definition at line 25 of file FrameConversion.h.

References theRowConversion.

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

25 { return theRowConversion; }
sipixelobjects::LinearConversion theRowConversion

Member Data Documentation

◆ theCollumnConversion

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

Definition at line 30 of file FrameConversion.h.

Referenced by collumn().

◆ theRowConversion

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

Definition at line 29 of file FrameConversion.h.

Referenced by row().