Base_ProjectorB.h

Go to the documentation of this file.
00001 //! \author{Anselmo Cervera, Juan J. Gomez-Cadenas and Jose Angel Hernando}
00002 //! \date{11/01}
00003 
00004 #ifndef ProjectorB_h
00005 #define ProjectorB_h 1
00006 
00007 #include "Kalman/Interface_IProjector.h"
00008 #include "Kalman/Interface_IModel.h"
00009 
00010 //! Basic implementation for projector
00011 /*!
00012     It contains an IModel to refer to.
00013     
00014     It computes the residuals via the H() matrix.
00015     
00016     It does not know how to compute H() matrix (leave it to derived classes).
00017 */
00018 class ProjectorB : public IProjector
00019 {
00020 public:
00021 
00022   //! default constructor
00023   ProjectorB(){}
00024 
00025   //! Constructor providing the model
00026   ProjectorB(IModel* pm){m_model=pm;}
00027 
00028   //! virtual destructor
00029   virtual ~ProjectorB() {};
00030 
00031   //-----------
00032 
00033   //! project the state of the point 
00034   virtual bool project(IPoint& point); 
00035 
00036   
00037   //!   Project the dynamic matrix
00038   virtual EMatrix projectionMatrix(const IState& state, const IMeasurement& meas){  
00039     EMatrix H = HMatrix(state, meas);
00040     return H*state.dynamicMatrix()*transpose(H);
00041   }
00042   
00043   //!   Project the dynamic vector
00044   virtual EVector projectionVector(const IState& state, const IMeasurement& meas)
00045     {return HMatrix(state,meas)*state.dynamicVector();}
00046 
00047  
00048   //----------
00049   
00050   virtual EMatrix measurementProjector(const IState& state, const IMeasurement& meas)
00051     { std::cout << "Called ProjectorB::measurementProjector" << std::endl; state.info(2); meas.info(2); return EMatrix(measNdim()-1, measNdim(),1) ;}
00052   //ME added cout
00053 
00054   virtual EMatrix HMatrix(const IState& state, const IMeasurement& meas)
00055     { std::cout << "Called ProjectorB::HMatrix" << std::endl; state.info(2); meas.info(2); return EMatrix(measNdim(),dynamicNdim(),0);}
00056   //ME added cout
00057 
00058   //! Returns the A matrix (dx/dr) for the Kalman vertex fit
00059   virtual EMatrix AMatrix(const IState& state, const IMeasurement& meas) 
00060   { std::cout << "Called ProjectorB::AMatrix" << std::endl; state.info(2); meas.info(2); return EMatrix( 1, 1, 0 ); }
00061   //ME added cout and return
00062 
00063   //! Returns the B matrix (dx/dp) for the Kalman vertex fit
00064   virtual EMatrix BMatrix(const IState& state, const IMeasurement& meas)
00065   { std::cout << "Called ProjectorB::BMAtrix" << std::endl; state.info(2); meas.info(2); return EMatrix( 1, 1, 0 ); }
00066   //ME added cout and return
00067 
00068    //! Returns the c0 vector  for the Kalman vertex fit
00069   virtual EVector c0(const IState& state, const IMeasurement& meas)
00070   { std::cout << "Called ProjectorB::c0" << std::endl; state.info(2); meas.info(2); return EVector( 1, 0 ); }
00071   //ME added cout and return
00072 
00073 
00074   //-----------
00075 
00076   //! get dimension of the dynamic vector
00077   virtual const int dynamicNdim() const {return m_model->dynamicNdim();}
00078 
00079   //! get dimension of the measurement
00080   virtual const int measNdim() const {return m_model->measNdim();}
00081 
00082   //-------------
00083 
00084   //! set projector verbosity 
00085   virtual void setVerbosity(int v){m_verbosity=v;}
00086   //! return projector verbosity 
00087   virtual int verbosity() {return m_verbosity;}  
00088 
00089 
00090  protected:
00091 
00092   //! return a model
00093   virtual IModel& model() const {return *m_model;};
00094   //! set a model
00095   virtual void setModel(IModel* p) {m_model = p;};
00096   
00097  protected:
00098 
00099   //! A pointer to the model
00100   IModel* m_model;  
00101 
00102   //! verbosity level
00103   int m_verbosity;
00104 
00105 };
00106 
00107 #endif
00108 

Generated on Mon Nov 23 08:01:43 2009 for MIPP(E907) by  doxygen 1.4.7