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 9 of file PixelDigitizerAlgorithm.h.

Constructor & Destructor Documentation

◆ TimewalkCurve()

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

Definition at line 178 of file PixelDigitizerAlgorithm.cc.

179  : x_(pset.getParameter<std::vector<double>>("charge")), y_(pset.getParameter<std::vector<double>>("delay")) {
180  if (x_.size() != y_.size())
181  throw cms::Exception("Configuration")
182  << "Timewalk model error: the number of charge values does not match the number of delay values!";
183 }

References x_, and y_.

Member Function Documentation

◆ operator()()

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

Definition at line 185 of file PixelDigitizerAlgorithm.cc.

185  {
186  auto it = std::lower_bound(x_.begin(), x_.end(), x);
187  if (it == x_.begin())
188  return y_.front();
189  if (it == x_.end())
190  return y_.back();
191  int index = std::distance(x_.begin(), it);
192  double x_high = *it;
193  double x_low = *(--it);
194  double p = (x - x_low) / (x_high - x_low);
195  return p * y_[index] + (1 - p) * y_[index - 1];
196 }

References HLT_FULL_cff::distance, pfDeepBoostedJetPreprocessParams_cfi::lower_bound, AlCaHLTBitMon_ParallelJobs::p, and x.

Member Data Documentation

◆ x_

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

Definition at line 18 of file PixelDigitizerAlgorithm.h.

Referenced by TimewalkCurve().

◆ y_

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

Definition at line 19 of file PixelDigitizerAlgorithm.h.

Referenced by TimewalkCurve().

AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
DDAxes::x
pfDeepBoostedJetPreprocessParams_cfi.lower_bound
lower_bound
Definition: pfDeepBoostedJetPreprocessParams_cfi.py:15
PixelDigitizerAlgorithm::TimewalkCurve::y_
std::vector< double > y_
Definition: PixelDigitizerAlgorithm.h:19
PixelDigitizerAlgorithm::TimewalkCurve::x_
std::vector< double > x_
Definition: PixelDigitizerAlgorithm.h:18
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
cms::Exception
Definition: Exception.h:70
HLT_FULL_cff.distance
distance
Definition: HLT_FULL_cff.py:7733
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27