src
TrackingTools
GsfTracking
src
GsfChi2MeasurementEstimator.cc
Go to the documentation of this file.
1
#include "
TrackingTools/GsfTracking/interface/GsfChi2MeasurementEstimator.h
"
2
#include "
TrackingTools/GsfTools/interface/GetComponents.h
"
3
4
#include "
TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h
"
5
#include "
TrackingTools/GsfTracking/interface/PosteriorWeightsCalculator.h
"
6
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
7
8
std::pair<bool, double>
GsfChi2MeasurementEstimator::estimate
(
const
TrajectoryStateOnSurface
& tsos,
9
const
TrackingRecHit
&
hit
)
const
{
10
GetComponents
comps(tsos);
11
auto
const
& tsvec = comps();
12
if
(tsvec.empty()) {
13
edm::LogError
(
"GsfChi2MeasurementEstimator"
) <<
"Trying to calculate chi2 of hit with respect to empty mixture!"
;
14
return
std::make_pair(
false
, 0.);
15
}
16
17
auto
const
&
weights
=
PosteriorWeightsCalculator
(tsvec).
weights
(
hit
);
18
if
(
weights
.empty())
19
return
std::make_pair(
false
, 0);
20
21
// Chi2MeasurementEstimator est(chiSquaredCut());
22
double
chi2
= 0.;
23
int
i
= 0;
24
for
(
auto
const
& ts : tsvec)
25
chi2
+=
weights
[
i
++] *
theEstimator
.
estimate
(ts,
hit
).second;
26
// Done - normalisation of weights is ensured
27
// by PosteriorWeightsCalculator
28
return
returnIt
(
chi2
);
29
}
GetComponents.h
isoTrack_cff.chi2
chi2
Definition:
isoTrack_cff.py:46
mps_fire.i
i
Definition:
mps_fire.py:429
PosteriorWeightsCalculator
Definition:
PosteriorWeightsCalculator.h:13
MessageLogger.h
Chi2MeasurementEstimator::estimate
std::pair< bool, double > estimate(const TrajectoryStateOnSurface &, const TrackingRecHit &) const override
Definition:
Chi2MeasurementEstimator.cc:32
TrackingRecHit
Definition:
TrackingRecHit.h:21
edm::LogError
Log< level::Error, false > LogError
Definition:
MessageLogger.h:129
TrajectoryStateOnSurface
Definition:
TrajectoryStateOnSurface.h:16
GsfChi2MeasurementEstimator::theEstimator
Chi2MeasurementEstimator theEstimator
Definition:
GsfChi2MeasurementEstimator.h:26
GsfChi2MeasurementEstimator::estimate
std::pair< bool, double > estimate(const TrajectoryStateOnSurface &, const TrackingRecHit &) const override
Definition:
GsfChi2MeasurementEstimator.cc:8
PosteriorWeightsCalculator::weights
std::vector< double > weights(const TrackingRecHit &tsos) const
Create random state.
Definition:
PosteriorWeightsCalculator.cc:11
hltDeepSecondaryVertexTagInfosPFPuppi_cfi.weights
weights
Definition:
hltDeepSecondaryVertexTagInfosPFPuppi_cfi.py:71
Chi2MeasurementEstimatorBase::returnIt
std::pair< bool, double > returnIt(double est) const
Definition:
Chi2MeasurementEstimatorBase.h:40
hit
Definition:
SiStripHitEffFromCalibTree.cc:87
PosteriorWeightsCalculator.h
TrajectoryStateOnSurface.h
GsfChi2MeasurementEstimator.h
GetComponents
Definition:
GetComponents.h:4
Generated for CMSSW Reference Manual by
1.8.14