CMS 3D CMS Logo

TruncatedAverageDeDxEstimator Class Reference

#include <RecoTracker/DeDx/interface/TruncatedAverageDeDxEstimator.h>

Inheritance diagram for TruncatedAverageDeDxEstimator:

BaseDeDxEstimator

List of all members.

Public Member Functions

virtual std::pair< float, float > dedx (const reco::DeDxHitCollection &Hits)
 TruncatedAverageDeDxEstimator (float fraction)

Private Attributes

float m_fraction


Detailed Description

Definition at line 8 of file TruncatedAverageDeDxEstimator.h.


Constructor & Destructor Documentation

TruncatedAverageDeDxEstimator::TruncatedAverageDeDxEstimator ( float  fraction  )  [inline]

Definition at line 11 of file TruncatedAverageDeDxEstimator.h.

00011 : m_fraction(fraction) {}


Member Function Documentation

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  } 


Member Data Documentation

float TruncatedAverageDeDxEstimator::m_fraction [private]

Definition at line 24 of file TruncatedAverageDeDxEstimator.h.

Referenced by dedx().


The documentation for this class was generated from the following file:
Generated on Tue Jun 9 18:34:37 2009 for CMSSW by  doxygen 1.5.4