CMS 3D CMS Logo

CSCTFPtMethods Class Reference

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

List of all members.

Public Types

enum  { kMaxParameters = 4 }
enum  {
  kME1andME2 = 1, kME1andME3, kME2andME3, kME2andME4,
  kME3andME4, kME1andME2ovr, kME2andMB1, kME2andMB2
}
 Allowed station combinations for extrapolation units. More...

Public Member Functions

bool chargeValid (unsigned Pt, unsigned Quality, unsigned Eta, unsigned method) const
 The hybrid method may be changing soon to: 1st Calculate PT with Darin's method 2nd if BELOW a certain cut call Cathy's method 3rd if Cathy's < Darin's use Cathy's otherwise return Darin's A study needs to be performed to determine any gains from this procedure.
 CSCTFPtMethods (const L1MuTriggerPtScale *ptScale=0)
float Pt2Stn (int type, float eta, float dphi, int fr=-1) const
 2-station Pt measurement for types (see SP class for 2-stn types)
float Pt2StnChiSq (int type, float eta, int dphi, int fr) const
float Pt2StnHybrid (int type, float eta, int dphi, int fr) const
 Third is the hybrid method.
float Pt3Stn (int type, float eta, float dphi1, float dphi2, int fr=-1) const
 3-station Pt measurement for types (see SP class for 3-stn types)
float Pt3StnChiSq (int type, float eta, int dphi1, int dphi2, int fr) const
float Pt3StnHybrid (int type, float eta, int dphi1, int dphi2, int fr) const
float PtEff90 (float pt, float eta, int mode) const
 Legacy Pt90 calculation function.

Static Public Attributes

static const float AkHighEta_Fit1 [kME2andMB2][kMaxParameters]
static const float AkHighEta_Fit2 [kME2andMB2][kMaxParameters]
static const float AkLowEta_Fit1 [kME2andMB2][kMaxParameters]
 The three station pt measument only needs a one constant fit, but the dependence on eta is still there.
static const float AkLowEta_Fit2 [kME2andMB2][kMaxParameters]
 First is the parameterizations of Acosta/McDonald.
static const float BkHighEta_Fit2 [kME2andMB2][kMaxParameters]
static const float BkLowEta_Fit2 [kME2andMB2][kMaxParameters]
static const float dphifr0 [4][15][28]
static const float dphifr1 [4][15][28]
static const float etabins [16]
static const float FRCorrHighEta [kME2andMB2][2]
static const float FRCorrLowEta [kME2andMB2][2]
 Corrections for ME1 F/R bit.
static const float kGlobalScaleFactor = 1.36
static const float ptbins [29]
 Second are the parameterizations of Acosta/Yeh.
static const float sigmafr0 [4][15][28]
static const float sigmafr1 [4][15][28]

Private Attributes

const L1MuTriggerPtScaletrigger_scale


Detailed Description

Definition at line 8 of file CSCTFPtMethods.h.


Member Enumeration Documentation

anonymous enum

Enumerator:
kMaxParameters 

Definition at line 11 of file CSCTFPtMethods.h.

00011 {kMaxParameters = 4};  

anonymous enum

Allowed station combinations for extrapolation units.

Enumerator:
kME1andME2 
kME1andME3 
kME2andME3 
kME2andME4 
kME3andME4 
kME1andME2ovr 
kME2andMB1 
kME2andMB2 

Definition at line 13 of file CSCTFPtMethods.h.


Constructor & Destructor Documentation

CSCTFPtMethods::CSCTFPtMethods ( const L1MuTriggerPtScale ptScale = 0  ) 

Definition at line 130 of file CSCTFPtMethods.cc.

00131   : trigger_scale( ptScale )
00132 {
00133 }


Member Function Documentation

bool CSCTFPtMethods::chargeValid ( unsigned  Pt,
unsigned  Quality,
unsigned  Eta,
unsigned  method 
) const

The hybrid method may be changing soon to: 1st Calculate PT with Darin's method 2nd if BELOW a certain cut call Cathy's method 3rd if Cathy's < Darin's use Cathy's otherwise return Darin's A study needs to be performed to determine any gains from this procedure.

A method to calculate the charge valid bit Regions where this bit is were determined via simulation

Definition at line 1023 of file CSCTFPtMethods.cc.

References HLT_VtxMuL3::result.

01024 {
01025   bool result = false;
01026 
01027   switch(method)
01028     {
01029     case 1:
01030       break;
01031     case 2:
01032       break;
01033     case 3:
01034       if(quality != 1)
01035         {
01036           if(pT <= 19)
01037             {
01038               if(eta >=4 && eta <=9)
01039                 result = true;         
01040             }
01041           if(pT <= 18 && pT >= 10)
01042             {
01043               if(eta > 0 && eta < 4)
01044                 result = true;
01045             }
01046         }
01047     };  
01048   
01049   return result;
01050 }

float CSCTFPtMethods::Pt2Stn ( int  type,
float  eta,
float  dphi,
int  fr = -1 
) const

2-station Pt measurement for types (see SP class for 2-stn types)

DEA: kluge to get verilog and original model to agree

Definition at line 139 of file CSCTFPtMethods.cc.

References funct::A, AkHighEta_Fit2, AkLowEta_Fit2, BkHighEta_Fit2, BkLowEta_Fit2, FRCorrHighEta, FRCorrLowEta, L1MuScale::getLowEdge(), L1MuTriggerPtScale::getPtScale(), kGlobalScaleFactor, kME1andME2, kME2andMB2, funct::sqrt(), and trigger_scale.

Referenced by CSCTFPtLUT::calcPt(), Pt2StnChiSq(), Pt2StnHybrid(), and Pt3Stn().

