25 std::vector<Trajectory>
40 if(aTraj.
empty()) { ret.clear();
return ret; }
44 LogDebug(
"TrackFitters") <<
"KFTrajectorySmoother::trajectories starting with " << avtm.size() <<
" HITS\n";
48 for (
unsigned int j=0;
j<avtm.size();
j++) {
49 if (avtm[
j].recHit()->det())
50 LogTrace(
"TrackFitters") <<
"hit #:" <<
j+1 <<
" rawId=" << avtm[
j].recHit()->det()->geographicalId().rawId()
51 <<
" validity=" << avtm[
j].recHit()->isValid();
53 LogTrace(
"TrackFitters") <<
"hit #:" <<
j+1 <<
" Hit with no Det information";
56 TSOS predTsos = avtm.back().forwardPredictedState();
62 unsigned int hitcounter = avtm.size();
63 for(std::vector<TM>::const_reverse_iterator itm = avtm.rbegin(); itm != (avtm.rend()); ++itm,--hitcounter) {
68 if ( hit->surface()==0 ) {
69 LogDebug(
"TrackFitters")<<
" Error: invalid hit with no GeomDet attached .... skipping";
73 if (hitcounter != avtm.size())
77 LogDebug(
"TrackFitters") <<
"KFTrajectorySmoother: predicted tsos not valid!";
79 LogDebug(
"TrackFitters") <<
" breaking trajectory" <<
"\n";
81 LogDebug(
"TrackFitters") <<
" killing trajectory" <<
"\n";
89 <<
"----------------- HIT #" << hitcounter <<
" (VALID)-----------------------\n"
90 <<
"HIT IS AT R " << hit->globalPosition().perp() <<
"\n"
91 <<
"HIT IS AT Z " << hit->globalPosition().z() <<
"\n"
92 <<
"HIT IS AT Phi " << hit->globalPosition().phi() <<
"\n"
93 <<
"HIT IS AT Loc " << hit->localPosition() <<
"\n"
94 <<
"WITH LocError " << hit->localPositionError() <<
"\n"
95 <<
"HIT IS AT Glo " << hit->globalPosition() <<
"\n"
96 <<
"SURFACE POSITION: " << hit->surface()->position() <<
"\n"
97 <<
"SURFACE ROTATION: " << hit->surface()->rotation() <<
"\n"
98 <<
"hit geographicalId=" << hit->geographicalId().rawId();
100 DetId hitId = hit->geographicalId();
118 LogTrace(
"TrackFitters") <<
" UNKNOWN TRACKER HIT TYPE ";
128 LogTrace(
"TrackFitters") <<
" UNKNOWN MUON HIT TYPE ";
131 LogTrace(
"TrackFitters") <<
" UNKNOWN HIT TYPE ";
133 TSOS combTsos,smooTsos;
144 if (hitcounter == avtm.size()) combTsos = itm->forwardPredictedState();
145 else if (hitcounter == 1) combTsos = predTsos;
146 else combTsos =
combiner(predTsos, itm->forwardPredictedState());
149 "KFTrajectorySmoother: combined tsos not valid!\n" <<
152 "TrackingRecHit: " << hit->surface()->toGlobal(hit->localPosition()) <<
"\n" ;
154 LogDebug(
"TrackFitters") <<
" breaking trajectory" <<
"\n";
156 LogDebug(
"TrackFitters") <<
" killing trajectory" <<
"\n";
164 if (preciseHit->isValid() ==
false){
165 LogTrace(
"TrackFitters") <<
"THE Precise HIT IS NOT VALID: using currTsos = predTsos" <<
"\n";
169 LogTrace(
"TrackFitters") <<
"THE Precise HIT IS VALID: updating currTsos" <<
"\n";
176 "Failed updating state with hit. Rolling back to non-updated state.\n" <<
177 "State: " << predTsos <<
178 "Hit local pos: " << hit->localPosition() <<
"\n" <<
179 "Hit local err: " << hit->localPositionError() <<
"\n" <<
180 "Hit global pos: " << hit->globalPosition() <<
"\n" <<
181 "Hit global err: " << hit->globalPositionError().matrix() <<
186 if (hitcounter == avtm.size()) smooTsos = itm->updatedState();
187 else if (hitcounter == 1) smooTsos = currTsos;
188 else smooTsos =
combiner(itm->forwardPredictedState(), currTsos);
191 LogDebug(
"TrackFitters") <<
"KFTrajectorySmoother: smoothed tsos not valid!";
193 LogDebug(
"TrackFitters") <<
" breaking trajectory" <<
"\n";
195 LogDebug(
"TrackFitters") <<
" killing trajectory" <<
"\n";
202 if (hitcounter != avtm.size()) estimate =
estimator()->
estimate(combTsos, *preciseHit ).second;
203 else estimate = itm->estimate();
206 <<
"predTsos !" <<
"\n"
208 <<
"currTsos !" <<
"\n"
210 <<
"smooTsos !" <<
"\n"
212 <<
"smoothing estimate (with combTSOS)=" << estimate <<
"\n"
213 <<
"filtering estimate=" << itm->estimate() <<
"\n";
216 if (preciseHit->det()) myTraj.
push(
TM(itm->forwardPredictedState(),
223 else myTraj.
push(
TM(itm->forwardPredictedState(),
233 <<
"----------------- HIT #" << hitcounter <<
" (INVALID)-----------------------";
238 if (hitcounter == avtm.size()) combTsos = itm->forwardPredictedState();
239 else if (hitcounter == 1) combTsos = predTsos;
240 else combTsos =
combiner(predTsos, itm->forwardPredictedState());
244 "KFTrajectorySmoother: combined tsos not valid!";
248 myTraj.
push(
TM(itm->forwardPredictedState(),
bool empty() const
True if trajectory has no measurements.
void rescaleError(double factor)
unsigned int layer() const
layer id
virtual PropagationDirection propagationDirection() const
TrajectorySeed const & seed() const
Access to the seed used to reconstruct the Trajectory.
virtual ~KFTrajectorySmoother()
virtual HitReturnType estimate(const TrajectoryStateOnSurface &ts, const TransientTrackingRecHit &hit) const =0
virtual TrajectoryStateOnSurface update(const TrajectoryStateOnSurface &, const TransientTrackingRecHit &) const =0
const DetLayerGeometry * theGeometry
GlobalPoint globalPosition() const
Propagator * thePropagator
void reserve(unsigned int n)
unsigned int layer() const
layer id
PropagationDirection const & direction() const
virtual std::vector< Trajectory > trajectories(const Trajectory &aTraj) const
DataContainer const & measurements() const
const MeasurementEstimator * estimator() const
const MeasurementEstimator * theEstimator
const TrajectoryStateUpdator * theUpdator
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
unsigned int disk() const
disk id
virtual TrajectoryStateOnSurface propagate(const FreeTrajectoryState &, const Surface &) const
const TrajectoryStateUpdator * updator() const
unsigned int wheel() const
wheel id
unsigned int layer() const
layer id
GlobalVector globalMomentum() const
virtual void setPropagationDirection(PropagationDirection dir) const
virtual const DetLayer * idToLayer(const DetId &detId) const
Detector det() const
get the detector field from this detid
void push(const TrajectoryMeasurement &tm)
unsigned int wheel() const
wheel id