CMS 3D CMS Logo

Functions
HcalCorrectionFunctions.h File Reference

Go to the source code of this file.

Functions

float hbminus_special_ecorr (int ieta, int iphi, double energy, int runnum)
 Special energy correction for some HB- cells. More...
 
float timeshift_ns_hbheho (float wpksamp)
 

Function Documentation

float hbminus_special_ecorr ( int  ieta,
int  iphi,
double  energy,
int  runnum 
)

Special energy correction for some HB- cells.

Special energy correction for some HB- cells.

Definition at line 413 of file HcalSimpleRecAlgo.cc.

References corr, JetChargeProducer_cfi::exp, METSignificanceParams_cfi::jeta, and slope.

Referenced by SimpleHBHEPhase1Algo::hbminusCorrectionFactor().

413  {
414 // return energy correction factor for HBM channels
415 // iphi=6 ieta=(-1,-15) and iphi=32 ieta=(-1,-7)
416 // I.Vodopianov 28 Feb. 2011
417  static const float low32[7] = {0.741,0.721,0.730,0.698,0.708,0.751,0.861};
418  static const float high32[7] = {0.973,0.925,0.900,0.897,0.950,0.935,1};
419  static const float low6[15] = {0.635,0.623,0.670,0.633,0.644,0.648,0.600,
420  0.570,0.595,0.554,0.505,0.513,0.515,0.561,0.579};
421  static const float high6[15] = {0.875,0.937,0.942,0.900,0.922,0.925,0.901,
422  0.850,0.852,0.818,0.731,0.717,0.782,0.853,0.778};
423 
424 
425  double slope, mid, en;
426  double corr = 1.0;
427 
428  if (!(iphi==6 && ieta<0 && ieta>-16) && !(iphi==32 && ieta<0 && ieta>-8))
429  return corr;
430 
431  int jeta = -ieta-1;
432  double xeta = (double) ieta;
433  if (energy > 0.) en=energy;
434  else en = 0.;
435 
436  if (iphi == 32) {
437  slope = 0.2272;
438  mid = 17.14 + 0.7147*xeta;
439  if (en > 100.) corr = high32[jeta];
440  else corr = low32[jeta]+(high32[jeta]-low32[jeta])/(1.0+exp(-(en-mid)*slope));
441  }
442  else if (iphi == 6 && runnum < 216091 ) {
443  slope = 0.1956;
444  mid = 15.96 + 0.3075*xeta;
445  if (en > 100.0) corr = high6[jeta];
446  else corr = low6[jeta]+(high6[jeta]-low6[jeta])/(1.0+exp(-(en-mid)*slope));
447  }
448 
449  // std::cout << "HBHE cell: ieta, iphi = " << ieta << " " << iphi
450  // << " -> energy = " << en << " corr = " << corr << std::endl;
451 
452  return corr;
453 }
static const double slope[3]
JetCorrectorParameters corr
Definition: classes.h:5
float timeshift_ns_hbheho ( float  wpksamp)

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

References actual_ns_hbheho, diffTreeTool::index, createfilelist::int, num_bins_hbheho, and wpksamp0_hbheho.

Referenced by SimpleHBHEPhase1Algo::m0Time(), and HcalSimpleRecAlgoImpl::reco().

532  {
533  float flx = (num_bins_hbheho-1)*(wpksamp - wpksamp0_hbheho);
534  int index = (int)flx;
535  float yval;
536 
537  if (index < 0) return actual_ns_hbheho[0];
538  else if (index >= num_bins_hbheho-1) return actual_ns_hbheho[num_bins_hbheho-1];
539 
540  // else interpolate:
541  float y1 = actual_ns_hbheho[index];
542  float y2 = actual_ns_hbheho[index+1];
543 
544  yval = y1 + (y2-y1)*(flx-(float)index);
545 
546  return yval;
547 }
static const float wpksamp0_hbheho
static const float actual_ns_hbheho[num_bins_hbheho]
static const int num_bins_hbheho
return(e1-e2)*(e1-e2)+dp *dp