00140 {
00141   float A = 0; 
00142   float B = 0;
00143   if (dphi == 0.0) dphi = 1.e-6;
00144   if (eta  < 0.0) eta  = static_cast<float>(fabs(static_cast<double>(eta)));
00145   if (dphi < 0.0) dphi = static_cast<float>(fabs(static_cast<double>(dphi)));
00147 #ifdef L1CSC_STANDALONE
00148   if (type == kME1andME2 && eta <= 1.25) fr = 1; 
00149 #else
00150   if (type == kME1andME2 && eta < 1.2) fr = 1; 
00151 #endif
00152   if (type >= kME1andME2 && 
00153       type <= kME2andMB2 && eta < 2.5) 
00154     {
00155       if (eta >= 0.0 && eta < 1.6)
00156         {
00157           A = AkLowEta_Fit2[type-1][0] + AkLowEta_Fit2[type-1][1]*eta 
00158             + AkLowEta_Fit2[type-1][2]*eta*eta + AkLowEta_Fit2[type-1][3]*eta*eta*eta;
00159           B = BkLowEta_Fit2[type-1][0] + BkLowEta_Fit2[type-1][1]*eta 
00160             + BkLowEta_Fit2[type-1][2]*eta*eta + BkLowEta_Fit2[type-1][3]*eta*eta*eta;
00161           if (fr >= 0 && fr <= 1) 
00162             {     
00163               A *= FRCorrLowEta[type-1][fr];
00164               B *= FRCorrLowEta[type-1][fr];
00165             } 
00166         }       
00167       
00168       if (eta >= 1.6 && eta < 2.5)
00169         {
00170           A = AkHighEta_Fit2[type-1][0] + AkHighEta_Fit2[type-1][1]*eta 
00171             + AkHighEta_Fit2[type-1][2]*eta*eta + AkHighEta_Fit2[type-1][3]*eta*eta*eta;
00172           B = BkHighEta_Fit2[type-1][0] + BkHighEta_Fit2[type-1][1]*eta 
00173             + BkHighEta_Fit2[type-1][2]*eta*eta + BkHighEta_Fit2[type-1][3]*eta*eta*eta;
00174         if (fr >= 0 && fr <= 1) 
00175           {
00176             A *= FRCorrHighEta[type-1][fr];
00177             B *= FRCorrHighEta[type-1][fr];
00178           } 
00179         }
00180       
00181       A *= kGlobalScaleFactor;
00182       B *= kGlobalScaleFactor;
00183       float Pt = (A + sqrt(A*A + 4.*dphi*B))/(2.*dphi);
00184 
00185       //      return (Pt>0.0) ? Pt : 0.0;
00186       return (Pt>trigger_scale->getPtScale()->getLowEdge(1)) ? Pt 
00187         : trigger_scale->getPtScale()->getLowEdge(1);
00188     }
00189     return 0.0;
00190 }

float CSCTFPtMethods::Pt2StnChiSq ( int  type,
float  eta,
int  dphi,
int  fr 
) const

Definition at line 618 of file CSCTFPtMethods.cc.

References diff, dphifr0, dphifr1, etabins, cmsRelvalreport::exit, i, j, k, min, Pt2Stn(), ptbins, ptmin, CSCTFConstants::SECTOR_RAD, sigmafr0, and sigmafr1.

Referenced by CSCTFPtLUT::calcPt(), and Pt2StnHybrid().

