14 const bool materialBeforeUpdate,
16 thePropagator(aPropagator.
clone()),
19 theUpdator(aUpdator.
clone()),
20 theEstimator(aEstimator.
clone()),
21 theMerger(aMerger.
clone()),
22 theMatBeforeUpdate(materialBeforeUpdate),
23 theErrorRescaling(errorRescaling),
24 theGeometry(detLayerGeometry)
46 std::vector<Trajectory>
58 if(aTraj.
empty())
return std::vector<Trajectory>();
71 TSOS predTsos = avtm.back().forwardPredictedState();
76 <<
"GsfTrajectorySmoother: predicted tsos of last measurement not valid!";
77 return std::vector<Trajectory>();
82 if(avtm.back().recHit()->isValid()) {
85 currTsos =
updator()->
update(predTsos, *avtm.back().recHit());
88 edm::LogInfo(
"GsfTrajectorySmoother") <<
"GsfTrajectorySmoother: tsos not valid after update!";
89 return std::vector<Trajectory>();
93 if (!avtm.back().forwardPredictedState().isValid() || !predTsos.
isValid() || !avtm.back().updatedState().isValid()){
95 return std::vector<Trajectory>();
98 myTraj.push(
TM(avtm.back().forwardPredictedState(),
100 avtm.back().updatedState(),
101 avtm.back().recHit(),
102 avtm.back().estimate(),
108 if (!avtm.back().forwardPredictedState().isValid()){
110 return std::vector<Trajectory>();
113 myTraj.push(
TM(avtm.back().forwardPredictedState(),
114 avtm.back().recHit(),
121 for(std::vector<TM>::reverse_iterator itm = avtm.rbegin() + 1;
122 itm < avtm.rend() - 1; ++itm) {
148 edm::LogInfo(
"GsfTrajectorySmoother") <<
"GsfTrajectorySmoother: predicted tsos not valid!";
149 return std::vector<Trajectory>();
153 if((*itm).recHit()->isValid()) {
164 <<
"GsfTrajectorySmoother: tsos not valid after update / material effects!";
165 return std::vector<Trajectory>();
171 TSOS combTsos =
combiner(predTsos, (*itm).forwardPredictedState());
173 LogDebug(
"GsfTrajectorySmoother") <<
174 "KFTrajectorySmoother: combined tsos not valid!\n"<<
177 "TrackingRecHit: "<<(*itm).recHit()->surface()->toGlobal((*itm).recHit()->localPosition())<<
"\n" ;
178 return std::vector<Trajectory>();
181 TSOS smooTsos =
combiner((*itm).updatedState(), predTsos);
184 LogDebug(
"GsfTrajectorySmoother") <<
185 "KFTrajectorySmoother: smoothed tsos not valid!";
186 return std::vector<Trajectory>();
189 if (!(*itm).forwardPredictedState().isValid() || !predTsos.
isValid() || !smooTsos.
isValid() ){
190 edm::LogError(
"InvalidState")<<
"inside hits with combination.";
191 return std::vector<Trajectory>();
195 myTraj.push(
TM((*itm).forwardPredictedState(),
205 TSOS combTsos =
combiner(predTsos, (*itm).forwardPredictedState());
208 LogDebug(
"GsfTrajectorySmoother") <<
209 "KFTrajectorySmoother: combined tsos not valid!";
210 return std::vector<Trajectory>();
213 if (!(*itm).forwardPredictedState().isValid() || !predTsos.
isValid() || !combTsos.
isValid() ){
214 edm::LogError(
"InvalidState")<<
"inside hits with invalid rechit.";
215 return std::vector<Trajectory>();
218 myTraj.push(
TM((*itm).forwardPredictedState(),
232 *avtm.front().recHit()->
surface());
238 edm::LogInfo(
"GsfTrajectorySmoother") <<
"GsfTrajectorySmoother: predicted tsos not valid!";
239 return std::vector<Trajectory>();
243 if(avtm.front().recHit()->isValid()) {
247 currTsos =
updator()->
update(predTsos, *avtm.front().recHit());
254 <<
"GsfTrajectorySmoother: tsos not valid after update / material effects!";
255 return std::vector<Trajectory>();
258 if (!avtm.front().forwardPredictedState().isValid() || !predTsos.
isValid() || !currTsos.
isValid() ){
260 return std::vector<Trajectory>();
263 myTraj.push(
TM(avtm.front().forwardPredictedState(),
266 avtm.front().recHit(),
273 if (!avtm.front().forwardPredictedState().isValid()){
275 return std::vector<Trajectory>();
277 myTraj.push(
TM(avtm.front().forwardPredictedState(),
278 avtm.front().recHit(),
283 return std::vector<Trajectory>(1, myTraj);
bool empty() const
True if trajectory has no measurements.
void rescaleError(double factor)
const MeasurementEstimator * estimator() const
const GsfPropagatorAdapter * theGeomPropagator
GsfPropagatorWithMaterial * thePropagator
virtual PropagationDirection propagationDirection() const
TrajectorySeed const & seed() const
Access to the seed used to reconstruct the Trajectory.
virtual HitReturnType estimate(const TrajectoryStateOnSurface &ts, const TransientTrackingRecHit &hit) const =0
virtual TrajectoryStateOnSurface update(const TrajectoryStateOnSurface &, const TransientTrackingRecHit &) const =0
virtual void setPropagationDirection(PropagationDirection dir) const
virtual ~GsfTrajectorySmoother()
GlobalPoint globalPosition() const
TrajectoryStateOnSurface merge(const TrajectoryStateOnSurface &tsos) const
FullConvolutionWithMaterial * clone() const
Clone.
const TrajectoryStateUpdator * updator() const
const Propagator * propagator() const
const FullConvolutionWithMaterial * theConvolutor
GsfTrajectorySmoother(const GsfPropagatorWithMaterial &aPropagator, const TrajectoryStateUpdator &aUpdator, const MeasurementEstimator &aEstimator, const MultiTrajectoryStateMerger &merger, float errorRescaling, const bool materialBeforeUpdate=true, const DetLayerGeometry *detLayerGeometry=0)
const DetLayerGeometry * theGeometry
PropagationDirection const & direction() const
U second(std::pair< T, U > const &p)
DataContainer const & measurements() const
const MultiTrajectoryStateMerger * theMerger
const DetLayerGeometry dummyGeometry
const MeasurementEstimator * theEstimator
virtual TrajectoryStateOnSurface propagate(const FreeTrajectoryState &, const Surface &) const
const TrajectoryStateUpdator * theUpdator
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
const Propagator & geometricalPropagator() const
Access to the geometrical propagator.
GlobalVector globalMomentum() const
const Surface & surface() const
virtual std::vector< Trajectory > trajectories(const Trajectory &aTraj) const
virtual const DetLayer * idToLayer(const DetId &detId) const
const FullConvolutionWithMaterial & convolutionWithMaterial() const
Access to the convolutor and thus to the material effects.