CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_9_patch3/src/Alignment/ReferenceTrajectories/interface/ReferenceTrajectory.h

Go to the documentation of this file.
00001 #ifndef Alignment_ReferenceTrajectories_ReferenceTrajectory_H
00002 #define Alignment_ReferenceTrajectories_ReferenceTrajectory_H
00003 
00038 #include "Alignment/ReferenceTrajectories/interface/ReferenceTrajectoryBase.h"
00039 #include "TrackingTools/TransientTrackingRecHit/interface/TransientTrackingRecHit.h"
00040 #include "DataFormats/TrajectorySeed/interface/PropagationDirection.h"
00041 #include "TrackingTools/TrajectoryState/interface/SurfaceSideDefinition.h"
00042 
00043 class TrajectoryStateOnSurface;
00044 class MagneticField;
00045 class MaterialEffectsUpdator;
00046 class BoundPlane;
00047 class BeamSpotTransientTrackingRecHit;
00048 
00049 namespace reco { class BeamSpot; }
00050 
00051 class ReferenceTrajectory : public ReferenceTrajectoryBase
00052 {
00053 
00054 public:
00055 
00056   typedef SurfaceSideDefinition::SurfaceSide SurfaceSide;
00057 
00065   ReferenceTrajectory(const TrajectoryStateOnSurface &referenceTsos,
00066                       const TransientTrackingRecHit::ConstRecHitContainer &recHits,
00067                       bool hitsAreReverse,
00068                       const MagneticField *magField,
00069                       MaterialEffects materialEffects,
00070                       PropagationDirection propDir,
00071                       double mass,
00072                       bool useBeamSpot,
00073                       const reco::BeamSpot &beamSpot);
00074   virtual ~ReferenceTrajectory() {}
00075 
00076   virtual ReferenceTrajectory* clone() const { return new ReferenceTrajectory(*this); }
00077 
00078 protected:
00079 
00080   ReferenceTrajectory(unsigned int nPar, unsigned int nHits, MaterialEffects materialEffects);
00081 
00084   virtual bool construct(const TrajectoryStateOnSurface &referenceTsos, 
00085                          const TransientTrackingRecHit::ConstRecHitContainer &recHits,
00086                          double mass, MaterialEffects materialEffects,
00087                          const PropagationDirection propDir, const MagneticField *magField,
00088                          bool useBeamSpot,
00089                          const reco::BeamSpot &beamSpot);
00090 
00093   MaterialEffectsUpdator* createUpdator(MaterialEffects materialEffects, double mass) const;
00094 
00097   virtual bool propagate(const BoundPlane &previousSurface, const TrajectoryStateOnSurface &previousTsos,
00098                          const BoundPlane &newSurface, TrajectoryStateOnSurface &newTsos, AlgebraicMatrix &newJacobian, 
00099                          AlgebraicMatrix &newCurvlinJacobian, double &nextStep,
00100                          const PropagationDirection propDir, const MagneticField *magField) const;
00101   
00104   virtual void fillMeasurementAndError(const TransientTrackingRecHit::ConstRecHitPointer &hitPtr,
00105                                        unsigned int iRow,
00106                                        const TrajectoryStateOnSurface &updatedTsos);
00107 
00110   virtual void fillDerivatives(const AlgebraicMatrix &projection,
00111                                const AlgebraicMatrix &fullJacobian, unsigned int iRow);
00112 
00115   virtual void fillTrajectoryPositions(const AlgebraicMatrix &projection, 
00116                                        const AlgebraicVector &mixedLocalParams, 
00117                                        unsigned int iRow);
00118 
00121   virtual bool addMaterialEffectsCov(const std::vector<AlgebraicMatrix> &allJacobians, 
00122                                      const std::vector<AlgebraicMatrix> &allProjections,
00123                                      const std::vector<AlgebraicSymMatrix> &allCurvChanges,
00124                                      const std::vector<AlgebraicSymMatrix> &allDeltaParaCovs);
00125                                      
00128   virtual bool addMaterialEffectsBp (const std::vector<AlgebraicMatrix> &allJacobians, 
00129                                      const std::vector<AlgebraicMatrix> &allProjections,
00130                                      const std::vector<AlgebraicSymMatrix> &allCurvChanges,
00131                                      const std::vector<AlgebraicSymMatrix> &allDeltaParaCovs,
00132                                      const std::vector<AlgebraicMatrix> &allLocalToCurv);
00133                                      
00136   virtual bool addMaterialEffectsBrl(const std::vector<AlgebraicMatrix> &allJacobians, 
00137                                      const std::vector<AlgebraicMatrix> &allProjections,
00138                                      const std::vector<AlgebraicSymMatrix> &allCurvChanges,
00139                                      const std::vector<AlgebraicSymMatrix> &allDeltaParaCovs,
00140                                      const std::vector<AlgebraicMatrix> &allLocalToCurv,
00141                                      const GlobalTrajectoryParameters &gtp);
00144   virtual bool addMaterialEffectsBrl(const std::vector<AlgebraicMatrix> &allProjections,
00145                                      const std::vector<AlgebraicSymMatrix> &allDeltaParaCovs,
00146                                      const std::vector<AlgebraicMatrix> &allLocalToCurv,
00147                                      const std::vector<double> &allSteps,
00148                                      const GlobalTrajectoryParameters &gtp,   
00149                                      const double minStep = 1.0);
00150           
00153   inline SurfaceSide surfaceSide(const PropagationDirection dir) const
00154   {
00155     return ( dir == alongMomentum ) ?
00156       SurfaceSideDefinition::beforeSurface :
00157       SurfaceSideDefinition::afterSurface;
00158   }
00159 
00162   AlgebraicMatrix
00163     getHitProjectionMatrix(const TransientTrackingRecHit::ConstRecHitPointer &recHit) const;
00164 
00167   template <unsigned int N>
00168     AlgebraicMatrix
00169     getHitProjectionMatrixT(const TransientTrackingRecHit::ConstRecHitPointer &recHit) const;
00170 };
00171 
00172 #endif