41 "KFTrajectoryFitter::fit(TrajectorySeed, <TransientTrackingRecHit>) not implemented");
54 throw cms::Exception(
"KFTrajectoryFitter",
"TrajectorySeed::direction() requested but not set");
61 <<
" +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n"
62 <<
" KFTrajectoryFitter::fit starting with " << hits.size() <<
" HITS";
64 for (
unsigned int j=0;
j<hits.size();
j++) {
66 LogTrace(
"TrackFitters") <<
"hit #:" <<
j+1 <<
" rawId=" << hits[
j]->det()->geographicalId().rawId()
67 <<
" validity=" << hits[
j]->isValid();
69 LogTrace(
"TrackFitters") <<
"hit #:" <<
j+1 <<
" Hit with no Det information";
71 LogTrace(
"TrackFitters") <<
" INITIAL STATE "<< firstPredTsos;
76 myTraj.reserve(hits.size());
78 TSOS predTsos(firstPredTsos);
82 for(RecHitContainer::const_iterator ihit = hits.begin(); ihit != hits.end(); ++ihit, ++hitcounter) {
89 LogDebug(
"TrackFitters")<<
" Error: invalid hit with no GeomDet attached .... skipping";
97 LogTrace(
"TrackFitters")<<
" ----------------- HIT #" << hitcounter <<
" (VALID)-----------------------\n"
104 <<
"SURFACE POSITION" <<
"\n"
106 <<
"SURFACE ROTATION" <<
"\n"
127 LogTrace(
"TrackFitters") <<
" UNKNOWN TRACKER HIT TYPE ";
137 LogTrace(
"TrackFitters") <<
" UNKNOWN MUON HIT TYPE ";
140 LogTrace(
"TrackFitters") <<
" UNKNOWN HIT TYPE ";
144 <<
" ----------------- INVALID HIT #" << hitcounter <<
" -----------------------";
148 if ( hitcounter != 1)
149 predTsos = p_cloned->propagate( currTsos, *(hit.
surface()) );
154 <<
"SOMETHING WRONG !" <<
"\n"
155 <<
"KFTrajectoryFitter: predicted tsos not valid!\n"
156 <<
"current TSOS: " << currTsos <<
"\n";
160 if( myTraj.foundHits() >=
minHits_ ) {
161 LogDebug(
"TrackFitters") <<
" breaking trajectory" <<
"\n";
164 LogDebug(
"TrackFitters") <<
" killing trajectory" <<
"\n";
174 LogTrace(
"TrackFitters") <<
"THE HIT IS VALID: updating hit with predTsos";
176 assert( (!(*ihit)->canImproveWithTrack()) | (
nullptr!=dynamic_cast<BaseTrackerRecHit const*>((*ihit).get())));
178 assert(preciseHit->isValid());
179 assert( (preciseHit->geographicalId()!=0U) | (!preciseHit->canImproveWithTrack()) );
180 assert(preciseHit->surface()!=
nullptr);
182 if unlikely(!preciseHit->isValid()){
183 LogTrace(
"TrackFitters") <<
"THE Precise HIT IS NOT VALID: using currTsos = predTsos" <<
"\n";
188 LogTrace(
"TrackFitters") <<
"THE Precise HIT IS VALID: updating currTsos" <<
"\n";
191 bool badState = (!currTsos.
isValid())
200 edm::LogError(
"FailedUpdate") <<
"updating with the hit failed. Not updating the trajectory with the hit";
208 LogTrace(
"FailedUpdate")<<
"updated state is valid but pretty bad, skipping. currTsos " <<currTsos<<
"\n predTsos "<<predTsos;
213 if( myTraj.foundHits() >=
minHits_ ) {
214 LogDebug(
"TrackFitters") <<
" breaking trajectory" <<
"\n";
217 LogDebug(
"TrackFitters") <<
" killing trajectory" <<
"\n";
221 if (preciseHit->det()){
222 myTraj.push(
TM(predTsos, currTsos, preciseHit,
227 myTraj.push(
TM(predTsos, currTsos, preciseHit,
234 LogDebug(
"TrackFitters") <<
"THE HIT IS NOT VALID: using currTsos" <<
"\n";
236 assert( ((*ihit)->det()==
nullptr) || (*ihit)->geographicalId()!=0U);
237 if ((*ihit)->det()) myTraj.push(
TM(predTsos, *ihit,0,
theGeometry->
idToLayer((*ihit)->geographicalId()) ));
238 else myTraj.push(
TM(predTsos, *ihit,0));
241 <<
"predTsos !" <<
"\n"
243 <<
"currTsos !" <<
"\n"
247 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
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.
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