diff --git a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/CMakeLists.txt b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/CMakeLists.txt index 2bdd3caafb8832f07c1fe808b6fcd471ad0bbd9c..ec85e163a461d26df1071ed2ee18c1665212ee37 100644 --- a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/CMakeLists.txt +++ b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/CMakeLists.txt @@ -43,11 +43,13 @@ atlas_add_library( FlavorTagDiscriminants Root/FlipTagEnums.cxx Root/VRJetOverlapDecorator.cxx Root/HbbTag.cxx + Root/HbbTagTool.cxx Root/HbbTagConfig.cxx Root/HbbGraphConfig.cxx INCLUDE_DIRS ${LWTNN_INCLUDE_DIRS} PUBLIC_HEADERS FlavorTagDiscriminants LINK_LIBRARIES AsgTools xAODBase xAODJet xAODEventInfo PathResolver + JetInterface ${LWTNN_LIBRARIES}) if (NOT XAOD_STANDALONE) diff --git a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/FlavorTagDiscriminantsDict.h b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/FlavorTagDiscriminantsDict.h index 0d8d0d56eda9c332c25be25b01f8a24cd6968690..6fa9f8866181ee704541d84809adcd30c44a5b2a 100644 --- a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/FlavorTagDiscriminantsDict.h +++ b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/FlavorTagDiscriminantsDict.h @@ -8,6 +8,7 @@ // This file includes all the header files that you need to create // dictionaries for. +#include "FlavorTagDiscriminants/HbbTagTool.h" #include "FlavorTagDiscriminants/DL2Tool.h" #include "FlavorTagDiscriminants/BTagAugmenterTool.h" #include "FlavorTagDiscriminants/BTagMuonAugmenterTool.h" diff --git a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/HbbTag.h b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/HbbTag.h index 43f41eb9173242f955fdb56c6a1e565705f2f593..2ce72c57439abae49ad663a71fcd00fe6e27dc23 100644 --- a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/HbbTag.h +++ b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/HbbTag.h @@ -23,6 +23,7 @@ namespace FlavorTagDiscriminants { { public: HbbTag(const HbbTagConfig& config); + ~HbbTag(); void decorate(const xAOD::Jet& jet) const; private: diff --git a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/HbbTagTool.h b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/HbbTagTool.h new file mode 100644 index 0000000000000000000000000000000000000000..38c15667ecb2eab8ba060dd9c38012a53d5fe6bf --- /dev/null +++ b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/HbbTagTool.h @@ -0,0 +1,38 @@ +// for text editors: this file is -*- C++ -*- +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef HBB_TAG_TOOL_H +#define HBB_TAG_TOOL_H + +#include "AsgTools/AsgTool.h" +#include "JetInterface/IJetDecorator.h" + +namespace FlavorTagDiscriminants { + + class HbbTag; + + struct HbbTagProperties { + std::string nnFile; + }; + + class HbbTagTool : public asg::AsgTool, virtual public IJetDecorator + { + ASG_TOOL_CLASS(HbbTagTool, IJetDecorator ) + public: + HbbTagTool(const std::string& name); + ~HbbTagTool(); + + StatusCode initialize(); + StatusCode finalize(); + + // returns 0 for success + int decorate(const xAOD::JetContainer& jets) const; + private: + HbbTagProperties m_props; //! + std::unique_ptr<HbbTag> m_hbb; //! + }; + +} +#endif diff --git a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/README.md b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/README.md index 280db9f138ed6b33020fa4ef3907cc1e0a3e717d..5c8ab24ef681293d919303f36ac442233c3c3e58 100644 --- a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/README.md +++ b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/README.md @@ -73,6 +73,26 @@ Some components of Hbb tagging also live here. These include: flavor tagging inputs. It also uses `HbbGraphConfig` and `HbbConstants`. + - `HbbTagTool`: ASG Tool interface around `HbbTag`. + + - `VRJetOverlapDecorator`: Adds decorations which quantify the + degree of overlap between VR subjets. The validity of flavor + tagging calibrations depends on this overlap being small. Two + numbers in particular are added: + + - `relativeDeltaRToVRJet`: smallest value of `dR / jet_radius`, + considering this jet paired with every other jet in the + event. Here `dR` is the angular separation between the two + jets, while `jet_radius` is the smallest the of the two jet + radii. + + - `deltaRToVRJet`: corresponds to the `dR` to whatever jet has + the smallest _relative_ delta R. This isn't necessarily the + smallest delta R. + + A smaller value in either of these corresponds to a larger + overlap. In general we recommend removing any jet where + `relativeDeltaRToVRJet < 1.0`. ### Other Files ### diff --git a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/HbbTag.cxx b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/HbbTag.cxx index 8e5a310342b4b6338ffdc659f8ec11fed7bedec2..f2acff73d034e0887f130754c878c5782fe717ec 100644 --- a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/HbbTag.cxx +++ b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/HbbTag.cxx @@ -87,6 +87,7 @@ namespace FlavorTagDiscriminants { m_outputs.emplace_back(node_name, node_writer); } } + HbbTag::~HbbTag() {} void HbbTag::decorate(const xAOD::Jet& jet) const { namespace hk = hbb_key; diff --git a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/HbbTagTool.cxx b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/HbbTagTool.cxx new file mode 100644 index 0000000000000000000000000000000000000000..6a5c509a0144ca037b059cfa5f34cc8fc11e1da2 --- /dev/null +++ b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/HbbTagTool.cxx @@ -0,0 +1,35 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +#include "FlavorTagDiscriminants/HbbTagTool.h" +#include "FlavorTagDiscriminants/HbbTag.h" + +namespace FlavorTagDiscriminants { + + HbbTagTool::HbbTagTool(const std::string& name): + asg::AsgTool(name), + m_props(), + m_hbb(nullptr) + { + declareProperty("nnFile", m_props.nnFile); + } + HbbTagTool::~HbbTagTool() {} + + StatusCode HbbTagTool::initialize() { + ATH_MSG_INFO("Initialize HbbTag from: " + m_props.nnFile); + m_hbb.reset(new HbbTag(HbbTagConfig(m_props.nnFile))); + return StatusCode::SUCCESS; + } + StatusCode HbbTagTool::finalize() { + return StatusCode::SUCCESS; + } + + int HbbTagTool::decorate(const xAOD::JetContainer& jets) const { + for (const auto& jet: jets) { + m_hbb->decorate(*jet); + } + return 0; // 0 means success + } + +} diff --git a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/src/components/FlavorTagDiscriminants_entries.cxx b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/src/components/FlavorTagDiscriminants_entries.cxx index fadc6d3032ea4b1e1b38dce195208dc01ed96a48..fb8aea28814ad0e58083dee2298ff998becdd232 100644 --- a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/src/components/FlavorTagDiscriminants_entries.cxx +++ b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/src/components/FlavorTagDiscriminants_entries.cxx @@ -4,15 +4,18 @@ #include "GaudiKernel/DeclareFactoryEntries.h" +#include "FlavorTagDiscriminants/HbbTagTool.h" #include "FlavorTagDiscriminants/DL2Tool.h" #include "FlavorTagDiscriminants/BTagAugmenterTool.h" #include "FlavorTagDiscriminants/BTagMuonAugmenterTool.h" +DECLARE_NAMESPACE_TOOL_FACTORY(FlavorTagDiscriminants, HbbTagTool) DECLARE_NAMESPACE_TOOL_FACTORY(FlavorTagDiscriminants, DL2Tool) DECLARE_NAMESPACE_TOOL_FACTORY(FlavorTagDiscriminants, BTagAugmenterTool) DECLARE_NAMESPACE_TOOL_FACTORY(FlavorTagDiscriminants, BTagMuonAugmenterTool) DECLARE_FACTORY_ENTRIES(FlavorTagDiscriminants) { + DECLARE_NAMESPACE_TOOL(FlavorTagDiscriminants, HbbTagTool) DECLARE_NAMESPACE_TOOL(FlavorTagDiscriminants, DL2Tool) DECLARE_NAMESPACE_TOOL(FlavorTagDiscriminants, BTagAugmenterTool) DECLARE_NAMESPACE_TOOL(FlavorTagDiscriminants, BTagMuonAugmenterTool)