00001 #ifndef Alignment_ReferenceTrajectories_ReferenceTrajectoryBase_H 00002 #define Alignment_ReferenceTrajectories_ReferenceTrajectoryBase_H 00003 00054 #include "DataFormats/GeometrySurface/interface/ReferenceCounted.h" 00055 00056 // for AlgebraicVector, -Matrix and -SymMatrix: 00057 #include "DataFormats/CLHEP/interface/AlgebraicObjects.h" 00058 #include "TrackingTools/TransientTrackingRecHit/interface/TransientTrackingRecHit.h" 00059 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h" 00060 #include "TrackingTools/TrajectoryParametrization/interface/LocalTrajectoryError.h" 00061 00062 #include <vector> 00063 00064 class ReferenceTrajectoryBase : public ReferenceCounted 00065 { 00066 00067 public: 00068 00069 typedef ReferenceCountingPointer<ReferenceTrajectoryBase> ReferenceTrajectoryPtr; 00070 00071 enum MaterialEffects { none, multipleScattering, energyLoss, combined }; 00072 00073 virtual ~ReferenceTrajectoryBase() {} 00074 00075 bool isValid() { return theValidityFlag; } 00076 00079 const AlgebraicVector& measurements() const { return theMeasurements; } 00080 00083 const AlgebraicSymMatrix& measurementErrors() const { return theMeasurementsCov; } 00084 00088 const AlgebraicVector& trajectoryPositions() const { return theTrajectoryPositions; } 00089 00092 const AlgebraicSymMatrix& trajectoryPositionErrors() const { return theTrajectoryPositionCov; } 00093 00097 const AlgebraicMatrix& derivatives() const { return theDerivatives; } 00098 00101 const AlgebraicVector& parameters() const { return theParameters; } 00102 00105 inline bool parameterErrorsAvailable() const { return theParamCovFlag; } 00106 00109 inline void setParameterErrors( const AlgebraicSymMatrix& error ) { theParameterCov = error; theParamCovFlag = true; } 00110 00113 inline const AlgebraicSymMatrix& parameterErrors() const { return theParameterCov; } 00114 00117 const std::vector<TrajectoryStateOnSurface>& trajectoryStates() const { return theTsosVec; } 00118 00122 const TransientTrackingRecHit::ConstRecHitContainer& recHits() const { return theRecHits; } 00123 00124 inline int numberOfHits() const { return theNumberOfHits; } 00125 00126 virtual ReferenceTrajectoryBase* clone() const = 0; 00127 00128 protected: 00129 00130 explicit ReferenceTrajectoryBase(unsigned int nPar = 0, unsigned int nHits = 0); 00131 00132 unsigned int numberOfUsedRecHits(const TransientTrackingRecHit::ConstRecHitContainer &recHits) const; 00133 bool useRecHit(const TransientTrackingRecHit::ConstRecHitPointer& hitPtr) const; 00134 00135 bool theValidityFlag; 00136 bool theParamCovFlag; 00137 00138 unsigned int theNumberOfHits; 00139 00140 std::vector<TrajectoryStateOnSurface> theTsosVec; 00141 TransientTrackingRecHit::ConstRecHitContainer theRecHits; 00142 00143 AlgebraicVector theMeasurements; 00144 AlgebraicSymMatrix theMeasurementsCov; 00145 00146 AlgebraicVector theTrajectoryPositions; 00147 AlgebraicSymMatrix theTrajectoryPositionCov; 00148 00149 AlgebraicVector theParameters; 00150 AlgebraicSymMatrix theParameterCov; 00151 00152 AlgebraicMatrix theDerivatives; 00153 00154 static const unsigned int nMeasPerHit = 2; 00155 }; 00156 00157 #endif // REFERENCE_TRAJECTORY_BASE_H 00158