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& traj) const{
00024 TrackParameters track = traj.parameters();
00025 HepMatrix sigma(5,5,0);
00026 vector<double> sigmaParams, par1, par2;
00027
00028 double eta = track.eta();
00029 double etaLow = m_id.low(0);
00030 double etaHigh = m_id.high(0);
00031 double etaRatio = (abs(eta) - etaLow ) / (etaHigh - etaLow);
00032 double pT = track.pT();
00033 double pTLow = m_id.low(1);
00034 double pTHigh = m_id.high(1);
00035
00036
00037
00038
00039
00040 vector<HepMatrix>::const_iterator iter = m_interpol.begin();
00041 vector<HepMatrix>::const_iterator end = m_interpol.end();
00042 for ( ;iter != end; ++iter){
00043
00044 par1.push_back(
00045 (*iter)[0][0] +
00046 ( (*iter)[1][0] - (*iter)[0][0] )*etaRatio
00047 );
00048
00049 par2.push_back(
00050 (*iter)[0][1] +
00051 ( (*iter)[1][1] - (*iter)[0][1] )*etaRatio
00052 );
00053
00054
00055
00056 double a,b;
00057 b = ( par2.back() - par1.back() ) *
00058 ( (pTHigh*pTLow) ) *
00059 ( (pTHigh*pTLow) ) /
00060 ( (pTLow*pTLow)-(pTHigh*pTHigh) );
00061
00062 a = ( par2.back()*(pTHigh*pTHigh) -
00063 par1.back()*(pTLow*pTLow)
00064 ) /
00065 ( (pTHigh*pTHigh)-(pTLow*pTLow) );
00066
00067 sigmaParams.push_back( a + b/(pT*pT) );
00068
00069
00070 }
00071
00072 for (int i = 0;i < 5; i++){
00073 sigma[i][i] = sigmaParams[i];
00074 }
00075 sigma(1,3) = sigma(3,1) = sigmaParams[7];
00076 sigma(1,5) = sigma(5,1) = sigmaParams[6];
00077 sigma(2,4) = sigma(4,2) = sigmaParams[8];
00078 sigma(3,5) = sigma(5,3) = sigmaParams[5];
00079 return sigma;
00080 }
00081
00082
00083 }