00001 //-------------------------------------------------------------------------- 00002 // File and Version Information: 00003 // $Id: TrkExchangeData.h,v 1.1.1.1 2005/04/21 06:01:42 zhangy Exp $ 00004 // 00005 // Description: 00006 // Class TrkExchangeData; a compact representation of a helix. This 00007 // describes only the helix parameters, not the errors 00008 // 00009 // Environment: 00010 // Software developed for the BaBar Detector at the SLAC B-Factory. 00011 // 00012 // Copyright Infomation; 00013 // Copyright (C) 2003 Lawrence Berkeley Laboratory 00014 // 00015 // Author(s): Dave Brown 07/17/03 00016 // 00017 //------------------------------------------------------------------------ 00018 00019 #ifndef TRKEXCHANGEDATA_HH 00020 #define TRKEXCHANGEDATA_HH 00021 00022 #include "MdcRecoUtil/BesODMGTypes.h" 00023 #include "TrkBase/TrkExchangePar.h" 00024 00025 template <class T> class ComPackBase; 00026 class ComPackExpFloat; 00027 class ComPackSignedExpFloat; 00028 class ComPackFlatFloat; 00029 00030 class TrkExchangeData { 00031 public: 00032 // default constructor for Objectivity 00033 TrkExchangeData(); 00034 // construct from a ExchangePar 00035 TrkExchangeData(const TrkExchangePar*); 00036 // copy and equivalence are OK 00037 TrkExchangeData(const TrkExchangeData&); 00038 TrkExchangeData& operator =(const TrkExchangeData&); 00039 // NO VIRTUAL DESTRUCTOR. Yes, this is on purpose, to cut down on overhead 00040 ~TrkExchangeData(); 00041 // allow separate unpacking of all parameters; 00042 // the helix function _RETURNS OWNERSHIP_ 00043 TrkExchangePar* exchange() const; 00044 // access to raw data 00045 const d_UShort& parameters(int index ) const { 00046 return _params[index]; } 00047 private: 00048 friend class TrkExchangeDataK; 00049 // array of parameter and diagonal covariance terms. 00050 // these are indexed by the same enum defined in TrkExchangePar. 00051 d_UShort _params[TrkExchangePar::nParam]; 00052 static const ComPackBase<double>& paramPacker(int); 00053 // statics used for packing 00054 static const ComPackSignedExpFloat _packd0; 00055 static const ComPackSignedExpFloat _packz0; 00056 static const ComPackFlatFloat _packphi0; 00057 static const ComPackSignedExpFloat _packomega; 00058 static const ComPackFlatFloat _packlambda; 00059 }; 00060 00061 #endif