Go to the documentation of this file.00001 #ifndef Alignment_ReferenceTrajectories_DualKalmanTrajectory_H
00002 #define Alignment_ReferenceTrajectories_DualKalmanTrajectory_H
00003
00022
00023
00024 #include "Alignment/ReferenceTrajectories/interface/ReferenceTrajectoryBase.h"
00025 #include "DataFormats/TrajectorySeed/interface/PropagationDirection.h"
00026 #include "DataFormats/GeometrySurface/interface/LocalError.h"
00027 #include "TrackingTools/PatternTools/interface/Trajectory.h"
00028
00029 #include <vector>
00030
00031 class ReferenceTrajectory;
00032 namespace reco { class BeamSpot;}
00033
00034 class DualKalmanTrajectory : public ReferenceTrajectoryBase
00035 {
00036
00037 public:
00038
00039 DualKalmanTrajectory(const Trajectory::DataContainer &trajMeasurements,
00040 const TrajectoryStateOnSurface &referenceTsos,
00041 const std::vector<unsigned int> &forwardRecHitNums,
00042 const std::vector<unsigned int> &backwardRecHitNums,
00043 const MagneticField *magField,
00044 MaterialEffects materialEffects,
00045 PropagationDirection propDir,
00046 double mass,
00047 bool useBeamSpot,
00048 const reco::BeamSpot &beamSpot,
00049 int residualMethod);
00050
00051 virtual ~DualKalmanTrajectory() {}
00052
00053 virtual DualKalmanTrajectory* clone() const { return new DualKalmanTrajectory(*this); }
00054
00055 protected:
00056
00057 DualKalmanTrajectory( unsigned int nPar = 0, unsigned int nHits = 0 );
00058
00060 virtual bool construct(const Trajectory::DataContainer &trajMeasurements,
00061 const TrajectoryStateOnSurface &referenceTsos,
00062 const std::vector<unsigned int> &forwardRecHitNums,
00063 const std::vector<unsigned int> &backwardRecHitNums,
00064 double mass, MaterialEffects materialEffects,
00065 const PropagationDirection propDir, const MagneticField *magField,
00066 bool useBeamSpot, const reco::BeamSpot &beamSpot,
00067 int residualMethod);
00068
00070 virtual ReferenceTrajectory* construct(const Trajectory::DataContainer &trajMeasurements,
00071 const TrajectoryStateOnSurface &referenceTsos,
00072 const std::vector<unsigned int> &recHits,
00073 double mass, MaterialEffects materialEffects,
00074 const PropagationDirection propDir,
00075 const MagneticField *magField,
00076 bool useBeamSpot,
00077 const reco::BeamSpot &beamSpot) const;
00079 bool fillKalmanPart(const Trajectory::DataContainer &trajMeasurements,
00080 const std::vector<unsigned int> &recHitNums, bool startFirst,
00081 unsigned int iNextHit, int residualMethod);
00083 TrajectoryStateOnSurface
00084 fillMeasurementAndError1(const TransientTrackingRecHit::ConstRecHitPointer &hitPtr,
00085 unsigned int iHit, const TrajectoryMeasurement &trajMeasurement);
00088 TrajectoryStateOnSurface
00089 fillMeasurementAndError2(const TransientTrackingRecHit::ConstRecHitPointer &hitPtr,
00090 unsigned int iHit, const TrajectoryMeasurement &trajMeasurement,
00091 bool doPull);
00092
00094 void fillTrajectoryPositions(const AlgebraicMatrix &projection,
00095 const TrajectoryStateOnSurface &tsos, unsigned int iHit);
00096
00098 LocalError hitErrorWithAPE(const TransientTrackingRecHit::ConstRecHitPointer &hitPtr) const;
00099
00100 virtual AlgebraicVector extractParameters(const TrajectoryStateOnSurface &referenceTsos) const;
00101
00102 inline const PropagationDirection oppositeDirection( const PropagationDirection propDir ) const
00103 { return ((propDir == anyDirection) ? anyDirection
00104 : ((propDir == alongMomentum) ? oppositeToMomentum : alongMomentum));
00105 }
00106
00107 };
00108
00109 #endif