CMS 3D CMS Logo

Namespaces | Functions | Variables
HcalSimpleRecAlgo.cc File Reference
#include "RecoLocalCalo/HcalRecAlgos/interface/HcalSimpleRecAlgo.h"
#include "FWCore/Framework/interface/ConsumesCollector.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "CalibCalorimetry/HcalAlgos/interface/HcalTimeSlew.h"
#include "RecoLocalCalo/HcalRecAlgos/src/HcalTDCReco.h"
#include "RecoLocalCalo/HcalRecAlgos/interface/rawEnergy.h"
#include "RecoLocalCalo/HcalRecAlgos/interface/HcalCorrectionFunctions.h"
#include "DataFormats/METReco/interface/HcalCaloFlagLabels.h"
#include "CondFormats/DataRecord/interface/HcalTimeSlewRecord.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include <algorithm>
#include <cmath>

Go to the source code of this file.

Namespaces

 HcalSimpleRecAlgoImpl
 

Functions

float hbminus_special_ecorr (int ieta, int iphi, double energy, int runnum)
 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, const int ifirst, const int n, const bool slewCorrect, const bool pulseCorrect, const HcalPulseContainmentCorrection *corr, const HcalTimeSlew::BiasSetting slewFlavor, const int runnum, const bool useLeak, const AbsOOTPileupCorrection *pileupCorrection, const BunchXParameter *bxInfo, const unsigned lenInfo, const int puCorrMethod, const HcalTimeSlew *hcalTimeSlew_delay_)
 
template<class Digi >
float HcalSimpleRecAlgoImpl::recoHFTime (const Digi &digi, const int maxI, const double amp_fC, const bool slewCorrect, double maxA, float t0, float t2)
 
template<class Digi >
void HcalSimpleRecAlgoImpl::removePileup (const Digi &digi, const HcalCoder &coder, const HcalCalibrations &calibs, const int ifirst, const int n, const bool pulseCorrect, const HcalPulseContainmentCorrection *corr, const AbsOOTPileupCorrection *pileupCorrection, const BunchXParameter *bxInfo, const unsigned lenInfo, double *p_maxA, double *p_ampl, double *p_uncorr_ampl, double *p_fc_ampl, int *p_nRead, int *p_maxI, bool *leakCorrApplied, float *p_t0, float *p_t2)
 
float timeshift_ns_hbheho (float wpksamp)
 
static float timeshift_ns_hf (float wpksamp)
 Timeshift correction for the HF PMTs. More...
 

Variables

static const float actual_ns_hbheho [num_bins_hbheho]
 
static const float actual_ns_hf [num_bins_hf]
 
constexpr 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

◆ hbminus_special_ecorr()

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

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

Special energy correction for some HB- cells.

Definition at line 463 of file HcalSimpleRecAlgo.cc.

References alignCSCRings::corr, hcalRecHitTable_cff::energy, JetChargeProducer_cfi::exp, hcalRecHitTable_cff::ieta, hcalRecHitTable_cff::iphi, METSignificanceParams_cfi::jeta, runnum, and slope.

Referenced by SimpleHBHEPhase1Algo::hbminusCorrectionFactor().

463  {
464  // return energy correction factor for HBM channels
465  // iphi=6 ieta=(-1,-15) and iphi=32 ieta=(-1,-7)
466  // I.Vodopianov 28 Feb. 2011
467  static const float low32[7] = {0.741, 0.721, 0.730, 0.698, 0.708, 0.751, 0.861};
468  static const float high32[7] = {0.973, 0.925, 0.900, 0.897, 0.950, 0.935, 1};
469  static const float low6[15] = {
470  0.635, 0.623, 0.670, 0.633, 0.644, 0.648, 0.600, 0.570, 0.595, 0.554, 0.505, 0.513, 0.515, 0.561, 0.579};
471  static const float high6[15] = {
472  0.875, 0.937, 0.942, 0.900, 0.922, 0.925, 0.901, 0.850, 0.852, 0.818, 0.731, 0.717, 0.782, 0.853, 0.778};
473 
474  double slope, mid, en;
475  double corr = 1.0;
476 
477  if (!(iphi == 6 && ieta < 0 && ieta > -16) && !(iphi == 32 && ieta < 0 && ieta > -8))
478  return corr;
479 
480  int jeta = -ieta - 1;
481  double xeta = (double)ieta;
482  if (energy > 0.)
483  en = energy;
484  else
485  en = 0.;
486 
487  if (iphi == 32) {
488  slope = 0.2272;
489  mid = 17.14 + 0.7147 * xeta;
490  if (en > 100.)
491  corr = high32[jeta];
492  else
493  corr = low32[jeta] + (high32[jeta] - low32[jeta]) / (1.0 + exp(-(en - mid) * slope));
494  } else if (iphi == 6 && runnum < 216091) {
495  slope = 0.1956;
496  mid = 15.96 + 0.3075 * xeta;
497  if (en > 100.0)
498  corr = high6[jeta];
499  else
500  corr = low6[jeta] + (high6[jeta] - low6[jeta]) / (1.0 + exp(-(en - mid) * slope));
501  }
502 
503  // std::cout << "HBHE cell: ieta, iphi = " << ieta << " " << iphi
504  // << " -> energy = " << en << " corr = " << corr << std::endl;
505 
506  return corr;
507 }
int runnum
static const double slope[3]
dictionary corr

