CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch9/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 
00032 #include "Alignment/ReferenceTrajectories/interface/ReferenceTrajectoryBase.h"
00033 #include "TrackingTools/TransientTrackingRecHit/interface/TransientTrackingRecHit.h"
00034 #include "DataFormats/TrajectorySeed/interface/PropagationDirection.h"
00035 #include "TrackingTools/TrajectoryState/interface/SurfaceSideDefinition.h"
00036 
00037 class TrajectoryStateOnSurface;
00038 class MagneticField;
00039 class MaterialEffectsUpdator;
00040 class BoundPlane;
00041 class BeamSpotTransientTrackingRecHit;
00042 
00043 namespace reco { class BeamSpot; }
00044 
00045 class ReferenceTrajectory : public ReferenceTrajectoryBase
00046 {
00047 
00048 public:
00049 
00050   typedef SurfaceSideDefinition::SurfaceSide SurfaceSide;
00051 
00059   ReferenceTrajectory(const TrajectoryStateOnSurface &referenceTsos,
00060                       const TransientTrackingRecHit::ConstRecHitContainer &recHits,
00061                       bool hitsAreReverse,
00062                       const MagneticField *magField,
00063                       MaterialEffects materialEffects,
00064                       PropagationDirection propDir,
00065                       double mass,
00066                       bool useBeamSpot,
00067                       const reco::BeamSpot &beamSpot);
00068   virtual ~ReferenceTrajectory() {}
00069 
00070   virtual ReferenceTrajectory* clone() const { return new ReferenceTrajectory(*this); }
00071 
00072 protected:
00073 
00074   ReferenceTrajectory(unsigned int nPar, unsigned int nHits, MaterialEffects materialEffects);
00075 
00078   virtual bool construct(const TrajectoryStateOnSurface &referenceTsos, 
00079                          const TransientTrackingRecHit::ConstRecHitContainer &recHits,
00080                          double mass, MaterialEffects materialEffects,
00081                          const PropagationDirection propDir, const MagneticField *magField,
00082                          bool useBeamSpot,
00083                          const reco::BeamSpot &beamSpot);
00084 
00087   MaterialEffectsUpdator* createUpdator(MaterialEffects materialEffects, double mass) const;
00088 
00091   virtual bool propagate(const BoundPlane &previousSurface, const TrajectoryStateOnSurface &previousTsos,
00092                          const BoundPlane &newSurface, TrajectoryStateOnSurface &newTsos, AlgebraicMatrix &newJacobian, 
00093                          AlgebraicMatrix &newCurvlinJacobian, double &nextStep,
00094                          const PropagationDirection propDir, const MagneticField *magField) const;
00095   
00098   virtual void fillMeasurementAndError(const TransientTrackingRecHit::ConstRecHitPointer &hitPtr,
00099                                        unsigned int iRow,
00100                                        const TrajectoryStateOnSurface &updatedTsos);
00101 
00104   virtual void fillDerivatives(const AlgebraicMatrix &projection,
00105                                const AlgebraicMatrix &fullJacobian, unsigned int iRow);
00106 
00109   virtual void fillTrajectoryPositions(const AlgebraicMatrix &projection, 
00110                                        const AlgebraicVector &mixedLocalParams, 
00111                                        unsigned int iRow);
00112 
00115   virtual bool addMaterialEffectsCov(const std::vector<AlgebraicMatrix> &allJacobians, 
00116                                      const std::vector<AlgebraicMatrix> &allProjections,
00117                                      const std::vector<AlgebraicSymMatrix> &allCurvChanges,
00118                                      const std::vector<AlgebraicSymMatrix> &allDeltaParaCovs);
00119                                      
00122   virtual bool addMaterialEffectsBp (const std::vector<AlgebraicMatrix> &allJacobians, 
00123                                      const std::vector<AlgebraicMatrix> &allProjections,
00124                                      const std::vector<AlgebraicSymMatrix> &allCurvChanges,
00125                                      const std::vector<AlgebraicSymMatrix> &allDeltaParaCovs,
00126                                      const std::vector<AlgebraicMatrix> &allLocalToCurv);
00127                                      
00130   virtual bool addMaterialEffectsBrl(const std::vector<AlgebraicMatrix> &allJacobians, 
00131                                      const std::vector<AlgebraicMatrix> &allProjections,
00132                                      const std::vector<AlgebraicSymMatrix> &allCurvChanges,
00133                                      const std::vector<AlgebraicSymMatrix> &allDeltaParaCovs,
00134                                      const std::vector<AlgebraicMatrix> &allLocalToCurv,
00135                                      const GlobalTrajectoryParameters &gtp);
00138   virtual bool addMaterialEffectsBrl(const std::vector<AlgebraicMatrix> &allProjections,
00139                                      const std::vector<AlgebraicSymMatrix> &allDeltaParaCovs,
00140                                      const std::vector<AlgebraicMatrix> &allLocalToCurv,
00141                                      const std::vector<double> &allSteps,
00142                                      const GlobalTrajectoryParameters &gtp,   
00143                                      const double minStep = 1.0);
00144           
00145   // Don't care for propagation direction 'anyDirection' - in that case the material effects
00146   // are anyway not updated ...
00147   inline const SurfaceSide surfaceSide(const PropagationDirection dir) const
00148   {
00149     return ( dir == alongMomentum ) ?
00150       SurfaceSideDefinition::beforeSurface :
00151       SurfaceSideDefinition::afterSurface;
00152   }
00153 };
00154 
00155 #endif