001 #include "AtlfastAlgs/ParameterResolutions.h"
002 #include <cmath>
003
004 namespace Atlfast
005 {
006
007 double ParameterResolutions::resolution( const TrackTrajectory& traj ) const
008 {
009
010
011 TrackParameters track = traj.parameters();
012 double eta = std::abs( track.eta() );
013 double pT = track.pT();
014
015 std::vector<BinID>::const_iterator iter = m_coefficientBins.begin();
016 std::vector<BinID>::const_iterator end = m_coefficientBins.end();
017 std::vector<double> coefficients;
018 coefficients.reserve( m_coefficientBins.size() );
019 for ( ; iter != end; ++iter )
020 {
021 double value = this->interpolate( eta, iter->low(), iter->high() );
022 coefficients.push_back(value);
023 }
024 return calculateResolution( pT, coefficients );
025 }
026
027
028 double ParameterResolutions::interpolate( double eta, double coeffLow, double coeffHigh ) const
029 {
030 double slope = ( coeffHigh - coeffLow ) / ( m_etaHigh - m_etaLow );
031 double value = coeffLow + slope * ( eta - m_etaLow );
032 return value;
033 }
034
035 double ParameterResolutions::calculateResolution( double pT, const std::vector<double>& coefficients ) const
036 {
037 if ( pT == 0 ) return 0;
038 double resolution = 0;
039 std::vector<double>::const_iterator powerSeries = m_powerSeries.begin();
040 std::vector<double>::const_iterator iter = coefficients.begin();
041 std::vector<double>::const_iterator end = coefficients.end();
042
043 for ( ; iter != end; ++iter )
044 {
045 resolution += (*iter) / std::pow( pT, (*powerSeries) );
046 ++powerSeries;
047 }
048 return resolution;
049 }
050
051 }
| Due to the LXR bug, the updates fail sometimes to remove references to deleted files. The Saturday's full rebuilds fix these problems |
|
This page was automatically generated by the
LXR engine.
|
|