CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
SimpleZSPJPTJetCorrector Class Reference

classes declaration More...

#include <SimpleZSPJPTJetCorrector.h>

Public Member Functions

virtual double correctionEtEtaPhiP (double fEt, double fEta, double fPhi, double fP) const
 
virtual double correctionPtEtaPhiE (double fPt, double fEta, double fPhi, double fE) const
 
virtual double correctionPUEtEtaPhiP (double fEt, double fEta, double fPhi, double fP) const
 
void init (const std::string &fDataFile)
 
 SimpleZSPJPTJetCorrector ()
 
 SimpleZSPJPTJetCorrector (const std::string &fDataFile)
 
virtual ~SimpleZSPJPTJetCorrector ()
 

Private Member Functions

SimpleZSPJPTJetCorrectoroperator= (const SimpleZSPJPTJetCorrector &)
 
 SimpleZSPJPTJetCorrector (const SimpleZSPJPTJetCorrector &)
 

Private Attributes

bool debug_
 
TFormula * mFunc
 
JetCorrectorParametersmParameters
 

Detailed Description

classes declaration

Definition at line 15 of file SimpleZSPJPTJetCorrector.h.

Constructor & Destructor Documentation

◆ SimpleZSPJPTJetCorrector() [1/3]

SimpleZSPJPTJetCorrector::SimpleZSPJPTJetCorrector ( )

Definition at line 20 of file SimpleZSPJPTJetCorrector.cc.

20 { debug_ = false; }

◆ SimpleZSPJPTJetCorrector() [2/3]

SimpleZSPJPTJetCorrector::SimpleZSPJPTJetCorrector ( const std::string &  fDataFile)

Definition at line 22 of file SimpleZSPJPTJetCorrector.cc.

22  {
23  debug_ = false;
24  mParameters = new JetCorrectorParameters(fDataFile, "");
25 
26  mFunc = new TFormula("function", ((mParameters->definitions()).formula()).c_str());
27 
28  // Read parameters
29  if (debug_) {
30  std::cout << " Size of parameters as read by SimpleJetCorrectorParameters " << mParameters->size() << std::endl;
31  for (unsigned int i = 0; i < mParameters->size(); i++) {
32  const std::vector<float> p = mParameters->record(i).parameters();
33  for (std::vector<float>::const_iterator j = p.begin(); j < p.end(); j++) {
34  std::cout << " Parameter number " << mParameters->record(i).xMin(0) << " " << mParameters->record(i).xMax(0)
35  << " " << (*j) << std::endl;
36  }
37  }
38  } // debug
39 }

References gather_cfg::cout, pfMETCorrectionType0_cfi::formula, mps_fire::i, dqmiolumiharvest::j, and AlCaHLTBitMon_ParallelJobs::p.

◆ ~SimpleZSPJPTJetCorrector()

SimpleZSPJPTJetCorrector::~SimpleZSPJPTJetCorrector ( )
virtual

Definition at line 41 of file SimpleZSPJPTJetCorrector.cc.

41 {}

◆ SimpleZSPJPTJetCorrector() [3/3]

SimpleZSPJPTJetCorrector::SimpleZSPJPTJetCorrector ( const SimpleZSPJPTJetCorrector )
private

Member Function Documentation

◆ correctionEtEtaPhiP()

double SimpleZSPJPTJetCorrector::correctionEtEtaPhiP ( double  fEt,
double  fEta,
double  fPhi,
double  fP 
) const
virtual

Definition at line 48 of file SimpleZSPJPTJetCorrector.cc.

48  {
49  double et = fEt;
50  double eta = fabs(fEta);
51  double factor = 1.;
52 
53  // Define Eta bin for parametrization
54  std::vector<float> xx;
55  xx.push_back(eta);
56  int band = mParameters->binIndex(xx);
57 
58  if (band < 0)
59  return factor;
60 
61  const std::vector<float> p = mParameters->record(band).parameters();
62 
63  // Set parameters
64  for (unsigned int i = 0; i < p.size(); i++) {
65  mFunc->SetParameter(i, p[i]);
66  }
67 
68  if (debug_) {
69  cout << " Et and eta of jet " << et << " " << eta << " bin " << band << " " << p[1] << " " << p[2] << " " << p[3]
70  << " " << p[4] << " " << p[5] << endl;
71  }
72 
73  // double koef = 1. - p[2]*exp(p[3]*et)-p[4]*exp(p[5]*et);
74 
75  double koef = 1. - mFunc->Eval(et);
76 
77  // If et calojet less then some value - use correction on the boundary
78 
79  if (et < p[0])
80  koef = 1. - mFunc->Eval(p[0]);
81 
82  //
83  if (koef <= 0.000001) {
84  if (debug_)
85  std::cout << "SimpleZSPJPTJetCorrector::Problem with ZSP corrections " << koef << std::endl;
86  koef = 1.;
87  }
88 
89  double etnew = et / koef;
90 
91  if (debug_)
92  cout << " The new energy found " << etnew << " " << et << " " << koef << endl;
93 
94  return etnew / et;
95 }

