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"
128 LogDebug(
"TrackFitters") <<
" UNKNOWN TRACKER HIT TYPE ";
143 LogDebug(
"TrackFitters") <<
" UNKNOWN MUON HIT TYPE ";
146 LogDebug(
"TrackFitters") <<
" UNKNOWN HIT TYPE ";
150 <<
" ----------------- INVALID HIT #" << hitcounter <<
" -----------------------";
154 if ( hitcounter != 1)
155 predTsos = p_cloned->propagate( currTsos, *(hit.
surface()) );
160 <<
"SOMETHING WRONG !" <<
"\n"
161 <<
"KFTrajectoryFitter: predicted tsos not valid!\n"
162 <<
"current TSOS: " << currTsos <<
"\n";
166 if( myTraj.foundHits() >=
minHits_ ) {
167 LogDebug(
"TrackFitters") <<
" breaking trajectory" <<
"\n";
170 LogDebug(
"TrackFitters") <<
" killing trajectory" <<
"\n";
180 LogTrace(
"TrackFitters") <<
"THE HIT IS VALID: updating hit with predTsos";
182 assert( (!(*ihit)->canImproveWithTrack()) | (
nullptr!=dynamic_cast<BaseTrackerRecHit const*>((*ihit).get())));
184 assert(preciseHit->isValid());
185 assert( (preciseHit->geographicalId()!=0U) | (!preciseHit->canImproveWithTrack()) );
186 assert(preciseHit->surface()!=
nullptr);
188 if unlikely(!preciseHit->isValid()){
189 LogTrace(
"TrackFitters") <<
"THE Precise HIT IS NOT VALID: using currTsos = predTsos" <<
"\n";
194 LogTrace(
"TrackFitters") <<
"THE Precise HIT IS VALID: updating currTsos" <<
"\n";
197 bool badState = (!currTsos.
isValid())
206 edm::LogError(
"FailedUpdate") <<
"updating with the hit failed. Not updating the trajectory with the hit";
214 LogTrace(
"FailedUpdate")<<
"updated state is valid but pretty bad, skipping. currTsos " <<currTsos<<
"\n predTsos "<<predTsos;
219 if( myTraj.foundHits() >=
minHits_ ) {
220 LogDebug(
"TrackFitters") <<
" breaking trajectory" <<
"\n";
223 LogDebug(
"TrackFitters") <<
" killing trajectory" <<
"\n";
227 if (preciseHit->det()){
228 myTraj.push(
TM(predTsos, currTsos, preciseHit,
233 myTraj.push(
TM(predTsos, currTsos, preciseHit,
240 LogDebug(
"TrackFitters") <<
"THE HIT IS NOT VALID: using currTsos" <<
"\n";
242 assert( ((*ihit)->det()==
nullptr) || (*ihit)->geographicalId()!=0U);
243 if ((*ihit)->det()) myTraj.push(
TM(predTsos, *ihit,0,
theGeometry->
idToLayer((*ihit)->geographicalId()) ));
244 else myTraj.push(
TM(predTsos, *ihit,0));
247 <<
"predTsos !" <<
"\n"
250 <<
"currTsos !" <<
"\n"
255 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
tuple ret
prodAgent to be discontinued
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
ConstRecHitContainer recHits() 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