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(State* state,
00041        Measurement* meas) : m_state(state),
00042                             m_measurement(meas),
00043                             m_residual(0.0),
00044                             m_errResidual(0.0),
00045                             m_projectionMatrix() {}
00046 
00048   Node() : m_state(),
00049            m_measurement(),
00050            m_residual(0.0),
00051            m_errResidual(0.0),
00052            m_projectionMatrix() {}
00053 
00055   virtual ~Node() {}
00056 
00058   virtual void reset();
00059 
00061   double chi2() const;
00062 
00064   Measurement & measurement();
00065 
00067   Measurement & measurement() const;
00068 
00070   State & state();
00071 
00073   State & state() const;
00074 
00076   virtual Node* clone() const;
00077 
00079   void setState(const State& state);
00080 
00082   double errResidual2() const;
00083 
00085   double residual() const;
00086 
00088   void setResidual(double value);
00089 
00091   double errResidual() const;
00092 
00094   void setErrResidual(double value);
00095 
00097   const HepMatrix& projectionMatrix() const;
00098 
00100   HepMatrix& projectionMatrix();
00101 
00103   void setProjectionMatrix(const HepMatrix& value);
00104 
00105 protected:
00106 
00107   State*       m_state;            
00108   Measurement* m_measurement;      
00109   double       m_residual;         
00110   double       m_errResidual;      
00111   HepMatrix    m_projectionMatrix; 
00112 
00113 private:
00114 
00115 };
00116 
00117 // -----------------------------------------------------------------------------
00118 //   end of class
00119 // -----------------------------------------------------------------------------
00120 
00121 // Including forward declarations
00122 
00123 inline double Node::residual() const 
00124 {
00125   return m_residual;
00126 }
00127 
00128 inline void Node::setResidual(double value) 
00129 {
00130   m_residual = value;
00131 }
00132 
00133 inline double Node::errResidual() const 
00134 {
00135   return m_errResidual;
00136 }
00137 
00138 inline void Node::setErrResidual(double value) 
00139 {
00140   m_errResidual = value;
00141 }
00142 
00143 inline const HepMatrix& Node::projectionMatrix() const 
00144 {
00145   return m_projectionMatrix;
00146 }
00147 
00148 inline HepMatrix& Node::projectionMatrix() 
00149 {
00150   return m_projectionMatrix;
00151 }
00152 
00153 inline void Node::setProjectionMatrix(const HepMatrix& value) 
00154 {
00155   m_projectionMatrix = value;
00156 }
00157 
00158 inline void Node::reset() 
00159 {
00160 
00161   if (m_state != NULL) delete m_state;
00162 //  m_measurement = NULL;
00163   m_state = NULL;
00164   m_residual = 0.;
00165   m_errResidual = 0.;
00166         
00167 }
00168 
00169 inline double Node::chi2() const 
00170 {
00171 
00172   return (m_errResidual >0 ? m_residual/m_errResidual: 0);
00173         
00174 }
00175 
00176 inline Measurement & Node::measurement() 
00177 {
00178 
00179   return *m_measurement;
00180         
00181 }
00182 
00183 inline Measurement & Node::measurement() const 
00184 {
00185 
00186   return *m_measurement;
00187         
00188 }
00189 
00190 inline State & Node::state() 
00191 {
00192 
00193   return *m_state;
00194         
00195 }
00196 
00197 inline State & Node::state() const 
00198 {
00199 
00200   return *m_state;
00201         
00202 }
00203 
00204 inline Node* Node::clone() const 
00205 {
00206 
00207   Node* me = new Node(state().clone(), (Measurement*) &measurement()); 
00208   me->setResidual(residual());
00209   me->setErrResidual(errResidual());
00210   return me;
00211         
00212 }
00213 
00214 inline void Node::setState(const State& state) 
00215 {
00216 
00217   if (m_state != NULL) delete m_state;
00218   m_state = state.clone();
00219         
00220 }
00221 
00222 inline double Node::errResidual2() const 
00223 {
00224 
00225   return m_errResidual*m_errResidual;
00226         
00227 }
00228 
00229 
00230 #endif 

Generated on Fri May 27 13:59:37 2005 for New Track Event Model by doxygen 1.4.1