CMS 3D CMS Logo

HcalSimpleRecAlgo.cc File Reference

#include "RecoLocalCalo/HcalRecAlgos/interface/HcalSimpleRecAlgo.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "CalibCalorimetry/HcalAlgos/interface/HcalTimeSlew.h"
#include <algorithm>
#include <math.h>

Go to the source code of this file.

Namespaces

namespace  HcalSimpleRecAlgoImpl

Functions

template<class Digi, class RecHit>
RecHit HcalSimpleRecAlgoImpl::reco (const Digi &digi, const HcalCoder &coder, const HcalCalibrations &calibs, int ifirst, int n, bool slewCorrect, const HcalPulseContainmentCorrection *corr, HcalTimeSlew::BiasSetting slewFlavor)
static float timeshift_ns_hbheho (float wpksamp)
 Timeshift correction for HPDs based on the position of the peak ADC measurement.
static float timeshift_ns_hf (float wpksamp)
 Same as above, but for the HF PMTs.

Variables

static const float actual_ns_hbheho [num_bins_hbheho]
static const float actual_ns_hf [num_bins_hf]
static double MaximumFractionalError = 0.0005
static const int num_bins_hbheho = 50
static const int num_bins_hf = 100
static const float scale_hbheho = 0.819786
static const float scale_hf = 0.999301
static const float wpksamp0_hbheho = 0.680178
static const float wpksamp0_hf = 0.500635


Function Documentation

float timeshift_ns_hbheho ( float  wpksamp  )  [static]

Timeshift correction for HPDs based on the position of the peak ADC measurement.

Allows for an accurate determination of the relative phase of the pulse shape from the HPD. Calculated based on a weighted sum of the -1,0,+1 samples relative to the peak as follows: wpksamp = (0*sample[0] + 1*sample[1] + 2*sample[2]) / (sample[0] + sample[1] + sample[2]) where sample[1] is the maximum ADC sample value.

Definition at line 212 of file HcalSimpleRecAlgo.cc.

References actual_ns_hbheho, index, int, num_bins_hbheho, scale_hbheho, and wpksamp0_hbheho.

Referenced by HcalSimpleRecAlgoImpl::reco().

00212                                          {
00213   int index=(int)(0.5+num_bins_hbheho*(wpksamp-wpksamp0_hbheho)/scale_hbheho);
00214   
00215   if      (index <    0)             return actual_ns_hbheho[0];
00216   else if (index >= num_bins_hbheho) return actual_ns_hbheho[num_bins_hbheho-1];
00217   
00218   return actual_ns_hbheho[index];
00219 }

float timeshift_ns_hf ( float  wpksamp  )  [static]

Same as above, but for the HF PMTs.

Definition at line 329 of file HcalSimpleRecAlgo.cc.

References actual_ns_hf, index, int, num_bins_hf, scale_hf, and wpksamp0_hf.

00329                                      {
00330   float flx = (num_bins_hf*(wpksamp - wpksamp0_hf)/scale_hf);
00331   int index = (int)flx;
00332   float yval;
00333   
00334   if      (index <    0)        return actual_ns_hf[0];
00335   else if (index >= num_bins_hf-1) return actual_ns_hf[num_bins_hf-1];
00336 
00337   // else interpolate:
00338   float y1       = actual_ns_hf[index];
00339   float y2       = actual_ns_hf[index+1];
00340 
00341   // float delta_x  = 1/(float)num_bins_hf;
00342   // yval = y1 + (y2-y1)*(flx-(float)index)/delta_x;
00343 
00344   yval = y1 + (y2-y1)*(flx-(float)index);
00345   return yval;
00346 }


Variable Documentation

const float actual_ns_hbheho[num_bins_hbheho] [static]

Definition at line 159 of file HcalSimpleRecAlgo.cc.

Referenced by timeshift_ns_hbheho().

const float actual_ns_hf[num_bins_hf] [static]

Definition at line 226 of file HcalSimpleRecAlgo.cc.

double MaximumFractionalError = 0.0005 [static]

Definition at line 7 of file HcalSimpleRecAlgo.cc.

const int num_bins_hbheho = 50 [static]

Definition at line 157 of file HcalSimpleRecAlgo.cc.

Referenced by timeshift_ns_hbheho().

const int num_bins_hf = 100 [static]

Definition at line 224 of file HcalSimpleRecAlgo.cc.

const float scale_hbheho = 0.819786 [static]

Definition at line 156 of file HcalSimpleRecAlgo.cc.

Referenced by timeshift_ns_hbheho().

const float scale_hf = 0.999301 [static]

Definition at line 223 of file HcalSimpleRecAlgo.cc.

const float wpksamp0_hbheho = 0.680178 [static]

Definition at line 155 of file HcalSimpleRecAlgo.cc.

Referenced by timeshift_ns_hbheho().

const float wpksamp0_hf = 0.500635 [static]

Definition at line 222 of file HcalSimpleRecAlgo.cc.


Generated on Tue Jun 9 17:55:18 2009 for CMSSW by  doxygen 1.5.4