CMS 3D CMS Logo

CSCSectorReceiverMiniLUT Class Reference

Author:
Brett Jackson
More...

#include <L1Trigger/CSCTrackFinder/interface/CSCSectorReceiverMiniLUT.h>

List of all members.

Static Public Member Functions

static global_eta_data calcGlobalEtaMEMini (unsigned short endcap, unsigned short sector, unsigned short station, unsigned short subsector, unsigned theadd)
static global_phi_data calcGlobalPhiMBMini (unsigned short endcap, unsigned short sector, unsigned short subsector, unsigned theadd)
static global_phi_data calcGlobalPhiMEMini (unsigned short endcap, unsigned short sector, unsigned short station, unsigned short subsector, unsigned theadd)
static lclphidat calcLocalPhiMini (unsigned theadd)

Static Private Attributes

static const unsigned short int gbl_eta_bounds [2][6][4][2][4][9][2]
static const float gbl_eta_params [2][6][4][2][4][9][3]
static const float gbl_phi_mb_params [2][6][2][9][2]
static const float gbl_phi_me_params [2][6][4][2][9][2]
static const float lcl_phi_param0 [1<< 4]
static const float lcl_phi_param1 = 6.4


Detailed Description

Author:
Brett Jackson

Provides a new way of defining the Lookup tables used by the core. Defines the lookup tables as parameterized functions in order to save on memory usage when compared to the current standard definitions of LUTs

Definition at line 15 of file CSCSectorReceiverMiniLUT.h.


Member Function Documentation

global_eta_data CSCSectorReceiverMiniLUT::calcGlobalEtaMEMini ( unsigned short  endcap,
unsigned short  sector,
unsigned short  station,
unsigned short  subsector,
unsigned  theadd 
) [static]

Definition at line 49 of file CSCSectorReceiverMiniLUT.cc.

References data, gbl_eta_bounds, gbl_eta_params, funct::log(), and CSCConstants::MAX_NUM_WIRES.

Referenced by CSCSectorReceiverLUT::globalEtaME().

00054 {
00055   if(endcap < 1 || endcap > 2)
00056     edm::LogWarning("CSCSectorReceiverMiniLUT")
00057       << "+++ Value of endcap, " << endcap
00058       << ", is out of bounds, [1, 2] +++\n";
00059   if(sector < 1 || sector > 6)
00060     edm::LogWarning("CSCSectorReceiverMiniLUT")
00061       << "+++ Value of sector, " << sector
00062       << ", is out of bounds, [1, 6] +++\n";
00063   if(station < 1 || station > 4)
00064     edm::LogWarning("CSCSectorReceiverMiniLUT")
00065       << "+++ Value of station, " << station
00066       << ", is out of bounds, [1, 4] +++\n";
00067   
00068   gbletadat data(0);
00069   
00070   unsigned short int cscid  = ((theadd >> 15) & 0xf);
00071   unsigned short int lclPhi = ((theadd >> 6)  & 0x3);
00072   unsigned short int WG     = ((theadd >> 8)  & 0x7f);
00073   
00074   int eta_temp, eta_min, eta_max;
00075   
00076   if((cscid > 0) && (cscid <= 9) && (WG < CSCConstants::MAX_NUM_WIRES))
00077     {
00078       if(station == 1)
00079         {
00080           eta_temp = (gbl_eta_params[endcap-1][sector-1][station-1][subsector-1][lclPhi][cscid-1][0] + 
00081                       gbl_eta_params[endcap-1][sector-1][station-1][subsector-1][lclPhi][cscid-1][1] *
00082                       log(gbl_eta_params[endcap-1][sector-1][station-1][subsector-1][lclPhi][cscid-1][2] + WG));
00083           eta_min = gbl_eta_bounds[endcap-1][sector-1][station-1][subsector-1][lclPhi][cscid-1][0];
00084           eta_max = gbl_eta_bounds[endcap-1][sector-1][station-1][subsector-1][lclPhi][cscid-1][1];
00085         }
00086       else
00087         {
00088           eta_temp = (gbl_eta_params[endcap-1][sector-1][station-1][0][lclPhi][cscid-1][0] + 
00089                       gbl_eta_params[endcap-1][sector-1][station-1][0][lclPhi][cscid-1][1] *
00090                       log(gbl_eta_params[endcap-1][sector-1][station-1][0][lclPhi][cscid-1][2] + WG));
00091           eta_min = gbl_eta_bounds[endcap-1][sector-1][station-1][0][lclPhi][cscid-1][0];
00092           eta_max = gbl_eta_bounds[endcap-1][sector-1][station-1][0][lclPhi][cscid-1][1];
00093         }
00094     }
00095   else
00096     {
00097       edm::LogWarning("CSCSectorReceiverMiniLUT")
00098         << "+++ Value of cscid, " << cscid
00099         << ", is out of bounds, [1, 9] -- or --"
00100         << " Value of wire group, " << WG 
00101         << ", exceeds max allowed, " << CSCConstants::MAX_NUM_WIRES << " +++\n";
00102     }
00103   
00104   // protect from negative numbers.  If the value of eta_temp is <0, set global eta to the minimum value
00105   if((eta_temp >= eta_min) &&
00106      (eta_temp <= eta_max))
00107     data.global_eta = eta_temp;
00108   else if(eta_temp < eta_min)
00109     data.global_eta = eta_min;
00110   else
00111     data.global_eta = eta_max;
00112   
00113   data.global_bend = 0;
00114   
00115   return data;
00116 }