◆ leakCorr()

float leakCorr ( double  energy)
static

Leak correction.

Definition at line 510 of file HcalSimpleRecAlgo.cc.

References alignCSCRings::corr.

Referenced by HcalSimpleRecAlgoImpl::reco().

510  {
511  double corr = 1.0;
512  return corr;
513 }
dictionary corr

◆ timeshift_ns_hbheho()

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

References actual_ns_hbheho, createfilelist::int, num_bins_hbheho, wpksamp0_hbheho, testProducerWithPsetDescEmpty_cfi::y1, testProducerWithPsetDescEmpty_cfi::y2, and makeMEIFBenchmarkPlots::yval.

Referenced by HcalSimpleRecAlgoImpl::reco().

584  {
585  float flx = (num_bins_hbheho - 1) * (wpksamp - wpksamp0_hbheho);
586  int index = (int)flx;
587  float yval;
588 
589  if (index < 0)
590  return actual_ns_hbheho[0];
591  else if (index >= num_bins_hbheho - 1)
592  return actual_ns_hbheho[num_bins_hbheho - 1];
593 
594  // else interpolate:
595  float y1 = actual_ns_hbheho[index];
596  float y2 = actual_ns_hbheho[index + 1];
597 
598  yval = y1 + (y2 - y1) * (flx - (float)index);
599 
600  return yval;
601 }
static const float wpksamp0_hbheho
static const float actual_ns_hbheho[num_bins_hbheho]
static const int num_bins_hbheho

◆ timeshift_ns_hf()

float timeshift_ns_hf ( float  wpksamp)
static

Timeshift correction for the HF PMTs.

Definition at line 710 of file HcalSimpleRecAlgo.cc.

References actual_ns_hf, createfilelist::int, num_bins_hf, wpksamp0_hf, testProducerWithPsetDescEmpty_cfi::y1, testProducerWithPsetDescEmpty_cfi::y2, and makeMEIFBenchmarkPlots::yval.

Referenced by HcalSimpleRecAlgoImpl::recoHFTime().

710  {
711  float flx = (num_bins_hf - 1) * (wpksamp - wpksamp0_hf);
712  int index = (int)flx;
713  float yval;
714 
715  if (index < 0)
716  return actual_ns_hf[0];
717  else if (index >= num_bins_hf - 1)
718  return actual_ns_hf[num_bins_hf - 1];
719 
720  // else interpolate:
721  float y1 = actual_ns_hf[index];
722  float y2 = actual_ns_hf[index + 1];
723 
724  // float delta_x = 1/(float)num_bins_hf;
725  // yval = y1 + (y2-y1)*(flx-(float)index)/delta_x;
726 
727  yval = y1 + (y2 - y1) * (flx - (float)index);
728  return yval;
729 }
static const float actual_ns_hf[num_bins_hf]
static const float wpksamp0_hf
static const int num_bins_hf

Variable Documentation

◆ actual_ns_hbheho

const float actual_ns_hbheho[num_bins_hbheho]
static

Definition at line 520 of file HcalSimpleRecAlgo.cc.

Referenced by timeshift_ns_hbheho().

◆ actual_ns_hf

const float actual_ns_hf[num_bins_hf]
static

Definition at line 606 of file HcalSimpleRecAlgo.cc.

Referenced by timeshift_ns_hf().

◆ MaximumFractionalError

constexpr double MaximumFractionalError = 0.002

Definition at line 18 of file HcalSimpleRecAlgo.cc.

Referenced by HcalSimpleRecAlgo::HcalSimpleRecAlgo().

◆ num_bins_hbheho

const int num_bins_hbheho = 61
static

Definition at line 518 of file HcalSimpleRecAlgo.cc.

Referenced by timeshift_ns_hbheho().

◆ num_bins_hf

const int num_bins_hf = 101
static

Definition at line 603 of file HcalSimpleRecAlgo.cc.

Referenced by timeshift_ns_hf().

◆ wpksamp0_hbheho

const float wpksamp0_hbheho = 0.5
static

Definition at line 517 of file HcalSimpleRecAlgo.cc.

Referenced by timeshift_ns_hbheho().

◆ wpksamp0_hf

const float wpksamp0_hf = 0.5
static

Definition at line 604 of file HcalSimpleRecAlgo.cc.

Referenced by timeshift_ns_hf().