25 <<
"----------------- HIT #" << hitCounter <<
" (VALID)-----------------------\n"
26 <<
"HIT IS AT R " << hit->globalPosition().perp() <<
"\n"
27 <<
"HIT IS AT Z " << hit->globalPosition().z() <<
"\n"
28 <<
"HIT IS AT Phi " << hit->globalPosition().phi() <<
"\n"
29 <<
"HIT IS AT Loc " << hit->localPosition() <<
"\n"
30 <<
"WITH LocError " << hit->localPositionError() <<
"\n"
31 <<
"HIT IS AT Glo " << hit->globalPosition() <<
"\n"
32 <<
"SURFACE POSITION: " << hit->surface()->position() <<
"\n"
33 <<
"SURFACE ROTATION: " << hit->surface()->rotation() <<
"\n"
34 <<
"hit geographicalId=" << hit->geographicalId().rawId();
36 DetId hitId = hit->geographicalId();
52 LogTrace(
"TrackFitters") <<
" UNKNOWN TRACKER HIT TYPE ";
62 LogTrace(
"TrackFitters") <<
" UNKNOWN MUON HIT TYPE ";
65 LogTrace(
"TrackFitters") <<
" UNKNOWN HIT TYPE ";
103 LogDebug(
"TrackFitters") <<
"KFTrajectorySmoother::trajectories starting with " << avtm.size() <<
" HITS\n";
104 for (
unsigned int j=0;
j<avtm.size();
j++) {
105 if (avtm[
j].recHit()->det())
106 LogTrace(
"TrackFitters") <<
"hit #:" <<
j+1 <<
" rawId=" << avtm[
j].recHit()->det()->geographicalId().rawId()
107 <<
" validity=" << avtm[
j].recHit()->isValid();
109 LogTrace(
"TrackFitters") <<
"hit #:" <<
j+1 <<
" Hit with no Det information";
111 #endif // EDM_ML_DEBUG
117 auto start = avtm.rbegin();
120 auto hitSize = avtm.rend()-
start;
122 LogDebug(
"TrackFitters") <<
" killing trajectory" <<
"\n";
127 myTraj.reserve(hitSize);
130 TSOS predTsos = (*start).forwardPredictedState();
134 auto hitCounter = hitSize;
135 for(std::vector<TM>::const_reverse_iterator itm =
start; itm != (avtm.rend()); ++itm,--hitCounter) {
142 LogDebug(
"TrackFitters") <<
" Error: invalid hit with no GeomDet attached .... skipping";
148 predTsos = usePropagator->
propagate( currTsos, *(hit->surface()) );
151 LogDebug(
"TrackFitters") <<
"KFTrajectorySmoother: predicted tsos not valid!";
152 LogDebug(
"TrackFitters") <<
" retry with last hit removed" <<
"\n";
156 << hitSize <<
' ' << hitCounter <<
' ' << int(hit->geographicalId()) <<
' '
157 << hit->surface()->position().perp() <<
' ' << hit->surface()->eta() <<
' ' << hit->surface()->phi() << std::endl;
165 TSOS combTsos,smooTsos;
176 if (itm ==
start) combTsos = itm->forwardPredictedState();
177 else if (hitCounter == 1) combTsos = predTsos;
178 else combTsos =
combiner(predTsos, itm->forwardPredictedState());
182 "KFTrajectorySmoother: combined tsos not valid!\n" <<
185 "TrackingRecHit: " << hit->surface()->toGlobal(hit->localPosition()) <<
"\n" ;
191 assert( (hit->geographicalId()!=0U) | (!hit->canImproveWithTrack()) );
192 assert(hit->surface()!=
nullptr);
194 assert( (!(hit)->canImproveWithTrack()) | (
nullptr!=dynamic_cast<BaseTrackerRecHit const*>(hit.get())));
196 assert(preciseHit->isValid());
197 assert( (preciseHit->geographicalId()!=0U) | (!preciseHit->canImproveWithTrack()) );
198 assert(preciseHit->surface()!=
nullptr);
200 dump(hit,hitCounter);
202 if unlikely(!preciseHit->isValid()){
203 LogTrace(
"TrackFitters") <<
"THE Precise HIT IS NOT VALID: using currTsos = predTsos" <<
"\n";
207 LogTrace(
"TrackFitters") <<
"THE Precise HIT IS VALID: updating currTsos" <<
"\n";
214 "Failed updating state with hit. Rolling back to non-updated state.\n" <<
215 "State: " << predTsos <<
217 "Hit local err: " << hit->localPositionError() <<
"\n" <<
218 "Hit global pos: " << hit->globalPosition() <<
"\n" <<
219 "Hit global err: " << hit->globalPositionError().matrix() <<
224 if (itm ==
start) smooTsos = itm->updatedState();
225 else if (hitCounter == 1) smooTsos = currTsos;
226 else smooTsos =
combiner(itm->forwardPredictedState(), currTsos);
229 LogDebug(
"TrackFitters") <<
"KFTrajectorySmoother: smoothed tsos not valid!";
237 else estimate = itm->estimate();
240 <<
"predTsos !" <<
"\n"
242 <<
" with local position " << predTsos.
localPosition() <<
"\n\n"
243 <<
"currTsos !" <<
"\n"
245 <<
" with local position " << currTsos.
localPosition() <<
"\n\n"
246 <<
"smooTsos !" <<
"\n"
248 <<
" with local position " << smooTsos.
localPosition() <<
"\n\n"
249 <<
"smoothing estimate (with combTSOS)=" << estimate <<
"\n"
250 <<
"filtering estimate=" << itm->estimate() <<
"\n";
253 if (preciseHit->det()) myTraj.push(
TM(itm->forwardPredictedState(),
260 else myTraj.push(
TM(itm->forwardPredictedState(),
270 <<
"----------------- HIT #" << hitCounter <<
" (INVALID)-----------------------";
275 if (itm ==
start) combTsos = itm->forwardPredictedState();
276 else if (hitCounter == 1) combTsos = predTsos;
277 else combTsos =
combiner(predTsos, itm->forwardPredictedState());
281 "KFTrajectorySmoother: combined tsos not valid!";
284 assert( (hit->det()==
nullptr) || hit->geographicalId()!=0U);
286 myTraj.push(
TM(itm->forwardPredictedState(),
292 else myTraj.push(
TM(itm->forwardPredictedState(),
301 if (!retry)
return ret;
bool empty() const
True if trajectory has no measurements.
void rescaleError(double factor)
tuple ret
prodAgent to be discontinued
unsigned int layer() const
layer id
virtual Trajectory trajectory(const Trajectory &aTraj) const override
TrajectorySeed const & seed() const
Access to the seed used to reconstruct the Trajectory.
virtual ~KFTrajectorySmoother()
const DetLayerGeometry * theGeometry
LocalPoint localPosition() const
GlobalPoint globalPosition() const
virtual PropagationDirection propagationDirection() const final
unsigned int layer() const
layer id
PropagationDirection const & direction() const
DataContainer const & measurements() const
virtual TrajectoryStateOnSurface update(const TrajectoryStateOnSurface &, const TrackingRecHit &) const =0
std::shared_ptr< TrackingRecHit const > ConstRecHitPointer
const MeasurementEstimator * estimator() const
const MeasurementEstimator * theEstimator
const TrajectoryStateUpdator * theUpdator
virtual HitReturnType estimate(const TrajectoryStateOnSurface &ts, const TrackingRecHit &hit) const =0
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
unsigned int disk() const
disk id
const TrajectoryStateUpdator * updator() const
TrackingRecHit *operator()[[cms TrackingRecHit::ConstRecHitPointer makeShared(TrackingRecHit::ConstRecHitPointer const &hit, TrajectoryStateOnSurface const &tsos) const
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
unsigned int wheel() const
wheel id
unsigned int layer() const
layer id
GlobalVector globalMomentum() const
const Propagator * theAlongPropagator
const Propagator * theOppositePropagator
virtual const DetLayer * idToLayer(const DetId &detId) const
Detector det() const
get the detector field from this detid
TkCloner const * theHitCloner
unsigned int wheel() const
wheel id