BOSS
8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Reconstruction/MdcPatRec/MdcRecoUtil/include/MdcRecoUtil/ComPackExpFloat.h
Go to the documentation of this file.
1
//--------------------------------------------------------------------------
2
// File and Version Information:
3
// $Id: ComPackExpFloat.h,v 1.2 2009/12/23 02:59:56 zhangy Exp $
4
//
5
// Description:
6
// class ComPackExpFloat; pack a floating (double) into a fixed range
7
// mantissa with an exponential (power of 2) representation. With this class, the values
8
// stored at the start of the range have the best precision, which
9
// gradually decreases to the worst precision when going to the opposite
10
// range. This is equivalent to flat packing of the log of the value,
11
// but because the exponent storage space is variable, this class allows
12
// the equivalent of scaling the (log) value.
13
//
14
// Environment:
15
// Software developed for the BaBar Detector at the SLAC B-Factory.
16
//
17
// Author List:
18
// Dave Brown 10/12/00
19
//
20
// Copyright Information:
21
// Copyright (C) 2000 LBNL
22
//
23
// History:
24
// Migration for BESIII MDC
25
//
26
//
27
//--------------------------------------------------------------------------
28
29
#ifndef COMPACKEXPFLOAT_HH
30
#define COMPACKEXPFLOAT_HH
31
32
#include "MdcRecoUtil/ComPackBase.h"
33
#include <iostream>
34
35
class
ComPackExpFloat
:
public
ComPackBase
<double> {
36
37
public
:
38
// specify the storage space (number of total bits) and the maximum exponent.
39
// The mantissa will be stored in the bits left over after storing the exponent
40
// Note that the exponent is -UNSIGNED-. Note that the stop and start values do
41
// _not_ have to be monotonic; the order simply defines which end of the range
42
// has the fine precision (start) vs coarse (stop). The 'center' command will
43
// use the start and stop values to define the (exact) range for unpacking data
44
// (ie the packing bins will be centered about those values).
45
ComPackExpFloat
(
unsigned
nbits,
unsigned
maxexponent,
double
start,
double
stop,
46
bool
center =
false
);
47
virtual
~ComPackExpFloat
();
48
// ComPackBase functions
49
virtual
StatusCode
pack
(
const
double
,
d_ULong
& )
const
;
50
virtual
StatusCode
unpack
(
const
d_ULong
,
double
& )
const
;
51
void
print
( std::ostream& os )
const
;
52
53
private
:
54
unsigned
_maxexp;
// maximum value of the exponent (+1)
55
unsigned
_expmsk;
// exponent storage mask
56
unsigned
_mansft;
// mantissa storage shift
57
unsigned
_manmsk;
// mantissa storage mask
58
unsigned
_maxman;
// maximum integer mantissa
59
double
_invrange;
// inverse range
60
// pre-computed quantities to speed unpacking
61
double
* _expfac;
62
double
* _expoff;
63
// disallow copy and equivalence
64
ComPackExpFloat
(
const
ComPackExpFloat
& );
65
ComPackExpFloat
& operator=(
const
ComPackExpFloat
& );
66
};
67
68
#endif
d_ULong
unsigned int d_ULong
Definition
InstallArea/x86_64-el9-gcc13-dbg/include/MdcRecoUtil/BesODMGTypes.h:95
ComPackBaseBase::StatusCode
StatusCode
Definition
InstallArea/x86_64-el9-gcc13-dbg/include/MdcRecoUtil/ComPackBaseBase.h:35
ComPackBase
Definition
InstallArea/x86_64-el9-gcc13-dbg/include/MdcRecoUtil/ComPackBase.h:39
ComPackExpFloat
Definition
InstallArea/x86_64-el9-gcc13-dbg/include/MdcRecoUtil/ComPackExpFloat.h:35
ComPackExpFloat::ComPackExpFloat
ComPackExpFloat(unsigned nbits, unsigned maxexponent, double start, double stop, bool center=false)
ComPackExpFloat::pack
virtual StatusCode pack(const double, d_ULong &) const
ComPackExpFloat::unpack
virtual StatusCode unpack(const d_ULong, double &) const
ComPackExpFloat::print
void print(std::ostream &os) const
ComPackExpFloat::~ComPackExpFloat
virtual ~ComPackExpFloat()
8.0.0
BOSS_Source
Reconstruction
MdcPatRec
MdcRecoUtil
include
MdcRecoUtil
ComPackExpFloat.h
Generated by
1.16.1