CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
PixelDigitizerAlgorithm::TimewalkCurve Class Reference

Public Member Functions

double operator() (double x) const
 
 TimewalkCurve (const edm::ParameterSet &pset)
 

Private Attributes

std::vector< double > x_
 
std::vector< double > y_
 

Detailed Description

Definition at line 14 of file PixelDigitizerAlgorithm.h.

Constructor & Destructor Documentation

◆ TimewalkCurve()

PixelDigitizerAlgorithm::TimewalkCurve::TimewalkCurve ( const edm::ParameterSet pset)

Definition at line 191 of file PixelDigitizerAlgorithm.cc.

References x_, and y_.

192  : x_(pset.getParameter<std::vector<double>>("charge")), y_(pset.getParameter<std::vector<double>>("delay")) {
193  if (x_.size() != y_.size())
194  throw cms::Exception("Configuration")
195  << "Timewalk model error: the number of charge values does not match the number of delay values!";
196 }

Member Function Documentation

◆ operator()()

double PixelDigitizerAlgorithm::TimewalkCurve::operator() ( double  x) const

Definition at line 198 of file PixelDigitizerAlgorithm.cc.

References HLT_2024v14_cff::distance, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, pfDeepBoostedJetPreprocessParams_cfi::lower_bound, AlCaHLTBitMon_ParallelJobs::p, and x.

198  {
199  auto it = std::lower_bound(x_.begin(), x_.end(), x);
200  if (it == x_.begin())
201  return y_.front();
202  if (it == x_.end())
203  return y_.back();
204  int index = std::distance(x_.begin(), it);
205  double x_high = *it;
206  double x_low = *(--it);
207  double p = (x - x_low) / (x_high - x_low);
208  return p * y_[index] + (1 - p) * y_[index - 1];
209 }

Member Data Documentation

◆ x_

std::vector<double> PixelDigitizerAlgorithm::TimewalkCurve::x_
private

Definition at line 23 of file PixelDigitizerAlgorithm.h.

Referenced by TimewalkCurve().

◆ y_

std::vector<double> PixelDigitizerAlgorithm::TimewalkCurve::y_
private

Definition at line 24 of file PixelDigitizerAlgorithm.h.

Referenced by TimewalkCurve().