14 const bool materialBeforeUpdate,
20 theUpdator(aUpdator.
clone()),
21 theEstimator(aEstimator.
clone()),
22 theMerger(aMerger.
clone()),
23 theMatBeforeUpdate(materialBeforeUpdate),
24 theErrorRescaling(errorRescaling),
25 theGeometry(detLayerGeometry)
27 auto p = aPropagator.
clone();
72 if( not usePropagator) {
76 Trajectory myTraj(aTraj.
seed(), usePropagator->propagationDirection());
80 TSOS predTsos = avtm.back().forwardPredictedState();
85 <<
"GsfTrajectorySmoother: predicted tsos of last measurement not valid!";
91 if(avtm.back().recHit()->isValid()) {
94 currTsos =
updator()->
update(predTsos, *avtm.back().recHit());
98 edm::LogInfo(
"GsfTrajectorySmoother") <<
"GsfTrajectorySmoother: tsos not valid after update!";
103 if (!avtm.back().forwardPredictedState().isValid() || !predTsos.
isValid() || !avtm.back().updatedState().isValid()){
108 myTraj.push(
TM(avtm.back().forwardPredictedState(),
110 avtm.back().updatedState(),
111 avtm.back().recHit(),
112 avtm.back().estimate(),
118 if (!avtm.back().forwardPredictedState().isValid()){
123 myTraj.push(
TM(avtm.back().forwardPredictedState(),
124 avtm.back().recHit(),
131 for(std::vector<TM>::const_reverse_iterator itm = avtm.rbegin() + 1;
132 itm < avtm.rend() - 1; ++itm) {
151 predTsos = usePropagator->propagate(currTsos,
156 usePropagator->propagationDirection());
158 edm::LogInfo(
"GsfTrajectorySmoother") <<
"GsfTrajectorySmoother: predicted tsos not valid!";
163 if((*itm).recHit()->isValid()) {
171 usePropagator->propagationDirection());
174 <<
"GsfTrajectorySmoother: tsos not valid after update / material effects!";
181 TSOS combTsos =
combiner(predTsos, (*itm).forwardPredictedState());
183 LogDebug(
"GsfTrajectorySmoother") <<
184 "KFTrajectorySmoother: combined tsos not valid!\n"<<
187 "TrackingRecHit: "<<(*itm).recHit()->surface()->toGlobal((*itm).recHit()->localPosition())<<
"\n" ;
191 TSOS smooTsos =
combiner((*itm).updatedState(), predTsos);
194 LogDebug(
"GsfTrajectorySmoother") <<
195 "KFTrajectorySmoother: smoothed tsos not valid!";
199 if (!(*itm).forwardPredictedState().isValid() || !predTsos.
isValid() || !smooTsos.
isValid() ){
200 edm::LogError(
"InvalidState")<<
"inside hits with combination.";
205 myTraj.push(
TM((*itm).forwardPredictedState(),
215 TSOS combTsos =
combiner(predTsos, (*itm).forwardPredictedState());
218 LogDebug(
"GsfTrajectorySmoother") <<
219 "KFTrajectorySmoother: combined tsos not valid!";
223 if (!(*itm).forwardPredictedState().isValid() || !predTsos.
isValid() || !combTsos.
isValid() ){
224 edm::LogError(
"InvalidState")<<
"inside hits with invalid rechit.";
228 myTraj.push(
TM((*itm).forwardPredictedState(),
241 predTsos = usePropagator->propagate(currTsos,
242 *avtm.front().recHit()->
surface());
246 usePropagator->propagationDirection());
248 edm::LogInfo(
"GsfTrajectorySmoother") <<
"GsfTrajectorySmoother: predicted tsos not valid!";
253 if(avtm.front().recHit()->isValid()) {
257 currTsos =
updator()->
update(predTsos, *avtm.front().recHit());
261 usePropagator->propagationDirection());
264 <<
"GsfTrajectorySmoother: tsos not valid after update / material effects!";
268 if (!avtm.front().forwardPredictedState().isValid() || !predTsos.
isValid() || !currTsos.
isValid() ){
273 myTraj.push(
TM(avtm.front().forwardPredictedState(),
276 avtm.front().recHit(),
283 if (!avtm.front().forwardPredictedState().isValid()){
287 myTraj.push(
TM(avtm.front().forwardPredictedState(),
288 avtm.front().recHit(),
bool empty() const
True if trajectory has no measurements.
void rescaleError(double factor)
const MeasurementEstimator * estimator() const
const GsfPropagatorAdapter * theGeomPropagator
TrajectorySeed const & seed() const
Access to the seed used to reconstruct the Trajectory.
virtual ~GsfTrajectorySmoother()
GlobalPoint globalPosition() const
TrajectoryStateOnSurface merge(const TrajectoryStateOnSurface &tsos) const
FullConvolutionWithMaterial * clone() const
Clone.
const TrajectoryStateUpdator * updator() 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
virtual TrajectoryStateOnSurface update(const TrajectoryStateOnSurface &, const TrackingRecHit &) const =0
const SurfaceType & surface() const
const MultiTrajectoryStateMerger * theMerger
const DetLayerGeometry dummyGeometry
virtual HitReturnType estimate(const TrajectoryStateOnSurface &ts, const TrackingRecHit &hit) const =0
const MeasurementEstimator * theEstimator
virtual Trajectory trajectory(const Trajectory &aTraj) const override
const TrajectoryStateUpdator * theUpdator
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
const GsfPropagatorWithMaterial * theAlongPropagator
const Propagator & geometricalPropagator() const
Access to the geometrical propagator.
GlobalVector globalMomentum() const
const GsfPropagatorWithMaterial * theOppositePropagator
virtual const DetLayer * idToLayer(const DetId &detId) const
virtual GsfPropagatorWithMaterial * clone() const
const FullConvolutionWithMaterial & convolutionWithMaterial() const
Access to the convolutor and thus to the material effects.