CMS 3D CMS Logo

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

#include <KalmanFilterFormats.h>

Inheritance diagram for trackerTFP::DataFormatKF:
trackerTFP::FormatKF< v >

Public Member Functions

double base () const
 
 DataFormatKF (const VariableKF &v, bool twos)
 
double digi (double val) const
 
bool inRange (double d) const
 
int integer (double d) const
 
double range () const
 
const std::pair< double, double > & rangeActual () const
 
bool twos () const
 
void updateRangeActual (double d)
 
int width () const
 
virtual ~DataFormatKF ()
 

Protected Attributes

double base_
 
double range_
 
std::pair< double, double > rangeActual_
 
bool twos_
 
VariableKF v_
 
int width_
 

Detailed Description

Definition at line 68 of file KalmanFilterFormats.h.

Constructor & Destructor Documentation

◆ DataFormatKF()

trackerTFP::DataFormatKF::DataFormatKF ( const VariableKF v,
bool  twos 
)

◆ ~DataFormatKF()

virtual trackerTFP::DataFormatKF::~DataFormatKF ( )
inlinevirtual

Definition at line 71 of file KalmanFilterFormats.h.

71 {}

Member Function Documentation

◆ base()

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

Definition at line 75 of file KalmanFilterFormats.h.

References base_.

Referenced by trackerTFP::KalmanFilter::update().

75 { return base_; }

◆ digi()

double trackerTFP::DataFormatKF::digi ( double  val) const
inline

◆ inRange()

bool trackerTFP::DataFormatKF::inRange ( double  d) const

Definition at line 68 of file KalmanFilterFormats.cc.

References ztail::d, range_, and twos_.

Referenced by updateRangeActual().

68  {
69  if (twos_)
70  return d >= -range_ / 2. && d < range_ / 2.;
71  return d >= 0 && d < range_;
72  }
d
Definition: ztail.py:151

◆ integer()

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

Definition at line 81 of file KalmanFilterFormats.h.

References base_, and ztail::d.

81 { return floor(d / base_); }
d
Definition: ztail.py:151

◆ range()

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

Definition at line 76 of file KalmanFilterFormats.h.

References range_.

76 { return range_; }

◆ rangeActual()

const std::pair<double, double>& trackerTFP::DataFormatKF::rangeActual ( ) const
inline

Definition at line 77 of file KalmanFilterFormats.h.

References rangeActual_.

77 { return rangeActual_; }
std::pair< double, double > rangeActual_

◆ twos()

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

Definition at line 73 of file KalmanFilterFormats.h.

References twos_.

73 { return twos_; }

◆ updateRangeActual()

void trackerTFP::DataFormatKF::updateRangeActual ( double  d)

Definition at line 74 of file KalmanFilterFormats.cc.

References ztail::d, cppFunctionSkipper::exception, inRange(), SiStripPI::max, SiStripPI::min, GetRecoTauVFromDQM_MC_cff::next, range_, rangeActual_, twos_, findQualityFiles::v, v_, and trackerTFP::variableKFstrs_.

Referenced by trackerTFP::KalmanFilter::KalmanFilter(), and trackerTFP::KalmanFilter::update().

74  {
75  rangeActual_ = make_pair(min(rangeActual_.first, d), max(rangeActual_.second, d));
76  if (!inRange(d)) {
77  string v = *next(variableKFstrs_.begin(), +v_);
78  cms::Exception exception("out_of_range");
79  exception.addContext("trackerTFP:DataFormatKF::updateRangeActual");
80  exception << "Variable " << v << " = " << d << " is out of range " << (twos_ ? -range_ / 2. : 0) << " to "
81  << (twos_ ? range_ / 2. : range_) << "." << endl;
82  if (twos_ || d >= 0.)
83  exception.addAdditionalInfo("Consider raising BaseShift" + v + " in KalmnaFilterFormats_cfi.py.");
84  throw exception;
85  }
86  }
bool inRange(double d) const
std::pair< double, double > rangeActual_
d
Definition: ztail.py:151
constexpr auto variableKFstrs_

◆ width()

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

Definition at line 74 of file KalmanFilterFormats.h.

References width_.

Member Data Documentation

◆ base_

double trackerTFP::DataFormatKF::base_
protected

◆ range_

double trackerTFP::DataFormatKF::range_
protected

◆ rangeActual_

std::pair<double, double> trackerTFP::DataFormatKF::rangeActual_
protected

Definition at line 89 of file KalmanFilterFormats.h.

Referenced by rangeActual(), and updateRangeActual().

◆ twos_

bool trackerTFP::DataFormatKF::twos_
protected

Definition at line 85 of file KalmanFilterFormats.h.

Referenced by inRange(), twos(), and updateRangeActual().

◆ v_

VariableKF trackerTFP::DataFormatKF::v_
protected

Definition at line 84 of file KalmanFilterFormats.h.

Referenced by updateRangeActual().

◆ width_

int trackerTFP::DataFormatKF::width_
protected