00001 //-------------------------------------------------------------------------- 00002 // File and Version Information: 00003 // $Id: ComPackFlatFloat.h,v 1.2 2009/12/23 02:59:56 zhangy Exp $ 00004 // 00005 // Description: 00006 // Class ComPackFlatFloat 00007 // - Maps a float onto an integer range - useful if you know that 00008 // a value will always be in a certain range. 00009 // 00010 // Environment: 00011 // Software developed for the BaBar Detector at the SLAC B-Factory. 00012 // 00013 // Author List: 00014 // D.E.Azzopardi Originator. 00015 // 00016 // Copyright Information: 00017 // Copyright (C) 1999 DESVA Research & Design, for Hedgehog Concepts 00018 // 00019 // History: 00020 // Migration for BESIII MDC 00021 // 00022 // Quote: 00023 // "Do, or do not, there is no try." 00024 // - Jedi Master Yoda 00025 // 00026 //-------------------------------------------------------------------------- 00027 00028 #ifndef COMPACKFLATFLOAT_HH 00029 #define COMPACKFLATFLOAT_HH 00030 00031 // 00032 // Bass class includes 00033 // 00034 #include "MdcRecoUtil/ComPackBase.h" 00035 00036 class ComPackFlatFloat:public ComPackBase<double> { 00037 00038 public: 00040 // Constructors: // 00042 ComPackFlatFloat(const double, const double, size_t); // linearly packed float 00043 00045 // Destructor: // 00047 virtual ~ComPackFlatFloat(); 00048 00050 // Packers: // 00052 StatusCode pack (const double, d_ULong &) const; 00053 00055 // Unpackers: // 00057 StatusCode unpack (const d_ULong, double &) const; 00058 00060 // Accessors: // 00062 00064 // Diagnostic: // 00066 void testMe ( size_t, double & ); 00067 00068 private: 00069 double _pacfac; 00070 double _upacfac; // precomputed values to speed packing/unpacking 00071 }; 00072 00073 #endif