00619 {
00620 
00621   float diff, min, ptmin, ptmax;
00622   float mypt = 0.0;
00623 
00624   int dphicopy = dphi;
00625 
00626   if (type<0 || type>3) 
00627     {
00628 //      std::cout << "CSCTFPtMethods: illegal track type for Chi-square method" << std::endl;
00629       edm::LogError("CSCTFPtMethods::Pt2StnChiSq()")<<"Illegal track type for Chi-square method";
00630       return 0.;
00631     }
00632   
00633   // flip sign
00634   //dphi = -dphi;
00635   
00636   // force positive
00637   eta = fabs(eta);
00638   
00639   //determine which eta bin muon falls into
00640   int i = 0;
00641   for(i = 0; i < 15; i++) 
00642     {
00643       if (eta >= etabins[i] && eta < etabins[i+1]) break;
00644     }
00645   if ( i == 15 ) 
00646     {
00647 //      std::cout<<" CSCTFPtMethods: muon not within any eta range"<< std::endl;
00648       edm::LogWarning("CSCTFPtMethods::Pt2StnChiSq()")<<"Muon not within any eta range";
00649       if (eta<etabins[0]) 
00650         { 
00651           eta = etabins[0];
00652           i = 0;
00653         }
00654       else if (eta>=etabins[15]) 
00655         {
00656           eta = etabins[15];
00657           i = 15;
00658         }
00659       else
00660         exit(0);
00661     }
00662 
00663   bool bCallOldMethod = false;
00664   
00665   if (fr == 0) 
00666     {
00667       //advance past bins in array w/ default values
00668       //default is: dphifr0[x][y][z] = -1, sigmafr0[x][y][z] = 1
00669       int j = 0;  //start from 1st column, j=0
00670       while (dphifr0[type][i][j] == -1 && sigmafr0[type][i][j] == 1 && j != 28) j++;
00671       if ( j == 28 ) 
00672         {
00673 //        std::cout <<" CSCTFPtMethods: every entry in row is default"<< std::endl;
00674           edm::LogInfo("CSCTFPtMethods::Pt2StnChiSq()")<<"Every entry in row is default";
00675           //      exit(0); //normal termination
00676           bCallOldMethod = true;
00677         }
00678 
00679       if (!bCallOldMethod) 
00680         {
00681           //set min, ptmin, ptmax to first bin
00682           //in row that is not default
00683           min = fabs(dphi - dphifr0[type][i][j]) / sigmafr0[type][i][j];
00684           ptmin = ptbins[j];
00685           ptmax = ptbins[j+1];
00686           
00687           //loop through all pt bins.  assign pt of bin w/ least diff
00688           //do not include default bins in calculation
00689           for ( int k = j; k < 28; k++ ) 
00690             {
00691               if(dphifr0[type][i][k] != -1 || sigmafr0[type][i][k] != 1) 
00692                 {
00693                   diff = fabs(dphi - dphifr0[type][i][k]) / sigmafr0[type][i][k];
00694                   if (diff < min) 
00695                     {
00696                       min = diff;
00697                       ptmin = ptbins[k];
00698                       ptmax = ptbins[k+1];
00699                     }
00700                 }
00701             }
00702           mypt = (ptmin + ptmax)/2;
00703         }
00704     }
00705 
00706   if (fr == 1) 
00707     {
00708       //advance past bins in array w/ default values
00709       //default is: dphifr1[x][y][z] = -1, sigmafr1[x][y][z] = 1
00710       int j = 0;  //start from 1st column, j=0
00711       
00712       while (dphifr1[type][i][j] == -1 && sigmafr1[type][i][j] == 1 && j != 28) j++;
00713       
00714       if ( j == 28 ) 
00715         {
00716 //        std::cout <<" CSCTFPtMethods: every entry in row is default"<< std::endl;
00717           edm::LogInfo("CSCTFPtMethods::Pt2StnChiSq()")<<"Every entry in row is default";
00718           //      exit(0); //normal termination
00719           bCallOldMethod = true;
00720         }
00721 
00722     if (!bCallOldMethod) 
00723       {
00724         //set min, ptmin, ptmax to first bin
00725         //in row that is not default
00726         min = fabs(dphi - dphifr1[type][i][j]) / sigmafr1[type][i][j];
00727         ptmin = ptbins[j];
00728         ptmax = ptbins[j+1];
00729         
00730         //loop through all pt bins.  assign pt of bin w/ least diff
00731         //do not include default bins in calculation
00732         for ( int k = j; k < 28; k++ ) 
00733           {
00734             if(dphifr1[type][i][k] != -1 || sigmafr1[type][i][k] != 1) 
00735               {
00736                 diff = fabs(dphi - dphifr1[type][i][k]) / sigmafr1[type][i][k];
00737                 if (diff < min) 
00738                   {
00739                     min = diff;
00740                     ptmin = ptbins[k];
00741                     ptmax = ptbins[k+1];
00742                   }
00743               }
00744           }
00745         mypt = (ptmin + ptmax)/2;
00746       }
00747     }
00748 
00749   // hybrid approach:
00750   if (bCallOldMethod)
00751     {
00752       float dphiR = static_cast<float>(dphicopy) / static_cast<float>(1<<12) * CSCTFConstants::SECTOR_RAD;
00753       // must change type definition, just add one
00754       mypt =  Pt2Stn(type+1, eta, dphiR, fr);
00755     }
00756   
00757   return mypt;
00758 }

float CSCTFPtMethods::Pt2StnHybrid ( int  type,
float  eta,
int  dphi,
int  fr 
) const

Third is the hybrid method.

Definition at line 993 of file CSCTFPtMethods.cc.

References Pt2Stn(), Pt2StnChiSq(), and CSCTFConstants::SECTOR_RAD.

Referenced by CSCTFPtLUT::calcPt().

00994 {
00995   float mypt = 0.0;
00996 
00997   mypt = Pt2StnChiSq(type, eta, dphi, fr);
00998   if(mypt >= 8.0)
00999     {
01000       float dphiR = static_cast<float>(dphi) / static_cast<float>(1<<12) * CSCTFConstants::SECTOR_RAD;
01001       mypt = Pt2Stn(type+1, eta, dphiR, fr);
01002     }
01003 
01004   return mypt;
01005 }

float CSCTFPtMethods::Pt3Stn ( int  type,
float  eta,
float  dphi1,
float  dphi2,
int  fr = -1 
) const

3-station Pt measurement for types (see SP class for 3-stn types)

Definition at line 192 of file CSCTFPtMethods.cc.

References AkHighEta_Fit1, AkLowEta_Fit1, c1, c2, FRCorrHighEta, FRCorrLowEta, L1MuScale::getLowEdge(), L1MuTriggerPtScale::getPtScale(), kGlobalScaleFactor, kME1andME2, kME1andME3, kME2andME3, kME2andME4, kME3andME4, Pt2Stn(), r, funct::sqrt(), and trigger_scale.

Referenced by CSCTFPtLUT::calcPt(), Pt3StnChiSq(), and Pt3StnHybrid().

