00001 #ifndef JETRESOLUTION_JERTOOL_H
00002 #define JETRESOLUTION_JERTOOL_H
00003
00004
00005 #include "TClass.h"
00006 #include "TFile.h"
00007 #include "TF1.h"
00008 #include "TGraph.h"
00009 #include "TGraphErrors.h"
00010 #include "TAxis.h"
00011
00012
00013 #include "AsgTools/AsgMetadataTool.h"
00014
00015
00016 #include "JetResolution/IJERTool.h"
00017
00018
00029 class JERTool : public virtual IJERTool,
00030 public asg::AsgMetadataTool
00031 {
00032
00034 ASG_TOOL_CLASS( JERTool, IJERTool )
00035
00036 public:
00037
00039 JERTool(const std::string& name);
00040
00042 JERTool(const JERTool&);
00043
00045 JERTool& operator=(const JERTool&) = delete;
00046
00048 ~JERTool();
00049
00050
00054
00056 virtual StatusCode initialize();
00057
00059
00063
00065 double getRelResolutionMC(const xAOD::Jet* jet);
00066
00068 double getRelResolutionData(const xAOD::Jet* jet);
00069
00071 double getUncertainty(const xAOD::Jet* jet,
00072 JER::Uncert errType = JER::JER_NP_ALL);
00073
00075
00076 protected:
00077
00080 StatusCode autoConfigure();
00081
00083 StatusCode parseConfiguration();
00085 StatusCode loadJERInputs();
00086
00090 int getEtaBin(const xAOD::Jet* jet);
00091
00092 private:
00093
00097
00098 static const unsigned int m_nEtaBins = 7;
00099
00100
00101 TAxis* m_etaAxis;
00102
00104 std::string m_fileName;
00105 int m_jetAlgo;
00106 std::string m_collectionName;
00107
00108
00109
00114 TGraph* m_jerNP[JER::JETALG_N][m_nEtaBins][JER::JER_NP_ALL];
00115
00116 };
00117
00118 #endif // JETRESOLUTION_JERTOOL_H