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

std::pair< float, float > dedx (const reco::DeDxHitCollection &Hits) override
 
 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 8 of file GenericAverageDeDxEstimator.h.

Constructor & Destructor Documentation

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

Definition at line 11 of file GenericAverageDeDxEstimator.h.

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

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

Member Function Documentation

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

Implements BaseDeDxEstimator.

Definition at line 15 of file GenericAverageDeDxEstimator.h.

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

15  {
16  float result=0;
17  size_t n = Hits.size();
18  for(size_t i = 0; i< n; i ++){
19  result+=pow(Hits[i].charge(),m_expo);
20  }
21  return std::make_pair( ((n>0)?pow(result/n,1./m_expo):0.0) ,-1);
22  }
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 25 of file GenericAverageDeDxEstimator.h.

Referenced by dedx(), and GenericAverageDeDxEstimator().