CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Namespaces | Functions | Variables
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>
#include <iostream>

Go to the source code of this file.

Namespaces

 HcalSimpleRecAlgoImpl
 

Functions

static float eCorr (int ieta, int iphi, double ampl)
 Ugly hack to apply energy corrections to some HB- cells. More...
 
static float leakCorr (double energy)
 Leak correction. More...
 
template<class Digi , class RecHit >
RecHit HcalSimpleRecAlgoImpl::reco (const Digi &digi, const HcalCoder &coder, const HcalCalibrations &calibs, int ifirst, int n, bool slewCorrect, bool pulseCorrect, const HcalPulseContainmentCorrection *corr, HcalTimeSlew::BiasSetting slewFlavor, bool forData, bool useLeak)
 
static float timeshift_ns_hbheho (float wpksamp)
 
static float timeshift_ns_hf (float wpksamp)
 Same as above, but for the HF PMTs. More...
 

Variables

static const float actual_ns_hbheho [num_bins_hbheho]
 
static const float actual_ns_hf [num_bins_hf]
 
static double MaximumFractionalError = 0.002
 
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 eCorr ( int  ieta,
int  iphi,
double  ampl 
)
static

Ugly hack to apply energy corrections to some HB- cells.

Definition at line 273 of file HcalSimpleRecAlgo.cc.

References corr, relval_parameters_module::energy, create_public_lumi_plots::exp, and slope.

Referenced by HcalSimpleRecAlgoImpl::reco().

273  {
274 // return energy correction factor for HBM channels
275 // iphi=6 ieta=(-1,-15) and iphi=32 ieta=(-1,-7)
276 // I.Vodopianov 28 Feb. 2011
277  static const float low32[7] = {0.741,0.721,0.730,0.698,0.708,0.751,0.861};
278  static const float high32[7] = {0.973,0.925,0.900,0.897,0.950,0.935,1};
279  static const float low6[15] = {0.635,0.623,0.670,0.633,0.644,0.648,0.600,
280  0.570,0.595,0.554,0.505,0.513,0.515,0.561,0.579};
281  static const float high6[15] = {0.875,0.937,0.942,0.900,0.922,0.925,0.901,
282  0.850,0.852,0.818,0.731,0.717,0.782,0.853,0.778};
283 
284 
285  double slope, mid, en;
286  double corr = 1.0;
287 
288  if (!(iphi==6 && ieta<0 && ieta>-16) && !(iphi==32 && ieta<0 && ieta>-8))
289  return corr;
290 
291  int jeta = -ieta-1;
292  double xeta = (double) ieta;
293  if (energy > 0.) en=energy;
294  else en = 0.;
295 
296  if (iphi == 32) {
297  slope = 0.2272;
298  mid = 17.14 + 0.7147*xeta;
299  if (en > 100.) corr = high32[jeta];
300  else corr = low32[jeta]+(high32[jeta]-low32[jeta])/(1.0+exp(-(en-mid)*slope));
301  }
302  else if (iphi == 6) {
303  slope = 0.1956;
304  mid = 15.96 + 0.3075*xeta;
305  if (en > 100.0) corr = high6[jeta];
306  else corr = low6[jeta]+(high6[jeta]-low6[jeta])/(1.0+exp(-(en-mid)*slope));
307  }
308 
309  // std::cout << "HBHE cell: ieta, iphi = " << ieta << " " << iphi
310  // << " -> energy = " << en << " corr = " << corr << std::endl;
311 
312  return corr;
313 }
static const double slope[3]
JetCorrectorParameters corr
Definition: classes.h:9
float leakCorr ( double  energy)
static

Leak correction.

Definition at line 317 of file HcalSimpleRecAlgo.cc.

References corr.

Referenced by HcalSimpleRecAlgoImpl::reco().

317  {
318  double corr = 1.0;
319  return corr;
320 }
JetCorrectorParameters corr
Definition: classes.h:9
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 392 of file HcalSimpleRecAlgo.cc.

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

Referenced by HcalSimpleRecAlgoImpl::reco().

392  {
393  float flx = (num_bins_hbheho-1)*(wpksamp - wpksamp0_hbheho);
394  int index = (int)flx;
395  float yval;
396 
397  if (index < 0) return actual_ns_hbheho[0];
398  else if (index >= num_bins_hbheho-1) return actual_ns_hbheho[num_bins_hbheho-1];
399 
400  // else interpolate:
401  float y1 = actual_ns_hbheho[index];
402  float y2 = actual_ns_hbheho[index+1];
403 
404  yval = y1 + (y2-y1)*(flx-(float)index);
405 
406  return yval;
407 }
static const float wpksamp0_hbheho
static const float actual_ns_hbheho[num_bins_hbheho]
static const int num_bins_hbheho
float timeshift_ns_hf ( float  wpksamp)
static

Same as above, but for the HF PMTs.

Definition at line 516 of file HcalSimpleRecAlgo.cc.

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

Referenced by HcalSimpleRecAlgo::reconstruct().

516  {
517  float flx = (num_bins_hf-1)*(wpksamp-wpksamp0_hf);
518  int index = (int)flx;
519  float yval;
520 
521  if (index < 0) return actual_ns_hf[0];
522  else if (index >= num_bins_hf-1) return actual_ns_hf[num_bins_hf-1];
523 
524  // else interpolate:
525  float y1 = actual_ns_hf[index];
526  float y2 = actual_ns_hf[index+1];
527 
528  // float delta_x = 1/(float)num_bins_hf;
529  // yval = y1 + (y2-y1)*(flx-(float)index)/delta_x;
530 
531  yval = y1 + (y2-y1)*(flx-(float)index);
532  return yval;
533 }
static const float actual_ns_hf[num_bins_hf]
static const float wpksamp0_hf
static const int num_bins_hf

Variable Documentation

const float actual_ns_hbheho[num_bins_hbheho]
static

Definition at line 328 of file HcalSimpleRecAlgo.cc.

Referenced by timeshift_ns_hbheho().

const float actual_ns_hf[num_bins_hf]
static

Definition at line 412 of file HcalSimpleRecAlgo.cc.

Referenced by timeshift_ns_hf().

double MaximumFractionalError = 0.002
static

Definition at line 9 of file HcalSimpleRecAlgo.cc.

const int num_bins_hbheho = 61
static

Definition at line 326 of file HcalSimpleRecAlgo.cc.

Referenced by timeshift_ns_hbheho().

const int num_bins_hf = 101
static

Definition at line 409 of file HcalSimpleRecAlgo.cc.

Referenced by timeshift_ns_hf().

const float wpksamp0_hbheho = 0.5
static

Definition at line 325 of file HcalSimpleRecAlgo.cc.

Referenced by timeshift_ns_hbheho().

const float wpksamp0_hf = 0.5
static

Definition at line 410 of file HcalSimpleRecAlgo.cc.

Referenced by timeshift_ns_hf().