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

Constructor & Destructor Documentation

◆ TimewalkCurve()

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

Definition at line 179 of file PixelDigitizerAlgorithm.cc.

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

References x_, and y_.

Member Function Documentation

◆ operator()()

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

Definition at line 186 of file PixelDigitizerAlgorithm.cc.

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

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

Referenced by TimewalkCurve().

◆ y_

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

Definition at line 25 of file PixelDigitizerAlgorithm.h.

Referenced by TimewalkCurve().

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