CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_4_5_patch3/src/Alignment/ReferenceTrajectories/interface/ReferenceTrajectoryBase.h

Go to the documentation of this file.
00001 #ifndef Alignment_ReferenceTrajectories_ReferenceTrajectoryBase_H
00002 #define Alignment_ReferenceTrajectories_ReferenceTrajectoryBase_H
00003 
00084 #include "DataFormats/GeometrySurface/interface/ReferenceCounted.h"
00085 
00086 // for AlgebraicVector, -Matrix and -SymMatrix:
00087 #include "DataFormats/CLHEP/interface/AlgebraicObjects.h"
00088 #include "TrackingTools/TransientTrackingRecHit/interface/TransientTrackingRecHit.h"
00089 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h"
00090 #include "TrackingTools/TrajectoryParametrization/interface/LocalTrajectoryError.h"
00091 
00092 #include <vector>
00093 
00094 class ReferenceTrajectoryBase : public ReferenceCounted
00095 {
00096 
00097 public:
00098 
00099   typedef ReferenceCountingPointer<ReferenceTrajectoryBase> ReferenceTrajectoryPtr;
00100 
00101   enum MaterialEffects { none, multipleScattering, energyLoss, combined, 
00102                          breakPoints, brokenLinesCoarse, brokenLinesFine };
00103 
00104   virtual ~ReferenceTrajectoryBase() {}
00105 
00106   bool isValid() { return theValidityFlag; }
00107 
00110   const AlgebraicVector& measurements() const { return theMeasurements; }
00111 
00114   const AlgebraicSymMatrix& measurementErrors() const { return theMeasurementsCov; }
00115   
00119   const AlgebraicVector& trajectoryPositions() const { return theTrajectoryPositions; }
00120 
00123   const AlgebraicSymMatrix& trajectoryPositionErrors() const { return theTrajectoryPositionCov; }
00124 
00128   const AlgebraicMatrix& derivatives() const { return theDerivatives; }
00129 
00132   const AlgebraicMatrix& trajectoryToCurv() const { return theInnerTrajectoryToCurvilinear; }
00135   const AlgebraicMatrix& localToTrajectory() const { return theInnerLocalToTrajectory; }    
00136 
00139   const AlgebraicVector& parameters() const { return theParameters; }
00140 
00143   inline bool parameterErrorsAvailable() const { return theParamCovFlag; }
00144 
00147   inline void setParameterErrors( const AlgebraicSymMatrix& error ) { theParameterCov = error; theParamCovFlag = true; }
00148   
00151   inline const AlgebraicSymMatrix& parameterErrors() const { return theParameterCov; }
00152 
00155   const std::vector<TrajectoryStateOnSurface>& trajectoryStates() const { return theTsosVec; }
00156 
00160   const TransientTrackingRecHit::ConstRecHitContainer& recHits() const { return theRecHits; }
00161 
00162   inline unsigned int numberOfHits() const { return theNumberOfHits; }
00163   inline unsigned int numberOfPar() const { return theNumberOfPars; }
00164   inline unsigned int numberOfMsMeas() const { return theNumberOfMsMeas; }  
00165   inline unsigned int numberOfMsPar() const { return theNumberOfMsPars; }  
00166   inline unsigned int numberOfHitMeas() const { return theNumberOfHits * nMeasPerHit; } 
00167      
00168   virtual ReferenceTrajectoryBase* clone() const = 0;
00169 
00170 protected:
00171 
00172   explicit ReferenceTrajectoryBase(unsigned int nPar, unsigned int nHits, unsigned int nMsPar, unsigned int nMsMeas);
00173 
00174   unsigned int numberOfUsedRecHits(const TransientTrackingRecHit::ConstRecHitContainer &recHits) const;
00175   bool useRecHit(const TransientTrackingRecHit::ConstRecHitPointer& hitPtr) const;
00176 
00177   bool theValidityFlag;
00178   bool theParamCovFlag;
00179 
00180   unsigned int theNumberOfHits;   // number of (measurements from) hits
00181   unsigned int theNumberOfPars;   // number of (track) parameters
00182   unsigned int theNumberOfMsMeas; // number of measurements for multiple scattering
00183   unsigned int theNumberOfMsPars; // number of parameters   for multiple scattering 
00184       
00185   std::vector<TrajectoryStateOnSurface> theTsosVec;
00186   TransientTrackingRecHit::ConstRecHitContainer theRecHits;
00187 
00188   AlgebraicVector     theMeasurements;
00189   AlgebraicSymMatrix  theMeasurementsCov;
00190 
00191   AlgebraicVector     theTrajectoryPositions;
00192   AlgebraicSymMatrix  theTrajectoryPositionCov;
00193 
00194   AlgebraicVector     theParameters;
00195   AlgebraicSymMatrix  theParameterCov;
00196 
00197   AlgebraicMatrix     theDerivatives;
00198 
00199 // CHK for beamspot   transformation trajectory parameter to curvilinear at refTSos
00200   AlgebraicMatrix     theInnerTrajectoryToCurvilinear;  
00201 // CHK for TwoBodyD.  transformation local to trajectory parameter at refTsos
00202   AlgebraicMatrix     theInnerLocalToTrajectory;  
00203     
00204   static const unsigned int nMeasPerHit = 2;
00205 };
00206 
00207 #endif // REFERENCE_TRAJECTORY_BASE_H
00208