CMS 3D CMS Logo

HcalPulseContainmentCorrection Class Reference

Amplitude correction for pulse containment in time. More...

#include <CalibCalorimetry/HcalAlgos/interface/HcalPulseContainmentCorrection.h>

List of all members.

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.

Private Attributes

std::map< double, double > mCorFactors_


Detailed Description

Amplitude correction for pulse containment in time.

Currently only for HPD pulse shape.

Date
2006/11/08 16:53:17
Revision
1.1
Author:
P. Dudero - Minnesota

Definition at line 15 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 207 of file HcalPulseContainmentCorrection.cc.

References max_recofc, and mCorFactors_.

00210 {
00211   RecoFCcorFactorAlgo corFalgo(num_samples, (double)fixedphase_ns);
00212 
00213   // Generate lookup map for the correction function, never exceeding
00214   // a maximum fractional error for lookups.
00215   //
00216   genlkupmap< RecoFCcorFactorAlgo > (1.0, max_recofc,  // generation domain
00217                                      max_fracerror,     // maximum fractional error
00218                                      1.0,   // min_xstep = minimum true fC increment
00219                                      corFalgo,
00220                                      mCorFactors_);     // return lookup map
00221 }


Member Function Documentation

double HcalPulseContainmentCorrection::fractionContained ( double  fc_ampl  )  const [inline]

Definition at line 22 of file HcalPulseContainmentCorrection.h.

References getCorrection().

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

double HcalPulseContainmentCorrection::getCorrection ( double  fc_ampl  )  const

Definition at line 224 of file HcalPulseContainmentCorrection.cc.

References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), mCorFactors_, and s.

Referenced by fractionContained(), and HcalSimpleRecAlgoImpl::reco().

00225 {
00226   double correction;
00227 
00228   std::map<double,double>::const_iterator fcupper,fclower;
00229 
00230   fcupper = mCorFactors_.upper_bound(fc_ampl);
00231   fclower = fcupper;
00232   fclower--;
00233 
00234   if (fcupper == mCorFactors_.end()) {
00235     correction = fclower->second;
00236   }
00237   else if (fcupper == mCorFactors_.begin()) {
00238     correction = fcupper->second;
00239   }
00240   else {
00241     if (fabs(fclower->first - fc_ampl) <
00242         fabs(fcupper->first - fc_ampl) )
00243       correction = fclower->second;
00244     else
00245       correction = fcupper->second;
00246   }
00247 
00248 #if 0
00249   char s[80];
00250   sprintf (s, "%7.1f (%8.5f %8.5f) (%8.5f %8.5f) %8.5f",
00251            fc_ampl,
00252            fclower->first, fclower->second,
00253            fcupper->first, fcupper->second,
00254            correction);
00255   cout << s << endl;
00256 #endif
00257 
00258   return correction;
00259 }


Member Data Documentation

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

Definition at line 25 of file HcalPulseContainmentCorrection.h.

Referenced by getCorrection(), and HcalPulseContainmentCorrection().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:23:49 2009 for CMSSW by  doxygen 1.5.4