00001 // Dear emacs, this is -*- c++ -*- 00002 // $Id: JetCalibrationToolExample3.h 299883 2014-03-28 17:34:16Z krasznaa $ 00003 #ifndef CPANALYSISEXAMPLES_JETCALIBRATIONTOOLEXAMPLE_H 00004 #define CPANALYSISEXAMPLES_JETCALIBRATIONTOOLEXAMPLE_H 00005 00006 // Rationale: temporary suppression of 00007 // unused-local-typedef warning in Boost header 00008 #pragma GCC diagnostic push 00009 #pragma GCC diagnostic ignored "-Wunused-local-typedefs" 00010 #include "boost/tuple/tuple.hpp" 00011 #pragma GCC diagnostic pop 00012 00013 // Framework include(s): 00014 #include "AsgTools/AsgTool.h" 00015 00016 // Local include(s): 00017 #include "CPAnalysisExamples/IJetCalibrationTool.h" 00018 #include "PATInterfaces/ISystematicsTool.h" 00019 #include "PATInterfaces/CorrectionTool.h" 00020 #include "xAODJet/JetContainer.h" 00021 00022 #include <boost/unordered_map.hpp> 00023 00024 namespace CP { 00025 00037 class JetCalibrationToolExample : public virtual IJetCalibrationTool, 00038 public virtual ISystematicsTool, 00039 public virtual CP::CorrectionTool< xAOD::JetContainer >, 00040 public asg::AsgTool 00041 { 00043 ASG_TOOL_CLASS2( JetCalibrationToolExample, CP::IJetCalibrationTool, CP::ISystematicsTool ) 00044 00045 public: 00047 JetCalibrationToolExample( const std::string& name ); 00048 00051 00053 virtual StatusCode initialize(); 00054 00056 00059 00061 virtual CorrectionCode applyCorrection( xAOD::Jet& object ); 00063 virtual CorrectionCode correctedCopy( const xAOD::Jet& input, 00064 xAOD::Jet*& output ); 00065 00067 00069 virtual bool 00070 isAffectedBySystematic( const SystematicVariation& systematic ) const; 00071 00073 virtual SystematicSet 00074 affectingSystematics() const; 00075 00077 virtual SystematicSet 00078 recommendedSystematics() const; 00079 00093 virtual SystematicCode applySystematicVariation 00094 ( const SystematicSet& systConfig ); 00095 00096 private: 00097 struct Calib 00098 { 00099 float m_calibrationFactor; 00100 }; 00101 boost::unordered_map<SystematicSet, Calib> m_calib; 00102 Calib* m_currentCalib; 00103 00104 }; // class JetCalibrationToolExample 00105 00106 } // namespace CP 00107 00108 #endif // CPANALYSISEXAMPLES_JETCALIBRATIONTOOLEXAMPLE1_H