CMS 3D CMS Logo

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

#include <GenericAverageDeDxEstimator.h>

Inheritance diagram for GenericAverageDeDxEstimator:
BaseDeDxEstimator

Public Member Functions

virtual std::pair< float, float > dedx (const reco::DeDxHitCollection &Hits)
 
 GenericAverageDeDxEstimator (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_expo
 

Detailed Description

Definition at line 7 of file GenericAverageDeDxEstimator.h.

Constructor & Destructor Documentation

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

Definition at line 10 of file GenericAverageDeDxEstimator.h.

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

10  {
11  m_expo = iConfig.getParameter<double>("exponent");
12  }
T getParameter(std::string const &) const

Member Function Documentation

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

Implements BaseDeDxEstimator.

Definition at line 14 of file GenericAverageDeDxEstimator.h.

References ALCARECOTkAlJpsiMuMu_cff::charge, mps_fire::i, m_expo, gen::n, funct::pow(), and mps_fire::result.

14  {
15  float result=0;
16  size_t n = Hits.size();
17  for(size_t i = 0; i< n; i ++){
18  result+=pow(Hits[i].charge(),m_expo);
19  }
20  return std::make_pair( ((n>0)?pow(result/n,1./m_expo):0.0) ,-1);
21  }
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40

Member Data Documentation

float GenericAverageDeDxEstimator::m_expo
private

Definition at line 24 of file GenericAverageDeDxEstimator.h.

Referenced by dedx(), and GenericAverageDeDxEstimator().