00001
00053 #ifndef _JESUNCERTAINTYPROVIDER_
00054 #define _JESUNCERTAINTYPROVIDER_
00055
00056 #include "TNamed.h"
00057 #include "TFile.h"
00058 #include "TH2D.h"
00059 #include <iostream>
00060 #include <string>
00061 #include <sstream>
00062 #include <cmath>
00063 #include <map>
00064 using std::cout;
00065 using std::map;
00066
00067 class JESUncertaintyProvider : public TNamed
00068 {
00069
00070 public:
00071
00072 enum Components {
00073
00074 CALORIMETER = 1,
00075 NOISETHRESHOLDS = 2,
00076 PERUGIATUNE = 4,
00077 ALPGENHERWIGJIMMY = 8,
00078 ETAINTERCALIBRATION = 16,
00079 CLOSURE = 32,
00080 PILEUP = 64,
00081
00082
00083 NOCLOSURE = 95,
00084 NOPILEUP = 63,
00085 NOPILEUPNOCLOSURE = 31,
00086 ALL = 127
00087 };
00088
00089
00090
00091 JESUncertaintyProvider(std::string CollectionName="AntiKt6TopoJetsEM", std::string FileName="JESUncertainty.root");
00092 ~JESUncertaintyProvider();
00093
00094
00095 double getRelUncert(double pT, double Eta, Components UncertComps = JESUncertaintyProvider::NOPILEUP, unsigned int nVtx=1);
00096 double getAbsUncert(double pT, double Eta, Components UncertComps = JESUncertaintyProvider::NOPILEUP, unsigned int nVtx=1);
00097
00098
00099
00100
00101
00102 virtual void init();
00103
00104
00105 virtual TFile* openInputFile(std::string FileName = "JESUncertainty.root");
00106
00107 #ifdef JES_STANDALONE
00108 ClassDef(JESUncertaintyProvider,1);
00109 #endif //JES_STANDALONE
00110
00111 protected:
00112
00113
00114 bool setInputCollection(std::string CollectionName);
00115
00116
00117 static const unsigned int m_nUncertainties_EMJES = 7;
00118 static const unsigned int m_nUncertainties_inSitu = 2;
00119
00120
00121 static const unsigned int m_nVertices = 7;
00122
00123
00124 const double m_GeV;
00125
00126
00127 map<int,TH2D*> m_uncGraph;
00128
00129
00130 map<int,TH2D*> m_pileupUncGraph;
00131
00132
00133 TFile* m_inputFile;
00134
00135
00136 double getComponents(int currentBin, Components UncertComps, unsigned int nVtx = 1);
00137
00138
00139 std::string m_collectionName;
00140
00141
00142 std::string m_fileName;
00143
00144
00145 bool m_isInit;
00146
00147
00148 bool m_doInSitu;
00149
00150
00151 };
00152
00153
00154 #endif