00001 #ifndef ISOLATIONCORRECTION_ISOLATIONCORRECTIONTOOL_H 00002 #define ISOLATIONCORRECTION_ISOLATIONCORRECTIONTOOL_H 00003 00004 #include "AsgTools/AsgTool.h" 00005 #include "AsgTools/AsgMetadataTool.h" 00006 #include "AsgTools/AsgMessaging.h" 00007 #include "IsolationCorrections/IIsolationCorrectionTool.h" 00008 #include "IsolationCorrections/IsolationCorrection.h" 00009 00010 namespace CP { 00011 00012 class IsolationCorrectionTool : virtual public IIsolationCorrectionTool, 00013 virtual public CP::ISystematicsTool, 00014 public asg::AsgMetadataTool { 00015 // Create a proper constructor for Athena 00016 ASG_TOOL_CLASS2( IsolationCorrectionTool, IIsolationCorrectionTool, CP::ISystematicsTool) 00017 00018 public: 00019 IsolationCorrectionTool( const std::string& name ); 00020 virtual ~IsolationCorrectionTool(); 00021 00022 virtual StatusCode initialize() override; 00023 virtual StatusCode finalize() 00024 #ifndef XAOD_STANDALONE 00025 override 00026 #endif 00027 ; 00028 00029 virtual StatusCode beginInputFile() override; 00030 virtual StatusCode beginEvent() override; 00031 virtual StatusCode endInputFile() override; 00032 00033 // Apply correction to a modifyable Egamma object 00034 virtual CP::CorrectionCode applyCorrection(xAOD::Egamma&) override; 00035 00036 // This helps to correct for the (wrong) leakage at the analysis level 00037 virtual CP::CorrectionCode CorrectLeakage(xAOD::Egamma&) override; 00038 00039 // Create a corrected copy from a const Egamma object 00040 virtual CP::CorrectionCode correctedCopy( const xAOD::Egamma&, xAOD::Egamma*&) override; 00041 00042 //systematics 00043 // Which systematics have an effect on the tool's behaviour? 00044 virtual CP::SystematicSet affectingSystematics() const override; 00045 // Is the tool affected by a specific systematic? 00046 virtual bool isAffectedBySystematic( const CP::SystematicVariation& systematic ) const override; 00047 //Systematics to be used for physics analysis 00048 virtual CP::SystematicSet recommendedSystematics() const override; 00049 //Use specific systematic 00050 virtual CP::SystematicCode applySystematicVariation ( const CP::SystematicSet& systConfig ) override; 00051 00052 virtual float GetPtCorrectedIsolation(const xAOD::Egamma&, xAOD::Iso::IsolationType) override; 00053 virtual float GetPtCorrection(const xAOD::Egamma&, xAOD::Iso::IsolationType) const override; 00054 virtual float GetDDCorrection(const xAOD::Egamma&, xAOD::Iso::IsolationType) override; 00055 00056 private: 00057 StatusCode get_simflavour_from_metadata(PATCore::ParticleDataType::DataType& result) ; 00058 float GetEtaPointing(const xAOD::Egamma* input) {return m_isol_corr->GetEtaPointing(input);}; 00059 00060 std::string m_corr_file; 00061 std::string m_corr_ddshift_2015_file; 00062 std::string m_corr_ddshift_file; 00063 std::string m_corr_ddsmearing_file; 00064 IsolationCorrection* m_isol_corr; 00065 std::string m_tool_ver_str; 00066 bool m_usemetadata; 00067 bool m_is_mc; 00068 bool m_AFII_corr; 00069 std::string m_ddVersion; 00070 bool m_apply_dd, m_apply_ddDefault; 00071 bool m_correct_etcone; 00072 bool m_trouble_categories; 00073 bool m_metadata_retrieved; 00074 00075 // For systematcis 00076 CP::SystematicVariation m_systDDonoff; 00077 }; 00078 00079 } 00080 00081 #endif