CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 (int num_samples, float fixedphase_ns, float max_fracerror)
 Generate energy correction factors based on a predetermined phase of the hit + time slew. More...
 
 HcalPulseContainmentCorrection (const HcalPulseShape *shape, int num_samples, float fixedphase_ns, float max_fracerror)
 

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 14 of file HcalPulseContainmentCorrection.h.

Constructor & Destructor Documentation

HcalPulseContainmentCorrection::HcalPulseContainmentCorrection ( 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 17 of file HcalPulseContainmentCorrection.cc.

References mCorFactors_.

20 {
21  HcalPulseContainmentAlgo corFalgo(num_samples, (double)fixedphase_ns);
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, 200000.0f, // generation domain
29  max_fracerror, // maximum fractional error
30  1.0, // min_xstep = minimum true fC increment
31  corFalgo,
32  mCorFactors_); // return lookup map
33 }
HcalPulseContainmentCorrection::HcalPulseContainmentCorrection ( const HcalPulseShape shape,
int  num_samples,
float  fixedphase_ns,
float  max_fracerror 
)

Definition at line 36 of file HcalPulseContainmentCorrection.cc.

References mCorFactors_.

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

Member Function Documentation

double HcalPulseContainmentCorrection::fractionContained ( double  fc_ampl) const
inline

Definition at line 24 of file HcalPulseContainmentCorrection.h.

References getCorrection().

24 { return 1.0/this->getCorrection(fc_ampl); }
double getCorrection(double fc_ampl) const
double HcalPulseContainmentCorrection::getCorrection ( double  fc_ampl) const

Definition at line 50 of file HcalPulseContainmentCorrection.cc.

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

Referenced by JetReCalibrator.JetReCalibrator::correct(), fractionContained(), ZdcSimpleRecAlgoImpl::reco1(), ZdcSimpleRecAlgoImpl::reco2(), and HcalSimpleRecAlgoImpl::removePileup().

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  }
63  else if (fcupper == mCorFactors_.begin()) {
64  correction = fcupper->second;
65  }
66  else {
67  if (fabs(fclower->first - fc_ampl) <
68  fabs(fcupper->first - fc_ampl) )
69  correction = fclower->second;
70  else
71  correction = fcupper->second;
72  }
73 
74 #if 0
75  char s[80];
76  sprintf (s, "%7.1f (%8.5f %8.5f) (%8.5f %8.5f) %8.5f",
77  fc_ampl,
78  fclower->first, fclower->second,
79  fcupper->first, fcupper->second,
80  correction);
81  cout << s << endl;
82 #endif
83 
84  return correction;
85 }
tuple cout
Definition: gather_cfg.py:121

Member Data Documentation

std::map<double,double> HcalPulseContainmentCorrection::mCorFactors_
private