diff --git a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/CMakeLists.txt b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/CMakeLists.txt index 5ce7e9ac8986aafcf6fac2ebe1bc206584bfe606..15d5161eb53fdc0983cd7fe33af1dacd00a4e4f2 100644 --- a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/CMakeLists.txt +++ b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/CMakeLists.txt @@ -42,13 +42,17 @@ atlas_add_library( FlavorTagDiscriminants Root/DL2Tool.cxx Root/customGetter.cxx Root/FlipTagEnums.cxx + Root/VRJetOverlapDecorator.cxx + Root/VRJetOverlapDecoratorTool.cxx Root/HbbTag.cxx + Root/HbbTagTool.cxx Root/HbbTagConfig.cxx Root/HbbGraphConfig.cxx Root/VRJetOverlapDecorator.cxx INCLUDE_DIRS ${LWTNN_INCLUDE_DIRS} PUBLIC_HEADERS FlavorTagDiscriminants LINK_LIBRARIES AsgTools xAODBase xAODJet xAODMuon 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..18ac4e7abe92d47cfbe9f761f4a521f5808329bd --- /dev/null +++ b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/HbbTagTool.h @@ -0,0 +1,37 @@ +// for text editors: this file is -*- C++ -*- +/* + Copyright (C) 2002-2020 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() override; + + // returns 0 for success + StatusCode decorate(const xAOD::JetContainer& jets) const override; + private: + HbbTagProperties m_props; + std::unique_ptr<HbbTag> m_hbb; + }; + +} +#endif diff --git a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/VRJetOverlapDecoratorTool.h b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/VRJetOverlapDecoratorTool.h new file mode 100644 index 0000000000000000000000000000000000000000..59e2f4651017b8f3e8d9cf75c881a1d93c6440cd --- /dev/null +++ b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/VRJetOverlapDecoratorTool.h @@ -0,0 +1,32 @@ +// for text editors: this file is -*- C++ -*- +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef VR_JET_OVERLAP_DECORATOR_TOOL_H +#define VR_JET_OVERLAP_DECORATOR_TOOL_H + +#include "AsgTools/AsgTool.h" +#include "JetInterface/IJetDecorator.h" + +class VRJetOverlapDecorator; + +namespace FlavorTagDiscriminants { + + class VRJetOverlapDecoratorTool : public asg::AsgTool, virtual public IJetDecorator + { + ASG_TOOL_CLASS(VRJetOverlapDecoratorTool, IJetDecorator ) + public: + VRJetOverlapDecoratorTool(const std::string& name); + ~VRJetOverlapDecoratorTool(); + + StatusCode initialize() override; + + // returns 0 for success + StatusCode decorate(const xAOD::JetContainer& jets) const override; + private: + std::unique_ptr<VRJetOverlapDecorator> m_dec; + }; + +} +#endif diff --git a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/README.md b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/README.md index 280db9f138ed6b33020fa4ef3907cc1e0a3e717d..c7d206cd2350f86d7f98ebeef8ace7333bf9d8ba 100644 --- a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/README.md +++ b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/README.md @@ -73,6 +73,30 @@ 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`. + + - `VRJetOverlapDecoratorTool`: ASG interface around the class + above. + ### 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..72ebd1d5de773ae276f5c8dab9b5edf6f2d00244 --- /dev/null +++ b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/HbbTagTool.cxx @@ -0,0 +1,32 @@ +/* + Copyright (C) 2002-2020 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::decorate(const xAOD::JetContainer& jets) const { + for (const xAOD::Jet* jet: jets) { + m_hbb->decorate(*jet); + } + return StatusCode::SUCCESS; + } + +} diff --git a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/VRJetOverlapDecoratorTool.cxx b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/VRJetOverlapDecoratorTool.cxx new file mode 100644 index 0000000000000000000000000000000000000000..a324d10be16531bea867028dee37109d9df038c2 --- /dev/null +++ b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/VRJetOverlapDecoratorTool.cxx @@ -0,0 +1,27 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +#include "FlavorTagDiscriminants/VRJetOverlapDecoratorTool.h" +#include "FlavorTagDiscriminants/VRJetOverlapDecorator.h" + +namespace FlavorTagDiscriminants { + + VRJetOverlapDecoratorTool::VRJetOverlapDecoratorTool(const std::string& name): + asg::AsgTool(name), + m_dec(nullptr) + { + } + VRJetOverlapDecoratorTool::~VRJetOverlapDecoratorTool() {} + + StatusCode VRJetOverlapDecoratorTool::initialize() { + m_dec.reset(new VRJetOverlapDecorator); + return StatusCode::SUCCESS; + } + + StatusCode VRJetOverlapDecoratorTool::decorate(const xAOD::JetContainer& jets) const { + m_dec->decorate(jets); + return StatusCode::SUCCESS; + } + +} diff --git a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/src/components/FlavorTagDiscriminants_entries.cxx b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/src/components/FlavorTagDiscriminants_entries.cxx index 626fb19f5b841e4b81c47fa6745f8aba6b6d77c2..4855fa22f06f3ceb583efc61ee61a9fb1018b59a 100644 --- a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/src/components/FlavorTagDiscriminants_entries.cxx +++ b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/src/components/FlavorTagDiscriminants_entries.cxx @@ -2,12 +2,16 @@ Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ +#include "FlavorTagDiscriminants/VRJetOverlapDecoratorTool.h" +#include "FlavorTagDiscriminants/HbbTagTool.h" #include "FlavorTagDiscriminants/DL2Tool.h" #include "FlavorTagDiscriminants/BTagAugmenterTool.h" #include "FlavorTagDiscriminants/BTagMuonAugmenterTool.h" using namespace FlavorTagDiscriminants; +DECLARE_COMPONENT(VRJetOverlapDecoratorTool) +DECLARE_COMPONENT(HbbTagTool) DECLARE_COMPONENT(DL2Tool) DECLARE_COMPONENT(BTagAugmenterTool) DECLARE_COMPONENT(BTagMuonAugmenterTool)