CMS 3D CMS Logo

Public Member Functions | Private Attributes

CSCToAFEB Class Reference

#include <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_.

            {

  for(int i=1; i<=6; i++) for(int j=1;j<=8;j++) {
    if(i==1 || i==3 || i==5) {
      if(j<5) layer_wire_to_channel_[i-1][j-1] =j+4;
      if(j>4) layer_wire_to_channel_[i-1][j-1] =j+8;
    }
    if(i==2 || i==4 || i==6) {
      if(j<5) layer_wire_to_channel_[i-1][j-1] =j;
      if(j>4) layer_wire_to_channel_[i-1][j-1] =j+4;
    }
  }

  for(int i=1; i<=6; i++) for(int j=1;j<=8;j++) 
    layer_wire_to_board_[i-1][j-1]=(i-1)/2+1;
  
  for(int i=1; i<=4; i++) for(int j=1;j<=3;j++) {
    if(i==1) {
      if(j==1) station_ring_to_nmxafeb_[i-1][j-1]=18;
      if(j==2) station_ring_to_nmxafeb_[i-1][j-1]=24;
      if(j==3) station_ring_to_nmxafeb_[i-1][j-1]=12;
    }
    if(i==2) {
      if(j==1) station_ring_to_nmxafeb_[i-1][j-1]=42;
      if(j==2) station_ring_to_nmxafeb_[i-1][j-1]=24;
      if(j==3) station_ring_to_nmxafeb_[i-1][j-1]=0;
    }
    if(i==3) {
      if(j==1) station_ring_to_nmxafeb_[i-1][j-1]=36;
      if(j==2) station_ring_to_nmxafeb_[i-1][j-1]=24;
      if(j==3) station_ring_to_nmxafeb_[i-1][j-1]=0;
    }
    if(i==4) {
      if(j==1) station_ring_to_nmxafeb_[i-1][j-1]=36;
      if(j==2) station_ring_to_nmxafeb_[i-1][j-1]=24;
      if(j==3) station_ring_to_nmxafeb_[i-1][j-1]=0;
    }
  } 

  for(int i=1; i<=4; i++) for(int j=1;j<=3;j++) {
    if(i==1) {
      if(j==1) station_ring_to_nmxwire_[i-1][j-1]=48;
      if(j==2) station_ring_to_nmxwire_[i-1][j-1]=64;
      if(j==3) station_ring_to_nmxwire_[i-1][j-1]=32;
    }
    if(i==2) {
      if(j==1) station_ring_to_nmxwire_[i-1][j-1]=112;
      if(j==2) station_ring_to_nmxwire_[i-1][j-1]=64;
      if(j==3) station_ring_to_nmxwire_[i-1][j-1]=0;
    }
    if(i==3) {
      if(j==1) station_ring_to_nmxwire_[i-1][j-1]=96;
      if(j==2) station_ring_to_nmxwire_[i-1][j-1]=64;
      if(j==3) station_ring_to_nmxwire_[i-1][j-1]=0;
    }
    if(i==4) {
      if(j==1) station_ring_to_nmxwire_[i-1][j-1]=96;
      if(j==2) station_ring_to_nmxwire_[i-1][j-1]=64;
      if(j==3) station_ring_to_nmxwire_[i-1][j-1]=0;
    }
  } 


  /*
  layer_wire_to_channel_[6][8] =     {{ 5,6,7,8,13,14,15,16 },
                                      { 1,2,3,4, 9,10,11,12 },
                                      { 5,6,7,8,13,14,15,16 },
                                      { 1,2,3,4, 9,10,11,12 },
                                      { 5,6,7,8,13,14,15,16 },
                                      { 1,2,3,4, 9,10,11,12 }};
  gives AFEB channel number for given layer and wire numbers.

  layer_wire_to_board_[6][8]   =     {{ 1,1,1,1,1,1,1,1 },
                                      { 1,1,1,1,1,1,1,1 },
                                      { 2,2,2,2,2,2,2,2 },
                                      { 2,2,2,2,2,2,2,2 },
                                      { 3,3,3,3,3,3,3,3 },
                                      { 3,3,3,3,3,3,3,3 }};
  gives position of AFEB in column for given layer and wire numbers.

  station_ring_to_nmxafeb_[4][3]=    {{18?,24,12},
                                      {42, 24,0 },
                                      {36, 24,0 ],
                                      {36, 24,0 }}; 
  gives max. # of AFEBs in CSC of different types for given station and ring.

  station_ring_to_nmxwire_[4][3]=    {{48?,64,32},
                                      {112,64,0 },
                                      {96, 64,0 ],
                                      {96, 64,0 }};
  gives max. # of wiregroups in one layer of CSC of different types
  for given station and ring.
  */
  }

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(), and CSCAFEBThrAnalysis::done().

                                                         {  
    int wire=wiregroup-8*((wiregroup-1)/8);
    int channel=layer_wire_to_channel_[layer - 1][wire - 1];
    return channel;
  }
int CSCToAFEB::getAfebPos ( int  layer,
int  wiregroup 
) const

return AFEB position number

Definition at line 20 of file CSCToAFEB.cc.

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

                                                          {
    int col=(wiregroup-1)/8+1;
    int wire=wiregroup-8*((wiregroup-1)/8);
    int afeb=(col-1)*3+layer_wire_to_board_[layer - 1][wire - 1];
    return afeb;  
  }
int CSCToAFEB::getLayer ( int  afeb,
int  channel 
) const

return layer number

Definition at line 27 of file CSCToAFEB.cc.

                                                     {
    int col=(afeb-1)/3+1;
    int pos_in_col=afeb-(col-1)*3; 
    int layer=pos_in_col*2-1;
    if(channel < 5 || (channel >8 && channel < 13)) layer++;
    return layer;
  }
int CSCToAFEB::getMaxAfeb ( int  station,
int  ring 
) const

return max. number of AFEBs

Definition at line 45 of file CSCToAFEB.cc.

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 CSCAFEBThrAnalysis::analyze(), and CSCAFEBConnectAnalysis::analyze().

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

return wiregroup number

Definition at line 35 of file CSCToAFEB.cc.

                                                         {
    int col=(afeb-1)/3+1;
    int wire=(col-1)*8+1;
    if(channel<5)               wire=wire+(channel-1);
    if(channel>4 && channel<9)  wire=wire+(channel-5);
    if(channel>8 && channel<13) wire=wire+(channel-5);
    if(channel>12)              wire=wire+(channel-9);             
    return wire;
  }
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().

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

Definition at line 14 of file CSCToAFEB.h.

Referenced by CSCToAFEB().

Definition at line 16 of file CSCToAFEB.h.

Referenced by CSCToAFEB().

Definition at line 17 of file CSCToAFEB.h.

Referenced by CSCToAFEB().