28 LogTrace(
"TrackFitters")<<
" ----------------- HIT #" << hitcounter <<
" (VALID)-----------------------\n" 35 <<
"SURFACE POSITION" <<
"\n" 37 <<
"SURFACE ROTATION" <<
"\n" 59 LogDebug(
"TrackFitters") <<
" UNKNOWN TRACKER HIT TYPE ";
74 LogDebug(
"TrackFitters") <<
" UNKNOWN MUON HIT TYPE ";
77 LogDebug(
"TrackFitters") <<
" UNKNOWN HIT TYPE ";
81 <<
" ----------------- INVALID HIT #" << hitcounter <<
" -----------------------";
107 "KFTrajectoryFitter::fit(TrajectorySeed, <TransientTrackingRecHit>) not implemented");
120 throw cms::Exception(
"KFTrajectoryFitter",
"TrajectorySeed::direction() requested but not set");
127 <<
" +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n" 128 <<
" KFTrajectoryFitter::fit starting with " << hits.size() <<
" HITS";
130 for (
unsigned int j=0;j<hits.size();j++) {
132 LogTrace(
"TrackFitters") <<
"hit #:" << j+1 <<
" rawId=" << hits[j]->det()->geographicalId().rawId()
133 <<
" validity=" << hits[j]->isValid();
135 LogTrace(
"TrackFitters") <<
"hit #:" << j+1 <<
" Hit with no Det information";
137 LogTrace(
"TrackFitters") <<
" INITIAL STATE "<< firstPredTsos;
140 Trajectory ret(aSeed, p_cloned->propagationDirection());
144 TSOS predTsos(firstPredTsos);
148 for(
auto ihit : hits) {
156 LogDebug(
"TrackFitters")<<
" Error: invalid hit with no GeomDet attached .... skipping";
162 if ( hitcounter != 1)
163 predTsos = p_cloned->propagate( currTsos, *(hit.
surface()) );
168 <<
"SOMETHING WRONG !" <<
"\n" 169 <<
"KFTrajectoryFitter: predicted tsos not valid!\n" 170 <<
"current TSOS: " << currTsos <<
"\n";
174 if( myTraj.foundHits() >=
minHits_ ) {
175 LogDebug(
"TrackFitters") <<
" breaking trajectory" <<
"\n";
178 LogDebug(
"TrackFitters") <<
" killing trajectory" <<
"\n";
186 assert(hit.
surface()!=
nullptr);
188 LogTrace(
"TrackFitters") <<
"THE HIT IS VALID: updating hit with predTsos";
190 assert( (!hit.
canImproveWithTrack()) | (
nullptr!=dynamic_cast<BaseTrackerRecHit const*>((ihit).
get())));
192 dump(*preciseHit,hitcounter);
193 assert(preciseHit->isValid());
194 assert( (preciseHit->geographicalId()!=0
U) | (!preciseHit->canImproveWithTrack()) );
195 assert(preciseHit->surface()!=
nullptr);
197 if unlikely(!preciseHit->isValid()){
198 LogTrace(
"TrackFitters") <<
"THE Precise HIT IS NOT VALID: using currTsos = predTsos" <<
"\n";
203 LogTrace(
"TrackFitters") <<
"THE Precise HIT IS VALID: updating currTsos" <<
"\n";
206 bool badState = (!currTsos.
isValid())
215 edm::LogError(
"FailedUpdate") <<
"updating with the hit failed. Not updating the trajectory with the hit";
223 LogTrace(
"FailedUpdate")<<
"updated state is valid but pretty bad, skipping. currTsos " <<currTsos<<
"\n predTsos "<<predTsos;
228 if( myTraj.foundHits() >=
minHits_ ) {
229 LogDebug(
"TrackFitters") <<
" breaking trajectory" <<
"\n";
232 LogDebug(
"TrackFitters") <<
" killing trajectory" <<
"\n";
236 if (preciseHit->det()){
237 myTraj.push(
TM(predTsos, currTsos, preciseHit,
242 myTraj.push(
TM(predTsos, currTsos, preciseHit,
248 dump(hit,hitcounter);
250 LogDebug(
"TrackFitters") <<
"THE HIT IS NOT VALID: using currTsos" <<
"\n";
252 assert( ((ihit)->det()==
nullptr) || (ihit)->geographicalId()!=0
U);
254 else myTraj.push(
TM(predTsos, ihit,0));
257 <<
"predTsos !" <<
"\n" 260 <<
"currTsos !" <<
"\n" 265 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.
LocalPoint localPosition() const
Geom::Phi< T > phi() 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 GlobalPoint globalPosition() const
virtual TrajectoryStateOnSurface update(const TrajectoryStateOnSurface &, const TrackingRecHit &) const =0
unsigned int layer() const
layer id
Trajectory fitOne(const Trajectory &aTraj, fitType) const override
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)
static const DetLayerGeometry dummyGeometry
virtual int dimension() const =0
Abs< T >::type abs(const T &t)
virtual LocalPoint localPosition() const =0
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 bool canImproveWithTrack() const
unsigned int wheel() const
wheel id
unsigned int layer() const
layer id
const Propagator * thePropagator
const RotationType & rotation() const
TrajectoryStateOnSurface const & updatedState() const
DetId geographicalId() const
virtual LocalError localPositionError() const =0
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
unsigned int wheel() const
wheel id
TkCloner const * theHitCloner