22 if(aTraj.
empty())
return std::vector<Trajectory>();
34 "KFTrajectoryFitter::fit(TrajectorySeed, <TransientTrackingRecHit>) not implemented");
36 return std::vector<Trajectory>();
41 const TSOS& firstPredTsos)
const
43 if(hits.empty())
return std::vector<Trajectory>();
47 throw cms::Exception(
"KFTrajectoryFitter",
"TrajectorySeed::direction() requested but not set");
53 <<
" +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n"
54 <<
" KFTrajectoryFitter::fit starting with " << hits.size() <<
" HITS";
56 for (
unsigned int j=0;
j<hits.size();
j++) {
58 LogTrace(
"TrackFitters") <<
"hit #:" <<
j+1 <<
" rawId=" << hits[
j]->det()->geographicalId().rawId()
59 <<
" validity=" << hits[
j]->isValid();
61 LogTrace(
"TrackFitters") <<
"hit #:" <<
j+1 <<
" Hit with no Det information";
63 LogTrace(
"TrackFitters") <<
" INITIAL STATE "<< firstPredTsos;
70 TSOS predTsos(firstPredTsos);
74 for(RecHitContainer::const_iterator ihit = hits.begin(); ihit != hits.end(); ++ihit, ++hitcounter) {
79 LogDebug(
"TrackFitters")<<
" Error: invalid hit with no GeomDet attached .... skipping";
86 <<
" ----------------- HIT #" << hitcounter <<
" (VALID)-----------------------\n"
93 <<
"SURFACE POSITION" <<
"\n"
95 <<
"SURFACE ROTATION" <<
"\n"
118 LogTrace(
"TrackFitters") <<
" UNKNOWN TRACKER HIT TYPE ";
128 LogTrace(
"TrackFitters") <<
" UNKNOWN MUON HIT TYPE ";
131 LogTrace(
"TrackFitters") <<
" UNKNOWN HIT TYPE ";
135 <<
" ----------------- INVALID HIT #" << hitcounter <<
" -----------------------";
139 if ( hitcounter != 1)
145 <<
"SOMETHING WRONG !" <<
"\n"
146 <<
"KFTrajectoryFitter: predicted tsos not valid!\n"
147 <<
"current TSOS: " << currTsos <<
"\n";
152 LogDebug(
"TrackFitters") <<
" breaking trajectory" <<
"\n";
155 LogDebug(
"TrackFitters") <<
" killing trajectory" <<
"\n";
156 return std::vector<Trajectory>();
162 LogTrace(
"TrackFitters") <<
"THE HIT IS VALID: updating hit with predTsos";
165 if (preciseHit->isValid() ==
false){
166 LogTrace(
"TrackFitters") <<
"THE Precise HIT IS NOT VALID: using currTsos = predTsos" <<
"\n";
171 LogTrace(
"TrackFitters") <<
"THE Precise HIT IS VALID: updating currTsos" <<
"\n";
174 bool badState = (!currTsos.
isValid())
182 if (!currTsos.
isValid())
edm::LogError(
"FailedUpdate")<<
"updating with the hit failed. Not updating the trajectory with the hit";
184 else LogTrace(
"FailedUpdate")<<
"updated state is valid but pretty bad, skipping. currTsos "<<currTsos<<
"\n predTsos "<<predTsos;
189 LogDebug(
"TrackFitters") <<
" breaking trajectory" <<
"\n";
192 LogDebug(
"TrackFitters") <<
" killing trajectory" <<
"\n";
193 return std::vector<Trajectory>();
197 if (preciseHit->det()) myTraj.
push(
TM(predTsos, currTsos, preciseHit,
200 else myTraj.
push(
TM(predTsos, currTsos, preciseHit,
201 estimator()->estimate(predTsos, *preciseHit).second));
206 LogDebug(
"TrackFitters") <<
"THE HIT IS NOT VALID: using currTsos" <<
"\n";
212 <<
"predTsos !" <<
"\n"
214 <<
"currTsos !" <<
"\n"
218 LogDebug(
"TrackFitters") <<
"Found 1 trajectory with " << myTraj.
foundHits() <<
" valid hits\n";
PropagationDirection direction() const
bool empty() const
True if trajectory has no measurements.
unsigned int layer() const
layer id
virtual PropagationDirection propagationDirection() 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.
virtual TrajectoryStateOnSurface update(const TrajectoryStateOnSurface &, const TransientTrackingRecHit &) const =0
Geom::Phi< T > phi() const
const MeasurementEstimator * estimator() const
void reserve(unsigned int n)
unsigned int layer() const
layer id
ConstRecHitContainer recHits(bool splitting=false) const
uint32_t rawId() const
get the raw id
U second(std::pair< T, U > const &p)
static const DetLayerGeometry dummyGeometry
virtual std::vector< Trajectory > fit(const Trajectory &aTraj) const
TrajectoryStateOnSurface updatedState() const
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
unsigned int disk() const
disk id
virtual TrajectoryStateOnSurface propagate(const FreeTrajectoryState &, const Surface &) const
const DetLayerGeometry * theGeometry
TrajectoryMeasurement const & firstMeasurement() const
virtual LocalError localPositionError() const =0
unsigned int wheel() const
wheel id
unsigned int layer() const
layer id
virtual RecHitPointer clone(const TrajectoryStateOnSurface &ts) const
virtual GlobalPoint globalPosition() const
const Propagator * thePropagator
virtual const Surface * surface() const
const RotationType & rotation() 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
void push(const TrajectoryMeasurement &tm)
unsigned int wheel() const
wheel id