39 "KFTrajectoryFitter::fit(TrajectorySeed, <TransientTrackingRecHit>) not implemented");
52 throw cms::Exception(
"KFTrajectoryFitter",
"TrajectorySeed::direction() requested but not set");
59 <<
" +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n"
60 <<
" KFTrajectoryFitter::fit starting with " << hits.size() <<
" HITS";
62 for (
unsigned int j=0;
j<hits.size();
j++) {
64 LogTrace(
"TrackFitters") <<
"hit #:" <<
j+1 <<
" rawId=" << hits[
j]->det()->geographicalId().rawId()
65 <<
" validity=" << hits[
j]->isValid();
67 LogTrace(
"TrackFitters") <<
"hit #:" <<
j+1 <<
" Hit with no Det information";
69 LogTrace(
"TrackFitters") <<
" INITIAL STATE "<< firstPredTsos;
74 myTraj.reserve(hits.size());
76 TSOS predTsos(firstPredTsos);
80 for(RecHitContainer::const_iterator ihit = hits.begin(); ihit != hits.end(); ++ihit, ++hitcounter) {
87 LogDebug(
"TrackFitters")<<
" Error: invalid hit with no GeomDet attached .... skipping";
95 LogTrace(
"TrackFitters")<<
" ----------------- HIT #" << hitcounter <<
" (VALID)-----------------------\n"
102 <<
"SURFACE POSITION" <<
"\n"
104 <<
"SURFACE ROTATION" <<
"\n"
126 LogTrace(
"TrackFitters") <<
" UNKNOWN TRACKER HIT TYPE ";
136 LogTrace(
"TrackFitters") <<
" UNKNOWN MUON HIT TYPE ";
139 LogTrace(
"TrackFitters") <<
" UNKNOWN HIT TYPE ";
143 <<
" ----------------- INVALID HIT #" << hitcounter <<
" -----------------------";
147 if ( hitcounter != 1)
148 predTsos = p_cloned->propagate( currTsos, *(hit.
surface()) );
153 <<
"SOMETHING WRONG !" <<
"\n"
154 <<
"KFTrajectoryFitter: predicted tsos not valid!\n"
155 <<
"current TSOS: " << currTsos <<
"\n";
159 if( myTraj.foundHits() >=
minHits_ ) {
160 LogDebug(
"TrackFitters") <<
" breaking trajectory" <<
"\n";
163 LogDebug(
"TrackFitters") <<
" killing trajectory" <<
"\n";
173 LogTrace(
"TrackFitters") <<
"THE HIT IS VALID: updating hit with predTsos";
175 assert( (!(*ihit)->canImproveWithTrack()) | (
nullptr!=dynamic_cast<BaseTrackerRecHit const*>((*ihit).get())));
177 assert(preciseHit->isValid());
178 assert( (preciseHit->geographicalId()!=0U) | (!preciseHit->canImproveWithTrack()) );
179 assert(preciseHit->surface()!=
nullptr);
181 if unlikely(!preciseHit->isValid()){
182 LogTrace(
"TrackFitters") <<
"THE Precise HIT IS NOT VALID: using currTsos = predTsos" <<
"\n";
187 LogTrace(
"TrackFitters") <<
"THE Precise HIT IS VALID: updating currTsos" <<
"\n";
190 bool badState = (!currTsos.
isValid())
199 edm::LogError(
"FailedUpdate") <<
"updating with the hit failed. Not updating the trajectory with the hit";
207 LogTrace(
"FailedUpdate")<<
"updated state is valid but pretty bad, skipping. currTsos " <<currTsos<<
"\n predTsos "<<predTsos;
212 if( myTraj.foundHits() >=
minHits_ ) {
213 LogDebug(
"TrackFitters") <<
" breaking trajectory" <<
"\n";
216 LogDebug(
"TrackFitters") <<
" killing trajectory" <<
"\n";
220 if (preciseHit->det()){
221 myTraj.push(
TM(predTsos, currTsos, preciseHit,
226 myTraj.push(
TM(predTsos, currTsos, preciseHit,
233 LogDebug(
"TrackFitters") <<
"THE HIT IS NOT VALID: using currTsos" <<
"\n";
235 assert( ((*ihit)->det()==
nullptr) || (*ihit)->geographicalId()!=0U);
236 if ((*ihit)->det()) myTraj.push(
TM(predTsos, *ihit,0,
theGeometry->
idToLayer((*ihit)->geographicalId()) ));
237 else myTraj.push(
TM(predTsos, *ihit,0));
240 <<
"predTsos !" <<
"\n"
243 <<
"currTsos !" <<
"\n"
248 LogDebug(
"TrackFitters") <<
"Found 1 trajectory with " << myTraj.foundHits() <<
" valid hits\n";
PropagationDirection direction() const
bool empty() const
True if trajectory has no measurements.
virtual int dimension() const =0
virtual const Surface * surface() const
unsigned int layer() const
layer id
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
Geom::Phi< T > phi() const
const MeasurementEstimator * estimator() const
virtual GlobalPoint globalPosition() const
unsigned int layer() const
layer id
uint32_t rawId() const
get the raw id
U second(std::pair< T, U > const &p)
std::unique_ptr< Propagator > SetPropagationDirection(Propagator const &iprop, PropagationDirection dir)
virtual TrajectoryStateOnSurface update(const TrajectoryStateOnSurface &, const TrackingRecHit &) const =0
static const DetLayerGeometry dummyGeometry
Abs< T >::type abs(const T &t)
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 DetLayerGeometry * theGeometry
TrajectoryMeasurement const & firstMeasurement() const
virtual LocalError localPositionError() const =0
virtual bool canImproveWithTrack() const
TrackingRecHit *operator()[[cms TrackingRecHit::ConstRecHitPointer makeShared(TrackingRecHit::ConstRecHitPointer const &hit, TrajectoryStateOnSurface const &tsos) const
unsigned int wheel() const
wheel id
unsigned int layer() const
layer id
Trajectory fitOne(const Trajectory &aTraj, fitType) const
const Propagator * thePropagator
const RotationType & rotation() const
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
virtual LocalPoint localPosition() const =0
const PositionType & position() const
Trajectory::RecHitContainer RecHitContainer
unsigned int wheel() const
wheel id
TkCloner const * theHitCloner