#include <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] |
Definition at line 11 of file TruncatedAverageDeDxEstimator.h.
: m_fraction(fraction) {}
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, and m_fraction.
{ int nTrunc = int( Hits.size()*m_fraction); double sumdedx = 0; for(size_t i=0;i + nTrunc < Hits.size() ; i++){ sumdedx+=Hits[i].charge(); } double avrdedx = (Hits.size()) ? sumdedx/(Hits.size()-nTrunc) :0.0; return std::make_pair(avrdedx,-1); }
float TruncatedAverageDeDxEstimator::m_fraction [private] |
Definition at line 24 of file TruncatedAverageDeDxEstimator.h.
Referenced by dedx().