global_phi_data CSCSectorReceiverMiniLUT::calcGlobalPhiMBMini ( unsigned short  endcap,
unsigned short  sector,
unsigned short  subsector,
unsigned  theadd 
) [static]

Definition at line 172 of file CSCSectorReceiverMiniLUT.cc.

References data, gbl_phi_mb_params, CSCBitWidths::kGlobalPhiDataBitWidth, and CSCBitWidths::kLocalPhiDataBitWidth.

Referenced by CSCSectorReceiverLUT::globalPhiMB().

00176 {
00177   if(endcap < 1 || endcap > 2)
00178     edm::LogWarning("CSCSectorReceiverMiniLUT")
00179       << "+++ Value of endcap, " << endcap
00180       << ", is out of bounds, [1, 2] +++\n";
00181   if(sector < 1 || sector > 6)
00182     edm::LogWarning("CSCSectorReceiverMiniLUT")
00183       << "+++ Value of sector, " << sector
00184       << ", is out of bounds, [1, 6] +++\n";
00185   
00186   gblphidat data(0);
00187   
00188   unsigned short int maxPhiL = 1<<CSCBitWidths::kLocalPhiDataBitWidth;
00189   unsigned short int maxPhiG = 1<<CSCBitWidths::kGlobalPhiDataBitWidth;
00190   unsigned short int cscid  = ((theadd >> 15)&0xf);
00191   unsigned short int lclPhi = (theadd & 0x3ff);
00192   
00193   if((cscid <= 3) || (cscid >= 7)) 
00194     maxPhiL = maxPhiL*(64./80); // currently a hack that is in place to handle the different number of strips in ME1/1 and ME1/3
00195   
00196   if((cscid > 0) && (cscid <= 9))
00197     {
00198       if(lclPhi < maxPhiL)
00199         data.global_phi = (gbl_phi_mb_params[endcap-1][sector-1][subsector-1][cscid-1][0] + 
00200                            gbl_phi_mb_params[endcap-1][sector-1][subsector-1][cscid-1][1]*lclPhi);
00201       else
00202         data.global_phi = (gbl_phi_mb_params[endcap-1][sector-1][subsector-1][cscid-1][0] + 
00203                            gbl_phi_mb_params[endcap-1][sector-1][subsector-1][cscid-1][1]*(maxPhiL-1));
00204     }
00205   else
00206     edm::LogWarning("CSCSectorReceiverMiniLUT")
00207       << "+++ Value of cscid, " << cscid
00208       << ", is out of bounds, [1, 9] +++\n";
00209   
00210   if(data.global_phi >= maxPhiG)
00211     edm::LogWarning("CSCSectorReceiverMiniLUT")
00212       << "+++ Value of global_phi, " << data.global_phi
00213       << ", exceeds max allowed, " << maxPhiG-1 << " +++\n";
00214   
00215   if(data.global_phi >= maxPhiG)
00216     edm::LogWarning("CSCSectorReceiverMiniLUT")
00217       << "+++ Value of global_phi, " << data.global_phi
00218       << ", exceeds max allowed, " << maxPhiG-1 << " +++\n";
00219   
00220   return data;
00221 }

