CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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  for (std::vector<l1t::Jet>::const_iterator uncalibjet = uncalibjets->begin(); uncalibjet != uncalibjets->end();
18  ++uncalibjet) {
19  if (jetCalibrationType == "None") {
20  l1t::Jet corrjets = *uncalibjet;
21  jets->push_back(corrjets);
22  continue;
23  }
24 
25  if (jetCalibrationType == "Stage1JEC") {
26  int jetPt = (uncalibjet->hwPt()) * jetLSB; // correction factors are parameterized as functions of physical pt
27  int jetPhi = uncalibjet->hwPhi();
28  int jetEta = uncalibjet->hwEta();
29  int jetQual = uncalibjet->hwQual();
30  double jpt = 0.0;
31 
32  double alpha = jetCalibrationParams[2 * jetEta + 0]; //Scale factor (See jetSF_cfi.py)
33  double gamma = ((jetCalibrationParams[2 * jetEta + 1])); //Offset
34 
35  jpt = jetPt * alpha + gamma;
36  unsigned int corjetET = (int)(jpt / jetLSB);
37 
38  ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> > jetLorentz(0, 0, 0, 0);
39  l1t::Jet corrjets(*&jetLorentz, corjetET, jetEta, jetPhi, jetQual);
40 
41  jets->push_back(corrjets);
42  }
43  }
44  }
45 } // namespace l1t
float alpha
Definition: AMPTWrapper.h:105
void JetCalibration(std::vector< l1t::Jet > *uncalibjets, std::vector< double > jetCalibrationParams, std::vector< l1t::Jet > *jets, std::string jetCalibrationType, double jetLSB)
Definition: Jet.h:20
vector< PseudoJet > jets