CMS 3D CMS Logo

CSCToAFEB Class Reference

CSC layer, wire vs AFEB channel map. More...

#include <OnlineDB/CSCCondDB/interface/CSCToAFEB.h>

List of all members.

Public Member Functions

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

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 i, j, layer_wire_to_board_, layer_wire_to_channel_, station_ring_to_nmxafeb_, and station_ring_to_nmxwire_.

00022             {
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   }


Member Function Documentation

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

return AFEB channel number

Definition at line 14 of file CSCToAFEB.cc.

References layer_wire_to_channel_.

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

00014                                                          {  
00015     int wire=wiregroup-8*((wiregroup-1)/8);
00016     int channel=layer_wire_to_channel_[layer - 1][wire - 1];
00017     return channel;
00018   }

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

return AFEB position number

Definition at line 20 of file CSCToAFEB.cc.

References parsecf::pyparsing::col(), and layer_wire_to_board_.

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

00020                                                           {
00021     int col=(wiregroup-1)/8+1;
00022     int wire=wiregroup-8*((wiregroup-1)/8);
00023     int afeb=(col-1)*3+layer_wire_to_board_[layer - 1][wire - 1];
00024     return afeb;  
00025   }

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

return layer number

Definition at line 27 of file CSCToAFEB.cc.

References parsecf::pyparsing::col().

00027                                                      {
00028     int col=(afeb-1)/3+1;
00029     int pos_in_col=afeb-(col-1)*3; 
00030     int layer=pos_in_col*2-1;
00031     if(channel < 5 || (channel >8 && channel < 13)) layer++;
00032     return layer;
00033   }

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

return max. number of AFEBs

Definition at line 45 of file CSCToAFEB.cc.

References station_ring_to_nmxafeb_.

00045                                                        {
00046     return station_ring_to_nmxafeb_[station-1][ring-1];
00047   }

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.

References station_ring_to_nmxwire_.

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

00050                                                        {
00051     return station_ring_to_nmxwire_[station-1][ring-1];
00052   }

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

return wiregroup number

Definition at line 35 of file CSCToAFEB.cc.

References parsecf::pyparsing::col().

00035                                                          {
00036     int col=(afeb-1)/3+1;
00037     int wire=(col-1)*8+1;
00038     if(channel<5)               wire=wire+(channel-1);
00039     if(channel>4 && channel<9)  wire=wire+(channel-5);
00040     if(channel>8 && channel<13) wire=wire+(channel-5);
00041     if(channel>12)              wire=wire+(channel-9);             
00042     return wire;
00043   }

void CSCToAFEB::print (  )  const

Print content.


Member Data Documentation

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

Definition at line 15 of file CSCToAFEB.h.

Referenced by CSCToAFEB(), and getAfebPos().

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

Definition at line 14 of file CSCToAFEB.h.

Referenced by CSCToAFEB(), and getAfebCh().

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

Definition at line 16 of file CSCToAFEB.h.

Referenced by CSCToAFEB(), and getMaxAfeb().

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

Definition at line 17 of file CSCToAFEB.h.

Referenced by CSCToAFEB(), and getMaxWire().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:17:31 2009 for CMSSW by  doxygen 1.5.4