CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Attributes
trackerTFP::DataFormat Class Reference

#include <DataFormats.h>

Inheritance diagram for trackerTFP::DataFormat:
trackerTFP::Format< v, p >

Public Member Functions

void attach (const int i, TTBV &ttBV) const
 
void attach (const double d, TTBV &ttBV) const
 
void attach (const TTBV bv, TTBV &ttBV) const
 
double base () const
 
 DataFormat (bool twos)
 
double digi (double d) const
 
void extract (TTBV &in, int &out) const
 
void extract (TTBV &in, double &out) const
 
void extract (TTBV &in, TTBV &out) const
 
double floating (int i) const
 
bool inRange (double d, bool digi=false) const
 
bool inRange (int i) const
 
int integer (double d) const
 
double range () const
 
int toSigned (int i) const
 
int toUnsigned (int i) const
 
int toUnsigned (double d) const
 
TTBV ttBV (int i) const
 
TTBV ttBV (double d) const
 
bool twos () const
 
int width () const
 
 ~DataFormat ()
 

Protected Attributes

double base_
 
double range_
 
bool twos_
 
int width_
 

Detailed Description

Definition at line 73 of file DataFormats.h.

Constructor & Destructor Documentation

◆ DataFormat()

trackerTFP::DataFormat::DataFormat ( bool  twos)
inline

Definition at line 75 of file DataFormats.h.

◆ ~DataFormat()

trackerTFP::DataFormat::~DataFormat ( )
inline

Definition at line 76 of file DataFormats.h.

76 {}

Member Function Documentation

◆ attach() [1/3]

void trackerTFP::DataFormat::attach ( const int  i,
TTBV ttBV 
) const
inline

Definition at line 88 of file DataFormats.h.

References mps_fire::i, ttBV(), twos_, and width_.

88 { ttBV += TTBV(i, width_, twos_); }
Bit vector used by Track Trigger emulators. Mainly used to convert integers into arbitrary (within ma...
Definition: TTBV.h:20
TTBV ttBV(int i) const
Definition: DataFormats.h:78

◆ attach() [2/3]

void trackerTFP::DataFormat::attach ( const double  d,
TTBV ttBV 
) const
inline

Definition at line 90 of file DataFormats.h.

References base_, ztail::d, ttBV(), twos_, and width_.

90 { ttBV += TTBV(d, base_, width_, twos_); }
Bit vector used by Track Trigger emulators. Mainly used to convert integers into arbitrary (within ma...
Definition: TTBV.h:20
TTBV ttBV(int i) const
Definition: DataFormats.h:78
d
Definition: ztail.py:151

◆ attach() [3/3]

void trackerTFP::DataFormat::attach ( const TTBV  bv,
TTBV ttBV 
) const
inline

Definition at line 92 of file DataFormats.h.

References ttBV().

92 { ttBV += bv; }
TTBV ttBV(int i) const
Definition: DataFormats.h:78

◆ base()

double trackerTFP::DataFormat::base ( ) const
inline

◆ digi()

double trackerTFP::DataFormat::digi ( double  d) const
inline

◆ extract() [1/3]

void trackerTFP::DataFormat::extract ( TTBV in,
int &  out 
) const
inline

◆ extract() [2/3]

void trackerTFP::DataFormat::extract ( TTBV in,
double &  out 
) const
inline

◆ extract() [3/3]

void trackerTFP::DataFormat::extract ( TTBV in,
TTBV out 
) const
inline

◆ floating()

double trackerTFP::DataFormat::floating ( int  i) const
inline

◆ inRange() [1/2]

bool trackerTFP::DataFormat::inRange ( double  d,
bool  digi = false 
) const
inline

Definition at line 106 of file DataFormats.h.

References base_, ztail::d, digi(), conifer::pow(), range(), range_, and width_.

Referenced by trackerTFP::HoughTransform::fillIn(), and trklet::KFin::produce().

106  {
107  const double range = digi ? base_ * pow(2, width_) : range_;
108  return d >= -range / 2. && d < range / 2.;
109  }
constexpr int pow(int x)
Definition: conifer.h:24
double range() const
Definition: DataFormats.h:119
d
Definition: ztail.py:151
double digi(double d) const
Definition: DataFormats.h:98

◆ inRange() [2/2]

bool trackerTFP::DataFormat::inRange ( int  i) const
inline

Definition at line 111 of file DataFormats.h.

References floating(), mps_fire::i, and inRange().

Referenced by inRange().

111 { return inRange(floating(i)); }
bool inRange(double d, bool digi=false) const
Definition: DataFormats.h:106
double floating(int i) const
Definition: DataFormats.h:94

◆ integer()

int trackerTFP::DataFormat::integer ( double  d) const
inline

◆ range()

double trackerTFP::DataFormat::range ( ) const
inline

Definition at line 119 of file DataFormats.h.

References range_.

Referenced by inRange(), and trackerTFP::TrackDR::TrackDR().

119 { return range_; }

◆ toSigned()

int trackerTFP::DataFormat::toSigned ( int  i) const
inline

◆ toUnsigned() [1/2]

int trackerTFP::DataFormat::toUnsigned ( int  i) const
inline

◆ toUnsigned() [2/2]

int trackerTFP::DataFormat::toUnsigned ( double  d) const
inline

Definition at line 104 of file DataFormats.h.

References integer(), conifer::pow(), and width_.

104 { return this->integer(d) + std::pow(2, width_) / 2; }
constexpr int pow(int x)
Definition: conifer.h:24
int integer(double d) const
Definition: DataFormats.h:96
d
Definition: ztail.py:151

◆ ttBV() [1/2]

TTBV trackerTFP::DataFormat::ttBV ( int  i) const
inline

Definition at line 78 of file DataFormats.h.

References mps_fire::i, twos_, and width_.

Referenced by attach(), and trklet::KFin::produce().

78 { return TTBV(i, width_, twos_); }
Bit vector used by Track Trigger emulators. Mainly used to convert integers into arbitrary (within ma...
Definition: TTBV.h:20

◆ ttBV() [2/2]

TTBV trackerTFP::DataFormat::ttBV ( double  d) const
inline

Definition at line 80 of file DataFormats.h.

References base_, ztail::d, twos_, and width_.

80 { return TTBV(d, base_, width_, twos_); }
Bit vector used by Track Trigger emulators. Mainly used to convert integers into arbitrary (within ma...
Definition: TTBV.h:20
d
Definition: ztail.py:151

◆ twos()

bool trackerTFP::DataFormat::twos ( ) const
inline

Definition at line 113 of file DataFormats.h.

References twos_.

113 { return twos_; }

◆ width()

int trackerTFP::DataFormat::width ( ) const
inline

Definition at line 115 of file DataFormats.h.

References width_.

Referenced by trackerTFP::LayerEncoding::LayerEncoding().

115 { return width_; }

Member Data Documentation

◆ base_

double trackerTFP::DataFormat::base_
protected

◆ range_

double trackerTFP::DataFormat::range_
protected

Definition at line 129 of file DataFormats.h.

Referenced by trackerTFP::Format< v, p >::Format(), inRange(), and range().

◆ twos_

bool trackerTFP::DataFormat::twos_
protected

Definition at line 123 of file DataFormats.h.

Referenced by attach(), extract(), ttBV(), and twos().

◆ width_

int trackerTFP::DataFormat::width_
protected