13 #include "Math/PtEtaPhiE4D.h" 14 #include "Math/LorentzVector.h" 31 mFunc =
new TFormula(
"function",((mParameters->definitions()).
formula()).c_str());
35 std::cout<<
" Size of parameters as read by SimpleJetCorrectorParameters "<<mParameters->size()<<std::endl;
36 for(
unsigned int i = 0;
i<mParameters->size();
i++){
37 const std::vector<float>
p = mParameters->record (
i).parameters ();
38 for(std::vector<float>::const_iterator j=p.begin(); j<p.end(); j++) {
39 std::cout<<
" Parameter number "<<mParameters->record (
i).xMin(0)<<
" "<<mParameters->record (
i).xMax(0)<<
" "<<(*j)<<std::endl;
49 double costhetainv = cosh (fEta);
50 return correctionEtEtaPhiP (fE/costhetainv, fEta, fPhi, fPt*costhetainv);
56 double eta=fabs (fEta);
60 std::vector<float>
xx; xx.push_back(eta);
61 int band = mParameters->binIndex(xx);
63 if(band < 0)
return factor;
65 const std::vector<float>
p = mParameters->record (band).parameters ();
68 for(
unsigned int i=0;
i<p.size();
i++) {
69 mFunc->SetParameter(
i,p[
i]);
73 cout<<
" Et and eta of jet "<<et<<
" "<<eta<<
" bin "<<band<<
" "<<p[1]<<
" "<<p[2]<<
" "<<p[3]<<
74 " "<<p[4]<<
" "<<p[5]<<endl;
79 double koef = 1. - mFunc->Eval(et);
83 if( et < p[0] ) koef = 1. - mFunc->Eval(p[0]);
88 if (debug_)
std::cout<<
"SimpleZSPJPTJetCorrector::Problem with ZSP corrections "<<koef<<std::endl;
92 double etnew = et/koef;
94 if (debug_)
cout<<
" The new energy found "<<etnew<<
" "<<et<<
" "<<koef<<endl;
102 double eta=fabs (fEta);
106 std::vector<float>
xx; xx.push_back(eta);
107 int band = mParameters->binIndex(xx);
109 if(band < 0)
return factor;
111 const std::vector<float>
p = mParameters->record (band).parameters ();
114 cout<<
" Et and eta of jet "<<et<<
" "<<eta<<
" bin "<<band<<std::endl;
117 double koef = (et-p[2])/et;
118 double etnew = et/koef;
120 if (debug_)
cout<<
" The new energy found "<<etnew<<
" "<<et<<endl;
SimpleZSPJPTJetCorrector()
virtual ~SimpleZSPJPTJetCorrector()
virtual double correctionPtEtaPhiE(double fPt, double fEta, double fPhi, double fE) const
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > XYZTLorentzVectorD
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiE4D< double > > PtEtaPhiELorentzVectorD
virtual double correctionPUEtEtaPhiP(double fEt, double fEta, double fPhi, double fP) const
virtual double correctionEtEtaPhiP(double fEt, double fEta, double fPhi, double fP) const
et
define resolution functions of each parameter