Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

LeptonBinData.cxx

Go to the documentation of this file.
00001 #include "AtlfastAlgs/LeptonBinData.h"
00002 #include <cmath>
00003 
00004 namespace Atlfast {
00005   using std::vector;
00006 
00007   //-----------------------------------------------
00008   // PUBLIC - Constructor
00009   //-----------------------------------------------
00010   //  
00011   //  LeptonBinData::LeptonBinData(
00012   //                       const BinID& id,
00013   //                       const vector<HepMatrix>& interpol
00014   //                       ):
00015   //    m_id(id),m_interpol(interpol){
00016   //  }
00017   
00018   //-----------------------------------------------
00019   // PUBLIC - void calculate
00020   // calculate matrix from data
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     //    cout << "LeptonBinData:  Getting Matrix for eta: " <<eta<<" and pT: " << pT << endl;
00037     //    cout << "eta ratio " << etaRatio << " with pt low, high " << pTLow<<","<<pTHigh<<endl;
00038     //    cout << "eta low, high " << etaLow <<","<< etaHigh;
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       //  cout << "interpol = " << *iter << endl;
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       // cout << "etaRatio interpol parameters are " << par1.back() << " and " << par2.back() << endl;
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       //cout << "a = " << a<<"   b = "<<b<<endl;
00069       //cout << "a + b/pT^2 = " << sigmaParams.back() << endl;
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 }//end of namespace

Generated on Tue Mar 18 11:18:24 2003 for AtlfastAlgs by doxygen1.3-rc1