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.

10 { m_expo = iConfig.getParameter<double>("exponent"); }

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

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.

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  }

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

Member Data Documentation

◆ m_expo

float GenericAverageDeDxEstimator::m_expo
private

Definition at line 22 of file GenericAverageDeDxEstimator.h.

Referenced by dedx(), and GenericAverageDeDxEstimator().

mps_fire.i
i
Definition: mps_fire.py:355
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
GenericAverageDeDxEstimator::m_expo
float m_expo
Definition: GenericAverageDeDxEstimator.h:22
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:30
mps_fire.result
result
Definition: mps_fire.py:303