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/TrMeasurement.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_measurements(),
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   void positionAndMomentum(const double z, const HepPoint3D& pos, const HepVector3D& mom, const HepSymMatrix& cov6D) const;
00074 
00076   HepPoint3D position(const double z) const;
00077 
00079   HepVector3D slopes(const double z) const;
00080 
00082   HepSymMatrix posMomCovariance(const double z) const;
00083 
00085   std::vector errPosition(const double z) const;
00086 
00088   std::vector errSlopes(const double z) const;
00089 
00091   double p(const double z) const;
00092 
00094   double pt(const double z) const;
00095 
00097   HepVector3D momentum(const double z) const;
00098 
00100   std::vector errMomentum(const double z) const;
00101 
00103   TrackType type();
00104 
00106   bool producedByAlgo(const TrTrack::HistoryFlag& flag);
00107 
00109   double chi2PerDoF() const;
00110 
00112   double chi2() const;
00113 
00115   void setChi2(double value);
00116 
00118   unsigned int nDoF() const;
00119 
00121   void setNDoF(unsigned int value);
00122 
00124   int errorFlag() const;
00125 
00127   void setErrorFlag(int value);
00128 
00130   void reset();
00131 
00133   void clone(TrTrack* track);
00134 
00136   double charge() const; 
00137 
00139   void setCharge(double value);
00140 
00142   virtual StreamBuffer& serialize(StreamBuffer& s) const;
00143 
00145   virtual StreamBuffer& serialize(StreamBuffer& s);
00146 
00148   virtual std::ostream& fillStream(std::ostream& s) const;
00149 
00150 protected: 
00151 
00153   void setType(const TrTrack::TrackType& value);
00154 
00156   unsigned int nStates() const;
00157 
00159   TrState* closestState(double z) const;
00160 
00162   const std::vector<TrState*> states() const;
00163 
00165   void setStates(const const& std::vector<TrState*>);
00166 
00168   unsigned int nMeasurements() const;
00169 
00171   const std::vector<TrMeasurement*> measurements() const;
00172 
00174   void setMeasurements(const const& std::vector<TrState*>);
00175 
00176 private: 
00177 
00178   std::vector<TrState*>       m_states;       
00179   std::vector<TrMeasurement*> m_measurements; 
00180   double                      m_chi2;         
00181   int                         m_ndof;         
00182   double                      m_charge;       
00183   int                         m_errorFlag;    
00184   int                         m_type;         
00185 
00186 };
00187 
00188 // -----------------------------------------------------------------------------
00189 //   end of class
00190 // -----------------------------------------------------------------------------
00191 
00192 
00193 inline const CLID& TrTrack::clID() const 
00194 {
00195   return TrTrack::classID();
00196 }
00197 
00198 inline const CLID& TrTrack::classID()
00199 {
00200   return CLID_TrTrack;
00201 }
00202 
00203 inline double TrTrack::chi2PerDoF() const
00204 {
00205    
00206           return ( ( m_ndof > 0 ) ? m_chi2/double(m_ndof) : 0. );
00207         
00208 }
00209 
00210 inline void TrTrack::reset()
00211 {
00212    
00213           m_closestState.reset();
00214           m_states.clear();
00215           m_measurements.clear();
00216           m_chi2      = 0;
00217           m_ndof      = 0;
00218           m_charge    = 0;
00219           m_errorFlag = 0;
00220         
00221 }
00222 
00223 inline double TrTrack::charge() const 
00224 {
00225   return m_charge;
00226 }
00227 
00228 inline void TrTrack::setCharge(double value)
00229 {
00230   m_charge = value; 
00231 }
00232 
00233 inline StreamBuffer& TrTrack::serialize(StreamBuffer& s) const 
00234 {
00235   KeyedObject<int>::serialize(s);
00236   s << m_states
00237     << m_measurements
00238     << (float)m_chi2
00239     << m_ndof
00240     << (float)m_charge
00241     << m_errorFlag
00242     << m_type;
00243   return s;
00244 }
00245 
00246 inline StreamBuffer& TrTrack::serialize(StreamBuffer& s)
00247 {
00248   float l_chi2, l_charge;
00249   KeyedObject<int>::serialize(s);
00250   s >> m_states
00251     >> m_measurements
00252     >> l_chi2
00253     >> m_ndof
00254     >> l_charge
00255     >> m_errorFlag
00256     >> m_type;
00257   m_chi2 = l_chi2;
00258   m_charge = l_charge;
00259   return s;
00260 }
00261 
00262 inline std::ostream& TrTrack::fillStream(std::ostream& s) const
00263 {
00264   s << "{ "
00265     << " states:\t" << m_states << std::endl
00266     << "   measurements:\t" << m_measurements << std::endl
00267     << "   chi2:\t" << (float)m_chi2 << std::endl
00268     << "   ndof:\t" << m_ndof << std::endl
00269     << "   charge:\t" << (float)m_charge << std::endl
00270     << "   errorFlag:\t" << m_errorFlag << std::endl
00271     << "   type:\t" << m_type << " } ";
00272   return s;
00273 }
00274 
00275 //Definition of keyed container for TrTrack
00276 typedef KeyedContainer<TrTrack, Containers::HashMap> TrTracks;
00277 
00278 #endif   

Generated on Fri Sep 10 19:14:13 2004 for New Track Event Model by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002