File indexing completed on 2024-04-06 12:02:18
0001 #ifndef SimpleJetCorrector_h
0002 #define SimpleJetCorrector_h
0003
0004 #include "CondFormats/Serialization/interface/Serializable.h"
0005
0006 #include <string>
0007 #include <vector>
0008
0009 #include "CondFormats/JetMETObjects/interface/JetCorrectorParameters.h"
0010
0011 #include "CommonTools/Utils/interface/FormulaEvaluator.h"
0012
0013 class JetCorrectorParameters;
0014
0015 class SimpleJetCorrector {
0016 public:
0017
0018 SimpleJetCorrector(const std::string& fDataFile, const std::string& fOption = "");
0019 SimpleJetCorrector(const JetCorrectorParameters& fParameters);
0020
0021 void setInterpolation(bool fInterpolation) { mDoInterpolation = fInterpolation; }
0022 float correction(const std::vector<float>& fX, const std::vector<float>& fY) const;
0023 const JetCorrectorParameters& parameters() const { return mParameters; }
0024
0025 private:
0026
0027 SimpleJetCorrector(const SimpleJetCorrector&);
0028 SimpleJetCorrector& operator=(const SimpleJetCorrector&);
0029 float invert(const double* args, const double* params) const;
0030 float correctionBin(unsigned fBin, const std::vector<float>& fY) const;
0031 unsigned findInvertVar();
0032 void setFuncParameters();
0033
0034 JetCorrectorParameters mParameters;
0035 reco::FormulaEvaluator mFunc;
0036 unsigned mInvertVar;
0037 bool mDoInterpolation;
0038 };
0039
0040 #endif