CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_7/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 numberOfVirtualMeas() const { return theNumberOfVirtualMeas; }  
00165   inline unsigned int numberOfVirtualPar() const { return theNumberOfVirtualPars; }  
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,
00173                                    unsigned int nVirtualPar, unsigned int nVirtualMeas);
00174 
00175   unsigned int numberOfUsedRecHits(const TransientTrackingRecHit::ConstRecHitContainer &recHits) const;
00176   bool useRecHit(const TransientTrackingRecHit::ConstRecHitPointer& hitPtr) const;
00177 
00178   bool theValidityFlag;
00179   bool theParamCovFlag;
00180 
00181   unsigned int theNumberOfHits;   // number of (measurements from) hits
00182   unsigned int theNumberOfPars;   // number of (track) parameters
00183   unsigned int theNumberOfVirtualMeas; // number of virtual measurements
00184   unsigned int theNumberOfVirtualPars; // number of parameters for virtual measurements
00185       
00186   std::vector<TrajectoryStateOnSurface> theTsosVec;
00187   TransientTrackingRecHit::ConstRecHitContainer theRecHits;
00188 
00189   AlgebraicVector     theMeasurements;
00190   AlgebraicSymMatrix  theMeasurementsCov;
00191 
00192   AlgebraicVector     theTrajectoryPositions;
00193   AlgebraicSymMatrix  theTrajectoryPositionCov;
00194 
00195   AlgebraicVector     theParameters;
00196   AlgebraicSymMatrix  theParameterCov;
00197 
00198   AlgebraicMatrix     theDerivatives;
00199 
00200 // CHK for beamspot   transformation trajectory parameter to curvilinear at refTSos
00201   AlgebraicMatrix     theInnerTrajectoryToCurvilinear;  
00202 // CHK for TwoBodyD.  transformation local to trajectory parameter at refTsos
00203   AlgebraicMatrix     theInnerLocalToTrajectory;  
00204     
00205   static const unsigned int nMeasPerHit = 2;
00206 };
00207 
00208 #endif // REFERENCE_TRAJECTORY_BASE_H
00209