Base_PropagatorB.h

Go to the documentation of this file.
00001 //! \authors{Anselmo Cervera, Juan J. Gomez-Cadenas and Jose Angel Hernando}
00002 //! \date{11/01}
00003 
00004 #ifndef PropagatorB_h
00005 #define PropagatorB_h 1
00006 
00007 #include "Kalman/Interface_IPropagator.h"
00008 #include "Kalman/Interface_IModel.h"
00009 
00010 //! Basic implementation for propagator
00011 /*!
00012     A model has:
00013     
00014         - A pointer to a IModel to refer to
00015         
00016     A model do:
00017     
00018         - the propagation via the IModel    
00019 
00020     A propagator preserves from the last propagation:
00021         
00022         - the F matrix
00023         
00024         - the Q matrix
00025         
00026         - the initial State
00027         
00028         - the end State
00029         
00030         - the end surface
00031         
00032 */
00033 class PropagatorB : public IPropagator 
00034 {
00035  public:
00036 
00037   //! default constructor
00038   PropagatorB() {}
00039 
00040   //! Constructor providing the model  
00041   PropagatorB(IModel* pm){m_model=pm;}
00042 
00043   //! default destructor
00044   virtual ~PropagatorB() {}
00045   
00046   //----------
00047   //! Propagate an state to a given length
00048   //! It compute the dynamicHV and the runningHV in the new surface, set the values in the state
00049   //! It has the extra possibility of propagate an state with a different model
00050   //! (note that the results it is the end (State) which is not const!)
00051   virtual bool propagate(const IState& ini, 
00052              const ISurface& is, 
00053              const HyperVector& natHV, 
00054              IState& end);
00055     
00056   //!  Returns the dynamicHV of the state when propagate an state to a surface
00057   virtual HyperVector computeDynamicHV(const IState& ini, 
00058                        const HyperVector& natHV,
00059                        const HyperVector& runHV);
00060 
00061 
00062   //! computes the dynamic vector
00063   virtual EVector computeDynamicVector(const IState& iniS, 
00064                        const HyperVector& natHV, 
00065                        const HyperVector& runHV);
00066 
00067   
00068   //!  Returns the runningHV of the state when propagate an state to a surface
00069   virtual HyperVector computeRunningHV(const IState& ini, const HyperVector& natHV)
00070   {
00071     std::cout << "PropagatorB::computeRunningHV called with:  " << natHV << std::endl;
00072     ini.info(2);
00073     return natHV;
00074   }  //ME added warning and return
00075   
00076 
00077    //! Computes the transport matrix F
00078   virtual EMatrix computeFMatrix(const IState& ini, 
00079                  const HyperVector& natHV,
00080                  const HyperVector& runHV);
00081    
00082   //----------
00083 
00084   //!   If the Propagator it is linear returns the F matrix
00085   //!   (if not returns the 1st term of Taylor expansion)
00086   virtual EMatrix FMatrix()  {return m_F;}
00087   
00088   //!   Returns the matrix of random extra errors added to the state during the
00089   //!   progation (null if non). This matrix is calculated by the Noiser.
00090   virtual EMatrix QMatrix() {return m_Q;}
00091 
00092   //! Returns the A matrix (dx/dr) for the Kalman vertex fit
00093   virtual EMatrix AMatrix(const IPoint& point);
00094 
00095   //! Returns the B matrix (dx/dp) for the Kalman vertex fit
00096   virtual EMatrix BMatrix(const IPoint& point);
00097 
00098   
00099   //----------
00100 
00101   //! get dimension of the dynamic vector
00102   virtual const int dynamicNdim() const {return m_model->dynamicNdim();}
00103 
00104   //-------------
00105 
00106   //! set propagator verbosity 
00107   virtual void setVerbosity(int v){m_verbosity=v;}
00108   //! return propagator verbosity 
00109   virtual int verbosity() {return m_verbosity;}  
00110 
00111   //! returns specific propagator properties
00112   virtual std::string propagatorProperties() 
00113     {cout << "There are not specific properties !!!" <<endl; return "";}
00114   //! set properties of the propagator in the case there is a choice
00115   virtual void setPropagatorProperties(void* prop)
00116      {cout << "You cannot select specific properties !!! " << (int)prop << endl;};  //ME added pointer to prop
00117 
00118 
00119   
00120   // temporary // todo
00121   virtual bool applyEnergyLoss(IState& state,
00122                    const HyperVector& natHV);
00123 
00124   virtual double  computeEnergyLoss(const double m, const double e0, 
00125                     const double s);
00126 
00127  protected:
00128 
00129   //! return a model
00130   virtual const IModel& model() const {return *m_model;};
00131   //! set a model
00132   virtual void setModel(IModel* p) {m_model = p;};
00133 
00134   //! compute parameters needed for the actual propagation
00135   virtual void computeParameters(const IState& iniS, 
00136                  const ISurface& surf, 
00137                  const HyperVector& natHV){    
00138     if (m_verbosity > 9){
00139       iniS.info();
00140       surf.info();
00141       natHV.info();
00142     }
00143   }
00144 
00145  protected:
00146   
00147   //! the initial state (not owner by the propagator)
00148   const IState* m_iniState;
00149   
00150   //! the end surface (not owner by the propagator)
00151   const ISurface* m_surface;
00152   
00153   //! the final state (not owner by the propagator)
00154   IState* m_endState;
00155   
00156   //! the F matrix of the last propagation  
00157   EMatrix m_F;
00158   
00159   //! The Q matrix of the last propagation
00160   EMatrix m_Q;
00161 
00162   //! A pointer to the model
00163   IModel* m_model;  
00164 
00165   //---
00166   int m_verbosity;
00167           
00168 };
00169 
00170 #endif
00171 

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