27 "KFTrajectoryFitter::fit(TrajectorySeed, <TransientTrackingRecHit>) not implemented");
40 throw cms::Exception(
"KFTrajectoryFitter",
"TrajectorySeed::direction() requested but not set");
47 <<
" +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n" 48 <<
" KFTrajectoryFitter::fit starting with " << hits.size() <<
" HITS";
50 for (
unsigned int j=0;j<hits.size();j++) {
52 LogTrace(
"TrackFitters") <<
"hit #:" << j+1 <<
" rawId=" << hits[j]->det()->geographicalId().rawId()
53 <<
" validity=" << hits[j]->isValid();
55 LogTrace(
"TrackFitters") <<
"hit #:" << j+1 <<
" Hit with no Det information";
57 LogTrace(
"TrackFitters") <<
" INITIAL STATE "<< firstPredTsos;
60 Trajectory ret(aSeed, p_cloned->propagationDirection());
64 TSOS predTsos(firstPredTsos);
68 for(
auto ihit : hits) {
76 LogDebug(
"TrackFitters")<<
" Error: invalid hit with no GeomDet attached .... skipping";
83 predTsos = p_cloned->propagate( currTsos, *(hit.
surface()) );
88 <<
"SOMETHING WRONG !" <<
"\n" 89 <<
"KFTrajectoryFitter: predicted tsos not valid!\n" 90 <<
"current TSOS: " << currTsos <<
"\n";
94 if( myTraj.foundHits() >=
minHits_ ) {
95 LogDebug(
"TrackFitters") <<
" breaking trajectory" <<
"\n";
98 LogDebug(
"TrackFitters") <<
" killing trajectory" <<
"\n";
106 assert(hit.
surface()!=
nullptr);
108 LogTrace(
"TrackFitters") <<
"THE HIT IS VALID: updating hit with predTsos";
110 assert( (!hit.
canImproveWithTrack()) | (
nullptr!=dynamic_cast<BaseTrackerRecHit const*>((ihit).
get())));
112 dump(*preciseHit,hitcounter,
"TrackFitters");
113 assert(preciseHit->isValid());
114 assert( (preciseHit->geographicalId()!=0
U) | (!preciseHit->canImproveWithTrack()) );
115 assert(preciseHit->surface()!=
nullptr);
117 if unlikely(!preciseHit->isValid()){
118 LogTrace(
"TrackFitters") <<
"THE Precise HIT IS NOT VALID: using currTsos = predTsos" <<
"\n";
123 LogTrace(
"TrackFitters") <<
"THE Precise HIT IS VALID: updating currTsos" <<
"\n";
126 bool badState = (!currTsos.
isValid())
135 edm::LogError(
"FailedUpdate") <<
"updating with the hit failed. Not updating the trajectory with the hit";
143 LogTrace(
"FailedUpdate")<<
"updated state is valid but pretty bad, skipping. currTsos " <<currTsos<<
"\n predTsos "<<predTsos;
148 if( myTraj.foundHits() >=
minHits_ ) {
149 LogDebug(
"TrackFitters") <<
" breaking trajectory" <<
"\n";
152 LogDebug(
"TrackFitters") <<
" killing trajectory" <<
"\n";
156 if (preciseHit->det()){
157 myTraj.push(
TM(predTsos, currTsos, preciseHit,
162 myTraj.push(
TM(predTsos, currTsos, preciseHit,
168 dump(hit,hitcounter,
"TrackFitters");
170 LogDebug(
"TrackFitters") <<
"THE HIT IS NOT VALID: using currTsos" <<
"\n";
172 assert( ((ihit)->det()==
nullptr) || (ihit)->geographicalId()!=0
U);
174 else myTraj.push(
TM(predTsos, ihit,0));
177 <<
"predTsos !" <<
"\n" 180 <<
"currTsos !" <<
"\n" 185 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
LocalPoint position() const
Local x and y position coordinates.
LocalPoint localPosition() const
const MeasurementEstimator * estimator() const
ConstRecHitContainer recHits() const
TrackingRecHit::ConstRecHitPointer makeShared(TrackingRecHit::ConstRecHitPointer const &hit, TrajectoryStateOnSurface const &tsos) const
void reserve(unsigned int n)
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 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
Detector det() const
get the detector field from this detid
const PositionType & position() const
Trajectory::RecHitContainer RecHitContainer
TkCloner const * theHitCloner