CMS 3D CMS Logo

Public Member Functions | Private Attributes

TruncatedAverageDeDxEstimator Class Reference

#include <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.

: 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, 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);
 } 

Member Data Documentation

Definition at line 24 of file TruncatedAverageDeDxEstimator.h.

Referenced by dedx().