Main Page
Namespaces
Classes
Package Documentation
RecoTracker
DeDx
interface
GenericTruncatedAverageDeDxEstimator.h
Go to the documentation of this file.
1
#ifndef RecoTrackerDeDx_GenericTruncatedAverageDeDxEstimator_h
2
#define RecoTrackerDeDx_GenericTruncatedAverageDeDxEstimator_h
3
4
#include "
RecoTracker/DeDx/interface/BaseDeDxEstimator.h
"
5
#include "
RecoTracker/DeDx/interface/DeDxTools.h
"
6
#include "
DataFormats/TrackReco/interface/DeDxHit.h
"
7
#include <numeric>
8
9
class
GenericTruncatedAverageDeDxEstimator
:
public
BaseDeDxEstimator
10
{
11
public
:
12
GenericTruncatedAverageDeDxEstimator
(
const
edm::ParameterSet
& iConfig){
13
m_fraction
= iConfig.
getParameter
<
double
>(
"fraction"
);
14
m_expo
= iConfig.
getParameter
<
double
>(
"exponent"
);
15
}
16
17
std::pair<float,float>
dedx
(
const
reco::DeDxHitCollection
& Hits)
override
{
18
int
first
= 0,
last
= Hits.size();
19
if
(
m_fraction
> 0) {
// truncate high charge ones
20
last
-=
int
(Hits.size()*
m_fraction
);
21
}
else
{
22
first +=
int
(Hits.size()*(-
m_fraction
));
23
}
24
double
sumdedx = 0;
25
for
(
int
i
= first;
i
<
last
;
i
++){
26
sumdedx+=
pow
(Hits[
i
].
charge
(),
m_expo
);
27
}
28
double
avrdedx = (last-
first
) ?
pow
(sumdedx/(last-first),1.0/
m_expo
) :0.0;
29
return
std::make_pair(avrdedx,-1);
30
}
31
32
private
:
33
float
m_fraction
,
m_expo
;
34
35
};
36
37
#endif
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
mps_fire.i
i
Definition:
mps_fire.py:156
reco::DeDxHitCollection
std::vector< DeDxHit > DeDxHitCollection
Definition:
DeDxHit.h:58
GenericTruncatedAverageDeDxEstimator::GenericTruncatedAverageDeDxEstimator
GenericTruncatedAverageDeDxEstimator(const edm::ParameterSet &iConfig)
Definition:
GenericTruncatedAverageDeDxEstimator.h:12
BaseDeDxEstimator.h
createfilelist.int
int
Definition:
createfilelist.py:10
GenericTruncatedAverageDeDxEstimator::m_expo
float m_expo
Definition:
GenericTruncatedAverageDeDxEstimator.h:33
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition:
ALCARECOTkAlJpsiMuMu_cff.py:47
plotBeamSpotDB.last
last
Definition:
plotBeamSpotDB.py:380
DeDxHit.h
DeDxTools.h
GenericTruncatedAverageDeDxEstimator
Definition:
GenericTruncatedAverageDeDxEstimator.h:9
plotBeamSpotDB.first
first
Definition:
plotBeamSpotDB.py:379
GenericTruncatedAverageDeDxEstimator::dedx
std::pair< float, float > dedx(const reco::DeDxHitCollection &Hits) override
Definition:
GenericTruncatedAverageDeDxEstimator.h:17
edm::ParameterSet
Definition:
ParameterSet.h:36
GenericTruncatedAverageDeDxEstimator::m_fraction
float m_fraction
Definition:
GenericTruncatedAverageDeDxEstimator.h:33
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