#include <RecoTracker/DeDx/interface/TruncatedAverageDeDxEstimator.h>
Public Member Functions | |
virtual std::pair< float, float > | dedx (const reco::DeDxHitCollection &Hits) |
TruncatedAverageDeDxEstimator (float fraction) | |
Private Attributes | |
float | m_fraction |
Definition at line 8 of file TruncatedAverageDeDxEstimator.h.
TruncatedAverageDeDxEstimator::TruncatedAverageDeDxEstimator | ( | float | fraction | ) | [inline] |
virtual std::pair<float,float> TruncatedAverageDeDxEstimator::dedx | ( | const reco::DeDxHitCollection & | Hits | ) | [inline, virtual] |
Implements BaseDeDxEstimator.
Definition at line 13 of file TruncatedAverageDeDxEstimator.h.
References i, int, and m_fraction.
00013 { 00014 int nTrunc = int( Hits.size()*m_fraction); 00015 double sumdedx = 0; 00016 for(size_t i=0;i + nTrunc < Hits.size() ; i++){ 00017 sumdedx+=Hits[i].charge(); 00018 } 00019 double avrdedx = (Hits.size()) ? sumdedx/(Hits.size()-nTrunc) :0.0; 00020 return std::make_pair(avrdedx,-1); 00021 }
float TruncatedAverageDeDxEstimator::m_fraction [private] |