Main Page
Namespaces
Classes
Package Documentation
RecoTracker
DeDx
interface
GenericAverageDeDxEstimator.h
Go to the documentation of this file.
1
#ifndef RecoTrackerDeDx_GenericAverageDeDxEstimator_h
2
#define RecoTrackerDeDx_GenericAverageDeDxEstimator_h
3
4
#include "
RecoTracker/DeDx/interface/DeDxTools.h
"
5
#include "
DataFormats/TrackReco/interface/DeDxHit.h
"
6
7
class
GenericAverageDeDxEstimator
:
public
BaseDeDxEstimator
8
{
9
public
:
10
GenericAverageDeDxEstimator
(
const
edm::ParameterSet
& iConfig){
11
m_expo
= iConfig.
getParameter
<
double
>(
"exponent"
);
12
}
13
14
virtual
std::pair<float,float>
dedx
(
const
reco::DeDxHitCollection
& Hits) {
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
}
22
23
private
:
24
float
m_expo
;
25
26
};
27
28
#endif
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
mps_fire.i
i
Definition:
mps_fire.py:156
GenericAverageDeDxEstimator
Definition:
GenericAverageDeDxEstimator.h:7
mps_fire.result
result
Definition:
mps_fire.py:113
GenericAverageDeDxEstimator::m_expo
float m_expo
Definition:
GenericAverageDeDxEstimator.h:24
reco::DeDxHitCollection
std::vector< DeDxHit > DeDxHitCollection
Definition:
DeDxHit.h:56
GenericAverageDeDxEstimator::GenericAverageDeDxEstimator
GenericAverageDeDxEstimator(const edm::ParameterSet &iConfig)
Definition:
GenericAverageDeDxEstimator.h:10
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition:
ALCARECOTkAlJpsiMuMu_cff.py:47
GenericAverageDeDxEstimator::dedx
virtual std::pair< float, float > dedx(const reco::DeDxHitCollection &Hits)
Definition:
GenericAverageDeDxEstimator.h:14
DeDxHit.h
DeDxTools.h
gen::n
int n
Definition:
Cascade2Hadronizer.cc:79
edm::ParameterSet
Definition:
ParameterSet.h:36
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition:
Power.h:40
BaseDeDxEstimator
Definition:
BaseDeDxEstimator.h:7
Generated for CMSSW Reference Manual by
1.8.11