Main Page   Compound List   File List   Compound Members   File Members  

State.h

Go to the documentation of this file.
00001 #ifndef State_h
00002 #define State_h 1
00003 
00004 #include "HepVector.h"
00005 #include "HepSymMatrix.h"
00006 #include "HepPoint3D.h"
00007 #include "HepVector3D.h"
00008 
00009 class State {
00010  public:
00011   
00012   // types of states
00013   // enum StateType {Helix};
00014   
00015  protected:
00016   
00018   // int m_type;
00019 
00021   HepVector m_x;
00022   
00024   HepSymMatrix m_cov;
00025   
00027   double m_z;
00028       
00031 
00032   public:
00033       
00035   State() 
00036     {}
00037   
00039   virtual ~State() 
00040     {}
00041   
00043   // void setType(const int type)
00044   //  {m_type = type;}
00045   
00047   // int type() const 
00048   //  {return m_type;}
00049 
00051   // [optinal: if we derive states], create derived class, return base
00052   //  virtual State* clone() const  
00053   // {State* state = new State(*this); return state;}
00054   
00056   void setVector(const HepVector& x)
00057     {m_x = x;}
00058 
00060   const HepVector& vector() const
00061     {return _hv.vector();}
00062   
00064   void setMatrix(const HepSymMatrix& cov)
00065     {m_cov = cov;}
00066 
00068   const HepSymMatrix& matrix() const
00069     {return m_cov;}
00070   
00072   void setZ(double par) 
00073     {_z = par;}
00074   
00076   double z() const
00077     {return _z;}
00078         
00080   HepPoint3D position() const
00081     {return HepPoint3D(m_x[0],m_x[1],m_z);}
00082 
00084   HepVector3D direction() const {
00085     double ocosz = sqrt(m_x[2]*m_x[2]+m_x[3]*m_x[3]+1);
00086     return HepVector3D(m_x[2]/ocosz,m_x[3]/ocosz,1/ocosz);
00087   }
00088   
00090   HepVector3D slopes() const
00091     {return HepVector3D(m_x[2],m_x[3],1.);}
00092   
00094   double p() const {
00095     //  [?]  if (m_x[4] == 0.) return ?;
00096     return (1/m_x[4]);
00097   }
00098 
00100   HepVector3D momentum() const {
00101     return p()*direction();
00102   }
00103 
00105   double pt() const {
00106     HepVector3D pp = momentum();
00107     return sqrt(pp.x()*pp.x()+pp.y()*pp.y());
00108   }
00109 
00110 };
00111 #endif
00112 

Generated on Thu Sep 9 10:05:53 2004 for New Track Event Model by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002