global_phi_data CSCSectorReceiverMiniLUT::calcGlobalPhiMEMini ( unsigned short  endcap,
unsigned short  sector,
unsigned short  station,
unsigned short  subsector,
unsigned  theadd 
) [static]

Definition at line 118 of file CSCSectorReceiverMiniLUT.cc.

References data, gbl_phi_me_params, CSCBitWidths::kGlobalPhiDataBitWidth, and CSCBitWidths::kLocalPhiDataBitWidth.

Referenced by CSCSectorReceiverLUT::globalPhiME().

00123 {
00124   if(endcap < 1 || endcap > 2)
00125     edm::LogWarning("CSCSectorReceiverMiniLUT")
00126       << "+++ Value of endcap, " << endcap
00127       << ", is out of bounds, [1, 2] +++\n";
00128   if(sector < 1 || sector > 6)
00129     edm::LogWarning("CSCSectorReceiverMiniLUT")
00130       << "+++ Value of sector, " << sector
00131       << ", is out of bounds, [1, 6] +++\n";
00132   if(station < 1 || station > 4)
00133     edm::LogWarning("CSCSectorReceiverMiniLUT")
00134       << "+++ Value of station, " << station
00135       << ", is out of bounds, [1, 4] +++\n";
00136   
00137   gblphidat data(0);
00138   
00139   unsigned short int maxPhiL = 1<<CSCBitWidths::kLocalPhiDataBitWidth;
00140   unsigned short int maxPhiG = 1<<CSCBitWidths::kGlobalPhiDataBitWidth;
00141   unsigned short int cscid  = ((theadd >> 15)&0xf);
00142   unsigned short int lclPhi = (theadd & 0x3ff);
00143 
00144   if(station == 1 && ((cscid <= 3) || (cscid >= 7))) 
00145     maxPhiL = maxPhiL*(64./80); // currently a hack that is in place to handle the different number of strips in ME1/1 and ME1/3
00146   
00147   if((cscid > 0) && (cscid <= 9))
00148     {
00149       if((station == 1) && (lclPhi < maxPhiL))
00150         data.global_phi = (gbl_phi_me_params[endcap-1][sector-1][station-1][subsector-1][cscid-1][0] + 
00151                            gbl_phi_me_params[endcap-1][sector-1][station-1][subsector-1][cscid-1][1]*lclPhi);
00152       else if((station == 1) && (lclPhi >= maxPhiL))
00153         data.global_phi = (gbl_phi_me_params[endcap-1][sector-1][station-1][subsector-1][cscid-1][0] + 
00154                            gbl_phi_me_params[endcap-1][sector-1][station-1][subsector-1][cscid-1][1]*(maxPhiL-1));
00155       else
00156         data.global_phi = (gbl_phi_me_params[endcap-1][sector-1][station-1][0][cscid-1][0] + 
00157                            gbl_phi_me_params[endcap-1][sector-1][station-1][0][cscid-1][1]*lclPhi);
00158     }
00159   else
00160     edm::LogWarning("CSCSectorReceiverMiniLUT")
00161       << "+++ Value of cscid, " << cscid
00162       << ", is out of bounds, [1, 9] +++\n";
00163   
00164   if(data.global_phi >= maxPhiG)
00165     edm::LogWarning("CSCSectorReceiverMiniLUT")
00166       << "+++ Value of global_phi, " << data.global_phi
00167       << ", exceeds max allowed, " << maxPhiG-1 << " +++\n";
00168   
00169   return data;
00170 }

