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::CSCToAFEB ( )
inline

Constructor.

Definition at line 21 of file CSCToAFEB.h.

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

References mps_fire::i, dqmiolumiharvest::j, layer_wire_to_board_, layer_wire_to_channel_, station_ring_to_nmxafeb_, and station_ring_to_nmxwire_.

Member Function Documentation

◆ getAfebCh()

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

return AFEB channel number

Definition at line 14 of file CSCToAFEB.cc.

14  {
15  int wire = wiregroup - 8 * ((wiregroup - 1) / 8);
16  int channel = layer_wire_to_channel_[layer - 1][wire - 1];
17  return channel;
18 }

References phase1PixelTopology::layer.

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

◆ getAfebPos()

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

return AFEB position number

Definition at line 20 of file CSCToAFEB.cc.

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 }

References cuy::col, and phase1PixelTopology::layer.

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

◆ getLayer()

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

return layer number

Definition at line 27 of file CSCToAFEB.cc.

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))
32  layer++;
33  return layer;
34 }

References cuy::col, and phase1PixelTopology::layer.

◆ getMaxAfeb()

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

return max. number of AFEBs

Definition at line 50 of file CSCToAFEB.cc.

50 { return station_ring_to_nmxafeb_[station - 1][ring - 1]; }

References relativeConstraints::ring, and relativeConstraints::station.

◆ getMaxWire()

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 53 of file CSCToAFEB.cc.

53 { return station_ring_to_nmxwire_[station - 1][ring - 1]; }

References relativeConstraints::ring, and relativeConstraints::station.

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

◆ getWireGroup()

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

return wiregroup number

Definition at line 36 of file CSCToAFEB.cc.

36  {
37  int col = (afeb - 1) / 3 + 1;
38  int wire = (col - 1) * 8 + 1;
39  if (channel < 5)
40  wire = wire + (channel - 1);
41  if (channel > 4 && channel < 9)
42  wire = wire + (channel - 5);
43  if (channel > 8 && channel < 13)
44  wire = wire + (channel - 5);
45  if (channel > 12)
46  wire = wire + (channel - 9);
47  return wire;
48 }

References cuy::col.

◆ print()

void CSCToAFEB::print ( ) const

Print content.

Member Data Documentation

◆ layer_wire_to_board_

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

Definition at line 14 of file CSCToAFEB.h.

Referenced by CSCToAFEB().

◆ layer_wire_to_channel_

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

Definition at line 13 of file CSCToAFEB.h.

Referenced by CSCToAFEB().

◆ station_ring_to_nmxafeb_

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

Definition at line 15 of file CSCToAFEB.h.

Referenced by CSCToAFEB().

◆ station_ring_to_nmxwire_

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

Definition at line 16 of file CSCToAFEB.h.

Referenced by CSCToAFEB().

mps_fire.i
i
Definition: mps_fire.py:428
relativeConstraints.station
station
Definition: relativeConstraints.py:67
CSCToAFEB::layer_wire_to_channel_
int layer_wire_to_channel_[6][8]
Definition: CSCToAFEB.h:13
cuy.col
col
Definition: cuy.py:1009
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
CSCToAFEB::layer_wire_to_board_
int layer_wire_to_board_[6][8]
Definition: CSCToAFEB.h:14
CSCToAFEB::station_ring_to_nmxwire_
int station_ring_to_nmxwire_[4][3]
Definition: CSCToAFEB.h:16
CSCToAFEB::station_ring_to_nmxafeb_
int station_ring_to_nmxafeb_[4][3]
Definition: CSCToAFEB.h:15
relativeConstraints.ring
ring
Definition: relativeConstraints.py:68
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66