5 #include "Math/PtEtaPhiE4D.h" 6 #include "Math/Vector3D.h" 7 #include "Math/LorentzVector.h" 93 std::vector<float> vx,vy;
112 std::vector<float>
result;
113 for(
unsigned i=0;
i<fNames.size();
i++)
115 if (fNames[
i] ==
"JetEta")
118 edm::LogError(
"JetCorrectionUncertainty::")<<
" jet eta is not set";
119 result.push_back(-999.0);
124 else if (fNames[
i] ==
"JetPt")
127 edm::LogError(
"JetCorrectionUncertainty::")<<
" jet pt is not set";
128 result.push_back(-999.0);
133 else if (fNames[
i] ==
"JetPhi")
136 edm::LogError(
"JetCorrectionUncertainty::")<<
" jet phi is not set";
137 result.push_back(-999.0);
142 else if (fNames[
i] ==
"JetE")
145 edm::LogError(
"JetCorrectionUncertainty::")<<
" jet energy is not set";
146 result.push_back(-999.0);
148 result.push_back(
mJetE);
151 else if (fNames[
i] ==
"JetEMF")
154 edm::LogError(
"JetCorrectionUncertainty::")<<
" jet emf is not set";
155 result.push_back(-999.0);
160 else if (fNames[
i] ==
"LepPx")
163 edm::LogError(
"JetCorrectionUncertainty::")<<
" lepton px is not set";
164 result.push_back(-999.0);
169 else if (fNames[
i] ==
"LepPy")
172 edm::LogError(
"JetCorrectionUncertainty::")<<
" lepton py is not set";
173 result.push_back(-999.0);
178 else if (fNames[
i] ==
"LepPz")
181 edm::LogError(
"JetCorrectionUncertainty::")<<
" lepton pz is not set";
182 result.push_back(-999.0);
189 edm::LogError(
"JetCorrectionUncertainty::")<<
" unknown parameter "<<fNames[
i];
190 result.push_back(-999.0);
201 typedef ROOT::Math::DisplacementVector3D<ROOT::Math::Cartesian3D<float> >
XYZVector;
202 PtEtaPhiELorentzVector
jet;
209 float lj_x = (
mAddLepToJet) ? lep.X()+jet.Px() : jet.Px();
210 float lj_y = (
mAddLepToJet) ? lep.Y()+jet.Py() : jet.Py();
211 float lj_z = (
mAddLepToJet) ? lep.Z()+jet.Pz() : jet.Pz();
213 float lj2 = lj_x*lj_x+lj_y*lj_y+lj_z*lj_z;
214 float pTrel2 = -999.0;
216 float lep2 = lep.X()*lep.X()+lep.Y()*lep.Y()+lep.Z()*lep.Z();
218 float lepXlj = lep.X()*lj_x+lep.Y()*lj_y+lep.Z()*lj_z;
220 float pLrel2 = lepXlj*lepXlj/lj2;
222 pTrel2 = lep2-pLrel2;
224 edm::LogError(
"JetCorrectionUncertainty")<<
" not positive lepton-jet momentum: "<<lj2;
225 return (pTrel2 > 0) ?
std::sqrt(pTrel2) : 0.0;
JetCorrectionUncertainty()
SimpleJetCorrectionUncertainty * mUncertainty
const Definitions & definitions() const
void setLepPx(float fLepPx)
std::vector< std::string > parVar() const
void setJetEMF(float fEMF)
PtEtaPhiELorentzVectorD PtEtaPhiELorentzVector
Lorentz vector with cartesian internal representation.
void setParameters(const std::string &fDataFile)
void setJetEta(float fEta)
float uncertainty(const std::vector< float > &fX, float fY, bool fDirection) const
float getUncertainty(bool fDirection)
std::vector< float > fillVector(const std::vector< std::string > &fNames)
void setLepPy(float fLepPy)
std::vector< std::string > binVar() const
math::XYZVector XYZVector
const JetCorrectorParameters & parameters() const
void setLepPz(float fLepPz)
~JetCorrectionUncertainty()