lclphidat CSCSectorReceiverMiniLUT::calcLocalPhiMini ( unsigned  theadd  )  [static]

Definition at line 21 of file CSCSectorReceiverMiniLUT.cc.

References data, CSCBitWidths::kLocalPhiDataBitWidth, lcl_phi_param0, lcl_phi_param1, CSCConstants::MAX_NUM_STRIPS, CSCConstants::NUM_CLCT_PATTERNS, and strip().

Referenced by CSCSectorReceiverLUT::localPhi().

00022 {
00023   // This method is ripped from CSCSectorReceverLUT.cc with minor changes
00024   
00025   lclphidat data;
00026   
00027   static int maxPhiL = 1<<CSCBitWidths::kLocalPhiDataBitWidth;
00028   unsigned short int pattern = ((theadd >> 8) & 0xf);
00029   unsigned short int strip   = (theadd & 0xff);
00030   
00031   if(strip < 2*CSCConstants::MAX_NUM_STRIPS && pattern < CSCConstants::NUM_CLCT_PATTERNS)
00032     data.phi_local = static_cast<unsigned>((lcl_phi_param0[pattern] + strip)*lcl_phi_param1);
00033   else
00034     edm::LogWarning("CSCSectorReceiverMiniLUT")
00035       << "+++ Value of strip, " << strip
00036       << ", exceeds max allowed, " << 2*CSCConstants::MAX_NUM_STRIPS-1
00037       << " +++\n";
00038   
00039   if(data.phi_local >= maxPhiL)
00040     edm::LogWarning("CSCSectorReceiverMiniLUT")
00041       << "+++ Value of phi_local, " << data.phi_local
00042       << ", exceeds max allowed, " << CSCConstants::NUM_CLCT_PATTERNS-1 << " +++\n";
00043   
00044   data.phi_bend_local = 0;
00045     
00046   return data;
00047 }


Member Data Documentation

const unsigned short int CSCSectorReceiverMiniLUT::gbl_eta_bounds [static, private]

Definition at line 28 of file CSCSectorReceiverMiniLUT.h.

Referenced by calcGlobalEtaMEMini().

const float CSCSectorReceiverMiniLUT::gbl_eta_params [static, private]

Definition at line 27 of file CSCSectorReceiverMiniLUT.h.

Referenced by calcGlobalEtaMEMini().

const float CSCSectorReceiverMiniLUT::gbl_phi_mb_params [static, private]

Definition at line 32 of file CSCSectorReceiverMiniLUT.h.

Referenced by calcGlobalPhiMBMini().

const float CSCSectorReceiverMiniLUT::gbl_phi_me_params [static, private]

Definition at line 30 of file CSCSectorReceiverMiniLUT.h.

Referenced by calcGlobalPhiMEMini().

const float CSCSectorReceiverMiniLUT::lcl_phi_param0 [static, private]

Initial value:

 
{
  0.50, 0.50, -0.10, 1.10, -0.14, 1.14, 0.27, 0.73, 0.29, 0.71, 0.50, 0, 0, 0, 0, 0
}

Definition at line 24 of file CSCSectorReceiverMiniLUT.h.

Referenced by calcLocalPhiMini().

const float CSCSectorReceiverMiniLUT::lcl_phi_param1 = 6.4 [static, private]

Definition at line 25 of file CSCSectorReceiverMiniLUT.h.

Referenced by calcLocalPhiMini().


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