Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:22:01

0001 #include "L1Trigger/TrackFindingTracklet/interface/TrackDer.h"
0002 
0003 using namespace std;
0004 using namespace trklet;
0005 
0006 TrackDer::TrackDer() {
0007   for (unsigned int i = 0; i < N_FITSTUB; i++) {
0008     irinvdphi_[i] = 9999999;
0009     irinvdzordr_[i] = 9999999;
0010     iphi0dphi_[i] = 9999999;
0011     iphi0dzordr_[i] = 9999999;
0012     itdphi_[i] = 9999999;
0013     itdzordr_[i] = 9999999;
0014     iz0dphi_[i] = 9999999;
0015     iz0dzordr_[i] = 9999999;
0016 
0017     rinvdphi_[i] = 0.0;
0018     rinvdzordr_[i] = 0.0;
0019     phi0dphi_[i] = 0.0;
0020     phi0dzordr_[i] = 0.0;
0021     tdphi_[i] = 0.0;
0022     tdzordr_[i] = 0.0;
0023     z0dphi_[i] = 0.0;
0024     z0dzordr_[i] = 0.0;
0025   }
0026 
0027   for (unsigned int i = 0; i < N_PSLAYER; i++) {
0028     for (unsigned int j = 0; j < N_PSLAYER; j++) {
0029       tdzcorr_[i][j] = 0.0;
0030       z0dzcorr_[i][j] = 0.0;
0031     }
0032   }
0033 }
0034 
0035 void TrackDer::setIndex(int layermask, int diskmask, int alphamask, int irinv) {
0036   layermask_ = layermask;
0037   diskmask_ = diskmask;
0038   alphamask_ = alphamask;
0039   irinv_ = irinv;
0040 }
0041 
0042 void TrackDer::fill(int t, double MinvDt[N_FITPARAM][N_FITSTUB * 2], int iMinvDt[N_FITPARAM][N_FITSTUB * 2]) const {
0043   unsigned int nlayer = 0;
0044   if (layermask_ & 1)
0045     nlayer++;
0046   if (layermask_ & 2)
0047     nlayer++;
0048   if (layermask_ & 4)
0049     nlayer++;
0050   if (layermask_ & 8)
0051     nlayer++;
0052   if (layermask_ & 16)
0053     nlayer++;
0054   if (layermask_ & 32)
0055     nlayer++;
0056   int sign = 1;
0057   if (t < 0)
0058     sign = -1;
0059   for (unsigned int i = 0; i < N_FITSTUB; i++) {
0060     MinvDt[0][2 * i] = rinvdphi_[i];
0061     MinvDt[1][2 * i] = phi0dphi_[i];
0062     MinvDt[2][2 * i] = sign * tdphi_[i];
0063     MinvDt[3][2 * i] = sign * z0dphi_[i];
0064     MinvDt[0][2 * i + 1] = rinvdzordr_[i];
0065     MinvDt[1][2 * i + 1] = phi0dzordr_[i];
0066     MinvDt[2][2 * i + 1] = tdzordr_[i];
0067     MinvDt[3][2 * i + 1] = z0dzordr_[i];
0068     iMinvDt[0][2 * i] = irinvdphi_[i];
0069     iMinvDt[1][2 * i] = iphi0dphi_[i];
0070     iMinvDt[2][2 * i] = sign * itdphi_[i];
0071     iMinvDt[3][2 * i] = sign * iz0dphi_[i];
0072     iMinvDt[0][2 * i + 1] = irinvdzordr_[i];
0073     iMinvDt[1][2 * i + 1] = iphi0dzordr_[i];
0074     iMinvDt[2][2 * i + 1] = itdzordr_[i];
0075     iMinvDt[3][2 * i + 1] = iz0dzordr_[i];
0076     if (i < nlayer) {
0077       MinvDt[0][2 * i + 1] *= sign;
0078       MinvDt[1][2 * i + 1] *= sign;
0079       iMinvDt[0][2 * i + 1] *= sign;
0080       iMinvDt[1][2 * i + 1] *= sign;
0081     } else {
0082       MinvDt[2][2 * i + 1] *= sign;
0083       MinvDt[3][2 * i + 1] *= sign;
0084       iMinvDt[2][2 * i + 1] *= sign;
0085       iMinvDt[3][2 * i + 1] *= sign;
0086     }
0087   }
0088 }