CMS 3D CMS Logo

Namespaces | Functions | Variables

/data/refman/pasoursint/CMSSW_4_1_8_patch9/src/RecoLocalCalo/HcalRecAlgos/src/ZdcSimpleRecAlgo.cc File Reference

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

Go to the source code of this file.

Namespaces

namespace  ZdcSimpleRecAlgoImpl

Functions

template<class Digi , class RecHit >
RecHit ZdcSimpleRecAlgoImpl::reco1 (const Digi &digi, const HcalCoder &coder, const HcalCalibrations &calibs, int ifirst, int n, bool slewCorrect, const HcalPulseContainmentCorrection *corr, HcalTimeSlew::BiasSetting slewFlavor)
template<class Digi , class RecHit >
RecHit ZdcSimpleRecAlgoImpl::reco2 (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_zdc (float wpksamp)

Variables

static const float actual_ns_zdc [num_bins_zdc]
static double MaximumFractionalError = 0.0005
static const int num_bins_zdc = 100
static const float scale_zdc = 0.999683
static const float wpksamp0_zdc = 0.500053

Function Documentation

float timeshift_ns_zdc ( float  wpksamp) [static]

Definition at line 299 of file ZdcSimpleRecAlgo.cc.

References actual_ns_zdc, getHLTprescales::index, num_bins_zdc, scale_zdc, and wpksamp0_zdc.

Referenced by ZdcSimpleRecAlgoImpl::reco1().

                                      {
  float flx = (num_bins_zdc*(wpksamp - wpksamp0_zdc)/scale_zdc);
  int index = (int)flx;
  float yval;
  
  if      (index <    0)        return actual_ns_zdc[0];
  else if (index >= num_bins_zdc-1) return actual_ns_zdc[num_bins_zdc-1];

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

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

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

Variable Documentation

const float actual_ns_zdc[num_bins_zdc] [static]

Definition at line 196 of file ZdcSimpleRecAlgo.cc.

Referenced by timeshift_ns_zdc().

double MaximumFractionalError = 0.0005 [static]

Definition at line 10 of file ZdcSimpleRecAlgo.cc.

Referenced by ZdcSimpleRecAlgo::ZdcSimpleRecAlgo().

const int num_bins_zdc = 100 [static]

Definition at line 194 of file ZdcSimpleRecAlgo.cc.

Referenced by timeshift_ns_zdc().

const float scale_zdc = 0.999683 [static]

Definition at line 193 of file ZdcSimpleRecAlgo.cc.

Referenced by timeshift_ns_zdc().

const float wpksamp0_zdc = 0.500053 [static]

Definition at line 192 of file ZdcSimpleRecAlgo.cc.

Referenced by timeshift_ns_zdc().