CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2/src/OnlineDB/CSCCondDB/interface/CSCToAFEB.h

Go to the documentation of this file.
00001 #ifndef CSCToAFEB_h
00002 #define CSCToAFEB_h
00003 
00011 class CSCToAFEB{
00012 
00013 private:
00014   int layer_wire_to_channel_[6][8];
00015   int layer_wire_to_board_[6][8];
00016   int station_ring_to_nmxafeb_[4][3];
00017   int station_ring_to_nmxwire_[4][3];
00018 public:
00019 
00021 
00022 CSCToAFEB (){
00023 
00024   for(int i=1; i<=6; i++) for(int j=1;j<=8;j++) {
00025     if(i==1 || i==3 || i==5) {
00026       if(j<5) layer_wire_to_channel_[i-1][j-1] =j+4;
00027       if(j>4) layer_wire_to_channel_[i-1][j-1] =j+8;
00028     }
00029     if(i==2 || i==4 || i==6) {
00030       if(j<5) layer_wire_to_channel_[i-1][j-1] =j;
00031       if(j>4) layer_wire_to_channel_[i-1][j-1] =j+4;
00032     }
00033   }
00034 
00035   for(int i=1; i<=6; i++) for(int j=1;j<=8;j++) 
00036     layer_wire_to_board_[i-1][j-1]=(i-1)/2+1;
00037   
00038   for(int i=1; i<=4; i++) for(int j=1;j<=3;j++) {
00039     if(i==1) {
00040       if(j==1) station_ring_to_nmxafeb_[i-1][j-1]=18;
00041       if(j==2) station_ring_to_nmxafeb_[i-1][j-1]=24;
00042       if(j==3) station_ring_to_nmxafeb_[i-1][j-1]=12;
00043     }
00044     if(i==2) {
00045       if(j==1) station_ring_to_nmxafeb_[i-1][j-1]=42;
00046       if(j==2) station_ring_to_nmxafeb_[i-1][j-1]=24;
00047       if(j==3) station_ring_to_nmxafeb_[i-1][j-1]=0;
00048     }
00049     if(i==3) {
00050       if(j==1) station_ring_to_nmxafeb_[i-1][j-1]=36;
00051       if(j==2) station_ring_to_nmxafeb_[i-1][j-1]=24;
00052       if(j==3) station_ring_to_nmxafeb_[i-1][j-1]=0;
00053     }
00054     if(i==4) {
00055       if(j==1) station_ring_to_nmxafeb_[i-1][j-1]=36;
00056       if(j==2) station_ring_to_nmxafeb_[i-1][j-1]=24;
00057       if(j==3) station_ring_to_nmxafeb_[i-1][j-1]=0;
00058     }
00059   } 
00060 
00061   for(int i=1; i<=4; i++) for(int j=1;j<=3;j++) {
00062     if(i==1) {
00063       if(j==1) station_ring_to_nmxwire_[i-1][j-1]=48;
00064       if(j==2) station_ring_to_nmxwire_[i-1][j-1]=64;
00065       if(j==3) station_ring_to_nmxwire_[i-1][j-1]=32;
00066     }
00067     if(i==2) {
00068       if(j==1) station_ring_to_nmxwire_[i-1][j-1]=112;
00069       if(j==2) station_ring_to_nmxwire_[i-1][j-1]=64;
00070       if(j==3) station_ring_to_nmxwire_[i-1][j-1]=0;
00071     }
00072     if(i==3) {
00073       if(j==1) station_ring_to_nmxwire_[i-1][j-1]=96;
00074       if(j==2) station_ring_to_nmxwire_[i-1][j-1]=64;
00075       if(j==3) station_ring_to_nmxwire_[i-1][j-1]=0;
00076     }
00077     if(i==4) {
00078       if(j==1) station_ring_to_nmxwire_[i-1][j-1]=96;
00079       if(j==2) station_ring_to_nmxwire_[i-1][j-1]=64;
00080       if(j==3) station_ring_to_nmxwire_[i-1][j-1]=0;
00081     }
00082   } 
00083 
00084 
00085   /*
00086   layer_wire_to_channel_[6][8] =     {{ 5,6,7,8,13,14,15,16 },
00087                                       { 1,2,3,4, 9,10,11,12 },
00088                                       { 5,6,7,8,13,14,15,16 },
00089                                       { 1,2,3,4, 9,10,11,12 },
00090                                       { 5,6,7,8,13,14,15,16 },
00091                                       { 1,2,3,4, 9,10,11,12 }};
00092   gives AFEB channel number for given layer and wire numbers.
00093 
00094   layer_wire_to_board_[6][8]   =     {{ 1,1,1,1,1,1,1,1 },
00095                                       { 1,1,1,1,1,1,1,1 },
00096                                       { 2,2,2,2,2,2,2,2 },
00097                                       { 2,2,2,2,2,2,2,2 },
00098                                       { 3,3,3,3,3,3,3,3 },
00099                                       { 3,3,3,3,3,3,3,3 }};
00100   gives position of AFEB in column for given layer and wire numbers.
00101 
00102   station_ring_to_nmxafeb_[4][3]=    {{18?,24,12},
00103                                       {42, 24,0 },
00104                                       {36, 24,0 ],
00105                                       {36, 24,0 }}; 
00106   gives max. # of AFEBs in CSC of different types for given station and ring.
00107 
00108   station_ring_to_nmxwire_[4][3]=    {{48?,64,32},
00109                                       {112,64,0 },
00110                                       {96, 64,0 ],
00111                                       {96, 64,0 }};
00112   gives max. # of wiregroups in one layer of CSC of different types
00113   for given station and ring.
00114   */
00115   }
00116 
00118   int getAfebCh(int layer, int wiregroup) const;
00120   int getAfebPos(int layer, int wiregroup) const; 
00122   int getLayer(int afeb, int channel) const;
00124   int getWireGroup(int afeb, int channel) const; 
00126   int getMaxAfeb(int station, int ring) const;
00128   int getMaxWire(int station, int ring) const;
00129  
00131   void print() const;
00132 
00133 };
00134 
00135 #endif