00001
00002
00003
00004
00005
00006 #ifndef FACTORIZED_JET_CORRECTOR_H
00007 #define FACTORIZED_JET_CORRECTOR_H
00008
00009 #include <vector>
00010 #include <string>
00011
00012 class SimpleJetCorrector;
00013 class JetCorrectorParameters;
00014
00015 class FactorizedJetCorrector
00016 {
00017 public:
00018 enum VarTypes {kJetPt,kJetEta,kJetPhi,kJetE,kJetEMF,kRelLepPt,kPtRel,kNPV,kJetA,kRho};
00019 enum LevelTypes {kL1,kL2,kL3,kL4,kL5,kL6,kL7,kL1fj};
00020 FactorizedJetCorrector();
00021 FactorizedJetCorrector(const std::string& fLevels, const std::string& fTags, const std::string& fOptions="");
00022 FactorizedJetCorrector(const std::vector<JetCorrectorParameters>& fParameters);
00023 ~FactorizedJetCorrector();
00024 void setNPV (int fNPV);
00025 void setJetEta (float fEta);
00026 void setJetPt (float fPt);
00027 void setJetE (float fE);
00028 void setJetPhi (float fE);
00029 void setJetEMF (float fEMF);
00030 void setJetA (float fA);
00031 void setRho (float fRho);
00032 void setLepPx (float fLepPx);
00033 void setLepPy (float fLepPy);
00034 void setLepPz (float fLepPz);
00035 void setAddLepToJet (bool fAddLepToJet);
00036 float getCorrection();
00037 std::vector<float> getSubCorrections();
00038
00039
00040 private:
00041
00042 FactorizedJetCorrector(const FactorizedJetCorrector&);
00043 FactorizedJetCorrector& operator= (const FactorizedJetCorrector&);
00044 float getLepPt() const;
00045 float getRelLepPt() const;
00046 float getPtRel() const;
00047 std::string parseOption(const std::string& ss, const std::string& type);
00048 std::string removeSpaces(const std::string& ss);
00049 std::vector<std::string> parseLevels(const std::string& ss);
00050 void initCorrectors(const std::string& fLevels, const std::string& fFiles, const std::string& fOptions);
00051 void checkConsistency(const std::vector<std::string>& fLevels, const std::vector<std::string>& fTags);
00052 std::vector<float> fillVector(std::vector<VarTypes> fVarTypes);
00053 std::vector<VarTypes> mapping(const std::vector<std::string>& fNames);
00054
00055 int mNPV;
00056 float mJetE;
00057 float mJetEta;
00058 float mJetPt;
00059 float mJetPhi;
00060 float mJetEMF;
00061 float mJetA;
00062 float mRho;
00063 float mLepPx;
00064 float mLepPy;
00065 float mLepPz;
00066 bool mAddLepToJet;
00067 bool mIsNPVset;
00068 bool mIsJetEset;
00069 bool mIsJetPtset;
00070 bool mIsJetPhiset;
00071 bool mIsJetEtaset;
00072 bool mIsJetEMFset;
00073 bool mIsJetAset;
00074 bool mIsRhoset;
00075 bool mIsLepPxset;
00076 bool mIsLepPyset;
00077 bool mIsLepPzset;
00078 bool mIsAddLepToJetset;
00079 std::vector<LevelTypes> mLevels;
00080 std::vector<std::vector<VarTypes> > mParTypes,mBinTypes;
00081 std::vector<SimpleJetCorrector*> mCorrectors;
00082
00083 std::vector<std::vector<float> > vvx;
00084 std::vector<std::vector<float> > vvy;
00085 std::vector<float> factors;
00086 };
00087 #endif