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 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 235 of file FrameConversion.cc.

References phase1PixelTopology::numColsInRoc, phase1PixelTopology::numRowsInRoc, PixelEndcapName::pannelName(), and PixelEndcapName::plaquetteName().

236 {
237  int slopeRow =0;
238  int slopeCol = 0;
239  int rowOffset = 0;
240  int colOffset = 0;
241 
242  if (name.pannelName()==1) {
243  if (name.plaquetteName()==1) {
244  slopeRow = 1;
245  slopeCol = -1;
246  rowOffset = 0;
247  colOffset = (1+rocIdInDetUnit)*LocalPixel::numColsInRoc-1;
248  } else if (name.plaquetteName()==2) {
249  if (rocIdInDetUnit <3) {
250  slopeRow = -1;
251  slopeCol = 1;
252  rowOffset = 2*LocalPixel::numRowsInRoc-1;
253  colOffset = rocIdInDetUnit*LocalPixel::numColsInRoc;
254  } else {
255  slopeRow = 1;
256  slopeCol = -1;
257  rowOffset = 0;
258  colOffset = (6-rocIdInDetUnit)*LocalPixel::numColsInRoc-1;
259  }
260  } else if (name.plaquetteName()==3) {
261  if (rocIdInDetUnit <4) {
262  slopeRow = -1;
263  slopeCol = 1;
264  rowOffset = 2*LocalPixel::numRowsInRoc-1;
265  colOffset = rocIdInDetUnit*LocalPixel::numColsInRoc;
266  } else {
267  slopeRow = 1;
268  slopeCol = -1;
269  rowOffset = 0;
270  colOffset = (8-rocIdInDetUnit)*LocalPixel::numColsInRoc-1;
271  }
272  } else if (name.plaquetteName()==4) {
273  slopeRow = -1;
274  slopeCol = 1;
275  rowOffset = LocalPixel::numRowsInRoc-1;
276  colOffset = rocIdInDetUnit*LocalPixel::numColsInRoc;
277  }
278  } else {
279  if (name.plaquetteName()==1) {
280  if (rocIdInDetUnit <3) {
281  slopeRow = 1;
282  slopeCol = -1;
283  rowOffset = 0;
284  colOffset = (3-rocIdInDetUnit)*LocalPixel::numColsInRoc-1;
285  } else {
286  slopeRow = -1;
287  slopeCol = 1;
288  colOffset = (rocIdInDetUnit-3)*LocalPixel::numColsInRoc;
289  rowOffset = 2*LocalPixel::numRowsInRoc-1;
290  }
291  } else if (name.plaquetteName()==2) {
292  if (rocIdInDetUnit <4) {
293  slopeRow = 1;
294  slopeCol = -1;
295  rowOffset = 0;
296  colOffset = (4-rocIdInDetUnit)*LocalPixel::numColsInRoc-1;
297  } else {
298  slopeRow = -1;
299  slopeCol = 1;
300  colOffset = (rocIdInDetUnit-4)*LocalPixel::numColsInRoc;
301  rowOffset = 2*LocalPixel::numRowsInRoc-1;
302  }
303  } else if (name.plaquetteName()==3) {
304  if (rocIdInDetUnit <5) {
305  slopeRow = 1;
306  slopeCol = -1;
307  rowOffset = 0;
308  colOffset = (5-rocIdInDetUnit)*LocalPixel::numColsInRoc-1;
309  } else {
310  slopeRow = -1;
311  slopeCol = 1;
312  colOffset = (rocIdInDetUnit-5)*LocalPixel::numColsInRoc;
313  rowOffset = 2*LocalPixel::numRowsInRoc-1;
314  }
315  }
316  }
317 
318  theRowConversion = LinearConversion(rowOffset,slopeRow);
319  theCollumnConversion = LinearConversion(colOffset, slopeCol);
320 }
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 168 of file FrameConversion.cc.

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

169 {
170  int slopeRow =0;
171  int slopeCol = 0;
172  int rowOffset = 0;
173  int colOffset = 0;
174 
175  //
177  if (shell == PixelBarrelName::mO || shell == PixelBarrelName::mI) { // -Z side
178 
179  if (name.isHalfModule() ) {
180 
181  slopeRow = -1; // d.k. 23/10/08
182  slopeCol = 1; // d.k. 13/11/08
183  rowOffset = LocalPixel::numRowsInRoc-1;
184  colOffset = rocIdInDetUnit * LocalPixel::numColsInRoc; // d.k. 13/11/08
185 
186  } else {
187 
188  if (rocIdInDetUnit <8) {
189  slopeRow = 1;
190  slopeCol = -1;
191 
192  rowOffset = 0;
193  colOffset = (8-rocIdInDetUnit)*LocalPixel::numColsInRoc-1;
194 
195  } else {
196  slopeRow = -1;
197  slopeCol = 1;
198 
199  rowOffset = 2*LocalPixel::numRowsInRoc-1;
200  colOffset = (rocIdInDetUnit-8)*LocalPixel::numColsInRoc;
201 
202  }
203  }
204 
205 
206  } else { // +Z side
207 
208  if (name.isHalfModule() ) {
209  slopeRow = -1;
210  slopeCol = 1;
211  rowOffset = LocalPixel::numRowsInRoc-1;
212  colOffset = rocIdInDetUnit * LocalPixel::numColsInRoc;
213  } else { // Full modules
214  if (rocIdInDetUnit <8) {
215  slopeRow = -1;
216  slopeCol = 1;
217  rowOffset = 2*LocalPixel::numRowsInRoc-1;
218  colOffset = rocIdInDetUnit * LocalPixel::numColsInRoc;
219  } else {
220  slopeRow = 1;
221  slopeCol = -1;
222  rowOffset = 0;
223  colOffset = (16-rocIdInDetUnit)*LocalPixel::numColsInRoc-1;
224  }
225  } // if modules
226 
227 
228  } // end if +-Z
229 
230  theRowConversion = LinearConversion(rowOffset,slopeRow);
231  theCollumnConversion = LinearConversion(colOffset, slopeCol);
232 
233 }
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  layer,
int  rocIdInDetUnit 
)

Definition at line 11 of file FrameConversion.cc.

References phase1PixelTopology::numColsInRoc, and phase1PixelTopology::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 
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
FrameConversion::FrameConversion ( bool  bpix,
int  side,
int  rocIdInDetUnit 
)

Definition at line 89 of file FrameConversion.cc.

References phase1PixelTopology::numColsInRoc, and phase1PixelTopology::numRowsInRoc.

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

References theCollumnConversion.

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

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

Definition at line 26 of file FrameConversion.h.

References theRowConversion.

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

26 { return theRowConversion; }
sipixelobjects::LinearConversion theRowConversion

Member Data Documentation

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

Definition at line 31 of file FrameConversion.h.

Referenced by collumn().

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

Definition at line 30 of file FrameConversion.h.

Referenced by row().