25 "KFTrajectoryFitter::fit(TrajectorySeed, <TransientTrackingRecHit>) not implemented");
32 const TSOS& firstPredTsos,
39 throw cms::Exception(
"KFTrajectoryFitter",
"TrajectorySeed::direction() requested but not set");
45 <<
" +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n" 46 <<
" KFTrajectoryFitter::fit starting with " << hits.size() <<
" HITS";
48 for (
unsigned int j = 0;
j < hits.size();
j++) {
50 LogTrace(
"TrackFitters") <<
"hit #:" <<
j + 1 <<
" rawId=" << hits[
j]->det()->geographicalId().rawId()
51 <<
" validity=" << hits[
j]->isValid();
53 LogTrace(
"TrackFitters") <<
"hit #:" <<
j + 1 <<
" Hit with no Det information";
55 LogTrace(
"TrackFitters") <<
" INITIAL STATE " << firstPredTsos;
60 myTraj.reserve(hits.size());
62 TSOS predTsos(firstPredTsos);
66 for (
auto ihit : hits) {
75 LogDebug(
"TrackFitters") <<
" Error: invalid hit with no GeomDet attached .... skipping";
82 predTsos = p_cloned->propagate(currTsos, *(hit.
surface()));
86 LogDebug(
"TrackFitters") <<
"SOMETHING WRONG !" 88 <<
"KFTrajectoryFitter: predicted tsos not valid!\n" 89 <<
"current TSOS: " << currTsos <<
"\n";
94 if (myTraj.foundHits() >=
minHits_) {
95 LogDebug(
"TrackFitters") <<
" breaking trajectory" 99 LogDebug(
"TrackFitters") <<
" killing trajectory" 108 assert(hit.
surface() !=
nullptr);
110 LogTrace(
"TrackFitters") <<
"THE HIT IS VALID: updating hit with predTsos";
112 assert((!hit.
canImproveWithTrack()) | (
nullptr != dynamic_cast<BaseTrackerRecHit const*>((ihit).
get())));
114 dump(*preciseHit, hitcounter,
"TrackFitters");
115 assert(preciseHit->isValid());
116 assert((preciseHit->geographicalId() != 0
U) | (!preciseHit->canImproveWithTrack()));
117 assert(preciseHit->surface() !=
nullptr);
121 LogTrace(
"TrackFitters") <<
"THE Precise HIT IS NOT VALID: using currTsos = predTsos" 127 LogTrace(
"TrackFitters") <<
"THE Precise HIT IS VALID: updating currTsos" 131 bool badState = (!currTsos.
isValid()) ||
141 <<
"updating with the hit failed. Not updating the trajectory with the hit";
147 edm::LogError(
"TrajectoryNotPosDef") <<
"Trajectory covariance is not positive-definite";
150 LogTrace(
"FailedUpdate") <<
"updated state is valid but pretty bad, skipping. currTsos " << currTsos
151 <<
"\n predTsos " << predTsos;
156 if (myTraj.foundHits() >=
minHits_) {
157 LogDebug(
"TrackFitters") <<
" breaking trajectory" 161 LogDebug(
"TrackFitters") <<
" killing trajectory" 167 if (preciseHit->det()) {
168 myTraj.push(
TM(predTsos,
174 myTraj.push(
TM(predTsos, currTsos, preciseHit,
estimator()->estimate(predTsos, *preciseHit).
second));
180 dump(hit, hitcounter,
"TrackFitters");
182 LogDebug(
"TrackFitters") <<
"THE HIT IS NOT VALID: using currTsos" 185 assert(((ihit)->det() ==
nullptr) || (ihit)->geographicalId() != 0
U);
189 myTraj.push(
TM(predTsos, ihit, 0));
191 LogTrace(
"TrackFitters") <<
"predTsos !" 193 << predTsos <<
" with local position " << predTsos.
localPosition() <<
"currTsos !" 195 << currTsos <<
" with local position " << currTsos.
localPosition();
198 LogDebug(
"TrackFitters") <<
"Found 1 trajectory with " << myTraj.foundHits() <<
" valid hits\n";
PropagationDirection direction() const
bool empty() const
True if trajectory has no measurements.
virtual const Surface * surface() const
TrajectorySeed const & seed() const
Access to the seed used to reconstruct the Trajectory.
const LocalTrajectoryParameters & localParameters() const
const TrajectoryStateUpdator * updator() const
constexpr bool isNotFinite(T x)
LocalPoint position() const
Local x and y position coordinates.
ret
prodAgent to be discontinued
LocalPoint localPosition() const
const MeasurementEstimator * estimator() const
ConstRecHitContainer recHits() const
TrackingRecHit::ConstRecHitPointer makeShared(TrackingRecHit::ConstRecHitPointer const &hit, TrajectoryStateOnSurface const &tsos) const
virtual TrajectoryStateOnSurface update(const TrajectoryStateOnSurface &, const TrackingRecHit &) const =0
Trajectory fitOne(const Trajectory &aTraj, fitType) const override
U second(std::pair< T, U > const &p)
std::unique_ptr< Propagator > SetPropagationDirection(Propagator const &iprop, PropagationDirection dir)
static const DetLayerGeometry dummyGeometry
Abs< T >::type abs(const T &t)
const LocalTrajectoryError & localError() const
const DetLayerGeometry * theGeometry
TrajectoryMeasurement const & firstMeasurement() const
virtual bool canImproveWithTrack() const
const Propagator * thePropagator
TrajectoryStateOnSurface const & updatedState() const
DetId geographicalId() const
virtual const DetLayer * idToLayer(const DetId &detId) const
const PositionType & position() const
Trajectory::RecHitContainer RecHitContainer
TkCloner const * theHitCloner
constexpr Detector det() const
get the detector field from this detid