CMS 3D CMS Logo

Namespaces | Functions | Variables

/data/refman/pasoursint/CMSSW_4_1_8_patch9/src/RecoLocalCalo/HcalRecAlgos/src/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)
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 = 61
static const int num_bins_hf = 101
static const float wpksamp0_hbheho = 0.5
static const float wpksamp0_hf = 0.5

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 255 of file HcalSimpleRecAlgo.cc.

References actual_ns_hbheho, getHLTprescales::index, num_bins_hbheho, and wpksamp0_hbheho.

Referenced by HcalSimpleRecAlgoImpl::reco().

                                         {
  float flx = (num_bins_hbheho-1)*(wpksamp - wpksamp0_hbheho);
  int index = (int)flx;
  float yval;

  if      (index <    0)               return actual_ns_hbheho[0];
  else if (index >= num_bins_hbheho-1) return actual_ns_hbheho[num_bins_hbheho-1];

  // else interpolate:
  float y1 = actual_ns_hbheho[index];
  float y2 = actual_ns_hbheho[index+1];

  yval = y1 + (y2-y1)*(flx-(float)index);

  return yval;
}
float timeshift_ns_hf ( float  wpksamp) [static]

Same as above, but for the HF PMTs.

Definition at line 379 of file HcalSimpleRecAlgo.cc.

References actual_ns_hf, getHLTprescales::index, num_bins_hf, and wpksamp0_hf.

Referenced by HcalSimpleRecAlgo::reconstruct().

                                     {
  float flx = (num_bins_hf-1)*(wpksamp-wpksamp0_hf);
  int index = (int)flx;
  float yval;
  
  if      (index <  0)             return actual_ns_hf[0];
  else if (index >= num_bins_hf-1) return actual_ns_hf[num_bins_hf-1];

  // else interpolate:
  float y1       = actual_ns_hf[index];
  float y2       = actual_ns_hf[index+1];

  // float delta_x  = 1/(float)num_bins_hf;
  // yval = y1 + (y2-y1)*(flx-(float)index)/delta_x;

  yval = y1 + (y2-y1)*(flx-(float)index);
  return yval;
}

Variable Documentation

const float actual_ns_hbheho[num_bins_hbheho] [static]

Definition at line 191 of file HcalSimpleRecAlgo.cc.

Referenced by timeshift_ns_hbheho().

const float actual_ns_hf[num_bins_hf] [static]

Definition at line 275 of file HcalSimpleRecAlgo.cc.

Referenced by timeshift_ns_hf().

double MaximumFractionalError = 0.0005 [static]

Definition at line 7 of file HcalSimpleRecAlgo.cc.

Referenced by HcalSimpleRecAlgo::HcalSimpleRecAlgo().

const int num_bins_hbheho = 61 [static]

Definition at line 189 of file HcalSimpleRecAlgo.cc.

Referenced by timeshift_ns_hbheho().

const int num_bins_hf = 101 [static]

Definition at line 272 of file HcalSimpleRecAlgo.cc.

Referenced by timeshift_ns_hf().

const float wpksamp0_hbheho = 0.5 [static]

Definition at line 188 of file HcalSimpleRecAlgo.cc.

Referenced by timeshift_ns_hbheho().

const float wpksamp0_hf = 0.5 [static]

Definition at line 273 of file HcalSimpleRecAlgo.cc.

Referenced by timeshift_ns_hf().