CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
CSCToAFEB Class Reference

#include <CSCToAFEB.h>

Public Member Functions

 CSCToAFEB ()
 Constructor. More...
 
int getAfebCh (int layer, int wiregroup) const
 return AFEB channel number More...
 
int getAfebPos (int layer, int wiregroup) const
 return AFEB position number More...
 
int getLayer (int afeb, int channel) const
 return layer number More...
 
int getMaxAfeb (int station, int ring) const
 return max. number of AFEBs More...
 
int getMaxWire (int station, int ring) const
 return max. number of wiregroups per layer More...
 
int getWireGroup (int afeb, int channel) const
 return wiregroup number More...
 
void print () const
 Print content. More...
 

Private Attributes

int layer_wire_to_board_ [6][8]
 
int layer_wire_to_channel_ [6][8]
 
int station_ring_to_nmxafeb_ [4][3]
 
int station_ring_to_nmxwire_ [4][3]
 

Detailed Description

CSC layer, wire vs AFEB channel map.

Author
N. Terentiev, CMU

Definition at line 11 of file CSCToAFEB.h.

Constructor & Destructor Documentation

CSCToAFEB::CSCToAFEB ( )
inline

Constructor.

Definition at line 22 of file CSCToAFEB.h.

References getAfebCh(), getAfebPos(), getLayer(), getMaxAfeb(), getMaxWire(), getWireGroup(), mps_fire::i, print(), relativeConstraints::ring, and relativeConstraints::station.

22  {
23 
24  for(int i=1; i<=6; i++) for(int j=1;j<=8;j++) {
25  if(i==1 || i==3 || i==5) {
26  if(j<5) layer_wire_to_channel_[i-1][j-1] =j+4;
27  if(j>4) layer_wire_to_channel_[i-1][j-1] =j+8;
28  }
29  if(i==2 || i==4 || i==6) {
30  if(j<5) layer_wire_to_channel_[i-1][j-1] =j;
31  if(j>4) layer_wire_to_channel_[i-1][j-1] =j+4;
32  }
33  }
34 
35  for(int i=1; i<=6; i++) for(int j=1;j<=8;j++)
36  layer_wire_to_board_[i-1][j-1]=(i-1)/2+1;
37 
38  for(int i=1; i<=4; i++) for(int j=1;j<=3;j++) {
39  if(i==1) {
40  if(j==1) station_ring_to_nmxafeb_[i-1][j-1]=18;
41  if(j==2) station_ring_to_nmxafeb_[i-1][j-1]=24;
42  if(j==3) station_ring_to_nmxafeb_[i-1][j-1]=12;
43  }
44  if(i==2) {
45  if(j==1) station_ring_to_nmxafeb_[i-1][j-1]=42;
46  if(j==2) station_ring_to_nmxafeb_[i-1][j-1]=24;
47  if(j==3) station_ring_to_nmxafeb_[i-1][j-1]=0;
48  }
49  if(i==3) {
50  if(j==1) station_ring_to_nmxafeb_[i-1][j-1]=36;
51  if(j==2) station_ring_to_nmxafeb_[i-1][j-1]=24;
52  if(j==3) station_ring_to_nmxafeb_[i-1][j-1]=0;
53  }
54  if(i==4) {
55  if(j==1) station_ring_to_nmxafeb_[i-1][j-1]=36;
56  if(j==2) station_ring_to_nmxafeb_[i-1][j-1]=24;
57  if(j==3) station_ring_to_nmxafeb_[i-1][j-1]=0;
58  }
59  }
60 
61  for(int i=1; i<=4; i++) for(int j=1;j<=3;j++) {
62  if(i==1) {
63  if(j==1) station_ring_to_nmxwire_[i-1][j-1]=48;
64  if(j==2) station_ring_to_nmxwire_[i-1][j-1]=64;
65  if(j==3) station_ring_to_nmxwire_[i-1][j-1]=32;
66  }
67  if(i==2) {
68  if(j==1) station_ring_to_nmxwire_[i-1][j-1]=112;
69  if(j==2) station_ring_to_nmxwire_[i-1][j-1]=64;
70  if(j==3) station_ring_to_nmxwire_[i-1][j-1]=0;
71  }
72  if(i==3) {
73  if(j==1) station_ring_to_nmxwire_[i-1][j-1]=96;
74  if(j==2) station_ring_to_nmxwire_[i-1][j-1]=64;
75  if(j==3) station_ring_to_nmxwire_[i-1][j-1]=0;
76  }
77  if(i==4) {
78  if(j==1) station_ring_to_nmxwire_[i-1][j-1]=96;
79  if(j==2) station_ring_to_nmxwire_[i-1][j-1]=64;
80  if(j==3) station_ring_to_nmxwire_[i-1][j-1]=0;
81  }
82  }
83 
84 
85  /*
86  layer_wire_to_channel_[6][8] = {{ 5,6,7,8,13,14,15,16 },
87  { 1,2,3,4, 9,10,11,12 },
88  { 5,6,7,8,13,14,15,16 },
89  { 1,2,3,4, 9,10,11,12 },
90  { 5,6,7,8,13,14,15,16 },
91  { 1,2,3,4, 9,10,11,12 }};
92  gives AFEB channel number for given layer and wire numbers.
93 
94  layer_wire_to_board_[6][8] = {{ 1,1,1,1,1,1,1,1 },
95  { 1,1,1,1,1,1,1,1 },
96  { 2,2,2,2,2,2,2,2 },
97  { 2,2,2,2,2,2,2,2 },
98  { 3,3,3,3,3,3,3,3 },
99  { 3,3,3,3,3,3,3,3 }};
100  gives position of AFEB in column for given layer and wire numbers.
101 
102  station_ring_to_nmxafeb_[4][3]= {{18?,24,12},
103  {42, 24,0 },
104  {36, 24,0 ],
105  {36, 24,0 }};
106  gives max. # of AFEBs in CSC of different types for given station and ring.
107 
108  station_ring_to_nmxwire_[4][3]= {{48?,64,32},
109  {112,64,0 },
110  {96, 64,0 ],
111  {96, 64,0 }};
112  gives max. # of wiregroups in one layer of CSC of different types
113  for given station and ring.
114  */
115  }
int station_ring_to_nmxafeb_[4][3]
Definition: CSCToAFEB.h:16
int station_ring_to_nmxwire_[4][3]
Definition: CSCToAFEB.h:17
int layer_wire_to_channel_[6][8]
Definition: CSCToAFEB.h:14
int layer_wire_to_board_[6][8]
Definition: CSCToAFEB.h:15