00193 {
00194     int ty1 = 0, ty2 =0;
00195 
00196     switch (type)
00197       {
00198       case 1 :
00199         ty1 = kME1andME2 -1; // subtype sets the right position for array A
00200         ty2 = kME2andME3 -1;
00201         break;
00202       case 2 :
00203         ty1 = kME1andME2 -1;
00204         ty2 = kME2andME4 -1;
00205         break;
00206       case 3 :
00207         ty1 = kME1andME3 -1;
00208         ty2 = kME3andME4 -1;
00209         break;
00210       case 4 :
00211         ty1 = kME2andME3 -1;
00212         ty2 = kME3andME4 -1;
00213         break;
00214       default:
00215         return 0.0;
00216       }
00217 
00218     // Switch to 2-Station measurement if dphi is too small
00219     // box cut around Pt of 10 GeV
00220     float Pt;
00221 //    if ( (fabs(static_cast<double>(dphi2))<0.004) &&
00222 //         (fabs(static_cast<double>(dphi1))<0.030)) {
00223     if ( fabs(static_cast<double>(dphi2))<0.004 ) 
00224       {
00225         Pt = Pt2Stn((ty1+1), eta, dphi1, fr);
00226       }
00227     else 
00228       {
00229         float c1=(-.2999 * (eta*eta*eta) + 2.030 * (eta*eta) - 4.235 * eta + 3.024) + 0.02;
00230         float c2=(-2.484 * (eta*eta*eta) + 14.43 * (eta*eta) - 27.66 * eta + 18.47)*.72;
00231         float r = 0.6; //correlation
00232         float A1 = 0; 
00233         float A2 = 0;
00234         
00235         if (dphi1 == 0.0) dphi1 = 1.e-6;
00236         if (dphi2 == 0.0) dphi2 = 1.e-6;    
00237         if (eta  < 0.0) eta  = static_cast<float>(fabs(static_cast<double>(eta)));
00238         if (eta >= 0.0 && eta < 1.6) 
00239           {
00240             A1 = AkLowEta_Fit1[ty1][0]         + AkLowEta_Fit1[ty1][1]*eta 
00241               + AkLowEta_Fit1[ty1][2]*eta*eta + AkLowEta_Fit1[ty1][3]*eta*eta*eta;
00242             A2 = AkLowEta_Fit1[ty2][0]         + AkLowEta_Fit1[ty2][1]*eta 
00243               + AkLowEta_Fit1[ty2][2]*eta*eta + AkLowEta_Fit1[ty2][3]*eta*eta*eta;
00244             if (fr >= 0 && fr <= 1) 
00245               {
00246                 A1 *= FRCorrLowEta[ty1][fr];
00247               }
00248           }
00249         
00250       if (eta >= 1.6 && eta < 2.5)
00251         {       
00252           A1 = AkHighEta_Fit1[ty1][0]         + AkHighEta_Fit1[ty1][1]*eta
00253             + AkHighEta_Fit1[ty1][2]*eta*eta + AkHighEta_Fit1[ty1][3]*eta*eta*eta;
00254           A2 = AkHighEta_Fit1[ty2][0]         + AkHighEta_Fit1[ty2][1]*eta
00255             + AkHighEta_Fit1[ty2][2]*eta*eta + AkHighEta_Fit1[ty2][3]*eta*eta*eta;
00256           if (fr >= 0 && fr <= 1) 
00257             {
00258               A1 *= FRCorrHighEta[ty1][fr];
00259             }
00260         }
00261       A1 *= kGlobalScaleFactor;
00262       A2 *= kGlobalScaleFactor;
00263       Pt = 1/((( -dphi1/c1/c1/A1+r*dphi2/c1/c2/A2+dphi1*r/c1/c2/A1-dphi2/c2/c2/A2)
00264                + sqrt( (dphi1/c1/c1/A1-r*dphi2/c1/c2/A2-dphi1*r/c1/A1/c2+dphi2/c2/c2/A2)
00265                        *(dphi1/c1/c1/A1-r*dphi2/c1/c2/A2-dphi1*r/c1/A1/c2+dphi2/c2/c2/A2)
00266                        + 8*(1-r*r)*(dphi1*dphi1/c1/c1/A1/A1-2*dphi1*dphi2*r/c1/A1/c2/A2
00267                                     +dphi2*dphi2/c2/c2/A2/A2)))/(4*(1-r*r)));
00268       
00269       } // end 2 or 3 station method
00270     //    if (Pt<0.0) Pt = 0.0;
00271     if (Pt<trigger_scale->getPtScale()->getLowEdge(1)) 
00272       Pt = trigger_scale->getPtScale()->getLowEdge(1);
00273 
00274     // switch to 2-stn Pt above 10 GeV:
00275     /*
00276       if (Pt>10.0) {
00277       switch (type)
00278       {
00279       case 1 :
00280       case 2 :
00281       Pt = Pt2Stn(1, eta, dphi1);
00282       break;
00283       case 3:
00284       Pt = Pt2Stn(2, eta, dphi1);
00285       break;
00286       case 4:
00287       Pt = Pt2Stn(3, eta, dphi1);
00288       }
00289       }
00290     */
00291     
00292     return Pt;
00293 }

float CSCTFPtMethods::Pt3StnChiSq ( int  type,
float  eta,
int  dphi1,
int  dphi2,
int  fr 
) const

Definition at line 761 of file CSCTFPtMethods.cc.

References funct::abs(), diff, dphifr0, dphifr1, etabins, cmsRelvalreport::exit, i, j, k, min, funct::pow(), Pt3Stn(), ptbins, ptmin, CSCTFConstants::SECTOR_RAD, sigmafr0, and sigmafr1.

Referenced by CSCTFPtLUT::calcPt(), and Pt3StnHybrid().

