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

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

◆ ~SimpleZSPJPTJetCorrector()

SimpleZSPJPTJetCorrector::~SimpleZSPJPTJetCorrector ( )
virtual

Definition at line 43 of file SimpleZSPJPTJetCorrector.cc.

43 {}

◆ 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 50 of file SimpleZSPJPTJetCorrector.cc.

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

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 45 of file SimpleZSPJPTJetCorrector.cc.

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

◆ correctionPUEtEtaPhiP()

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

Definition at line 99 of file SimpleZSPJPTJetCorrector.cc.

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

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:355
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
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
gather_cfg.cout
cout
Definition: gather_cfg.py:144
JetCorrectorParameters::definitions
const Definitions & definitions() const
Definition: JetCorrectorParameters.h:113
PVValHelper::eta
Definition: PVValidationHelpers.h:69
DQMScaleToClient_cfi.factor
factor
Definition: DQMScaleToClient_cfi.py:8
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:112
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:50
JetCorrectorParameters::size
unsigned size() const
Definition: JetCorrectorParameters.h:114
JetCorrectorParameters
Definition: JetCorrectorParameters.h:25
JetCorrectorParameters::binIndex
int binIndex(const std::vector< float > &fX) const
Definition: JetCorrectorParameters.cc:176
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
geometryCSVtoXML.xx
xx
Definition: geometryCSVtoXML.py:19
SimpleZSPJPTJetCorrector::mFunc
TFormula * mFunc
Definition: SimpleZSPJPTJetCorrector.h:30