00001 #include "AtlfastAlgs/LeptonBinData.h"
00002 #include <cmath>
00003
00004 namespace Atlfast {
00005 using std::vector;
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 HepMatrix LeptonBinData::getMatrix(const TrackTrajectory& track) const{
00024
00025 HepMatrix sigma(5,5,0);
00026 vector<double> sigmaParams, par1, par2;
00027
00028 double eta = track.eta();
00029 double etaRatio = (abs(eta) - m_id.low(0) )/
00030 (m_id.high(0) - m_id.low(0));
00031 double pT = track.pT();
00032 double pTLow = m_id.low(1);
00033 double pTHigh = m_id.high(1);
00034 vector<HepMatrix>::const_iterator iter = m_interpol.begin();
00035 for ( ;iter != m_interpol.end(); iter++){
00036 par1.push_back(
00037 (*iter)[0][0] +
00038 ( (*iter)[1][0] - (*iter)[0][0] )*etaRatio
00039 );
00040
00041 par2.push_back(
00042 (*iter)[0][1] +
00043 ( (*iter)[1][1] - (*iter)[0][1] )*etaRatio
00044 );
00045
00046 double a,b;
00047 b = ( par2.back() - par1.back() ) *
00048 ( (pTHigh*pTLow) ) *
00049 ( (pTHigh*pTLow) ) /
00050 ( (pTLow*pTLow)-(pTHigh*pTHigh) );
00051
00052 a = ( par2.back()*(pTHigh*pTHigh) -
00053 par1.back()*(pTLow*pTLow)
00054 ) /
00055 ( (pTHigh*pTHigh)-(pTLow*pTLow) );
00056
00057 sigmaParams.push_back( a + b/(pT*pT) );
00058 }
00059
00060 for (int i = 0;i < 5; i++){
00061 sigma[i][i] = sigmaParams[i];
00062 }
00063 sigma(1,3) = sigma(3,1) = sigmaParams[7];
00064 sigma(1,5) = sigma(5,1) = sigmaParams[6];
00065 sigma(2,4) = sigma(4,2) = sigmaParams[8];
00066 sigma(3,5) = sigma(5,3) = sigmaParams[5];
00067
00068 return sigma;
00069 }
00070
00071
00072 }