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