00762 {
00763 
00764   float diff, min, ptmin, ptmax;
00765   float mypt = 0.0;
00766 
00767   int dphi1copy = dphi1, dphi2copy = dphi2;
00768 
00769   if (type<4 || type>5) 
00770     {
00771 //      std::cout << "PtParams: illegal track type for Chi-square method" << std::endl;
00772       edm::LogError("CSCTFPtMethods::Pt3StnChiSq()")<<"Illegal track type for Chi-square method";
00773       return 0.;
00774     }
00775 
00776   // flip sign
00777   //dphi1 = -dphi1; 
00778   //dphi2 = -dphi2; 
00779 
00780 
00781   //determine which eta bin muon falls into
00782   int i = 0;
00783   for( i = 0; i < 15; i++ ) 
00784     {
00785       if ( eta >= etabins[i] && eta < etabins[i + 1] ) break;
00786     }
00787   if ( i == 15 ) 
00788     {
00789       //std::cout<<"muon not within any eta range";
00790       edm::LogWarning("CSCTFPtMethods::Pt3StnChiSq()")<<"Muon not within any eta range";
00791       if (eta<etabins[0]) 
00792         { 
00793           eta = etabins[0];
00794           i = 0;
00795         }
00796       else if (eta>=etabins[15]) 
00797         {
00798           eta = etabins[15];
00799           i = 15;
00800         }
00801       else
00802         exit(0);
00803     }
00804 
00805   bool bCallOldMethod = false;
00806 
00807   if(abs(dphi2) < 32) dphi2 = 0; //dphi2=dphi23 or dphi24
00808 
00809   //sta1-2-3, dphi1=dphi12, dphi2=dphi23
00810   if (type == 4) 
00811     {
00812       if (fr == 0) 
00813         {
00814           //advance past bins in array w/ default values
00815           //default is: dphifr0[x][y][z] = -1, sigmafr0[x][y][z] = 1
00816           int j = 0;  //start from 1st column, j = 0
00817           while ( ((dphifr0[0][i][j] == -1 && sigmafr0[0][i][j] == 1) || (dphifr0[2][i][j] == -1 && sigmafr0[2][i][j] == 1)) && j != 28 ) j++;
00818           if ( j == 28 ) 
00819             {
00820 //            std::cout<<" L1MuCSCPtParams: every entry in row is default"<<std::endl;  
00821               edm::LogInfo("CSCTFPtMethods::Pt3StnChiSq()")<<"Every entry in row is default";
00822               //        exit(0); //normal termination
00823               bCallOldMethod = true;
00824             }
00825           
00826           if (!bCallOldMethod) 
00827             {
00828               //set min, ptmin, ptmax to first bin
00829               //in row that is not default
00830               min = 1.5625 * ( (pow((dphi1 - dphifr0[0][i][j]),2) / pow(sigmafr0[0][i][j],2)) + (pow((dphi2 - dphifr0[2][i][j]),2) / pow(sigmafr0[2][i][j],2)) - (1.2 * (dphi1 - dphifr0[0][i][j]) * (dphi2 - dphifr0[2][i][j]) / (sigmafr0[0][i][j] * sigmafr0[2][i][j])) ); //calculate chi square
00831               ptmin = ptbins[j];
00832               ptmax = ptbins[j + 1];
00833               
00834               //loop through all pt bins.  assign pt of bin w/ least diff
00835               //do not include default bins in calculation
00836               for ( int k = j; k < 28; k++ ) 
00837                 {
00838                   if( (dphifr0[0][i][k] != -1 || sigmafr0[0][i][k] != 1) && (dphifr0[2][i][k] != -1 || sigmafr0[2][i][k] != 1) ) 
00839                     {
00840                       diff = 1.5625 * ( (pow((dphi1 - dphifr0[0][i][k]),2) / pow(sigmafr0[0][i][k],2)) + (pow((dphi2 - dphifr0[2][i][k]),2) / pow(sigmafr0[2][i][k],2)) - (1.2 * (dphi1 - dphifr0[0][i][k]) * (dphi2 - dphifr0[2][i][k]) / (sigmafr0[0][i][k] * sigmafr0[2][i][k])) );
00841                       if (diff < min) 
00842                         {
00843                           min = diff;
00844                           ptmin = ptbins[k];
00845                           ptmax = ptbins[k + 1];
00846                         }
00847                     }
00848                 }
00849               mypt = (ptmin + ptmax) / 2;
00850             }
00851         }
00852       
00853       if (fr == 1) 
00854         {
00855           //advance past bins in array w/ default values
00856           //default is: dphifr1[x][y][z] = -1, sigmafr1[x][y][z] = 1
00857           int j = 0;  //start from 1st column, j = 0
00858           while ( ((dphifr1[0][i][j] == -1 && sigmafr1[0][i][j] == 1) || (dphifr1[2][i][j] == -1 && sigmafr1[2][i][j] == 1)) && j != 28 ) j++;
00859           if ( j == 28 ) 
00860             {
00861 //            std::cout<<" L1MuCSCPtParams: every entry in row is default"<<std::endl;  
00862               edm::LogInfo("CSCTFPtMethods::Pt3StnChiSq()")<<"Every entry in row is default";
00863               //        exit(0); //normal termination
00864               bCallOldMethod = true;
00865             }
00866 
00867           if (!bCallOldMethod) 
00868             {
00869               //set min, ptmin, ptmax to first bin
00870               //in row that is not default
00871               min = 1.5625 * ( (pow((dphi1 - dphifr1[0][i][j]),2) / pow(sigmafr1[0][i][j],2)) + (pow((dphi2 - dphifr1[2][i][j]),2) / pow(sigmafr1[2][i][j],2)) - (1.2 * (dphi1 - dphifr1[0][i][j]) * (dphi2 - dphifr1[2][i][j]) / (sigmafr1[0][i][j] * sigmafr1[2][i][j])) ); //calculate chi square
00872               ptmin = ptbins[j];
00873               ptmax = ptbins[j + 1];
00874               
00875               //loop through all pt bins.  assign pt of bin w/ least diff
00876               //do not include default bins in calculation
00877               for ( int k = j; k  < 28; k++ ) 
00878                 {
00879                   if( (dphifr1[0][i][k] != -1 || sigmafr1[0][i][k] != 1) && (dphifr1[2][i][k] != -1 || sigmafr1[2][i][k] != 1) ) 
00880                     {
00881                       diff = 1.5625 * ( (pow((dphi1 - dphifr1[0][i][k]),2) / pow(sigmafr1[0][i][k],2)) + (pow((dphi2 - dphifr1[2][i][k]),2) / pow(sigmafr1[2][i][k],2)) - (1.2 * (dphi1 - dphifr1[0][i][k]) * (dphi2 - dphifr1[2][i][k]) / (sigmafr1[0][i][k] * sigmafr1[2][i][k])) );
00882                       if (diff < min) 
00883                         {
00884                           min = diff;
00885                           ptmin = ptbins[k];
00886                           ptmax = ptbins[k + 1];
00887                         }
00888                     }
00889                   mypt = (ptmin + ptmax) / 2;
00890                 }
00891             }
00892         }
00893     }
00894   
00895   //sta1-2-4, dphi1=dphi12, dphi2=dphi24
00896   if (type == 5) 
00897     {
00898       
00899       if (fr == 0) 
00900         {
00901           //advance past bins in array w/ default values
00902           //default is: dphifr0[x][y][z] = -1, sigmafr0[x][y][z] = 1
00903           int j = 0;  //start from 1st column, j = 0
00904           while ( ((dphifr0[0][i][j] == -1 && sigmafr0[0][i][j] == 1) || (dphifr0[3][i][j] == -1 && sigmafr0[3][i][j] == 1)) && j != 28 ) j++;
00905           if ( j == 28 ) 
00906             {
00907 //            std::cout<<" L1MuCSCPtParams: every entry in row is default"<<std::endl;  
00908               edm::LogInfo("CSCTFPtMethods::Pt3StnChiSq()")<<"Every entry in row is default";
00909               //        exit(0); //normal termination
00910               bCallOldMethod = true;
00911             }
00912 
00913           if (!bCallOldMethod) 
00914             {
00915               //set min, ptmin, ptmax to first bin
00916               //in row that is not default
00917               min = 1.5625 * ( (pow((dphi1 - dphifr0[0][i][j]),2) / pow(sigmafr0[0][i][j],2)) + (pow((dphi2 - dphifr0[3][i][j]),2) / pow(sigmafr0[3][i][j],2)) - (1.2 * (dphi1 - dphifr0[0][i][j]) * (dphi2 - dphifr0[3][i][j]) / (sigmafr0[0][i][j] * sigmafr0[3][i][j])) ); //calculate chi square
00918               ptmin = ptbins[j];
00919               ptmax = ptbins[j + 1];
00920               
00921               //loop through all pt bins.  assign pt of bin w/ least diff
00922       //do not include default bins in calculation
00923               for ( int k = j; k < 28; k++ ) 
00924                 {
00925                   if( (dphifr0[0][i][k] != -1 || sigmafr0[0][i][k] != 1) && (dphifr0[3][i][k] != -1 || sigmafr0[3][i][k] != 1) ) 
00926                     {
00927                       diff = 1.5625 * ( (pow((dphi1 - dphifr0[0][i][k]),2) / pow(sigmafr0[0][i][k],2)) + (pow((dphi2 - dphifr0[3][i][k]),2) / pow(sigmafr0[3][i][k],2)) - (1.2 * (dphi1 - dphifr0[0][i][k]) * (dphi2 - dphifr0[3][i][k]) / (sigmafr0[0][i][k] * sigmafr0[3][i][k])) );
00928                       if (diff < min) 
00929                         {
00930                           min = diff;
00931                           ptmin = ptbins[k];
00932                           ptmax = ptbins[k + 1];
00933                         }
00934                     }
00935                 }
00936               mypt = (ptmin + ptmax) / 2;
00937             }
00938         }
00939       
00940       if (fr == 1) 
00941         {
00942           //advance past bins in array w/ default values
00943           //default is: dphifr1[x][y][z] = -1, sigmafr1[x][y][z] = 1
00944           int j = 0;  //start from 1st column, j = 0
00945           while ( ((dphifr1[0][i][j] == -1 && sigmafr1[0][i][j] == 1) || (dphifr1[3][i][j] == -1 && sigmafr1[3][i][j] == 1)) && j != 28 ) j++;
00946           if ( j == 28 ) 
00947             {
00948 //            std::cout<<" L1MuCSCPtParams: every entry in row is default"<<std::endl;  
00949               edm::LogInfo("CSCTFPtMethods::Pt3StnChiSq()")<<"Every entry in row is default";
00950               //        exit(0); //normal termination
00951               bCallOldMethod = true;
00952             }
00953           
00954           if (!bCallOldMethod) 
00955             {
00956               //set min, ptmin, ptmax to first bin
00957               //in row that is not default
00958               min = 1.5625 * ( (pow((dphi1 - dphifr1[0][i][j]),2) / pow(sigmafr1[0][i][j],2)) + (pow((dphi2 - dphifr1[3][i][j]),2) / pow(sigmafr1[3][i][j],2)) - (1.2 * (dphi1 - dphifr1[0][i][j]) * (dphi2 - dphifr1[3][i][j]) / (sigmafr1[0][i][j] * sigmafr1[3][i][j])) ); //calculate chi square
00959               ptmin = ptbins[j];
00960               ptmax = ptbins[j + 1];
00961               
00962               //loop through all pt bins.  assign pt of bin w/ least diff
00963               //do not include default bins in calculation
00964               for ( int k = j; k < 28; k++ ) 
00965                 {
00966                   if( (dphifr1[0][i][k] != -1 || sigmafr1[0][i][k] != 1) && (dphifr1[3][i][k] != -1 || sigmafr1[3][i][k] != 1) ) 
00967                     {
00968                       diff = 1.5625 * ( (pow((dphi1 - dphifr1[0][i][k]),2) / pow(sigmafr1[0][i][k],2)) + (pow((dphi2 - dphifr1[3][i][k]),2) / pow(sigmafr1[3][i][k],2)) - (1.2 * (dphi1 - dphifr1[0][i][k]) * (dphi2 - dphifr1[3][i][k]) / (sigmafr1[0][i][k] * sigmafr1[3][i][k])) );
00969                       if (diff < min) 
00970                         {
00971                           min = diff;
00972                           ptmin = ptbins[k];
00973                           ptmax = ptbins[k + 1];
00974                         }
00975                     }
00976                 }
00977               mypt = (ptmin + ptmax) / 2;
00978             }
00979         }
00980     }
00981     
00982   if (bCallOldMethod) 
00983     {
00984       float dphi12R = (static_cast<float>(dphi1copy)) / static_cast<float>(1<<12) * CSCTFConstants::SECTOR_RAD;
00985       float dphi23R = (static_cast<float>(dphi2copy)) / static_cast<float>(1<<12) * CSCTFConstants::SECTOR_RAD;
00986       // change defintion of track type to old method
00987       mypt =  Pt3Stn(type-3, eta, dphi12R, dphi23R, fr);
00988     }
00989   return mypt;
00990 
00991 }

