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 "RecoLocalCalo/HcalRecAlgos/src/HcalTDCReco.h"
#include "RecoLocalCalo/HcalRecAlgos/interface/rawEnergy.h"
#include "DataFormats/METReco/interface/HcalCaloFlagLabels.h"
#include <algorithm>
#include <cmath>

Go to the source code of this file.

Namespaces

 HcalSimpleRecAlgoImpl
 

Functions

static float eCorr (int ieta, int iphi, double ampl, 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 PulseShapeFitOOTPileupCorrection *psFitOOTpuCorr, HcalDeterministicFit *hltOOTpuCorr, PedestalSub *hltPedSub)
 
template<class Digi , class RecHit >
RecHit HcalSimpleRecAlgoImpl::recoHBHE (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 PulseShapeFitOOTPileupCorrection *psFitOOTpuCorr, HcalDeterministicFit *hltOOTpuCorr, PedestalSub *hltPedSub)
 
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)
 
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]
 
int HPDShapev3DataNum = 105
 
int HPDShapev3MCNum = 105
 
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,
int  runnum 
)
static

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

Definition at line 668 of file HcalSimpleRecAlgo.cc.

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

Referenced by PFClusterProducer::PFClusterProducer(), PFMultiDepthClusterProducer::PFMultiDepthClusterProducer(), HcalSimpleRecAlgoImpl::reco(), and HcalSimpleRecAlgoImpl::recoHBHE().

668  {
669 // return energy correction factor for HBM channels
670 // iphi=6 ieta=(-1,-15) and iphi=32 ieta=(-1,-7)
671 // I.Vodopianov 28 Feb. 2011
672  static const float low32[7] = {0.741,0.721,0.730,0.698,0.708,0.751,0.861};
673  static const float high32[7] = {0.973,0.925,0.900,0.897,0.950,0.935,1};
674  static const float low6[15] = {0.635,0.623,0.670,0.633,0.644,0.648,0.600,
675  0.570,0.595,0.554,0.505,0.513,0.515,0.561,0.579};
676  static const float high6[15] = {0.875,0.937,0.942,0.900,0.922,0.925,0.901,
677  0.850,0.852,0.818,0.731,0.717,0.782,0.853,0.778};
678 
679 
680  double slope, mid, en;
681  double corr = 1.0;
682 
683  if (!(iphi==6 && ieta<0 && ieta>-16) && !(iphi==32 && ieta<0 && ieta>-8))
684  return corr;
685 
686  int jeta = -ieta-1;
687  double xeta = (double) ieta;
688  if (energy > 0.) en=energy;
689  else en = 0.;
690 
691  if (iphi == 32) {
692  slope = 0.2272;
693  mid = 17.14 + 0.7147*xeta;
694  if (en > 100.) corr = high32[jeta];
695  else corr = low32[jeta]+(high32[jeta]-low32[jeta])/(1.0+exp(-(en-mid)*slope));
696  }
697  else if (iphi == 6 && runnum < 216091 ) {
698  slope = 0.1956;
699  mid = 15.96 + 0.3075*xeta;
700  if (en > 100.0) corr = high6[jeta];
701  else corr = low6[jeta]+(high6[jeta]-low6[jeta])/(1.0+exp(-(en-mid)*slope));
702  }
703 
704  // std::cout << "HBHE cell: ieta, iphi = " << ieta << " " << iphi
705  // << " -> energy = " << en << " corr = " << corr << std::endl;
706 
707  return corr;
708 }
static const double slope[3]
JetCorrectorParameters corr
Definition: classes.h:5
tuple runnum
Definition: summaryLumi.py:210
float leakCorr ( double  energy)
static

Leak correction.

Definition at line 712 of file HcalSimpleRecAlgo.cc.

References corr.

Referenced by HcalSimpleRecAlgoImpl::reco(), and HcalSimpleRecAlgoImpl::recoHBHE().

712  {
713  double corr = 1.0;
714  return corr;
715 }
JetCorrectorParameters corr
Definition: classes.h:5
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 787 of file HcalSimpleRecAlgo.cc.

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

Referenced by HcalSimpleRecAlgoImpl::reco(), and HcalSimpleRecAlgoImpl::recoHBHE().

787  {
788  float flx = (num_bins_hbheho-1)*(wpksamp - wpksamp0_hbheho);
789  int index = (int)flx;
790  float yval;
791 
792  if (index < 0) return actual_ns_hbheho[0];
793  else if (index >= num_bins_hbheho-1) return actual_ns_hbheho[num_bins_hbheho-1];
794 
795  // else interpolate:
796  float y1 = actual_ns_hbheho[index];
797  float y2 = actual_ns_hbheho[index+1];
798 
799  yval = y1 + (y2-y1)*(flx-(float)index);
800 
801  return yval;
802 }
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
float timeshift_ns_hf ( float  wpksamp)
static

Same as above, but for the HF PMTs.

Definition at line 911 of file HcalSimpleRecAlgo.cc.

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

Referenced by HcalSimpleRecAlgoImpl::recoHFTime().

911  {
912  float flx = (num_bins_hf-1)*(wpksamp-wpksamp0_hf);
913  int index = (int)flx;
914  float yval;
915 
916  if (index < 0) return actual_ns_hf[0];
917  else if (index >= num_bins_hf-1) return actual_ns_hf[num_bins_hf-1];
918 
919  // else interpolate:
920  float y1 = actual_ns_hf[index];
921  float y2 = actual_ns_hf[index+1];
922 
923  // float delta_x = 1/(float)num_bins_hf;
924  // yval = y1 + (y2-y1)*(flx-(float)index)/delta_x;
925 
926  yval = y1 + (y2-y1)*(flx-(float)index);
927  return yval;
928 }
static const float actual_ns_hf[num_bins_hf]
static const float wpksamp0_hf
static const int num_bins_hf
return(e1-e2)*(e1-e2)+dp *dp

Variable Documentation

const float actual_ns_hbheho[num_bins_hbheho]
static

Definition at line 723 of file HcalSimpleRecAlgo.cc.

Referenced by timeshift_ns_hbheho().

const float actual_ns_hf[num_bins_hf]
static

Definition at line 807 of file HcalSimpleRecAlgo.cc.

Referenced by timeshift_ns_hf().

int HPDShapev3DataNum = 105

Definition at line 15 of file HcalSimpleRecAlgo.cc.

Referenced by HcalSimpleRecAlgo::setForData().

int HPDShapev3MCNum = 105

Definition at line 16 of file HcalSimpleRecAlgo.cc.

Referenced by HcalSimpleRecAlgo::setForData().

double MaximumFractionalError = 0.002

Definition at line 14 of file HcalSimpleRecAlgo.cc.

const int num_bins_hbheho = 61
static

Definition at line 721 of file HcalSimpleRecAlgo.cc.

Referenced by timeshift_ns_hbheho().

const int num_bins_hf = 101
static

Definition at line 804 of file HcalSimpleRecAlgo.cc.

Referenced by timeshift_ns_hf().

const float wpksamp0_hbheho = 0.5
static

Definition at line 720 of file HcalSimpleRecAlgo.cc.

Referenced by timeshift_ns_hbheho().

const float wpksamp0_hf = 0.5
static

Definition at line 805 of file HcalSimpleRecAlgo.cc.

Referenced by timeshift_ns_hf().