#include <JetCorrectionUncertainty.h>
Public Member Functions | |
float | getUncertainty (bool fDirection) |
JetCorrectionUncertainty (const std::string &fDataFile) | |
JetCorrectionUncertainty () | |
JetCorrectionUncertainty (const JetCorrectorParameters &fParameters) | |
void | setAddLepToJet (bool fAddLepToJet) |
void | setJetE (float fE) |
void | setJetEMF (float fEMF) |
void | setJetEta (float fEta) |
void | setJetPhi (float fE) |
void | setJetPt (float fPt) |
void | setLepPx (float fLepPx) |
void | setLepPy (float fLepPy) |
void | setLepPz (float fLepPz) |
void | setParameters (const std::string &fDataFile) |
~JetCorrectionUncertainty () | |
Private Member Functions | |
std::vector< float > | fillVector (const std::vector< std::string > &fNames) |
float | getPtRel () |
JetCorrectionUncertainty (const JetCorrectionUncertainty &) | |
JetCorrectionUncertainty & | operator= (const JetCorrectionUncertainty &) |
Private Attributes | |
bool | mAddLepToJet |
bool | mIsJetEMFset |
bool | mIsJetEset |
bool | mIsJetEtaset |
bool | mIsJetPhiset |
bool | mIsJetPtset |
bool | mIsLepPxset |
bool | mIsLepPyset |
bool | mIsLepPzset |
float | mJetE |
float | mJetEMF |
float | mJetEta |
float | mJetPhi |
float | mJetPt |
float | mLepPx |
float | mLepPy |
float | mLepPz |
SimpleJetCorrectionUncertainty * | mUncertainty |
Definition at line 9 of file JetCorrectionUncertainty.h.
JetCorrectionUncertainty::JetCorrectionUncertainty | ( | ) |
Definition at line 12 of file JetCorrectionUncertainty.cc.
References mAddLepToJet, mIsJetEMFset, mIsJetEset, mIsJetEtaset, mIsJetPhiset, mIsJetPtset, mIsLepPxset, mIsLepPyset, mIsLepPzset, mJetE, mJetEMF, mJetEta, mJetPhi, mJetPt, mLepPx, mLepPy, mLepPz, and mUncertainty.
{ mJetEta = -9999; mJetPt = -9999; mJetPhi = -9999; mJetE = -9999; mJetEMF = -9999; mLepPx = -9999; mLepPy = -9999; mLepPz = -9999; mIsJetEset = false; mIsJetPtset = false; mIsJetPhiset = false; mIsJetEtaset = false; mIsJetEMFset = false; mIsLepPxset = false; mIsLepPyset = false; mIsLepPzset = false; mAddLepToJet = false; mUncertainty = new SimpleJetCorrectionUncertainty(); }
JetCorrectionUncertainty::JetCorrectionUncertainty | ( | const std::string & | fDataFile | ) |
Definition at line 34 of file JetCorrectionUncertainty.cc.
References mAddLepToJet, mIsJetEMFset, mIsJetEset, mIsJetEtaset, mIsJetPhiset, mIsJetPtset, mIsLepPxset, mIsLepPyset, mIsLepPzset, mJetE, mJetEMF, mJetEta, mJetPhi, mJetPt, mLepPx, mLepPy, mLepPz, and mUncertainty.
{ mJetEta = -9999; mJetPt = -9999; mJetPhi = -9999; mJetE = -9999; mJetEMF = -9999; mLepPx = -9999; mLepPy = -9999; mLepPz = -9999; mIsJetEset = false; mIsJetPtset = false; mIsJetPhiset = false; mIsJetEtaset = false; mIsJetEMFset = false; mIsLepPxset = false; mIsLepPyset = false; mIsLepPzset = false; mAddLepToJet = false; mUncertainty = new SimpleJetCorrectionUncertainty(fDataFile); }
JetCorrectionUncertainty::JetCorrectionUncertainty | ( | const JetCorrectorParameters & | fParameters | ) |
Definition at line 56 of file JetCorrectionUncertainty.cc.
References mAddLepToJet, mIsJetEMFset, mIsJetEset, mIsJetEtaset, mIsJetPhiset, mIsJetPtset, mIsLepPxset, mIsLepPyset, mIsLepPzset, mJetE, mJetEMF, mJetEta, mJetPhi, mJetPt, mLepPx, mLepPy, mLepPz, and mUncertainty.
{ mJetEta = -9999; mJetPt = -9999; mJetPhi = -9999; mJetE = -9999; mJetEMF = -9999; mLepPx = -9999; mLepPy = -9999; mLepPz = -9999; mIsJetEset = false; mIsJetPtset = false; mIsJetPhiset = false; mIsJetEtaset = false; mIsJetEMFset = false; mIsLepPxset = false; mIsLepPyset = false; mIsLepPzset = false; mAddLepToJet = false; mUncertainty = new SimpleJetCorrectionUncertainty(fParameters); }
JetCorrectionUncertainty::~JetCorrectionUncertainty | ( | ) |
Definition at line 78 of file JetCorrectionUncertainty.cc.
References mUncertainty.
{ delete mUncertainty; }
JetCorrectionUncertainty::JetCorrectionUncertainty | ( | const JetCorrectionUncertainty & | ) | [private] |
std::vector< float > JetCorrectionUncertainty::fillVector | ( | const std::vector< std::string > & | fNames | ) | [private] |
Definition at line 110 of file JetCorrectionUncertainty.cc.
References Exception, i, mIsJetEMFset, mIsJetEset, mIsJetEtaset, mIsJetPhiset, mIsJetPtset, mIsLepPxset, mIsLepPyset, mIsLepPzset, mJetE, mJetEMF, mJetEta, mJetPt, mLepPx, mLepPy, mLepPz, and query::result.
Referenced by getUncertainty().
{ std::vector<float> result; for(unsigned i=0;i<fNames.size();i++) { if (fNames[i] == "JetEta") { if (!mIsJetEtaset) throw cms::Exception("JetCorrectionUncertainty::")<<" jet eta is not set"; result.push_back(mJetEta); } else if (fNames[i] == "JetPt") { if (!mIsJetPtset) throw cms::Exception("JetCorrectionUncertainty::")<<" jet pt is not set"; result.push_back(mJetPt); } else if (fNames[i] == "JetPhi") { if (!mIsJetPhiset) throw cms::Exception("JetCorrectionUncertainty::")<<" jet phi is not set"; result.push_back(mJetPt); } else if (fNames[i] == "JetE") { if (!mIsJetEset) throw cms::Exception("JetCorrectionUncertainty::")<<" jet energy is not set"; result.push_back(mJetE); } else if (fNames[i] == "JetEMF") { if (!mIsJetEMFset) throw cms::Exception("JetCorrectionUncertainty::")<<" jet emf is not set"; result.push_back(mJetEMF); } else if (fNames[i] == "LepPx") { if (!mIsLepPxset) throw cms::Exception("JetCorrectionUncertainty::")<<" lepton px is not set"; result.push_back(mLepPx); } else if (fNames[i] == "LepPy") { if (!mIsLepPyset) throw cms::Exception("JetCorrectionUncertainty::")<<" lepton py is not set"; result.push_back(mLepPy); } else if (fNames[i] == "LepPz") { if (!mIsLepPzset) throw cms::Exception("JetCorrectionUncertainty::")<<" lepton pz is not set"; result.push_back(mLepPz); } else throw cms::Exception("JetCorrectionUncertainty::")<<" unknown parameter "<<fNames[i]; } return result; }
float JetCorrectionUncertainty::getPtRel | ( | ) | [private] |
Definition at line 171 of file JetCorrectionUncertainty.cc.
References Exception, metsig::jet, mAddLepToJet, mJetE, mJetEta, mJetPhi, mJetPt, mLepPx, mLepPy, mLepPz, and mathSSE::sqrt().
{ typedef ROOT::Math::LorentzVector<ROOT::Math::PtEtaPhiE4D<float> > PtEtaPhiELorentzVector; typedef ROOT::Math::DisplacementVector3D<ROOT::Math::Cartesian3D<float> > XYZVector; PtEtaPhiELorentzVector jet; XYZVector lep; jet.SetPt(mJetPt); jet.SetEta(mJetEta); jet.SetPhi(mJetPhi); jet.SetE(mJetE); lep.SetXYZ(mLepPx,mLepPy,mLepPz); float lj_x = (mAddLepToJet) ? lep.X()+jet.Px() : jet.Px(); float lj_y = (mAddLepToJet) ? lep.Y()+jet.Py() : jet.Py(); float lj_z = (mAddLepToJet) ? lep.Z()+jet.Pz() : jet.Pz(); // absolute values squared float lj2 = lj_x*lj_x+lj_y*lj_y+lj_z*lj_z; if (!(lj2 > 0)) throw cms::Exception("JetCorrectionUncertainty")<<" not positive lepton-jet momentum: "<<lj2; float lep2 = lep.X()*lep.X()+lep.Y()*lep.Y()+lep.Z()*lep.Z(); // projection vec(mu) to lepjet axis float lepXlj = lep.X()*lj_x+lep.Y()*lj_y+lep.Z()*lj_z; // absolute value squared and normalized float pLrel2 = lepXlj*lepXlj/lj2; // lep2 = pTrel2 + pLrel2 float pTrel2 = lep2-pLrel2; return (pTrel2 > 0) ? std::sqrt(pTrel2) : 0.0; }
float JetCorrectionUncertainty::getUncertainty | ( | bool | fDirection | ) |
Definition at line 90 of file JetCorrectionUncertainty.cc.
References JetCorrectorParameters::definitions(), fillVector(), mIsJetEMFset, mIsJetEset, mIsJetEtaset, mIsJetPhiset, mIsJetPtset, mIsLepPxset, mIsLepPyset, mIsLepPzset, mUncertainty, SimpleJetCorrectionUncertainty::parameters(), query::result, and SimpleJetCorrectionUncertainty::uncertainty().
Referenced by JetCorrectorDemo::analyze().
{ float result; std::vector<float> vx,vy; vx = fillVector(mUncertainty->parameters().definitions().binVar()); vy = fillVector(mUncertainty->parameters().definitions().parVar()); result = mUncertainty->uncertainty(vx,vy[0],fDirection); mIsJetEset = false; mIsJetPtset = false; mIsJetPhiset = false; mIsJetEtaset = false; mIsJetEMFset = false; mIsLepPxset = false; mIsLepPyset = false; mIsLepPzset = false; return result; }
JetCorrectionUncertainty& JetCorrectionUncertainty::operator= | ( | const JetCorrectionUncertainty & | ) | [private] |
void JetCorrectionUncertainty::setAddLepToJet | ( | bool | fAddLepToJet | ) | [inline] |
Definition at line 26 of file JetCorrectionUncertainty.h.
References mAddLepToJet.
{mAddLepToJet = fAddLepToJet;}
void JetCorrectionUncertainty::setJetE | ( | float | fE | ) |
Definition at line 219 of file JetCorrectionUncertainty.cc.
References mIsJetEset, and mJetE.
{ mJetE = fE; mIsJetEset = true; }
void JetCorrectionUncertainty::setJetEMF | ( | float | fEMF | ) |
Definition at line 225 of file JetCorrectionUncertainty.cc.
References mIsJetEMFset, and mJetEMF.
{ mJetEMF = fEMF; mIsJetEMFset = true; }
void JetCorrectionUncertainty::setJetEta | ( | float | fEta | ) |
Definition at line 201 of file JetCorrectionUncertainty.cc.
References mIsJetEtaset, and mJetEta.
Referenced by JetCorrectorDemo::analyze().
{ mJetEta = fEta; mIsJetEtaset = true; }
void JetCorrectionUncertainty::setJetPhi | ( | float | fE | ) |
Definition at line 213 of file JetCorrectionUncertainty.cc.
References mIsJetPhiset, and mJetPhi.
{ mJetPhi = fPhi; mIsJetPhiset = true; }
void JetCorrectionUncertainty::setJetPt | ( | float | fPt | ) |
Definition at line 207 of file JetCorrectionUncertainty.cc.
References mIsJetPtset, and mJetPt.
Referenced by JetCorrectorDemo::analyze().
{ mJetPt = fPt; mIsJetPtset = true; }
void JetCorrectionUncertainty::setLepPx | ( | float | fLepPx | ) |
Definition at line 231 of file JetCorrectionUncertainty.cc.
References mIsLepPxset, and mLepPx.
{ mLepPx = fPx; mIsLepPxset = true; }
void JetCorrectionUncertainty::setLepPy | ( | float | fLepPy | ) |
Definition at line 237 of file JetCorrectionUncertainty.cc.
References mIsLepPyset, and mLepPy.
{ mLepPy = fPy; mIsLepPyset = true; }
void JetCorrectionUncertainty::setLepPz | ( | float | fLepPz | ) |
Definition at line 243 of file JetCorrectionUncertainty.cc.
References mIsLepPzset, and mLepPz.
{ mLepPz = fPz; mIsLepPzset = true; }
void JetCorrectionUncertainty::setParameters | ( | const std::string & | fDataFile | ) |
Definition at line 83 of file JetCorrectionUncertainty.cc.
References mUncertainty.
{ //---- delete the mParameters pointer before setting the new address --- delete mUncertainty; mUncertainty = new SimpleJetCorrectionUncertainty(fDataFile); }
bool JetCorrectionUncertainty::mAddLepToJet [private] |
Definition at line 43 of file JetCorrectionUncertainty.h.
Referenced by getPtRel(), JetCorrectionUncertainty(), and setAddLepToJet().
bool JetCorrectionUncertainty::mIsJetEMFset [private] |
Definition at line 48 of file JetCorrectionUncertainty.h.
Referenced by fillVector(), getUncertainty(), JetCorrectionUncertainty(), and setJetEMF().
bool JetCorrectionUncertainty::mIsJetEset [private] |
Definition at line 44 of file JetCorrectionUncertainty.h.
Referenced by fillVector(), getUncertainty(), JetCorrectionUncertainty(), and setJetE().
bool JetCorrectionUncertainty::mIsJetEtaset [private] |
Definition at line 47 of file JetCorrectionUncertainty.h.
Referenced by fillVector(), getUncertainty(), JetCorrectionUncertainty(), and setJetEta().
bool JetCorrectionUncertainty::mIsJetPhiset [private] |
Definition at line 46 of file JetCorrectionUncertainty.h.
Referenced by fillVector(), getUncertainty(), JetCorrectionUncertainty(), and setJetPhi().
bool JetCorrectionUncertainty::mIsJetPtset [private] |
Definition at line 45 of file JetCorrectionUncertainty.h.
Referenced by fillVector(), getUncertainty(), JetCorrectionUncertainty(), and setJetPt().
bool JetCorrectionUncertainty::mIsLepPxset [private] |
Definition at line 49 of file JetCorrectionUncertainty.h.
Referenced by fillVector(), getUncertainty(), JetCorrectionUncertainty(), and setLepPx().
bool JetCorrectionUncertainty::mIsLepPyset [private] |
Definition at line 50 of file JetCorrectionUncertainty.h.
Referenced by fillVector(), getUncertainty(), JetCorrectionUncertainty(), and setLepPy().
bool JetCorrectionUncertainty::mIsLepPzset [private] |
Definition at line 51 of file JetCorrectionUncertainty.h.
Referenced by fillVector(), getUncertainty(), JetCorrectionUncertainty(), and setLepPz().
float JetCorrectionUncertainty::mJetE [private] |
Definition at line 35 of file JetCorrectionUncertainty.h.
Referenced by fillVector(), getPtRel(), JetCorrectionUncertainty(), and setJetE().
float JetCorrectionUncertainty::mJetEMF [private] |
Definition at line 39 of file JetCorrectionUncertainty.h.
Referenced by fillVector(), JetCorrectionUncertainty(), and setJetEMF().
float JetCorrectionUncertainty::mJetEta [private] |
Definition at line 36 of file JetCorrectionUncertainty.h.
Referenced by fillVector(), getPtRel(), JetCorrectionUncertainty(), and setJetEta().
float JetCorrectionUncertainty::mJetPhi [private] |
Definition at line 38 of file JetCorrectionUncertainty.h.
Referenced by getPtRel(), JetCorrectionUncertainty(), and setJetPhi().
float JetCorrectionUncertainty::mJetPt [private] |
Definition at line 37 of file JetCorrectionUncertainty.h.
Referenced by fillVector(), getPtRel(), JetCorrectionUncertainty(), and setJetPt().
float JetCorrectionUncertainty::mLepPx [private] |
Definition at line 40 of file JetCorrectionUncertainty.h.
Referenced by fillVector(), getPtRel(), JetCorrectionUncertainty(), and setLepPx().
float JetCorrectionUncertainty::mLepPy [private] |
Definition at line 41 of file JetCorrectionUncertainty.h.
Referenced by fillVector(), getPtRel(), JetCorrectionUncertainty(), and setLepPy().
float JetCorrectionUncertainty::mLepPz [private] |
Definition at line 42 of file JetCorrectionUncertainty.h.
Referenced by fillVector(), getPtRel(), JetCorrectionUncertainty(), and setLepPz().
Definition at line 52 of file JetCorrectionUncertainty.h.
Referenced by getUncertainty(), JetCorrectionUncertainty(), setParameters(), and ~JetCorrectionUncertainty().