Main Page
Namespaces
Classes
Package Documentation
RecoTracker
DeDx
interface
TruncatedAverageDeDxEstimator.h
Go to the documentation of this file.
1
#ifndef RecoTrackerDeDx_TruncatedAverageDeDxEstimator_h
2
#define RecoTrackerDeDx_TruncatedAverageDeDxEstimator_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
TruncatedAverageDeDxEstimator
:
public
BaseDeDxEstimator
10
{
11
public
:
12
TruncatedAverageDeDxEstimator
(
const
edm::ParameterSet
& iConfig){
13
m_fraction
= iConfig.
getParameter
<
double
>(
"fraction"
);
14
}
15
16
std::pair<float,float>
dedx
(
const
reco::DeDxHitCollection
& Hits)
override
{
17
int
nTrunc =
int
( Hits.size()*
m_fraction
);
18
double
sumdedx = 0;
19
for
(
size_t
i
=0;
i
+ nTrunc < Hits.size() ;
i
++){
20
sumdedx+=Hits[
i
].charge();
21
}
22
double
avrdedx = (Hits.size()) ? sumdedx/(Hits.size()-nTrunc) :0.0;
23
return
std::make_pair(avrdedx,-1);
24
}
25
26
private
:
27
float
m_fraction
;
28
29
};
30
31
#endif
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
TruncatedAverageDeDxEstimator::m_fraction
float m_fraction
Definition:
TruncatedAverageDeDxEstimator.h:27
mps_fire.i
i
Definition:
mps_fire.py:269
TruncatedAverageDeDxEstimator::dedx
std::pair< float, float > dedx(const reco::DeDxHitCollection &Hits) override
Definition:
TruncatedAverageDeDxEstimator.h:16
reco::DeDxHitCollection
std::vector< DeDxHit > DeDxHitCollection
Definition:
DeDxHit.h:58
BaseDeDxEstimator.h
createfilelist.int
int
Definition:
createfilelist.py:10
TruncatedAverageDeDxEstimator
Definition:
TruncatedAverageDeDxEstimator.h:9
DeDxHit.h
DeDxTools.h
edm::ParameterSet
Definition:
ParameterSet.h:36
TruncatedAverageDeDxEstimator::TruncatedAverageDeDxEstimator
TruncatedAverageDeDxEstimator(const edm::ParameterSet &iConfig)
Definition:
TruncatedAverageDeDxEstimator.h:12
BaseDeDxEstimator
Definition:
BaseDeDxEstimator.h:7
Generated for CMSSW Reference Manual by
1.8.11