Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:58:08

0001 ///////////////////////////////////////////////////////////////////////////////
0002 // File: HFRecalibration.cc
0003 // Description: simple helper class containing parameterized
0004 //              function for HF damade recovery for Upgrade studies
0005 //              evaluated using SimG4CMS/Calo/ HFDarkening
0006 ///////////////////////////////////////////////////////////////////////////////
0007 
0008 #include "CalibCalorimetry/HcalAlgos/interface/HFRecalibration.h"
0009 
0010 // CMSSW Headers
0011 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0012 
0013 using namespace edm;
0014 
0015 HFRecalibration::HFRecalibration(const edm::ParameterSet& pset) {
0016   //HFParsAB[Depth=0/1][A=0/B=1]
0017   HFParsAB[0][0] = pset.getParameter<vecOfDoubles>("HFdepthOneParameterA");
0018   HFParsAB[0][1] = pset.getParameter<vecOfDoubles>("HFdepthOneParameterB");
0019   HFParsAB[1][0] = pset.getParameter<vecOfDoubles>("HFdepthTwoParameterA");
0020   HFParsAB[1][1] = pset.getParameter<vecOfDoubles>("HFdepthTwoParameterB");
0021 }
0022 
0023 HFRecalibration::~HFRecalibration() {}
0024 
0025 double HFRecalibration::getCorr(int ieta, int depth, double lumi) {
0026   // parameterizations provided by James Wetzel
0027 
0028   ieta = (abs(ieta) - loweriEtaBin);
0029 
0030   if (ieta < 0 || ieta > 11 || depth < 1 || depth > 2) {
0031     return 1.0;
0032   }
0033 
0034   switch (depth) {
0035     case 1:
0036       reCalFactor = (1 + HFParsAB[0][0][ieta] * sqrt(lumi) + HFParsAB[0][1][ieta] * lumi);
0037       break;
0038     case 2:
0039       reCalFactor = (1 + HFParsAB[1][0][ieta] * sqrt(lumi) + HFParsAB[1][1][ieta] * lumi);
0040   }
0041 
0042   return reCalFactor;
0043 }