CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
TruncatedAverageDeDxEstimator Class Reference

#include <TruncatedAverageDeDxEstimator.h>

Inheritance diagram for TruncatedAverageDeDxEstimator:
BaseDeDxEstimator

Public Member Functions

virtual std::pair< float, float > dedx (const reco::DeDxHitCollection &Hits)
 
 TruncatedAverageDeDxEstimator (const edm::ParameterSet &iConfig)
 
- Public Member Functions inherited from BaseDeDxEstimator
virtual void beginRun (edm::Run const &run, const edm::EventSetup &iSetup)
 
virtual ~BaseDeDxEstimator ()
 

Private Attributes

float m_fraction
 

Detailed Description

Definition at line 9 of file TruncatedAverageDeDxEstimator.h.

Constructor & Destructor Documentation

TruncatedAverageDeDxEstimator::TruncatedAverageDeDxEstimator ( const edm::ParameterSet iConfig)
inline

Definition at line 12 of file TruncatedAverageDeDxEstimator.h.

References edm::ParameterSet::getParameter(), and m_fraction.

12  {
13  m_fraction = iConfig.getParameter<double>("fraction");
14  }
T getParameter(std::string const &) const

Member Function Documentation

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

Implements BaseDeDxEstimator.

Definition at line 16 of file TruncatedAverageDeDxEstimator.h.

References mps_fire::i, createfilelist::int, and m_fraction.

16  {
17  int nTrunc = int( Hits.size()*m_fraction);
18  double sumdedx = 0;
19  for(size_t i=0;i + nTrunc < Hits.size() ; i++){
20  sumdedx+=Hits[i].charge();
21  }
22  double avrdedx = (Hits.size()) ? sumdedx/(Hits.size()-nTrunc) :0.0;
23  return std::make_pair(avrdedx,-1);
24  }

Member Data Documentation

float TruncatedAverageDeDxEstimator::m_fraction
private

Definition at line 27 of file TruncatedAverageDeDxEstimator.h.

Referenced by dedx(), and TruncatedAverageDeDxEstimator().