float CSCTFPtMethods::Pt3StnHybrid ( int  type,
float  eta,
int  dphi1,
int  dphi2,
int  fr 
) const

Definition at line 1007 of file CSCTFPtMethods.cc.

References Pt3Stn(), Pt3StnChiSq(), and CSCTFConstants::SECTOR_RAD.

Referenced by CSCTFPtLUT::calcPt().

01008 {
01009   float mypt = 0.0;
01010 
01011   mypt = Pt3StnChiSq(type, eta, dphi1, dphi2, fr);
01012   if(mypt >= 8.0)
01013     {
01014       float dphi12R = (static_cast<float>(dphi1)) / static_cast<float>(1<<12) * CSCTFConstants::SECTOR_RAD;
01015       float dphi23R = (static_cast<float>(dphi2)) / static_cast<float>(1<<12) * CSCTFConstants::SECTOR_RAD;
01016       // change defintion of track type to old method
01017       mypt =  Pt3Stn(type-3, eta, dphi12R, dphi23R, fr);      
01018     }
01019 
01020   return mypt;
01021 }

float CSCTFPtMethods::PtEff90 ( float  pt,
float  eta,
int  mode 
) const

Legacy Pt90 calculation function.

Definition at line 1052 of file CSCTFPtMethods.cc.

