Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
src
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/DeDxTools.h
"
5
#include "
DataFormats/TrackReco/interface/DeDxHit.h
"
6
#include <numeric>
7
8
class
TruncatedAverageDeDxEstimator
:
public
BaseDeDxEstimator
9
{
10
public
:
11
TruncatedAverageDeDxEstimator
(
float
fraction):
m_fraction
(fraction) {}
12
13
virtual
std::pair<float,float>
dedx
(
const
reco::DeDxHitCollection
& Hits){
14
int
nTrunc = int( Hits.size()*
m_fraction
);
15
double
sumdedx = 0;
16
for
(
size_t
i
=0;
i
+ nTrunc < Hits.size() ;
i
++){
17
sumdedx+=Hits[
i
].charge();
18
}
19
double
avrdedx = (Hits.size()) ? sumdedx/(Hits.size()-nTrunc) :0.0;
20
return
std::make_pair(avrdedx,-1);
21
}
22
23
private
:
24
float
m_fraction
;
25
26
};
27
28
#endif
TruncatedAverageDeDxEstimator::m_fraction
float m_fraction
Definition:
TruncatedAverageDeDxEstimator.h:24
i
int i
Definition:
DBlmapReader.cc:9
reco::DeDxHitCollection
std::vector< DeDxHit > DeDxHitCollection
Definition:
DeDxHit.h:49
TruncatedAverageDeDxEstimator::TruncatedAverageDeDxEstimator
TruncatedAverageDeDxEstimator(float fraction)
Definition:
TruncatedAverageDeDxEstimator.h:11
TruncatedAverageDeDxEstimator::dedx
virtual std::pair< float, float > dedx(const reco::DeDxHitCollection &Hits)
Definition:
TruncatedAverageDeDxEstimator.h:13
TruncatedAverageDeDxEstimator
Definition:
TruncatedAverageDeDxEstimator.h:8
DeDxHit.h
DeDxTools.h
BaseDeDxEstimator
Definition:
BaseDeDxEstimator.h:5
Generated for CMSSW Reference Manual by
1.8.5