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.

Date:
2011/09/08 13:23:03
Revision:
1.3
Author
P. Dudero - Minnesota

Definition at line 16 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;
27  genlkupmap<HcalPulseContainmentAlgo> (1.0, 5000.0f, // generation domain
28  max_fracerror, // maximum fractional error
29  1.0, // min_xstep = minimum true fC increment
30  corFalgo,
31  mCorFactors_); // return lookup map
32 }
HcalPulseContainmentCorrection::HcalPulseContainmentCorrection ( const HcalPulseShape shape,
int  num_samples,
float  fixedphase_ns,
float  max_fracerror 
)

Definition at line 35 of file HcalPulseContainmentCorrection.cc.

References mCorFactors_.

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

Member Function Documentation

double HcalPulseContainmentCorrection::fractionContained ( double  fc_ampl) const
inline

Definition at line 26 of file HcalPulseContainmentCorrection.h.

References getCorrection().

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

Definition at line 49 of file HcalPulseContainmentCorrection.cc.

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

Referenced by fractionContained(), HcalSimpleRecAlgoImpl::reco(), ZdcSimpleRecAlgoImpl::reco1(), ZdcSimpleRecAlgoImpl::reco2(), and HcalSimpleRecAlgo::reconstruct().

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

Member Data Documentation

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