CMS 3D CMS Logo

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

#include <HcalPulseContainmentCorrection.h>

Public Member Functions

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

Private Attributes

std::map< double, double > mCorFactors_
 

Detailed Description

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

Author
P. Dudero - Minnesota

Definition at line 15 of file HcalPulseContainmentCorrection.h.

Constructor & Destructor Documentation

◆ HcalPulseContainmentCorrection() [1/2]

HcalPulseContainmentCorrection::HcalPulseContainmentCorrection ( int  num_samples,
float  fixedphase_ns,
float  max_fracerror,
const HcalTimeSlew hcalTimeSlew_delay 
)

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

Definition at line 17 of file HcalPulseContainmentCorrection.cc.

20  {
21  HcalPulseContainmentAlgo corFalgo(num_samples, (double)fixedphase_ns, hcalTimeSlew_delay);
22 
23  // Generate lookup map for the correction function, never exceeding
24  // a maximum fractional error for lookups.
25  //
26  // static const double max_recofc = 5000.0f; // HPD,
27  // max_recofc = 200000.0f; // SiPMs
28  genlkupmap<HcalPulseContainmentAlgo>(1.0,
29  200000.0f, // generation domain
30  max_fracerror, // maximum fractional error
31  1.0, // min_xstep = minimum true fC increment
32  corFalgo,
33  mCorFactors_); // return lookup map
34 }

References f, and mCorFactors_.

◆ HcalPulseContainmentCorrection() [2/2]

HcalPulseContainmentCorrection::HcalPulseContainmentCorrection ( const HcalPulseShape shape,
int  num_samples,
float  fixedphase_ns,
float  max_fracerror,
const HcalTimeSlew hcalTimeSlew_delay 
)

Definition at line 37 of file HcalPulseContainmentCorrection.cc.

41  {
42  HcalPulseContainmentAlgo corFalgo(shape, num_samples, (double)fixedphase_ns, hcalTimeSlew_delay);
43  genlkupmap<HcalPulseContainmentAlgo>(1.0,
44  200000.0f, // generation domain
45  max_fracerror, // maximum fractional error
46  1.0, // min_xstep = minimum true fC increment
47  corFalgo,
48  mCorFactors_); // return lookup map
49 }

References f, and mCorFactors_.

Member Function Documentation

◆ fractionContained()

double HcalPulseContainmentCorrection::fractionContained ( double  fc_ampl) const
inline

Definition at line 27 of file HcalPulseContainmentCorrection.h.

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

References getCorrection().

◆ getCorrection()

double HcalPulseContainmentCorrection::getCorrection ( double  fc_ampl) const

Definition at line 51 of file HcalPulseContainmentCorrection.cc.

51  {
52  double correction;
53 
54  std::map<double, double>::const_iterator fcupper, fclower;
55 
56  fcupper = mCorFactors_.upper_bound(fc_ampl);
57  fclower = fcupper;
58  fclower--;
59 
60  if (fcupper == mCorFactors_.end()) {
61  correction = fclower->second;
62  } else if (fcupper == mCorFactors_.begin()) {
63  correction = fcupper->second;
64  } else {
65  if (fabs(fclower->first - fc_ampl) < fabs(fcupper->first - fc_ampl))
66  correction = fclower->second;
67  else
68  correction = fcupper->second;
69  }
70 
71 #if 0
72  char s[80];
73  sprintf (s, "%7.1f (%8.5f %8.5f) (%8.5f %8.5f) %8.5f",
74  fc_ampl,
75  fclower->first, fclower->second,
76  fcupper->first, fcupper->second,
77  correction);
78  cout << s << endl;
79 #endif
80 
81  return correction;
82 }

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

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

Member Data Documentation

◆ mCorFactors_

std::map<double, double> HcalPulseContainmentCorrection::mCorFactors_
private
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
gather_cfg.cout
cout
Definition: gather_cfg.py:144
HcalPulseContainmentAlgo
Definition: HcalPulseContainmentAlgo.h:9
HcalPulseContainmentCorrection::mCorFactors_
std::map< double, double > mCorFactors_
Definition: HcalPulseContainmentCorrection.h:30
alignCSCRings.s
s
Definition: alignCSCRings.py:92
pfMETCorrectionType0_cfi.correction
correction
Definition: pfMETCorrectionType0_cfi.py:39
HcalPulseContainmentCorrection::getCorrection
double getCorrection(double fc_ampl) const
Definition: HcalPulseContainmentCorrection.cc:51