RecoVertex
GhostTrackFitter
src
PositiveSideGhostTrackFitter.cc
Go to the documentation of this file.
1
#include <cmath>
2
#include <vector>
3
4
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
5
#include "
DataFormats/GeometryVector/interface/GlobalVector.h
"
6
#include "
DataFormats/GeometryVector/interface/GlobalPoint.h
"
7
8
#include "
RecoVertex/GhostTrackFitter/interface/GhostTrackState.h
"
9
#include "
RecoVertex/GhostTrackFitter/interface/GhostTrackPrediction.h
"
10
11
#include "
RecoVertex/GhostTrackFitter/interface/PositiveSideGhostTrackFitter.h
"
12
13
using namespace
reco
;
14
15
GhostTrackPrediction
PositiveSideGhostTrackFitter::fit
(
const
GhostTrackFitter::PredictionUpdater
&updater,
16
const
GhostTrackPrediction
&
prior
,
17
std::vector<GhostTrackState> &states,
18
double
&
ndof
,
19
double
&
chi2
) {
20
double
rho =
prior
.rho();
21
for
(
unsigned
int
i
= 0;
i
< states.size();
i
++) {
22
GhostTrackState
&
state
= states[
i
];
23
state
.linearize(
prior
,
true
, .5 / rho);
24
}
25
26
GhostTrackPrediction
pred =
actualFitter_
->fit(updater,
prior
, states,
ndof
,
chi2
);
27
28
double
origin = pred.
lambda
(
origin_
);
29
bool
done
=
true
;
30
for
(
unsigned
int
i
= 0;
i
< states.size();
i
++) {
31
GhostTrackState
&
state
= states[
i
];
32
double
lambda =
state
.lambda();
33
if
(lambda < origin && (origin - lambda) < 3.5) {
34
GhostTrackState
testState =
state
;
35
testState.
linearize
(pred, 2. * origin - lambda);
36
double
ndof
,
chi2
;
37
38
if
(testState.
isValid
()) {
39
updater.
contribution
(
prior
, testState,
ndof
,
chi2
,
true
);
40
if
(
ndof
> 0. &&
chi2
< 10.) {
41
state
= testState;
42
if
(
state
.weight() != 1.)
43
state
.setWeight(3.);
44
done
=
false
;
45
}
46
}
else
{
47
edm::LogError
(
"InvalidGhostTrackState"
) <<
"Invalid GhostTrackState encountered!"
;
48
}
49
}
50
}
51
52
if
(!
done
) {
53
for
(
unsigned
int
i
= 0;
i
< states.size();
i
++) {
54
GhostTrackState
&
state
= states[
i
];
55
double
lambda =
state
.lambda();
56
if
(
state
.weight() != 1. && lambda < origin) {
57
double
weight
=
std::exp
(10. * (origin - lambda) - .1);
58
state
.setWeight(
std::min
(
state
.weight(),
weight
));
59
}
60
}
61
62
pred =
actualFitter_
->fit(updater,
prior
, states,
ndof
,
chi2
);
63
}
64
65
return
pred;
66
}
GhostTrackPrediction.h
reco::GhostTrackFitter::PredictionUpdater
Definition:
GhostTrackFitter.h:42
reco::GhostTrackState::isValid
bool isValid() const
Definition:
GhostTrackState.h:42
mps_fire.i
i
Definition:
mps_fire.py:428
MessageLogger.h
min
T min(T a, T b)
Definition:
MathUtil.h:58
mps_merge.weight
weight
Definition:
mps_merge.py:88
reco::GhostTrackFitter::PredictionUpdater::contribution
virtual void contribution(const GhostTrackPrediction &pred, const GhostTrackState &state, double &ndof, double &chi2, bool withPredError=false) const =0
GhostTrackState.h
reco
fixed size matrix
Definition:
AlignmentAlgorithmBase.h:46
hltPixelTracks_cff.chi2
chi2
Definition:
hltPixelTracks_cff.py:25
reco::GhostTrackState
Definition:
GhostTrackState.h:21
ndof
Definition:
HIMultiTrackSelector.h:49
fileCollector.done
done
Definition:
fileCollector.py:123
reco::GhostTrackState::linearize
bool linearize(const GhostTrackPrediction &pred, bool initial=false, double lambda=0.)
Definition:
GhostTrackState.h:47
edm::LogError
Log< level::Error, false > LogError
Definition:
MessageLogger.h:123
reco::PositiveSideGhostTrackFitter::origin_
GlobalPoint origin_
Definition:
PositiveSideGhostTrackFitter.h:34
reco::PositiveSideGhostTrackFitter::actualFitter_
std::unique_ptr< GhostTrackFitter::FitterImpl > actualFitter_
Definition:
PositiveSideGhostTrackFitter.h:35
RunInfoPI::state
state
Definition:
RunInfoPayloadInspectoHelper.h:16
reco::PositiveSideGhostTrackFitter::fit
GhostTrackPrediction fit(const GhostTrackFitter::PredictionUpdater &updater, const GhostTrackPrediction &prior, std::vector< GhostTrackState > &states, double &ndof, double &chi2) override
Definition:
PositiveSideGhostTrackFitter.cc:15
GlobalVector.h
bookConverter.prior
prior
Definition:
bookConverter.py:146
PositiveSideGhostTrackFitter.h
reco::GhostTrackPrediction
Definition:
GhostTrackPrediction.h:21
JetChargeProducer_cfi.exp
exp
Definition:
JetChargeProducer_cfi.py:6
GlobalPoint.h
weight
Definition:
weight.py:1
reco::GhostTrackPrediction::lambda
double lambda(const GlobalPoint &point) const
Definition:
GhostTrackPrediction.h:65
Generated for CMSSW Reference Manual by
1.8.16