References c.

01053 {
01054   // set pT resolution 
01055   float c;
01056   switch (mode) 
01057     {
01058       // 3-stn with ME1
01059     case 2:
01060     case 3:
01061     case 4:
01062       // leave as 2 Stn for now:
01063       //        if (eta < 2.0)
01064       //            c = 0.2;
01065       //        else
01066       //            c = 0.2 + (eta-2.0)*0.5;
01067       //        break;
01068       // 2-stn with ME1
01069     case 6:
01070     case 7:
01071       //        c=(-.2999 * (eta*eta*eta) + 2.030 * (eta*eta) - 4.235 * eta + 3.024)+0.02;
01072       // Try just fixed value from fits to Pt turn-on curves
01073       c=0.3;
01074       break;
01075       // 2 or 3 stn without ME1
01076     case 5:
01077     case 8:
01078     case 9:
01079       c=(-2.484 * (eta*eta*eta) + 14.43 * (eta*eta) - 27.66 * eta + 18.47)*.72;
01080       break;
01081     case 10:
01082       c=2.0;
01083       break;
01084       // MB1 tracks
01085     case 11:
01086     case 12:
01087     case 13:
01088     case 14:
01089     case 15:
01090       c=0.3;
01091       break;
01092     default:
01093       c = 0.0;
01094     };
01095   // Calculation of 90% threshold from 50% one, assuming Gaussian resolution
01096   // 90% of Gaussian area extends to 1.28*sigma
01097   if (c>0.78) c = 0.78;
01098   //    return pt/(1.0 - 1.28*c);
01099   // Let's go back to old empirical method:
01100   return pt*(1.0 + 1.28*c);
01101 }


Member Data Documentation

const float CSCTFPtMethods::AkHighEta_Fit1 [static]

Initial value:

 
  {
    
    {0.6275, -0.2133, 0.0, 0.0},                        
    {-1.124, 2.492, -1.347, 0.2204},            
    {0.5214, -0.7536, 0.3913, -.06739},         
    {1.394, -1.886, 0.8809, -0.1369},           
    {-0.5519E-02, 0.8496E-02, 0.0, 0.0},        
    {0.6644, -0.2312, 0.0, 0.0},                        
    {0.80, -0.54, 0.0, 0.0},                    
    {0.80, -0.54, 0.0, 0.0},                    
  }

Definition at line 31 of file CSCTFPtMethods.h.

Referenced by Pt3Stn().

const float CSCTFPtMethods::AkHighEta_Fit2 [static]

Initial value:

 
  {
    {0.6425, -0.2308, 0.0, 0.0},                                
    {0.6923, -0.2336, 0.0, 0.0},                                
    {-0.7147, .01117, -0.5255E-04, 0.7991E-07}, 
    {-1.377, 2.150, -1.046, 0.1667},                    
    {-.02974, .04816, -.02105, .003640},                
    {0.6425, -0.2308, 0.0, 0.0},                                
    {0.80, -0.54, 0.0, 0.0},                            
    {0.80, -0.54, 0.0, 0.0},                            
  }

Definition at line 23 of file CSCTFPtMethods.h.

Referenced by Pt2Stn().

const float CSCTFPtMethods::AkLowEta_Fit1 [static]

Initial value:

 
  {
    
    
    {3.900, -8.391, 6.062, -1.436},                             
    
    {8.03602, -17.5355, 12.7725, -3.0616 },     
    {0.8372, -2.220, 1.908, -0.5233},                   
    {-0.04389, 0.05174, 0.0, 0.0},                              
    {-0.5519E-02, 0.8496E-02, 0.0, 0.0},                
    {-4.228, 8.546, -5.617, 1.235},                             
    {0.80, -0.54, 0.0, 0.0},                            
    {0.80, -0.54, 0.0, 0.0},                            
  }
