Main Page   Namespace List   Compound List   File List   Compound Members   File Members  

TrTrack.h

Go to the documentation of this file.
00001 
00002 
00003 //   **************************************************************************
00004 //   *                                                                        *
00005 //   *                      ! ! ! A T T E N T I O N ! ! !                     *
00006 //   *                                                                        *
00007 //   *  This file was created automatically by GaudiObjDesc, please do not    *
00008 //   *  delete it or edit it by hand.                                         *
00009 //   *                                                                        *
00010 //   *  If you want to change this file, first change the corresponding       *
00011 //   *  xml-file and rerun the tools from GaudiObjDesc (or run make if you    *
00012 //   *  are using it from inside a Gaudi-package).                            *
00013 //   *                                                                        *
00014 //   **************************************************************************
00015 
00016 
00017 
00018 #ifndef TrEvent_TrTrack_H
00019 #define TrEvent_TrTrack_H 1
00020 
00021 // Include files
00022 #include <vector>
00023 #include "Kernel/CLHEPStreams.h"
00024 #include "GaudiKernel/KeyedObject.h"
00025 #include "GaudiKernel/ObjectList.h"
00026 #include "GaudiKernel/ObjectVector.h"
00027 #include "GaudiKernel/StreamBuffer.h"
00028 #include "Event/TrNode.h"
00029 #include "Event/TrState.h"
00030 
00031 
00032 // Class ID definition
00033   static const CLID& CLID_TrTrack = 10003;
00034 
00044 class TrTrack: public KeyedObject<int>
00045 {
00046 
00047 public: 
00048 
00049   enum TrackType {Velotrack,Backward,Long,Upstream,Downstream,Ttrack};   
00050   enum HistoryFlag {LongTrack,Seeding,TrKshort,TrMatching,VeloTrack,VeloTT};   
00051 
00053   TrTrack(const TrTrack& track);
00054 
00056   TrTrack() 
00057     : m_states(),
00058     m_nodes(),
00059     m_chi2(0.0),
00060     m_ndof(0),
00061     m_charge(0.0),
00062     m_errorFlag(0),
00063     m_type(0) {}
00064 
00066   virtual ~TrTrack() {}
00067 
00069   virtual const CLID& clID() const; 
00070   static const CLID& classID(); 
00071 
00073   virtual bool producedByAlgo(const TrTrack::HistoryFlag& flag);
00074 
00076   virtual unsigned int nStates() const;
00077 
00079   virtual TrState* closestState(double z) const;
00080 
00082   virtual unsigned int nNodes() const;
00083 
00085   virtual const std::vector<TrMeasurement*> measurements() const;
00086 
00088   virtual void setMeasurements(const const& std::vector<TrState*>);
00089 
00091   virtual double chi2PerDoF() const;
00092 
00094   virtual double chi2() const;
00095 
00097   virtual void setChi2(double value);
00098 
00100   virtual unsigned int nDoF() const;
00101 
00103   virtual void setNDoF(unsigned int value);
00104 
00106   virtual int errorFlag() const;
00107 
00109   virtual void setErrorFlag(int value);
00110 
00112   virtual void reset();
00113 
00115   virtual void clone(TrTrack* track);
00116 
00118   const std::vector<TrState*>& states() const; 
00119 
00121   std::vector<TrState*>& states();
00122 
00124   void setStates(const std::vector<TrState*>& value);
00125 
00127   const std::vector<TrNode*>& nodes() const; 
00128 
00130   std::vector<TrNode*>& nodes();
00131 
00133   void setNodes(const std::vector<TrNode*>& value);
00134 
00136   double charge() const; 
00137 
00139   void setCharge(double value);
00140 
00142   int type() const; 
00143 
00145   void setType(int value);
00146 
00148   virtual StreamBuffer& serialize(StreamBuffer& s) const;
00149 
00151   virtual StreamBuffer& serialize(StreamBuffer& s);
00152 
00154   virtual std::ostream& fillStream(std::ostream& s) const;
00155 
00156 protected: 
00157 
00158 private: 
00159 
00160   std::vector<TrState*> m_states;    
00161   std::vector<TrNode*>  m_nodes;     
00162   double                m_chi2;      
00163   int                   m_ndof;      
00164   double                m_charge;    
00165   int                   m_errorFlag; 
00166   int                   m_type;      
00167 
00168 };
00169 
00170 // -----------------------------------------------------------------------------
00171 //   end of class
00172 // -----------------------------------------------------------------------------
00173 
00174 
00175 inline const CLID& TrTrack::clID() const 
00176 {
00177   return TrTrack::classID();
00178 }
00179 
00180 inline const CLID& TrTrack::classID()
00181 {
00182   return CLID_TrTrack;
00183 }
00184 
00185 inline double TrTrack::chi2PerDoF() const
00186 {
00187    
00188    return ( ( m_ndof > 0 ) ? m_chi2/double(m_ndof) : 0. );
00189         
00190 }
00191 
00192 inline void TrTrack::reset()
00193 {
00194    
00195    m_closestState.reset();
00196    m_states.clear();
00197    m_nodes.clear();
00198    m_chi2      = 0;
00199    m_ndof      = 0;
00200    m_charge    = 0;
00201    m_errorFlag = 0;
00202    m_type      = 0;
00203         
00204 }
00205 
00206 inline const std::vector<TrState*>& TrTrack::states() const 
00207 {
00208   return m_states;
00209 }
00210 
00211 inline std::vector<TrState*>& TrTrack::states()
00212 {
00213   return m_states;
00214 }
00215 
00216 inline void TrTrack::setStates(const std::vector<TrState*>& value)
00217 {
00218   m_states = value; 
00219 }
00220 
00221 inline const std::vector<TrNode*>& TrTrack::nodes() const 
00222 {
00223   return m_nodes;
00224 }
00225 
00226 inline std::vector<TrNode*>& TrTrack::nodes()
00227 {
00228   return m_nodes;
00229 }
00230 
00231 inline void TrTrack::setNodes(const std::vector<TrNode*>& value)
00232 {
00233   m_nodes = value; 
00234 }
00235 
00236 inline double TrTrack::charge() const 
00237 {
00238   return m_charge;
00239 }
00240 
00241 inline void TrTrack::setCharge(double value)
00242 {
00243   m_charge = value; 
00244 }
00245 
00246 inline int TrTrack::type() const 
00247 {
00248   return m_type;
00249 }
00250 
00251 inline void TrTrack::setType(int value)
00252 {
00253   m_type = value; 
00254 }
00255 
00256 inline StreamBuffer& TrTrack::serialize(StreamBuffer& s) const 
00257 {
00258   KeyedObject<int>::serialize(s);
00259   s << m_states
00260     << m_nodes
00261     << (float)m_chi2
00262     << m_ndof
00263     << (float)m_charge
00264     << m_errorFlag
00265     << m_type;
00266   return s;
00267 }
00268 
00269 inline StreamBuffer& TrTrack::serialize(StreamBuffer& s)
00270 {
00271   float l_chi2, l_charge;
00272   KeyedObject<int>::serialize(s);
00273   s >> m_states
00274     >> m_nodes
00275     >> l_chi2
00276     >> m_ndof
00277     >> l_charge
00278     >> m_errorFlag
00279     >> m_type;
00280   m_chi2 = l_chi2;
00281   m_charge = l_charge;
00282   return s;
00283 }
00284 
00285 inline std::ostream& TrTrack::fillStream(std::ostream& s) const
00286 {
00287   s << "{ "
00288     << " states:\t" << m_states << std::endl
00289     << "   nodes:\t" << m_nodes << std::endl
00290     << "   chi2:\t" << (float)m_chi2 << std::endl
00291     << "   ndof:\t" << m_ndof << std::endl
00292     << "   charge:\t" << (float)m_charge << std::endl
00293     << "   errorFlag:\t" << m_errorFlag << std::endl
00294     << "   type:\t" << m_type << " } ";
00295   return s;
00296 }
00297 
00298 //Definition of keyed container for TrTrack
00299 typedef KeyedContainer<TrTrack, Containers::HashMap> TrTracks;
00300 
00301 #endif   

Generated on Tue Sep 28 18:11:17 2004 for New Track Event Model by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002