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 218 of file PixelDigitizerAlgorithm.cc.

219  : x_(pset.getParameter<std::vector<double>>("charge")), y_(pset.getParameter<std::vector<double>>("delay")) {
220  if (x_.size() != y_.size())
221  throw cms::Exception("Configuration")
222  << "Timewalk model error: the number of charge values does not match the number of delay values!";
223 }

References x_, and y_.

Member Function Documentation

◆ operator()()

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

Definition at line 225 of file PixelDigitizerAlgorithm.cc.

225  {
226  auto it = std::lower_bound(x_.begin(), x_.end(), x);
227  if (it == x_.begin())
228  return y_.front();
229  if (it == x_.end())
230  return y_.back();
231  int index = std::distance(x_.begin(), it);
232  double x_high = *it;
233  double x_low = *(--it);
234  double p = (x - x_low) / (x_high - x_low);
235  return p * y_[index] + (1 - p) * y_[index - 1];
236 }

References HLT_2018_cff::distance, cuda_std::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
HLT_2018_cff.distance
distance
Definition: HLT_2018_cff.py:6417
DDAxes::x
cuda_std::lower_bound
__host__ constexpr __device__ RandomIt lower_bound(RandomIt first, RandomIt last, const T &value, Compare comp={})
Definition: cudastdAlgorithm.h:27
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
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27