ATLAS Offline Software
Classes | Public Member Functions | Public Attributes | List of all members
DecoderFloat_IEEE754 Class Reference

#include <ErrorMatrixCompressor.h>

Collaboration diagram for DecoderFloat_IEEE754:

Classes

union  FloatLongIntUnion
 

Public Member Functions

 DecoderFloat_IEEE754 ()
 
 ~DecoderFloat_IEEE754 ()
 
void setF (float f)
 
float getF ()
 
void setL (int l)
 
unsigned int getL ()
 
void print ()
 
short int getExponent ()
 
unsigned int getMantissa ()
 
void setExponent (short int)
 
void setSign (int)
 

Public Attributes

FloatLongIntUnion m_data
 

Detailed Description

Definition at line 20 of file ErrorMatrixCompressor.h.

Constructor & Destructor Documentation

◆ DecoderFloat_IEEE754()

DecoderFloat_IEEE754::DecoderFloat_IEEE754 ( )
inline

Definition at line 30 of file ErrorMatrixCompressor.h.

31  {
32  m_data.f=0.0;
33  }

◆ ~DecoderFloat_IEEE754()

DecoderFloat_IEEE754::~DecoderFloat_IEEE754 ( )
inline

Definition at line 34 of file ErrorMatrixCompressor.h.

34 {};

Member Function Documentation

◆ getExponent()

short int DecoderFloat_IEEE754::getExponent ( )

Definition at line 48 of file ErrorMatrixCompressor.cxx.

49 {
50  unsigned int mask = 0x7f800000;
51  return ((m_data.l & mask) >> 23);
52 }

◆ getF()

float DecoderFloat_IEEE754::getF ( )
inline

Definition at line 39 of file ErrorMatrixCompressor.h.

40  {
41  if(m_data.l==(unsigned int)0x80000000)
42  return 0.0;
43  else
44  return m_data.f;
45  }

◆ getL()

unsigned int DecoderFloat_IEEE754::getL ( )
inline

Definition at line 50 of file ErrorMatrixCompressor.h.

51  {
52  return m_data.l;
53  }

◆ getMantissa()

unsigned int DecoderFloat_IEEE754::getMantissa ( )

Definition at line 54 of file ErrorMatrixCompressor.cxx.

55 {
56  unsigned int mask = 0x007fffff;
57  return (m_data.l & mask);
58 }

◆ print()

void DecoderFloat_IEEE754::print ( )

Definition at line 24 of file ErrorMatrixCompressor.cxx.

25 {
26  // printf("0x%X\n",m_data.l);
27  unsigned int mask = 0x00000001;
28  for(int i=31;i>=0;i--)
29  {
30  unsigned int m = mask << i;
31  //printf("0x%X\n",m);
32  if(m_data.l & m) std::cout<<"1";
33  else std::cout<<"0";
34  }
35  std::cout<<std::endl;
36  /*
37  mask = 0x80000000;
38  int sign = (m_data.l & mask) >> 31;
39  mask = 0x7f800000;
40  short int exponent = (m_data.l & mask) >> 23;
41  mask = 0x007fffff;
42  unsigned int mant = (m_data.l & mask);
43  printf("Sign=0x%X Exponent = 0x%X Mantissa = 0x%X\n",sign,exponent,mant);
44  printf("Sign=%d Exponent = %d Mantissa = %ld\n",sign,exponent,mant);
45  */
46 }

◆ setExponent()

void DecoderFloat_IEEE754::setExponent ( short int  ex)

Definition at line 61 of file ErrorMatrixCompressor.cxx.

62 {
63  unsigned int buf=ex;
64  buf=buf<<23;
65  unsigned int mask=0x7F800000;
66  m_data.l=m_data.l | (buf & mask);
67 }

◆ setF()

void DecoderFloat_IEEE754::setF ( float  f)
inline

Definition at line 35 of file ErrorMatrixCompressor.h.

36  {
37  m_data.f=f;
38  }

◆ setL()

void DecoderFloat_IEEE754::setL ( int  l)
inline

Definition at line 46 of file ErrorMatrixCompressor.h.

47  {
48  m_data.l=l;
49  }

◆ setSign()

void DecoderFloat_IEEE754::setSign ( int  s)

Definition at line 69 of file ErrorMatrixCompressor.cxx.

70 {
71  if(s>0)
72  {
73  m_data.l=m_data.l & 0x7FFFFFFF;
74  }
75  else
76  {
77  m_data.l=m_data.l | 0x80000000;
78  }
79 }

Member Data Documentation

◆ m_data

FloatLongIntUnion DecoderFloat_IEEE754::m_data

Definition at line 60 of file ErrorMatrixCompressor.h.


The documentation for this class was generated from the following files:
python.CaloRecoConfig.f
f
Definition: CaloRecoConfig.py:127
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
DecoderFloat_IEEE754::FloatLongIntUnion::f
float f
Definition: ErrorMatrixCompressor.h:25
UploadAMITag.l
list l
Definition: UploadAMITag.larcaf.py:158
python.utils.AtlRunQueryLookup.mask
string mask
Definition: AtlRunQueryLookup.py:460
DecoderFloat_IEEE754::FloatLongIntUnion::l
unsigned int l
Definition: ErrorMatrixCompressor.h:26
DecoderFloat_IEEE754::m_data
FloatLongIntUnion m_data
Definition: ErrorMatrixCompressor.h:60
lumiFormat.i
int i
Definition: lumiFormat.py:92
python.DecayParser.buf
buf
print ("=> [%s]"cmd)
Definition: DecayParser.py:27