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::GenericAverageDeDxEstimator ( const edm::ParameterSet iConfig)
inline

Definition at line 10 of file GenericAverageDeDxEstimator.h.

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

10 { m_expo = iConfig.getParameter<double>("exponent"); }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303

Member Function Documentation

◆ dedx()

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

Implements BaseDeDxEstimator.

Definition at line 12 of file GenericAverageDeDxEstimator.h.

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

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

Member Data Documentation

◆ m_expo

float GenericAverageDeDxEstimator::m_expo
private

Definition at line 22 of file GenericAverageDeDxEstimator.h.

Referenced by dedx(), and GenericAverageDeDxEstimator().