CMS 3D CMS Logo

JetCalibrationMethods.cc
Go to the documentation of this file.
1 // JetCalibrationMethods.cc
2 // Authors: Inga Bucinskaite, UIC
3 //
4 // This file should contain the different algorithms used for Jet Calibration
5 //
6 
8 #include <vector>
9 
10 namespace l1t {
11 
12  void JetCalibration(std::vector<l1t::Jet> * uncalibjets,
13  std::vector<double> jetCalibrationParams,
14  std::vector<l1t::Jet> * jets,
15  std::string jetCalibrationType,
16  double jetLSB)
17  {
18 
19  for (std::vector<l1t::Jet>::const_iterator uncalibjet = uncalibjets->begin(); uncalibjet != uncalibjets->end(); ++uncalibjet){
20 
21  if (jetCalibrationType == "None") {
22  l1t::Jet corrjets = *uncalibjet;
23  jets->push_back(corrjets);
24  continue;
25  }
26 
27  if (jetCalibrationType == "Stage1JEC") {
28  int jetPt = (uncalibjet->hwPt())*jetLSB; // correction factors are parameterized as functions of physical pt
29  int jetPhi = uncalibjet->hwPhi();
30  int jetEta = uncalibjet->hwEta();
31  int jetQual = uncalibjet->hwQual();
32  double jpt = 0.0;
33 
34  double alpha = jetCalibrationParams[2*jetEta + 0]; //Scale factor (See jetSF_cfi.py)
35  double gamma = ((jetCalibrationParams[2*jetEta + 1])); //Offset
36 
37  jpt = jetPt*alpha+gamma;
38  unsigned int corjetET =(int) (jpt/jetLSB);
39 
40  ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> > jetLorentz(0,0,0,0);
41  l1t::Jet corrjets(*&jetLorentz, corjetET, jetEta, jetPhi, jetQual);
42 
43  jets->push_back(corrjets);
44  }
45  }
46  }
47 }
float alpha
Definition: AMPTWrapper.h:95
void JetCalibration(std::vector< l1t::Jet > *uncalibjets, std::vector< double > jetCalibrationParams, std::vector< l1t::Jet > *jets, std::string jetCalibrationType, double jetLSB)
delete x;
Definition: CaloConfig.h:22
Definition: Jet.h:16
vector< PseudoJet > jets