Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:31:44

0001 #ifndef CSCToAFEB_h
0002 #define CSCToAFEB_h
0003 
0004 /**\class  CSCToAFEB
0005  *
0006  * CSC layer, wire vs AFEB channel map. 
0007  *
0008  * \author N. Terentiev, CMU
0009  */
0010 
0011 class CSCToAFEB {
0012 private:
0013   int layer_wire_to_channel_[6][8];
0014   int layer_wire_to_board_[6][8];
0015   int station_ring_to_nmxafeb_[4][3];
0016   int station_ring_to_nmxwire_[4][3];
0017 
0018 public:
0019   /// Constructor
0020 
0021   CSCToAFEB() {
0022     for (int i = 1; i <= 6; i++)
0023       for (int j = 1; j <= 8; j++) {
0024         if (i == 1 || i == 3 || i == 5) {
0025           if (j < 5)
0026             layer_wire_to_channel_[i - 1][j - 1] = j + 4;
0027           if (j > 4)
0028             layer_wire_to_channel_[i - 1][j - 1] = j + 8;
0029         }
0030         if (i == 2 || i == 4 || i == 6) {
0031           if (j < 5)
0032             layer_wire_to_channel_[i - 1][j - 1] = j;
0033           if (j > 4)
0034             layer_wire_to_channel_[i - 1][j - 1] = j + 4;
0035         }
0036       }
0037 
0038     for (int i = 1; i <= 6; i++)
0039       for (int j = 1; j <= 8; j++)
0040         layer_wire_to_board_[i - 1][j - 1] = (i - 1) / 2 + 1;
0041 
0042     for (int i = 1; i <= 4; i++)
0043       for (int j = 1; j <= 3; j++) {
0044         if (i == 1) {
0045           if (j == 1)
0046             station_ring_to_nmxafeb_[i - 1][j - 1] = 18;
0047           if (j == 2)
0048             station_ring_to_nmxafeb_[i - 1][j - 1] = 24;
0049           if (j == 3)
0050             station_ring_to_nmxafeb_[i - 1][j - 1] = 12;
0051         }
0052         if (i == 2) {
0053           if (j == 1)
0054             station_ring_to_nmxafeb_[i - 1][j - 1] = 42;
0055           if (j == 2)
0056             station_ring_to_nmxafeb_[i - 1][j - 1] = 24;
0057           if (j == 3)
0058             station_ring_to_nmxafeb_[i - 1][j - 1] = 0;
0059         }
0060         if (i == 3) {
0061           if (j == 1)
0062             station_ring_to_nmxafeb_[i - 1][j - 1] = 36;
0063           if (j == 2)
0064             station_ring_to_nmxafeb_[i - 1][j - 1] = 24;
0065           if (j == 3)
0066             station_ring_to_nmxafeb_[i - 1][j - 1] = 0;
0067         }
0068         if (i == 4) {
0069           if (j == 1)
0070             station_ring_to_nmxafeb_[i - 1][j - 1] = 36;
0071           if (j == 2)
0072             station_ring_to_nmxafeb_[i - 1][j - 1] = 24;
0073           if (j == 3)
0074             station_ring_to_nmxafeb_[i - 1][j - 1] = 0;
0075         }
0076       }
0077 
0078     for (int i = 1; i <= 4; i++)
0079       for (int j = 1; j <= 3; j++) {
0080         if (i == 1) {
0081           if (j == 1)
0082             station_ring_to_nmxwire_[i - 1][j - 1] = 48;
0083           if (j == 2)
0084             station_ring_to_nmxwire_[i - 1][j - 1] = 64;
0085           if (j == 3)
0086             station_ring_to_nmxwire_[i - 1][j - 1] = 32;
0087         }
0088         if (i == 2) {
0089           if (j == 1)
0090             station_ring_to_nmxwire_[i - 1][j - 1] = 112;
0091           if (j == 2)
0092             station_ring_to_nmxwire_[i - 1][j - 1] = 64;
0093           if (j == 3)
0094             station_ring_to_nmxwire_[i - 1][j - 1] = 0;
0095         }
0096         if (i == 3) {
0097           if (j == 1)
0098             station_ring_to_nmxwire_[i - 1][j - 1] = 96;
0099           if (j == 2)
0100             station_ring_to_nmxwire_[i - 1][j - 1] = 64;
0101           if (j == 3)
0102             station_ring_to_nmxwire_[i - 1][j - 1] = 0;
0103         }
0104         if (i == 4) {
0105           if (j == 1)
0106             station_ring_to_nmxwire_[i - 1][j - 1] = 96;
0107           if (j == 2)
0108             station_ring_to_nmxwire_[i - 1][j - 1] = 64;
0109           if (j == 3)
0110             station_ring_to_nmxwire_[i - 1][j - 1] = 0;
0111         }
0112       }
0113 
0114     /*
0115   layer_wire_to_channel_[6][8] =     {{ 5,6,7,8,13,14,15,16 },
0116                                       { 1,2,3,4, 9,10,11,12 },
0117                                       { 5,6,7,8,13,14,15,16 },
0118                                       { 1,2,3,4, 9,10,11,12 },
0119                                       { 5,6,7,8,13,14,15,16 },
0120                                       { 1,2,3,4, 9,10,11,12 }};
0121   gives AFEB channel number for given layer and wire numbers.
0122 
0123   layer_wire_to_board_[6][8]   =     {{ 1,1,1,1,1,1,1,1 },
0124                                       { 1,1,1,1,1,1,1,1 },
0125                                       { 2,2,2,2,2,2,2,2 },
0126                                       { 2,2,2,2,2,2,2,2 },
0127                                       { 3,3,3,3,3,3,3,3 },
0128                                       { 3,3,3,3,3,3,3,3 }};
0129   gives position of AFEB in column for given layer and wire numbers.
0130 
0131   station_ring_to_nmxafeb_[4][3]=    {{18?,24,12},
0132                                       {42, 24,0 },
0133                                       {36, 24,0 ],
0134                                       {36, 24,0 }}; 
0135   gives max. # of AFEBs in CSC of different types for given station and ring.
0136 
0137   station_ring_to_nmxwire_[4][3]=    {{48?,64,32},
0138                                       {112,64,0 },
0139                                       {96, 64,0 ],
0140                                       {96, 64,0 }};
0141   gives max. # of wiregroups in one layer of CSC of different types
0142   for given station and ring.
0143   */
0144   }
0145 
0146   /// return AFEB channel number
0147   int getAfebCh(int layer, int wiregroup) const;
0148   /// return AFEB position number
0149   int getAfebPos(int layer, int wiregroup) const;
0150   /// return layer number
0151   int getLayer(int afeb, int channel) const;
0152   /// return wiregroup number
0153   int getWireGroup(int afeb, int channel) const;
0154   /// return max. number of AFEBs
0155   int getMaxAfeb(int station, int ring) const;
0156   /// return max. number of wiregroups per layer
0157   int getMaxWire(int station, int ring) const;
0158 
0159   /// Print content
0160   void print() const;
0161 };
0162 
0163 #endif