Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

Node.h

Go to the documentation of this file.
00001 
00002 //   **************************************************************************
00003 //   *                                                                        *
00004 //   *                      ! ! ! A T T E N T I O N ! ! !                     *
00005 //   *                                                                        *
00006 //   *  This file was created automatically by GaudiObjDesc, please do not    *
00007 //   *  delete it or edit it by hand.                                         *
00008 //   *                                                                        *
00009 //   *  If you want to change this file, first change the corresponding       *
00010 //   *  xml-file and rerun the tools from GaudiObjDesc (or run make if you    *
00011 //   *  are using it from inside a Gaudi-package).                            *
00012 //   *                                                                        *
00013 //   **************************************************************************
00014 
00015 #ifndef TrackEvent_Node_H
00016 #define TrackEvent_Node_H 1
00017 
00018 // Include files
00019 #include "Event/State.h"
00020 #include "Event/Measurement.h"
00021 #include "CLHEP/Matrix/Matrix.h"
00022 
00023 
00024 // Forward declarations
00025 
00035 class Node
00036 {
00037 public:
00038 
00040   Node() : m_measurement(),
00041            m_state(),
00042            m_residual(0.0),
00043            m_errResidual(0.0),
00044            m_projectionMatrix() {}
00045 
00047   ~Node();
00048 
00050   virtual void reset();
00051 
00053   double chi2() const;
00054 
00056   Measurement & measurement();
00057 
00059   Measurement & measurement() const;
00060 
00062   State & state();
00063 
00065   State & state() const;
00066 
00068   virtual Node* clone() const;
00069 
00071   void setMeasurement(const Measurement& meas);
00072 
00074   void setState(const State& state);
00075 
00077   double errResidual2() const;
00078 
00080   double residual() const;
00081 
00083   void setResidual(double value);
00084 
00086   double errResidual() const;
00087 
00089   void setErrResidual(double value);
00090 
00092   const HepMatrix& projectionMatrix() const;
00093 
00095   HepMatrix& projectionMatrix();
00096 
00098   void setProjectionMatrix(const HepMatrix& value);
00099 
00100 protected:
00101 
00102   Measurement* m_measurement;      
00103   State*       m_state;            
00104   double       m_residual;         
00105   double       m_errResidual;      
00106   HepMatrix    m_projectionMatrix; 
00107 
00108 private:
00109 
00110 };
00111 
00112 // -----------------------------------------------------------------------------
00113 //   end of class
00114 // -----------------------------------------------------------------------------
00115 
00116 // Including forward declarations
00117 
00118 inline Node::~Node() 
00119 {
00120 
00121   reset();
00122         
00123 }
00124 
00125 inline double Node::residual() const 
00126 {
00127   return m_residual;
00128 }
00129 
00130 inline void Node::setResidual(double value) 
00131 {
00132   m_residual = value;
00133 }
00134 
00135 inline double Node::errResidual() const 
00136 {
00137   return m_errResidual;
00138 }
00139 
00140 inline void Node::setErrResidual(double value) 
00141 {
00142   m_errResidual = value;
00143 }
00144 
00145 inline const HepMatrix& Node::projectionMatrix() const 
00146 {
00147   return m_projectionMatrix;
00148 }
00149 
00150 inline HepMatrix& Node::projectionMatrix() 
00151 {
00152   return m_projectionMatrix;
00153 }
00154 
00155 inline void Node::setProjectionMatrix(const HepMatrix& value) 
00156 {
00157   m_projectionMatrix = value;
00158 }
00159 
00160 inline void Node::reset() 
00161 {
00162 
00163   if (m_state != NULL) delete m_state;
00164   m_measurement = NULL;
00165   m_state = NULL;
00166   m_residual = 0.;
00167   m_errResidual = 0.;
00168         
00169 }
00170 
00171 inline double Node::chi2() const 
00172 {
00173 
00174   return (m_errResidual >0 ? m_residual/m_errResidual: 0);
00175         
00176 }
00177 
00178 inline Measurement & Node::measurement() 
00179 {
00180 
00181   return *m_measurement;
00182         
00183 }
00184 
00185 inline Measurement & Node::measurement() const 
00186 {
00187 
00188   return *m_measurement;
00189         
00190 }
00191 
00192 inline State & Node::state() 
00193 {
00194 
00195   return *m_state;
00196         
00197 }
00198 
00199 inline State & Node::state() const 
00200 {
00201 
00202   return *m_state;
00203         
00204 }
00205 
00206 inline Node* Node::clone() const 
00207 {
00208 
00209   Node* me = new Node(); 
00210   me->setMeasurement(measurement());
00211   me->setState(state());
00212   me->setResidual(residual());
00213   me->setErrResidual(errResidual());
00214   return me;
00215         
00216 }
00217 
00218 inline void Node::setMeasurement(const Measurement& meas) 
00219 {
00220 
00221   m_measurement = (Measurement*) &meas;
00222         
00223 }
00224 
00225 inline void Node::setState(const State& state) 
00226 {
00227 
00228   if (m_state != NULL) delete m_state;
00229   m_state = state.clone();
00230         
00231 }
00232 
00233 inline double Node::errResidual2() const 
00234 {
00235 
00236   return m_errResidual*m_errResidual;
00237         
00238 }
00239 
00240 
00241 #endif 

Generated on Wed May 4 11:52:34 2005 for New Track Event Model by doxygen 1.4.1