CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
CastorPulseContainmentCorrection Class Reference

#include <CastorPulseContainmentCorrection.h>

Public Member Functions

 CastorPulseContainmentCorrection (int num_samples, float fixedphase_ns, float max_fracerror)
 Generate energy correction factors based on a predetermined phase of the hit + time slew. More...
 
double fractionContained (double fc_ampl) const
 
double getCorrection (double fc_ampl) const
 

Private Attributes

std::map< double, double > mCorFactors_
 

Detailed Description

Amplitude correction for pulse containment in time. Currently only for HPD pulse shape.

Definition at line 12 of file CastorPulseContainmentCorrection.h.

Constructor & Destructor Documentation

◆ CastorPulseContainmentCorrection()

CastorPulseContainmentCorrection::CastorPulseContainmentCorrection ( int  num_samples,
float  fixedphase_ns,
float  max_fracerror 
)

Generate energy correction factors based on a predetermined phase of the hit + time slew.

Definition at line 76 of file CastorPulseContainmentCorrection.cc.

78  {
79  RecoFCcorFactorAlgo<CastorPulseShapes::Shape> corFalgo(num_samples, (double)fixedphase_ns);
80 
81  // Generate lookup map for the correction function, never exceeding
82  // a maximum fractional error for lookups.
83  //
84  genlkupmap<RecoFCcorFactorAlgo<CastorPulseShapes::Shape> >(1.0,
85  5000.0f, // generation domain
86  max_fracerror, // maximum fractional error
87  1.0, // min_xstep = minimum true fC increment
88  corFalgo,
89  mCorFactors_); // return lookup map
90 }

References mCorFactors_.

Member Function Documentation

◆ fractionContained()

double CastorPulseContainmentCorrection::fractionContained ( double  fc_ampl) const
inline

Definition at line 17 of file CastorPulseContainmentCorrection.h.

17 { return 1.0 / this->getCorrection(fc_ampl); }

References getCorrection().

◆ getCorrection()

double CastorPulseContainmentCorrection::getCorrection ( double  fc_ampl) const

Definition at line 92 of file CastorPulseContainmentCorrection.cc.

92  {
93  double correction;
94 
95  std::map<double, double>::const_iterator fcupper, fclower;
96 
97  fcupper = mCorFactors_.upper_bound(fc_ampl);
98  fclower = fcupper;
99  fclower--;
100 
101  if (fcupper == mCorFactors_.end()) {
102  correction = fclower->second;
103  } else if (fcupper == mCorFactors_.begin()) {
104  correction = fcupper->second;
105  } else {
106  if (fabs(fclower->first - fc_ampl) < fabs(fcupper->first - fc_ampl))
107  correction = fclower->second;
108  else
109  correction = fcupper->second;
110  }
111 
112 #if 0
113  char s[80];
114  sprintf (s, "%7.1f (%8.5f %8.5f) (%8.5f %8.5f) %8.5f",
115  fc_ampl,
116  fclower->first, fclower->second,
117  fcupper->first, fcupper->second,
118  correction);
119  cout << s << endl;
120 #endif
121 
122  return correction;
123 }

References pfMETCorrectionType0_cfi::correction, gather_cfg::cout, mCorFactors_, and alignCSCRings::s.

Referenced by JetReCalibrator.JetReCalibrator::correct(), and fractionContained().

Member Data Documentation

◆ mCorFactors_

std::map<double, double> CastorPulseContainmentCorrection::mCorFactors_
private
gather_cfg.cout
cout
Definition: gather_cfg.py:144
CastorPulseContainmentCorrection::getCorrection
double getCorrection(double fc_ampl) const
Definition: CastorPulseContainmentCorrection.cc:92
alignCSCRings.s
s
Definition: alignCSCRings.py:92
CastorPulseContainmentCorrection::mCorFactors_
std::map< double, double > mCorFactors_
Definition: CastorPulseContainmentCorrection.h:20
pfMETCorrectionType0_cfi.correction
correction
Definition: pfMETCorrectionType0_cfi.py:39
RecoFCcorFactorAlgo
Definition: genlkupmap.h:114