00001
00030 #ifndef _JERPROVIDER_
00031 #define _JERPROVIDER_
00032
00033 #include "TNamed.h"
00034 #include "TFile.h"
00035 #include "TF1.h"
00036 #include <TRandom.h>
00037 #include <iostream>
00038
00039 #include <cmath>
00040 #include <map>
00041
00042 using std::cout;
00043 using std::endl;
00044 using std::map;
00045
00046 class JERProvider : public TNamed
00047 {
00048
00049 public:
00050
00051
00052 JERProvider() { }
00053 JERProvider(std::string CollectionName, std::string MethodName = "Truth", std::string FileName="JERProviderPlots.root");
00054 virtual ~JERProvider();
00055
00056
00057 void init();
00058
00059
00060 TF1* getParam(double y);
00061
00062
00063 float getSigma(double pt, double y);
00064
00065
00066 float getUncert(double pt, double y);
00067
00068
00069 void setInputCollection(std::string CollectionName, std::string MethodName);
00070
00071 #ifdef JER_STANDALONE
00072 ClassDef(JERProvider,1);
00073 #endif
00074
00075 private:
00076
00077 static const int m_nParam = 6;
00078
00079 static const int m_nY = 6;
00080
00081
00082 std::string m_collectionName;
00083 std::string m_methodName;
00084 std::string m_fileName;
00085
00086
00087 bool m_isInit;
00088
00089
00090 TFile* m_inputFile;
00091
00092
00093 map<int,TF1*> m_jerFunc;
00094
00095
00096 map<int,float> m_param;
00097
00098
00099 float m_uncert;
00100
00101
00102 float m_offset;
00103
00104 };
00105
00106 #endif