#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. | |
double | fractionContained (double fc_ampl) const |
double | getCorrection (double fc_ampl) const |
Private Attributes | |
std::map< double, double > | mCorFactors_ |
Amplitude correction for pulse containment in time. Currently only for HPD pulse shape.
Definition at line 12 of file CastorPulseContainmentCorrection.h.
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 81 of file CastorPulseContainmentCorrection.cc.
References mCorFactors_.
{ RecoFCcorFactorAlgo<CastorPulseShapes::Shape> corFalgo(num_samples, (double)fixedphase_ns); // Generate lookup map for the correction function, never exceeding // a maximum fractional error for lookups. // genlkupmap< RecoFCcorFactorAlgo<CastorPulseShapes::Shape> > (1.0, 5000.0f, // generation domain max_fracerror, // maximum fractional error 1.0, // min_xstep = minimum true fC increment corFalgo, mCorFactors_); // return lookup map }
double CastorPulseContainmentCorrection::fractionContained | ( | double | fc_ampl | ) | const [inline] |
Definition at line 19 of file CastorPulseContainmentCorrection.h.
References getCorrection().
{ return 1.0/this->getCorrection(fc_ampl); }
double CastorPulseContainmentCorrection::getCorrection | ( | double | fc_ampl | ) | const |
Definition at line 98 of file CastorPulseContainmentCorrection.cc.
References gather_cfg::cout, mCorFactors_, and alignCSCRings::s.
Referenced by fractionContained(), and CastorSimpleRecAlgoImpl::reco().
{ double correction; std::map<double,double>::const_iterator fcupper,fclower; fcupper = mCorFactors_.upper_bound(fc_ampl); fclower = fcupper; fclower--; if (fcupper == mCorFactors_.end()) { correction = fclower->second; } else if (fcupper == mCorFactors_.begin()) { correction = fcupper->second; } else { if (fabs(fclower->first - fc_ampl) < fabs(fcupper->first - fc_ampl) ) correction = fclower->second; else correction = fcupper->second; } #if 0 char s[80]; sprintf (s, "%7.1f (%8.5f %8.5f) (%8.5f %8.5f) %8.5f", fc_ampl, fclower->first, fclower->second, fcupper->first, fcupper->second, correction); cout << s << endl; #endif return correction; }
std::map<double,double> CastorPulseContainmentCorrection::mCorFactors_ [private] |
Definition at line 22 of file CastorPulseContainmentCorrection.h.
Referenced by CastorPulseContainmentCorrection(), and getCorrection().