Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:51:14

0001 // This is the file "FactorizedJetCorrectorCalculator.cc".
0002 // This is the implementation of the class FactorizedJetCorrectorCalculator.
0003 // Author: Konstantinos Kousouris, Philipp Schieferdecker
0004 // Email:  kkousour@fnal.gov, philipp.schieferdecker@cern.ch
0005 
0006 #include "CondFormats/JetMETObjects/interface/FactorizedJetCorrectorCalculator.h"
0007 #include "CondFormats/JetMETObjects/interface/SimpleJetCorrector.h"
0008 #include "CondFormats/JetMETObjects/interface/JetCorrectorParameters.h"
0009 #include "CondFormats/JetMETObjects/interface/Utilities.h"
0010 #include "Math/PtEtaPhiE4D.h"
0011 #include "Math/Vector3D.h"
0012 #include "Math/LorentzVector.h"
0013 #include <vector>
0014 #include <string>
0015 #include <sstream>
0016 
0017 //------------------------------------------------------------------------
0018 //--- Default FactorizedJetCorrectorCalculator constructor -------------------------
0019 //------------------------------------------------------------------------
0020 FactorizedJetCorrectorCalculator::FactorizedJetCorrectorCalculator() {}
0021 //------------------------------------------------------------------------
0022 //--- FactorizedJetCorrectorCalculator constructor ---------------------------------
0023 //------------------------------------------------------------------------
0024 FactorizedJetCorrectorCalculator::FactorizedJetCorrectorCalculator(const std::string& fLevels,
0025                                                                    const std::string& fFiles,
0026                                                                    const std::string& fOptions) {
0027   initCorrectors(fLevels, fFiles, fOptions);
0028 }
0029 //------------------------------------------------------------------------
0030 //--- FactorizedJetCorrectorCalculator constructor ---------------------------------
0031 //------------------------------------------------------------------------
0032 FactorizedJetCorrectorCalculator::FactorizedJetCorrectorCalculator(
0033     const std::vector<JetCorrectorParameters>& fParameters) {
0034   for (unsigned i = 0; i < fParameters.size(); i++) {
0035     std::string ss = fParameters[i].definitions().level();
0036     if (ss == "L1Offset")
0037       mLevels.push_back(kL1);
0038     else if (ss == "L1JPTOffset")
0039       mLevels.push_back(kL1JPT);
0040     else if (ss == "L2Relative")
0041       mLevels.push_back(kL2);
0042     else if (ss == "L3Absolute")
0043       mLevels.push_back(kL3);
0044     else if (ss == "L2L3Residual")
0045       mLevels.push_back(kL2L3Res);
0046     else if (ss == "L4EMF")
0047       mLevels.push_back(kL4);
0048     else if (ss == "L5Flavor")
0049       mLevels.push_back(kL5);
0050     else if (ss == "L6SLB")
0051       mLevels.push_back(kL6);
0052     else if (ss == "L7Parton")
0053       mLevels.push_back(kL7);
0054     else if (ss == "L1FastJet")
0055       mLevels.push_back(kL1fj);
0056     else {
0057       std::stringstream sserr;
0058       sserr << "unknown correction level " << ss;
0059       handleError("FactorizedJetCorrectorCalculator", sserr.str());
0060     }
0061     mCorrectors.push_back(new SimpleJetCorrector(fParameters[i]));
0062     mBinTypes.push_back(mapping(mCorrectors[i]->parameters().definitions().binVar()));
0063     mParTypes.push_back(mapping(mCorrectors[i]->parameters().definitions().parVar()));
0064   }
0065 }
0066 
0067 //------------------------------------------------------------------------
0068 //--- FactorizedJetCorrectorCalculator destructor ----------------------------------
0069 //------------------------------------------------------------------------
0070 FactorizedJetCorrectorCalculator::~FactorizedJetCorrectorCalculator() {
0071   for (unsigned i = 0; i < mCorrectors.size(); i++)
0072     delete mCorrectors[i];
0073 }
0074 //------------------------------------------------------------------------
0075 //--- initialises the correctors -----------------------------------------
0076 //------------------------------------------------------------------------
0077 void FactorizedJetCorrectorCalculator::initCorrectors(const std::string& fLevels,
0078                                                       const std::string& fFiles,
0079                                                       const std::string& fOptions) {
0080   //---- Read the CorrectionLevels string and parse the requested sub-correction levels.
0081   std::vector<std::string> tmp = parseLevels(removeSpaces(fLevels));
0082   for (unsigned i = 0; i < tmp.size(); i++) {
0083     if (tmp[i] == "L1Offset")
0084       mLevels.push_back(kL1);
0085     else if (tmp[i] == "L1JPTOffset")
0086       mLevels.push_back(kL1JPT);
0087     else if (tmp[i] == "L2Relative")
0088       mLevels.push_back(kL2);
0089     else if (tmp[i] == "L3Absolute")
0090       mLevels.push_back(kL3);
0091     else if (tmp[i] == "L2L3Residual")
0092       mLevels.push_back(kL2L3Res);
0093     else if (tmp[i] == "L4EMF")
0094       mLevels.push_back(kL4);
0095     else if (tmp[i] == "L5Flavor")
0096       mLevels.push_back(kL5);
0097     else if (tmp[i] == "L6SLB")
0098       mLevels.push_back(kL6);
0099     else if (tmp[i] == "L7Parton")
0100       mLevels.push_back(kL7);
0101     else if (tmp[i] == "L1FastJet")
0102       mLevels.push_back(kL1fj);
0103     else {
0104       std::stringstream sserr;
0105       sserr << "unknown correction level " << tmp[i];
0106       handleError("FactorizedJetCorrectorCalculator", sserr.str());
0107     }
0108   }
0109   //---- Read the parameter filenames string and parse the requested sub-correction tags.
0110   std::vector<std::string> Files = parseLevels(removeSpaces(fFiles));
0111   //---- Read the Options string and define the FlavorOption and PartonOption.
0112   std::string FlavorOption = parseOption(removeSpaces(fOptions), "L5Flavor");
0113   std::string PartonOption = parseOption(removeSpaces(fOptions), "L7Parton");
0114   //---- Check the consistency between tags and requested sub-corrections.
0115   checkConsistency(tmp, Files);
0116   //---- Create instances of the requested sub-correctors.
0117   for (unsigned i = 0; i < mLevels.size(); i++) {
0118     if (mLevels[i] == kL1 || mLevels[i] == kL1JPT || mLevels[i] == kL2 || mLevels[i] == kL3 || mLevels[i] == kL4 ||
0119         mLevels[i] == kL6 || mLevels[i] == kL1fj)
0120       mCorrectors.push_back(new SimpleJetCorrector(Files[i]));
0121     else if (mLevels[i] == kL5 && FlavorOption.length() == 0)
0122       handleError("FactorizedJetCorrectorCalculator",
0123                   "must specify flavor option when requesting L5Flavor correction!");
0124     else if (mLevels[i] == kL5 && FlavorOption.length() > 0)
0125       mCorrectors.push_back(new SimpleJetCorrector(Files[i], FlavorOption));
0126     else if (mLevels[i] == kL7 && PartonOption.length() == 0)
0127       handleError("FactorizedJetCorrectorCalculator",
0128                   "must specify parton option when requesting L7Parton correction!");
0129     else if (mLevels[i] == kL7 && PartonOption.length() > 0)
0130       mCorrectors.push_back(new SimpleJetCorrector(Files[i], PartonOption));
0131     else {
0132       std::stringstream sserr;
0133       sserr << "unknown correction level " << tmp[i];
0134       handleError("FactorizedJetCorrectorCalculator", sserr.str());
0135     }
0136     mBinTypes.push_back(mapping(mCorrectors[i]->parameters().definitions().binVar()));
0137     mParTypes.push_back(mapping(mCorrectors[i]->parameters().definitions().parVar()));
0138   }
0139 }
0140 //------------------------------------------------------------------------
0141 //--- Mapping between variable names and variable types ------------------
0142 //------------------------------------------------------------------------
0143 std::vector<FactorizedJetCorrectorCalculator::VarTypes> FactorizedJetCorrectorCalculator::mapping(
0144     const std::vector<std::string>& fNames) const {
0145   std::vector<VarTypes> result;
0146   for (unsigned i = 0; i < fNames.size(); i++) {
0147     std::string ss = fNames[i];
0148     if (ss == "JetPt")
0149       result.push_back(kJetPt);
0150     else if (ss == "JetEta")
0151       result.push_back(kJetEta);
0152     else if (ss == "JetPhi")
0153       result.push_back(kJetPhi);
0154     else if (ss == "JetE")
0155       result.push_back(kJetE);
0156     else if (ss == "JetEMF")
0157       result.push_back(kJetEMF);
0158     else if (ss == "RelLepPt")
0159       result.push_back(kRelLepPt);
0160     else if (ss == "PtRel")
0161       result.push_back(kPtRel);
0162     else if (ss == "NPV")
0163       result.push_back(kNPV);
0164     else if (ss == "JetA")
0165       result.push_back(kJetA);
0166     else if (ss == "Rho")
0167       result.push_back(kRho);
0168     else if (ss == "JPTrawE")
0169       result.push_back(kJPTrawE);
0170     else if (ss == "JPTrawEt")
0171       result.push_back(kJPTrawEt);
0172     else if (ss == "JPTrawPt")
0173       result.push_back(kJPTrawPt);
0174     else if (ss == "JPTrawEta")
0175       result.push_back(kJPTrawEta);
0176     else if (ss == "JPTrawOff")
0177       result.push_back(kJPTrawOff);
0178     else {
0179       std::stringstream sserr;
0180       sserr << "unknown parameter name: " << ss;
0181       handleError("FactorizedJetCorrectorCalculator", sserr.str());
0182     }
0183   }
0184   return result;
0185 }
0186 //------------------------------------------------------------------------
0187 //--- Consistency checker ------------------------------------------------
0188 //------------------------------------------------------------------------
0189 void FactorizedJetCorrectorCalculator::checkConsistency(const std::vector<std::string>& fLevels,
0190                                                         const std::vector<std::string>& fTags) {
0191   //---- First check: the number of tags must be equal to the number of sub-corrections.
0192   if (fLevels.size() != fTags.size()) {
0193     std::stringstream sserr;
0194     sserr << "number of correction levels: " << fLevels.size() << " doesn't match # of tags: " << fTags.size();
0195     handleError("FactorizedJetCorrectorCalculator", sserr.str());
0196   }
0197   //---- Second check: each tag must contain the corresponding sub-correction level.
0198   for (unsigned int i = 0; i < fTags.size(); i++) {
0199     if ((int)fTags[i].find(fLevels[i]) < 0) {
0200       std::stringstream sserr;
0201       sserr << "inconsistent tag: " << fTags[i] << " for "
0202             << "the requested correction: " << fLevels[i];
0203       handleError("FactorizedJetCorrectorCalculator", sserr.str());
0204     }
0205   }
0206 }
0207 //------------------------------------------------------------------------
0208 //--- String parser ------------------------------------------------------
0209 //------------------------------------------------------------------------
0210 std::vector<std::string> FactorizedJetCorrectorCalculator::parseLevels(const std::string& ss) const {
0211   std::vector<std::string> result;
0212   unsigned int pos(0), j, newPos;
0213   int i;
0214   std::string tmp;
0215   //---- The ss string must be of the form: "LX:LY:...:LZ"
0216   while (pos < ss.length()) {
0217     tmp = "";
0218     i = ss.find(':', pos);
0219     if (i < 0 && pos == 0) {
0220       result.push_back(ss);
0221       pos = ss.length();
0222     } else if (i < 0 && pos > 0) {
0223       for (j = pos; j < ss.length(); j++)
0224         tmp += ss[j];
0225       result.push_back(tmp);
0226       pos = ss.length();
0227     } else {
0228       newPos = i;
0229       for (j = pos; j < newPos; j++)
0230         tmp += ss[j];
0231       result.push_back(tmp);
0232       pos = newPos + 1;
0233     }
0234   }
0235   return result;
0236 }
0237 //------------------------------------------------------------------------
0238 //--- String parser ------------------------------------------------------
0239 //------------------------------------------------------------------------
0240 std::string FactorizedJetCorrectorCalculator::parseOption(const std::string& ss, const std::string& type) const {
0241   std::string result;
0242   int pos1(-1), pos2(-1);
0243   //---- The ss string must be of the form: "type1:option1&type2:option2&..."
0244   pos1 = ss.find(type + ":");
0245   if (pos1 < 0)
0246     result = "";
0247   else {
0248     pos2 = ss.find('&', pos1 + type.length() + 1);
0249     if (pos2 < 0)
0250       result = ss.substr(pos1 + type.length() + 1, ss.length() - pos1 - type.length() - 1);
0251     else
0252       result = ss.substr(pos1 + type.length() + 1, pos2 - pos1 - type.length() - 1);
0253   }
0254   return result;
0255 }
0256 //------------------------------------------------------------------------
0257 //--- String manipulator -------------------------------------------------
0258 //------------------------------------------------------------------------
0259 std::string FactorizedJetCorrectorCalculator::removeSpaces(const std::string& ss) const {
0260   std::string result("");
0261   std::string aChar;
0262   for (unsigned int i = 0; i < ss.length(); i++) {
0263     aChar = ss.substr(i, 1);
0264     if (aChar != " ")
0265       result += aChar;
0266   }
0267   return result;
0268 }
0269 //------------------------------------------------------------------------
0270 //--- Returns the correction ---------------------------------------------
0271 //------------------------------------------------------------------------
0272 float FactorizedJetCorrectorCalculator::getCorrection(FactorizedJetCorrectorCalculator::VariableValues& iValues) const {
0273   std::vector<float>&& vv = getSubCorrections(iValues);
0274   return vv.back();
0275 }
0276 //------------------------------------------------------------------------
0277 //--- Returns the vector of subcorrections, up to a given level ----------
0278 //------------------------------------------------------------------------
0279 std::vector<float> FactorizedJetCorrectorCalculator::getSubCorrections(
0280     FactorizedJetCorrectorCalculator::VariableValues& iValues) const {
0281   float scale, factor;
0282   std::vector<float> factors;
0283   std::vector<float> vx, vy;
0284   factor = 1;
0285   for (unsigned int i = 0; i < mLevels.size(); i++) {
0286     vx = fillVector(mBinTypes[i], iValues);
0287     vy = fillVector(mParTypes[i], iValues);
0288     //if (mLevels[i]==kL2 || mLevels[i]==kL6)
0289     //mCorrectors[i]->setInterpolation(true);
0290     scale = mCorrectors[i]->correction(vx, vy);
0291     //----- For JPT jets, the offset is stored in order to be used later by the the L1JPTOffset
0292     if ((mLevels[i] == kL1 || mLevels[i] == kL1fj) && iValues.mIsJPTrawP4set && !iValues.mIsJPTrawOFFset) {
0293       iValues.setJPTrawOff(scale);
0294     } else if (mLevels[i] == kL6 && iValues.mAddLepToJet) {
0295       scale *= 1.0 + getLepPt(iValues) / iValues.mJetPt;
0296       iValues.mJetE *= scale;
0297       iValues.mJetPt *= scale;
0298       factor *= scale;
0299     } else {
0300       iValues.mJetE *= scale;
0301       iValues.mJetPt *= scale;
0302       factor *= scale;
0303     }
0304     factors.push_back(factor);
0305   }
0306   iValues.reset();
0307   return factors;
0308 }
0309 //------------------------------------------------------------------------
0310 //--- Reads the parameter names and fills a vector of floats -------------
0311 //------------------------------------------------------------------------
0312 std::vector<float> FactorizedJetCorrectorCalculator::fillVector(
0313     const std::vector<VarTypes>& fVarTypes, const FactorizedJetCorrectorCalculator::VariableValues& iValues) const {
0314   //  std::vector<VarTypes> fVarTypes = _fVarTypes;
0315   std::vector<float> result;
0316   for (unsigned i = 0; i < fVarTypes.size(); i++) {
0317     if (fVarTypes[i] == kJetEta) {
0318       if (!iValues.mIsJetEtaset)
0319         handleError("FactorizedJetCorrectorCalculator", "jet eta is not set");
0320       result.push_back(iValues.mJetEta);
0321     } else if (fVarTypes[i] == kNPV) {
0322       if (!iValues.mIsNPVset)
0323         handleError("FactorizedJetCorrectorCalculator", "number of primary vertices is not set");
0324       result.push_back(iValues.mNPV);
0325     } else if (fVarTypes[i] == kJetPt) {
0326       if (!iValues.mIsJetPtset)
0327         handleError("FactorizedJetCorrectorCalculator", "jet pt is not set");
0328       result.push_back(iValues.mJetPt);
0329     } else if (fVarTypes[i] == kJetPhi) {
0330       if (!iValues.mIsJetPhiset)
0331         handleError("FactorizedJetCorrectorCalculator", "jet phi is not set");
0332       result.push_back(iValues.mJetPhi);
0333     } else if (fVarTypes[i] == kJetE) {
0334       if (!iValues.mIsJetEset)
0335         handleError("FactorizedJetCorrectorCalculator", "jet E is not set");
0336       result.push_back(iValues.mJetE);
0337     } else if (fVarTypes[i] == kJetEMF) {
0338       if (!iValues.mIsJetEMFset)
0339         handleError("FactorizedJetCorrectorCalculator", "jet EMF is not set");
0340       result.push_back(iValues.mJetEMF);
0341     } else if (fVarTypes[i] == kJetA) {
0342       if (!iValues.mIsJetAset)
0343         handleError("FactorizedJetCorrectorCalculator", "jet area is not set");
0344       result.push_back(iValues.mJetA);
0345     } else if (fVarTypes[i] == kRho) {
0346       if (!iValues.mIsRhoset)
0347         handleError("FactorizedJetCorrectorCalculator", "fastjet density Rho is not set");
0348       result.push_back(iValues.mRho);
0349     } else if (fVarTypes[i] == kJPTrawE) {
0350       if (!iValues.mIsJPTrawP4set)
0351         handleError("FactorizedJetCorrectorCalculator", "raw CaloJet P4 for JPT is not set");
0352       result.push_back(iValues.mJPTrawE);
0353     } else if (fVarTypes[i] == kJPTrawEt) {
0354       if (!iValues.mIsJPTrawP4set)
0355         handleError("FactorizedJetCorrectorCalculator", "raw CaloJet P4 for JPT is not set");
0356       result.push_back(iValues.mJPTrawEt);
0357     } else if (fVarTypes[i] == kJPTrawPt) {
0358       if (!iValues.mIsJPTrawP4set)
0359         handleError("FactorizedJetCorrectorCalculator", "raw CaloJet P4 for JPT is not set");
0360       result.push_back(iValues.mJPTrawPt);
0361     } else if (fVarTypes[i] == kJPTrawEta) {
0362       if (!iValues.mIsJPTrawP4set)
0363         handleError("FactorizedJetCorrectorCalculator", "raw CaloJet P4 for JPT is not set");
0364       result.push_back(iValues.mJPTrawEta);
0365     } else if (fVarTypes[i] == kJPTrawOff) {
0366       if (!iValues.mIsJPTrawOFFset)
0367         handleError("FactorizedJetCorrectorCalculator", "Offset correction for JPT is not set");
0368       result.push_back(iValues.mJPTrawOff);
0369     } else if (fVarTypes[i] == kRelLepPt) {
0370       if (!iValues.mIsJetPtset || !iValues.mIsAddLepToJetset || !iValues.mIsLepPxset || !iValues.mIsLepPyset)
0371         handleError("FactorizedJetCorrectorCalculator", "can't calculate rel lepton pt");
0372       result.push_back(getRelLepPt(iValues));
0373     } else if (fVarTypes[i] == kPtRel) {
0374       if (!iValues.mIsJetPtset || !iValues.mIsJetEtaset || !iValues.mIsJetPhiset || !iValues.mIsJetEset ||
0375           !iValues.mIsAddLepToJetset || !iValues.mIsLepPxset || !iValues.mIsLepPyset || !iValues.mIsLepPzset)
0376         handleError("FactorizedJetCorrectorCalculator", "can't calculate ptrel");
0377       result.push_back(getPtRel(iValues));
0378     } else {
0379       std::stringstream sserr;
0380       sserr << "unknown parameter " << fVarTypes[i];
0381       handleError("FactorizedJetCorrectorCalculator", sserr.str());
0382     }
0383   }
0384   return result;
0385 }
0386 //------------------------------------------------------------------------
0387 //--- Calculate the lepPt (needed for the SLB) ---------------------------
0388 //------------------------------------------------------------------------
0389 float FactorizedJetCorrectorCalculator::getLepPt(const FactorizedJetCorrectorCalculator::VariableValues& iValues) const {
0390   return std::sqrt(iValues.mLepPx * iValues.mLepPx + iValues.mLepPy * iValues.mLepPy);
0391 }
0392 //------------------------------------------------------------------------
0393 //--- Calculate the relLepPt (needed for the SLB) ---------------------------
0394 //------------------------------------------------------------------------
0395 float FactorizedJetCorrectorCalculator::getRelLepPt(
0396     const FactorizedJetCorrectorCalculator::VariableValues& iValues) const {
0397   float lepPt = getLepPt(iValues);
0398   return (iValues.mAddLepToJet) ? lepPt / (iValues.mJetPt + lepPt) : lepPt / iValues.mJetPt;
0399 }
0400 //------------------------------------------------------------------------
0401 //--- Calculate the PtRel (needed for the SLB) ---------------------------
0402 //------------------------------------------------------------------------
0403 float FactorizedJetCorrectorCalculator::getPtRel(const FactorizedJetCorrectorCalculator::VariableValues& iValues) const {
0404   typedef ROOT::Math::LorentzVector<ROOT::Math::PtEtaPhiE4D<float> > PtEtaPhiELorentzVector;
0405   typedef ROOT::Math::DisplacementVector3D<ROOT::Math::Cartesian3D<float> > XYZVector;
0406   PtEtaPhiELorentzVector jet;
0407   XYZVector lep;
0408   jet.SetPt(iValues.mJetPt);
0409   jet.SetEta(iValues.mJetEta);
0410   jet.SetPhi(iValues.mJetPhi);
0411   jet.SetE(iValues.mJetE);
0412   lep.SetXYZ(iValues.mLepPx, iValues.mLepPy, iValues.mLepPz);
0413   float lj_x = (iValues.mAddLepToJet) ? lep.X() + jet.Px() : jet.Px();
0414   float lj_y = (iValues.mAddLepToJet) ? lep.Y() + jet.Py() : jet.Py();
0415   float lj_z = (iValues.mAddLepToJet) ? lep.Z() + jet.Pz() : jet.Pz();
0416   // absolute values squared
0417   float lj2 = lj_x * lj_x + lj_y * lj_y + lj_z * lj_z;
0418   if (lj2 <= 0) {
0419     std::stringstream sserr;
0420     sserr << "lepton+jet momentum sq is not positive: " << lj2;
0421     handleError("FactorizedJetCorrectorCalculator", sserr.str());
0422   }
0423   float lep2 = lep.X() * lep.X() + lep.Y() * lep.Y() + lep.Z() * lep.Z();
0424   // projection vec(mu) to lepjet axis
0425   float lepXlj = lep.X() * lj_x + lep.Y() * lj_y + lep.Z() * lj_z;
0426   // absolute value squared and normalized
0427   float pLrel2 = lepXlj * lepXlj / lj2;
0428   // lep2 = pTrel2 + pLrel2
0429   float pTrel2 = lep2 - pLrel2;
0430   return (pTrel2 > 0) ? std::sqrt(pTrel2) : 0.0;
0431 }
0432 
0433 //------------------------------------------------------------------------
0434 //--- Default FactorizedJetCorrectorCalculator::VariableValues constructor -------------------------
0435 //------------------------------------------------------------------------
0436 FactorizedJetCorrectorCalculator::VariableValues::VariableValues() {
0437   mJetEta = -9999;
0438   mJetPt = -9999;
0439   mJetPhi = -9999;
0440   mJetE = -9999;
0441   mJetEMF = -9999;
0442   mJetA = -9999;
0443   mRho = -9999;
0444   mLepPx = -9999;
0445   mLepPy = -9999;
0446   mLepPz = -9999;
0447   mNPV = -9999;
0448   mJPTrawE = -9999;
0449   mJPTrawEt = -9999;
0450   mJPTrawPt = -9999;
0451   mJPTrawEta = -9999;
0452   mJPTrawOff = -9999;
0453   mAddLepToJet = false;
0454   mIsNPVset = false;
0455   mIsJetEset = false;
0456   mIsJetPtset = false;
0457   mIsJetPhiset = false;
0458   mIsJetEtaset = false;
0459   mIsJetEMFset = false;
0460   mIsJetAset = false;
0461   mIsRhoset = false;
0462   mIsJPTrawP4set = false;
0463   mIsJPTrawOFFset = false;
0464   mIsLepPxset = false;
0465   mIsLepPyset = false;
0466   mIsLepPzset = false;
0467   mIsAddLepToJetset = false;
0468 }
0469 
0470 //------------------------------------------------------------------------
0471 //--- Setters ------------------------------------------------------------
0472 //------------------------------------------------------------------------
0473 void FactorizedJetCorrectorCalculator::VariableValues::setNPV(int fNPV) {
0474   mNPV = fNPV;
0475   mIsNPVset = true;
0476 }
0477 void FactorizedJetCorrectorCalculator::VariableValues::setJetEta(float fEta) {
0478   mJetEta = fEta;
0479   mIsJetEtaset = true;
0480 }
0481 //------------------------------------------------------------------------
0482 void FactorizedJetCorrectorCalculator::VariableValues::setJetPt(float fPt) {
0483   mJetPt = fPt;
0484   mIsJetPtset = true;
0485 }
0486 //------------------------------------------------------------------------
0487 void FactorizedJetCorrectorCalculator::VariableValues::setJetPhi(float fPhi) {
0488   mJetPhi = fPhi;
0489   mIsJetPhiset = true;
0490 }
0491 //------------------------------------------------------------------------
0492 void FactorizedJetCorrectorCalculator::VariableValues::setJetE(float fE) {
0493   mJetE = fE;
0494   mIsJetEset = true;
0495 }
0496 //------------------------------------------------------------------------
0497 void FactorizedJetCorrectorCalculator::VariableValues::setJetEMF(float fEMF) {
0498   mJetEMF = fEMF;
0499   mIsJetEMFset = true;
0500 }
0501 //------------------------------------------------------------------------
0502 void FactorizedJetCorrectorCalculator::VariableValues::setJetA(float fA) {
0503   mJetA = fA;
0504   mIsJetAset = true;
0505 }
0506 //------------------------------------------------------------------------
0507 void FactorizedJetCorrectorCalculator::VariableValues::setRho(float fRho) {
0508   mRho = fRho;
0509   mIsRhoset = true;
0510 }
0511 //------------------------------------------------------------------------
0512 void FactorizedJetCorrectorCalculator::VariableValues::setJPTrawP4(const TLorentzVector& fJPTrawP4) {
0513   mJPTrawE = fJPTrawP4.Energy();
0514   mJPTrawEt = fJPTrawP4.Et();
0515   mJPTrawPt = fJPTrawP4.Pt();
0516   mJPTrawEta = fJPTrawP4.Eta();
0517   mIsJPTrawP4set = true;
0518 }
0519 //------------------------------------------------------------------------
0520 void FactorizedJetCorrectorCalculator::VariableValues::setJPTrawOff(float fJPTrawOff) {
0521   mJPTrawOff = fJPTrawOff;
0522   mIsJPTrawOFFset = true;
0523 }
0524 //------------------------------------------------------------------------
0525 void FactorizedJetCorrectorCalculator::VariableValues::setLepPx(float fPx) {
0526   mLepPx = fPx;
0527   mIsLepPxset = true;
0528 }
0529 //------------------------------------------------------------------------
0530 void FactorizedJetCorrectorCalculator::VariableValues::setLepPy(float fPy) {
0531   mLepPy = fPy;
0532   mIsLepPyset = true;
0533 }
0534 //------------------------------------------------------------------------
0535 void FactorizedJetCorrectorCalculator::VariableValues::setLepPz(float fPz) {
0536   mLepPz = fPz;
0537   mIsLepPzset = true;
0538 }
0539 //------------------------------------------------------------------------
0540 void FactorizedJetCorrectorCalculator::VariableValues::setAddLepToJet(bool fAddLepToJet) {
0541   mAddLepToJet = fAddLepToJet;
0542   mIsAddLepToJetset = true;
0543 }
0544 
0545 void FactorizedJetCorrectorCalculator::VariableValues::reset() {
0546   mIsNPVset = false;
0547   mIsJetEset = false;
0548   mIsJetPtset = false;
0549   mIsJetPhiset = false;
0550   mIsJetEtaset = false;
0551   mIsJetEMFset = false;
0552   mIsJetAset = false;
0553   mIsRhoset = false;
0554   mIsJPTrawP4set = false;
0555   mIsJPTrawOFFset = false;
0556   mIsLepPxset = false;
0557   mIsLepPyset = false;
0558   mIsLepPzset = false;
0559   mAddLepToJet = false;
0560 }