00001
00002
00003
00004
00006 #ifndef JETCALIBTOOLS_APPLYJETCALIBRATION_H
00007 #define JETCALIBTOOLS_APPLYJETCALIBRATION_H 1
00008
00009 #include <string.h>
00010
00011 #include <TString.h>
00012 #include <TEnv.h>
00013
00014 #include "AsgTools/AsgTool.h"
00015
00016 #include "xAODEventInfo/EventInfo.h"
00017 #include "xAODTracking/VertexContainer.h"
00018 #include "xAODEventShape/EventShape.h"
00019
00020
00021 #include "JetCalibTools/IJetCalibrationTool.h"
00022 #include "JetCalibTools/JetCalibrationToolBase.h"
00023 #include "JetCalibTools/CalibrationMethods/JetPileupCorrection.h"
00024 #include "JetCalibTools/CalibrationMethods/ResidualOffsetCorrection.h"
00025 #include "JetCalibTools/CalibrationMethods/EtaJESCorrection.h"
00026 #include "JetCalibTools/CalibrationMethods/GlobalSequentialCorrection.h"
00027 #include "JetCalibTools/CalibrationMethods/InsituDataCorrection.h"
00028 #include "JetCalibTools/CalibrationMethods/JMSCorrection.h"
00029
00030 class JetPileupCorrection;
00031 class ResidualOffsetCorrection;
00032 class EtaJESCorrection;
00033 class GlobalSequentialCorrection;
00034 class InsituDataCorrection;
00035 class JMSCorrection;
00036
00037 class JetCalibrationTool
00038 : virtual public ::JetCalibrationToolBase {
00039
00040 ASG_TOOL_CLASS2(JetCalibrationTool, IJetCalibrationTool, IJetModifier)
00041
00042 public:
00043
00045 JetCalibrationTool(const std::string& name);
00046
00048 virtual ~JetCalibrationTool();
00049
00050 enum jetScale { EM, LC, PFLOW };
00051
00052
00053 virtual StatusCode initializeTool(const std::string& name);
00054
00055
00056 StatusCode initialize();
00057
00058
00059 StatusCode finalize();
00060
00062 virtual StatusCode applyCalibration(xAOD::Jet& jet) const;
00063
00064 virtual CP::CorrectionCode applyCorrection(xAOD::Jet& jet);
00065
00066 virtual int modify(xAOD::JetContainer&) const;
00067 virtual int modifyJet(xAOD::Jet&) const;
00068
00069 protected:
00071 virtual StatusCode calibrateImpl(xAOD::Jet& jet, JetEventInfo& jetEventInfo) const;
00072
00073
00074 private:
00075
00076 virtual StatusCode initializeEvent(JetEventInfo& jetEventInfo) const;
00077
00078 StatusCode getCalibClass(const std::string& name, TString calibration);
00079
00080
00081 private:
00082
00083 std::string m_jetAlgo;
00084 std::string m_config;
00085 std::string m_calibSeq;
00086 std::string m_calibAreaTag;
00087 bool m_devMode;
00088 bool m_isData;
00089 bool m_mass;
00090 bool m_timeDependentCalib;
00091 bool m_originCorrectedClusters;
00092 std::string m_rhoKey;
00093 std::string m_dir;
00094 std::string m_eInfoName;
00095 std::vector<TString> m_timeDependentInsituConfigs;
00096 std::vector<double> m_runBins;
00097 bool m_doSetDetectorEta;
00098
00099
00100 TEnv * m_globalConfig;
00101 std::vector<TEnv*> m_globalTimeDependentConfigs;
00102
00103
00104 jetScale m_jetScale;
00105 bool m_doJetArea;
00106 bool m_doResidual;
00107 bool m_doOrigin;
00108 bool m_doGSC;
00109
00110
00111 std::vector<JetCalibrationToolBase*> m_calibClasses;
00112 JetPileupCorrection * m_jetPileupCorr;
00113 EtaJESCorrection * m_etaJESCorr;
00114 GlobalSequentialCorrection * m_globalSequentialCorr;
00115 InsituDataCorrection * m_insituDataCorr;
00116 std::vector<JetCalibrationToolBase*> m_insituTimeDependentCorr;
00117 JMSCorrection * m_jetMassCorr;
00118
00119 };
00120
00121 #endif //> !JETCALIBTOOLS_APPLYJETCALIBRATION_H