CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
logintpack Namespace Reference

Functions

int8_t pack8log (double x, double lmin, double lmax, uint8_t base=128)
 
int8_t pack8logCeil (double x, double lmin, double lmax, uint8_t base=128)
 
double unpack8log (int8_t i, double lmin, double lmax, uint8_t base=128)
 

Function Documentation

int8_t logintpack::pack8log ( double  x,
double  lmin,
double  lmax,
uint8_t  base = 128 
)

Definition at line 20 of file liblogintpack.h.

References newFWLiteAna::base, prof2calltree::l, fff_deleter::log, and alignCSCRings::r.

Referenced by pat::PackedCandidate::packVtx().

21  {
22  if(base>128) base=128;
23  float l =log(fabs(x));
24  float centered = (l-lmin)/(lmax-lmin)*base;
25  int8_t r=centered;
26  if(centered >= base-1) return r=base-1;
27  if(centered < 0) return r=0;
28  if(x<0) r=-r;
29  return r;
30  }
tuple base
Main Program
Definition: newFWLiteAna.py:92
Definition: DDAxes.h:10
int8_t logintpack::pack8logCeil ( double  x,
double  lmin,
double  lmax,
uint8_t  base = 128 
)

Definition at line 8 of file liblogintpack.h.

References newFWLiteAna::base, prof2calltree::l, fff_deleter::log, and alignCSCRings::r.

Referenced by pat::PackedCandidate::packVtx().

9  {
10  if(base>128) base=128;
11  float l =log(fabs(x));
12  float centered = (l-lmin)/(lmax-lmin)*base;
13  int8_t r=ceil(centered);
14  if(centered >= base-1) return r=base-1;
15  if(centered < 0) return r=0;
16  if(x<0) r=-r;
17  return r;
18  }
tuple base
Main Program
Definition: newFWLiteAna.py:92
Definition: DDAxes.h:10
double logintpack::unpack8log ( int8_t  i,
double  lmin,
double  lmax,
uint8_t  base = 128 
)

Definition at line 32 of file liblogintpack.h.

References funct::abs(), newFWLiteAna::base, create_public_lumi_plots::exp, and prof2calltree::l.

Referenced by pat::PackedCandidate::unpackVtx().

33  {
34  if(base>128) base=128;
35  float basef=base;
36  float l=lmin+abs(i)/basef*(lmax-lmin);
37  float val=exp(l);
38  if(i<0) return -val; else return val;
39  }
tuple base
Main Program
Definition: newFWLiteAna.py:92
int i
Definition: DBlmapReader.cc:9
Abs< T >::type abs(const T &t)
Definition: Abs.h:22