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