The three station pt measument only needs a one constant fit, but the dependence on eta is still there.

dphi = A/pt

Definition at line 30 of file CSCTFPtMethods.h.

Referenced by Pt3Stn().

const float CSCTFPtMethods::AkLowEta_Fit2 [static]

Initial value:

 
  {
    
    {-0.6131, 0.6870, 0.0285, -0.1147},                 
    
    {8.03602, -17.5355, 12.7725, -3.0616 },     
    {5.765, -12.85, 9.543, -2.345},                     
    {-4.068, 8.254, -5.491, 1.214},                     
    {-.02974, .04816, -.02105, .003640},        
    {-3.358, 7.038, -4.766, 1.079},                     
    {0.80, -0.54, 0.0, 0.0},                    
    {0.80, -0.54, 0.0, 0.0},                    
  }
First is the parameterizations of Acosta/McDonald.

The two station pt measument needs a two constant fit with a break in the detector depending on what detectors it hit (eta) dphi = A/pt + B/(pt^2)

Definition at line 22 of file CSCTFPtMethods.h.

Referenced by Pt2Stn().

const float CSCTFPtMethods::BkHighEta_Fit2 [static]

Initial value:

 
  {
    {14.79, -21.10, 10.16, -1.623},             
    {70.67, -105.7, 52.49, -8.631},             
    {15.70, -23.94, 11.89, -1.939},             
    {17.18, -26.38, 13.13, -2.139},             
    {0.0, 0.0, 0.0, 0.0},                               
    {14.79, -21.10, 10.16, -1.623},             
    {0.0, 0.0, 0.0, 0.0},                               
    {0.0, 0.0, 0.0, 0.0}                                
  }

Definition at line 26 of file CSCTFPtMethods.h.

Referenced by Pt2Stn().

const float CSCTFPtMethods::BkLowEta_Fit2 [static]

Initial value:

 
  {
    
    {7.0509, -7.3282, -0.1465, 1.308},  
    
    {0.0, 0.0, 0.0, 0.0},       
    {-38.55, 82.95, -59.66, 14.29},             
    {20.71, -45.34, 32.05, -7.415},             
    {0.0, 0.0, 0.0, 0.0},                               
    {-0.6167, 0.08421, 0.2454, 0.0},    
    {0.0, 0.0, 0.0, 0.0},                               
    {0.0, 0.0, 0.0, 0.0}                                
  }

Definition at line 25 of file CSCTFPtMethods.h.

Referenced by Pt2Stn().

const float CSCTFPtMethods::dphifr0 [static]

Definition at line 48 of file CSCTFPtMethods.h.

Referenced by Pt2StnChiSq(), and Pt3StnChiSq().

const float CSCTFPtMethods::dphifr1 [static]

Definition at line 49 of file CSCTFPtMethods.h.

Referenced by Pt2StnChiSq(), and Pt3StnChiSq().

const float CSCTFPtMethods::etabins [static]

Initial value:

 
  {0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 
   1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4}

Definition at line 47 of file CSCTFPtMethods.h.

Referenced by Pt2StnChiSq(), and Pt3StnChiSq().

const float CSCTFPtMethods::FRCorrHighEta [static]

Initial value:

 
  {


    {0.966, 1.176}, 
    {0.966, 1.176},   
    {1.0, 1.0},   
    {1.0, 1.0},   
    {1.0, 1.0},   
    {1.0, 1.0},   
    {1.0, 1.0},   
    {1.0, 1.0}    
  }

Definition at line 36 of file CSCTFPtMethods.h.

Referenced by Pt2Stn(), and Pt3Stn().

const float CSCTFPtMethods::FRCorrLowEta [static]

Initial value:

 
  {


    {1.30, 1.0}, 
    {1.30, 1.0},   
    {1.0, 1.0},   
    {1.0, 1.0},   
    {1.0, 1.0},   
    {1.0, 1.0},   
    {1.0, 1.0},   
    {1.0, 1.0}    
  }
Corrections for ME1 F/R bit.

Definition at line 35 of file CSCTFPtMethods.h.

Referenced by Pt2Stn(), and Pt3Stn().

const float CSCTFPtMethods::kGlobalScaleFactor = 1.36 [static]

Definition at line 33 of file CSCTFPtMethods.h.

Referenced by Pt2Stn(), and Pt3Stn().

const float CSCTFPtMethods::ptbins [static]

Initial value:

 
  {2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0, 6.0, 7.0, 8.0, 
   10.0, 12.0, 14.0, 16.0, 18.0, 20.0, 25.0, 30.0, 35.0, 40.0, 
   45.0, 50.0, 60.0, 70.0, 80.0, 90.0, 100.0, 120.0, 140.0}
Second are the parameterizations of Acosta/Yeh.

Definition at line 46 of file CSCTFPtMethods.h.

Referenced by Pt2StnChiSq(), and Pt3StnChiSq().

const float CSCTFPtMethods::sigmafr0 [static]

Definition at line 50 of file CSCTFPtMethods.h.

Referenced by Pt2StnChiSq(), and Pt3StnChiSq().

const float CSCTFPtMethods::sigmafr1 [static]

Definition at line 51 of file CSCTFPtMethods.h.

Referenced by Pt2StnChiSq(), and Pt3StnChiSq().

const L1MuTriggerPtScale* CSCTFPtMethods::trigger_scale [private]

Definition at line 77 of file CSCTFPtMethods.h.

Referenced by Pt2Stn(), and Pt3Stn().


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