References gather_cfg::cout, EgHLTOffHistBins_cfi::et, PVValHelper::eta, DQMScaleToClient_cfi::factor, mps_fire::i, AlCaHLTBitMon_ParallelJobs::p, and geometryCSVtoXML::xx.

◆ correctionPtEtaPhiE()

double SimpleZSPJPTJetCorrector::correctionPtEtaPhiE ( double  fPt,
double  fEta,
double  fPhi,
double  fE 
) const
virtual

Definition at line 43 of file SimpleZSPJPTJetCorrector.cc.

43  {
44  double costhetainv = cosh(fEta);
45  return correctionEtEtaPhiP(fE / costhetainv, fEta, fPhi, fPt * costhetainv);
46 }

◆ correctionPUEtEtaPhiP()

double SimpleZSPJPTJetCorrector::correctionPUEtEtaPhiP ( double  fEt,
double  fEta,
double  fPhi,
double  fP 
) const
virtual

Definition at line 97 of file SimpleZSPJPTJetCorrector.cc.

97  {
98  double et = fEt;
99  double eta = fabs(fEta);
100  double factor = 1.;
101 
102  // Define Eta bin for parametrization
103  std::vector<float> xx;
104  xx.push_back(eta);
105  int band = mParameters->binIndex(xx);
106 
107  if (band < 0)
108  return factor;
109 
110  const std::vector<float> p = mParameters->record(band).parameters();
111 
112  if (debug_) {
113  cout << " Et and eta of jet " << et << " " << eta << " bin " << band << std::endl;
114  }
115 
116  double koef = (et - p[2]) / et;
117  double etnew = et / koef;
118 
119  if (debug_)
120  cout << " The new energy found " << etnew << " " << et << endl;
121 
122  return etnew / et;
123 }

References gather_cfg::cout, EgHLTOffHistBins_cfi::et, PVValHelper::eta, DQMScaleToClient_cfi::factor, AlCaHLTBitMon_ParallelJobs::p, and geometryCSVtoXML::xx.

◆ init()

void SimpleZSPJPTJetCorrector::init ( const std::string &  fDataFile)

◆ operator=()

SimpleZSPJPTJetCorrector& SimpleZSPJPTJetCorrector::operator= ( const SimpleZSPJPTJetCorrector )
private

Member Data Documentation

◆ debug_

bool SimpleZSPJPTJetCorrector::debug_
private

Definition at line 31 of file SimpleZSPJPTJetCorrector.h.

◆ mFunc

TFormula* SimpleZSPJPTJetCorrector::mFunc
private

Definition at line 30 of file SimpleZSPJPTJetCorrector.h.

◆ mParameters

JetCorrectorParameters* SimpleZSPJPTJetCorrector::mParameters
private

Definition at line 29 of file SimpleZSPJPTJetCorrector.h.

mps_fire.i
i
Definition: mps_fire.py:428
JetCorrectorParameters::Record::xMax
float xMax(unsigned fVar) const
Definition: JetCorrectorParameters.h:76
SimpleZSPJPTJetCorrector::mParameters
JetCorrectorParameters * mParameters
Definition: SimpleZSPJPTJetCorrector.h:29
pfMETCorrectionType0_cfi.formula
formula
Definition: pfMETCorrectionType0_cfi.py:46
gather_cfg.cout
cout
Definition: gather_cfg.py:144
JetCorrectorParameters::definitions
const Definitions & definitions() const
Definition: JetCorrectorParameters.h:122
PVValHelper::eta
Definition: PVValidationHelpers.h:70
DQMScaleToClient_cfi.factor
factor
Definition: DQMScaleToClient_cfi.py:8
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
JetCorrectorParameters::Record::xMin
float xMin(unsigned fVar) const
Definition: JetCorrectorParameters.h:75
SimpleZSPJPTJetCorrector::debug_
bool debug_
Definition: SimpleZSPJPTJetCorrector.h:31
JetCorrectorParameters::record
const Record & record(unsigned fBin) const
Definition: JetCorrectorParameters.h:121
EgHLTOffHistBins_cfi.et
et
Definition: EgHLTOffHistBins_cfi.py:8
JetCorrectorParameters::Record::parameters
std::vector< float > parameters() const
Definition: JetCorrectorParameters.h:79
SimpleZSPJPTJetCorrector::correctionEtEtaPhiP
virtual double correctionEtEtaPhiP(double fEt, double fEta, double fPhi, double fP) const
Definition: SimpleZSPJPTJetCorrector.cc:48
JetCorrectorParameters::size
unsigned size() const
Definition: JetCorrectorParameters.h:123
JetCorrectorParameters
Definition: JetCorrectorParameters.h:25
JetCorrectorParameters::binIndex
int binIndex(const std::vector< float > &fX) const
Definition: JetCorrectorParameters.cc:178
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
geometryCSVtoXML.xx
xx
Definition: geometryCSVtoXML.py:19
SimpleZSPJPTJetCorrector::mFunc
TFormula * mFunc
Definition: SimpleZSPJPTJetCorrector.h:30