26 "KFTrajectoryFitter::fit(TrajectorySeed, <TransientTrackingRecHit>) not implemented");
33 const TSOS& firstPredTsos,
40 throw cms::Exception(
"KFTrajectoryFitter",
"TrajectorySeed::direction() requested but not set");
46 <<
" +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n"
47 <<
" KFTrajectoryFitter::fit starting with " <<
hits.size() <<
" HITS";
49 for (
unsigned int j = 0;
j <
hits.size();
j++) {
51 LogTrace(
"TrackFitters") <<
"hit #:" <<
j + 1 <<
" rawId=" <<
hits[
j]->det()->geographicalId().rawId()
52 <<
" validity=" <<
hits[
j]->isValid();
54 LogTrace(
"TrackFitters") <<
"hit #:" <<
j + 1 <<
" Hit with no Det information";
56 LogTrace(
"TrackFitters") <<
" INITIAL STATE " << firstPredTsos;
61 myTraj.reserve(
hits.size());
63 TSOS predTsos(firstPredTsos);
67 for (
auto ihit :
hits) {
76 LogDebug(
"TrackFitters") <<
" Error: invalid hit with no GeomDet attached .... skipping";
83 predTsos = p_cloned->propagate(currTsos, *(
hit.surface()));
87 LogDebug(
"TrackFitters") <<
"SOMETHING WRONG !"
89 <<
"KFTrajectoryFitter: predicted tsos not valid!\n"
90 <<
"current TSOS: " << currTsos <<
"\n";
93 LogTrace(
"TrackFitters") <<
"next Surface: " <<
hit.surface()->position() <<
"\n";
95 if (myTraj.foundHits() >=
minHits_) {
96 LogDebug(
"TrackFitters") <<
" breaking trajectory"
100 LogDebug(
"TrackFitters") <<
" killing trajectory"
108 assert((
hit.geographicalId() != 0
U) | !
hit.canImproveWithTrack());
111 LogTrace(
"TrackFitters") <<
"THE HIT IS VALID: updating hit with predTsos";
113 assert((!
hit.canImproveWithTrack()) | (
nullptr != dynamic_cast<BaseTrackerRecHit const*>((ihit).
get())));
115 dump(*preciseHit, hitcounter,
"TrackFitters");
116 assert(preciseHit->isValid());
117 assert((preciseHit->geographicalId() != 0
U) | (!preciseHit->canImproveWithTrack()));
118 assert(preciseHit->surface() !=
nullptr);
122 LogTrace(
"TrackFitters") <<
"THE Precise HIT IS NOT VALID: using currTsos = predTsos"
128 LogTrace(
"TrackFitters") <<
"THE Precise HIT IS VALID: updating currTsos"
132 bool badState = (!currTsos.
isValid()) ||
142 <<
"updating with the hit failed. Not updating the trajectory with the hit";
148 edm::LogError(
"TrajectoryNotPosDef") <<
"Trajectory covariance is not positive-definite";
151 LogTrace(
"FailedUpdate") <<
"updated state is valid but pretty bad, skipping. currTsos " << currTsos
152 <<
"\n predTsos " << predTsos;
157 if (myTraj.foundHits() >=
minHits_) {
158 LogDebug(
"TrackFitters") <<
" breaking trajectory"
162 LogDebug(
"TrackFitters") <<
" killing trajectory"
168 if (preciseHit->det()) {
169 myTraj.push(
TM(predTsos,
175 myTraj.push(
TM(predTsos, currTsos, preciseHit,
estimator()->estimate(predTsos, *preciseHit).
second));
181 dump(
hit, hitcounter,
"TrackFitters");
183 LogDebug(
"TrackFitters") <<
"THE HIT IS NOT VALID: using currTsos"
186 assert(((ihit)->det() ==
nullptr) || (ihit)->geographicalId() != 0
U);
190 myTraj.push(
TM(predTsos, ihit, 0));
192 LogTrace(
"TrackFitters") <<
"predTsos !"
194 << predTsos <<
" with local position " << predTsos.
localPosition() <<
"currTsos !"
196 << currTsos <<
" with local position " << currTsos.
localPosition();
199 LogDebug(
"TrackFitters") <<
"Found 1 trajectory with " << myTraj.foundHits() <<
" valid hits\n";