Member Function Documentation

int CSCToAFEB::getAfebCh ( int  layer,
int  wiregroup 
) const

return AFEB channel number

Definition at line 14 of file CSCToAFEB.cc.

Referenced by CSCAFEBThrAnalysis::analyze(), CSCToAFEB(), and CSCAFEBThrAnalysis::done().

14  {
15  int wire=wiregroup-8*((wiregroup-1)/8);
16  int channel=layer_wire_to_channel_[layer - 1][wire - 1];
17  return channel;
18  }
int layer_wire_to_channel_[6][8]
Definition: CSCToAFEB.h:14
int CSCToAFEB::getAfebPos ( int  layer,
int  wiregroup 
) const

return AFEB position number

Definition at line 20 of file CSCToAFEB.cc.

References cuy::col.

Referenced by CSCAFEBThrAnalysis::analyze(), CSCToAFEB(), and CSCAFEBThrAnalysis::done().

20  {
21  int col=(wiregroup-1)/8+1;
22  int wire=wiregroup-8*((wiregroup-1)/8);
23  int afeb=(col-1)*3+layer_wire_to_board_[layer - 1][wire - 1];
24  return afeb;
25  }
col
Definition: cuy.py:1008
int layer_wire_to_board_[6][8]
Definition: CSCToAFEB.h:15
int CSCToAFEB::getLayer ( int  afeb,
int  channel 
) const

return layer number

Definition at line 27 of file CSCToAFEB.cc.

References cuy::col.

Referenced by CSCToAFEB().

27  {
28  int col=(afeb-1)/3+1;
29  int pos_in_col=afeb-(col-1)*3;
30  int layer=pos_in_col*2-1;
31  if(channel < 5 || (channel >8 && channel < 13)) layer++;
32  return layer;
33  }
col
Definition: cuy.py:1008
int CSCToAFEB::getMaxAfeb ( int  station,
int  ring 
) const

return max. number of AFEBs

Definition at line 45 of file CSCToAFEB.cc.

Referenced by CSCToAFEB().

int CSCToAFEB::getMaxWire ( int  station,
int  ring 
) const

return max. number of wiregroups per layer

return max. number of wiregroups per plane

Definition at line 50 of file CSCToAFEB.cc.

Referenced by CSCAFEBConnectAnalysis::analyze(), CSCAFEBThrAnalysis::analyze(), and CSCToAFEB().

int CSCToAFEB::getWireGroup ( int  afeb,
int  channel 
) const

return wiregroup number

Definition at line 35 of file CSCToAFEB.cc.

References cuy::col.

Referenced by CSCToAFEB().

35  {
36  int col=(afeb-1)/3+1;
37  int wire=(col-1)*8+1;
38  if(channel<5) wire=wire+(channel-1);
39  if(channel>4 && channel<9) wire=wire+(channel-5);
40  if(channel>8 && channel<13) wire=wire+(channel-5);
41  if(channel>12) wire=wire+(channel-9);
42  return wire;
43  }
col
Definition: cuy.py:1008
void CSCToAFEB::print ( ) const

Print content.

Referenced by CSCToAFEB().

Member Data Documentation

int CSCToAFEB::layer_wire_to_board_[6][8]
private

Definition at line 15 of file CSCToAFEB.h.

int CSCToAFEB::layer_wire_to_channel_[6][8]
private

Definition at line 14 of file CSCToAFEB.h.

int CSCToAFEB::station_ring_to_nmxafeb_[4][3]
private

Definition at line 16 of file CSCToAFEB.h.

int CSCToAFEB::station_ring_to_nmxwire_[4][3]
private

Definition at line 17 of file CSCToAFEB.h.