ATLAS Offline Software
BoostedXbbTag.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef jetsubstructureutils_boostedxbbtag_header
6 #define jetsubstructureutils_boostedxbbtag_header
7 
8 // @Author: Giordon Stark
9 // @Email: gstark@cern.ch
10 
11 // c++ includes
12 #include <set>
13 #include <string>
14 #include<memory>
15 
16 // EDM includes
17 #include <xAODJet/JetContainer.h>
18 #include <xAODMuon/MuonContainer.h>
20 
21 // forward-declare the ROOT includes
22 class TFile;
23 class TH2;
24 
25 namespace JetSubStructureUtils {
26  class BoostedXbbTag {
27  public:
28  // standard tool constructor
29  BoostedXbbTag(const std::string& working_point = "medium",
30 #ifdef ROOTCORE
31  const std::string& recommendations_file = "$ROOTCOREBIN/data/JetSubStructureUtils/config_13TeV_Htagging_MC15c_77WP_20160522.dat",
32 #else
33  const std::string& recommendations_file = "JetSubStructureUtils/data/config_13TeV_Htagging_MC15c_77WP_20160522.dat",
34 #endif
35  const std::string& boson_type = "Higgs",
36  const std::string& algorithm_name = "AK10LCTRIMF5R20",
37  int num_bTags = 2,
38  const std::string& decor_prefix = "",
39  bool debug = false,
40  bool verbose = false);
41 
42  // this is recommended usage, pass in jet, muons, get true/false
43  int result(const xAOD::Jet& jet, const xAOD::MuonContainer* muons) const;
44  // sometimes you don't have certain properties set so pass them in
45  // to select the appropriate tagging recommendation
46  int result(const xAOD::Jet& jet, const std::string& algorithm_name, const xAOD::MuonContainer* muons) const;
47 
48  // given the jet and configurations, return the string representation of the jet
49  // eg: AK10LCTRIMF5R20, CA10LCPRUNR50Z15, CA12LCBDRSM100R30Y15
50  std::pair<bool, std::string> get_algorithm_name(const xAOD::Jet& jet,
51  const xAOD::JetAlgorithmType::ID jet_algorithm,
52  const float size_parameter,
53  const xAOD::JetInput::Type jet_input,
54  const xAOD::JetTransform::Type jet_transform) const;
55 
56  // return a vector of track jets which are btagged by the tool
57  std::vector<const xAOD::Jet*> get_bTagged_trackJets(const xAOD::Jet& jet) const;
58  // return the matched muon object (nullptr if there is not one)
59  std::vector<const xAOD::Muon*> get_matched_muons(const xAOD::Jet& jet) const;
60  TLorentzVector get_correctedJet_TLV(const xAOD::Jet& jet) const;
61  std::pair<float, float> get_mass_window(const xAOD::Jet& jet) const;
62  std::pair<float, std::string> get_D2_pivot(const xAOD::Jet& jet) const;
63 
64  private:
65  std::string m_working_point;
67  std::string m_boson_type;
68  std::string m_algorithm_name;
70  std::string m_decor_prefix;
71  bool m_debug,
73 
74  float m_bTagCut,
78  std::vector<float> m_D2_params;
79  std::string m_D2_cut_direction;
80  std::unique_ptr<CP::MuonSelectionTool> m_muonSelectionTool;
81 
82  // this is so we don't error out in general, esp. for athena jobs
84 
85  // main 4 details for classifying a jet
90 
91  // for trimming
94 
95  // for pruning
98 
99  // for splitting
100  // static const SG::AuxElement::ConstAccessor<int> NSubjetMax ("NSubjetMax");
102  /* MuMax, YMin, RClus */
103  // static const SG::AuxElement::ConstAccessor<float> RClus ("RClus"); // defined above for trimming
106 
107  // for D2
112 
113  // generic accessors used
115 
116  // generic decorations used
122  };
123 }
124 
125 #endif
JetSubStructureUtils::BoostedXbbTag::get_correctedJet_TLV
TLorentzVector get_correctedJet_TLV(const xAOD::Jet &jet) const
Definition: BoostedXbbTag.cxx:626
JetSubStructureUtils::BoostedXbbTag::s_parent
static const SG::AuxElement::ConstAccessor< ElementLink< xAOD::JetContainer > > s_parent
Definition: BoostedXbbTag.h:114
JetSubStructureUtils::BoostedXbbTag::m_isB
const SG::AuxElement::Decorator< int > m_isB
Definition: BoostedXbbTag.h:117
JetSubStructureUtils::BoostedXbbTag::m_verbose
bool m_verbose
Definition: BoostedXbbTag.h:72
JetSubStructureUtils::BoostedXbbTag::s_D2
static const SG::AuxElement::ConstAccessor< float > s_D2
Definition: BoostedXbbTag.h:108
JetSubStructureUtils::BoostedXbbTag::m_matchedMuonsLink
const SG::AuxElement::Decorator< std::vector< ElementLink< xAOD::IParticleContainer > > > m_matchedMuonsLink
Definition: BoostedXbbTag.h:118
xAOD::JetTransform::Type
Type
Enum for types of jet transformations.
Definition: JetContainerInfo.h:112
JetSubStructureUtils::BoostedXbbTag::s_ECF1
static const SG::AuxElement::ConstAccessor< float > s_ECF1
Definition: BoostedXbbTag.h:109
JetSubStructureUtils::BoostedXbbTag::s_PtFrac
static const SG::AuxElement::ConstAccessor< float > s_PtFrac
Definition: BoostedXbbTag.h:93
JetSubStructureUtils::BoostedXbbTag::m_D2Pivot
const SG::AuxElement::Decorator< std::pair< float, std::string > > m_D2Pivot
Definition: BoostedXbbTag.h:121
JetSubStructureUtils::BoostedXbbTag::m_massWindow
const SG::AuxElement::Decorator< std::pair< float, float > > m_massWindow
Definition: BoostedXbbTag.h:120
JetSubStructureUtils::BoostedXbbTag::m_massMin
float m_massMin
Definition: BoostedXbbTag.h:76
JetSubStructureUtils::BoostedXbbTag
Definition: BoostedXbbTag.h:26
JetSubStructureUtils::BoostedXbbTag::s_RClus
static const SG::AuxElement::ConstAccessor< float > s_RClus
Definition: BoostedXbbTag.h:92
JetSubStructureUtils::BoostedXbbTag::s_AlgorithmType
static const SG::AuxElement::ConstAccessor< int > s_AlgorithmType
Definition: BoostedXbbTag.h:86
JetSubStructureUtils::BoostedXbbTag::m_boson_type
std::string m_boson_type
Definition: BoostedXbbTag.h:67
SG::ConstAccessor
Helper class to provide constant type-safe access to aux data.
Definition: ConstAccessor.h:54
JetSubStructureUtils::BoostedXbbTag::m_D2_params
std::vector< float > m_D2_params
Definition: BoostedXbbTag.h:78
JetSubStructureUtils::BoostedXbbTag::m_bTagCutCharm
float m_bTagCutCharm
Definition: BoostedXbbTag.h:75
JetSubStructureUtils::BoostedXbbTag::get_algorithm_name
std::pair< bool, std::string > get_algorithm_name(const xAOD::Jet &jet, const xAOD::JetAlgorithmType::ID jet_algorithm, const float size_parameter, const xAOD::JetInput::Type jet_input, const xAOD::JetTransform::Type jet_transform) const
Definition: BoostedXbbTag.cxx:203
JetSubStructureUtils::BoostedXbbTag::s_BDRS
static const SG::AuxElement::ConstAccessor< char > s_BDRS
Definition: BoostedXbbTag.h:101
JetSubStructureUtils
Definition: RCJet.h:49
JetSubStructureUtils::BoostedXbbTag::s_ECF3
static const SG::AuxElement::ConstAccessor< float > s_ECF3
Definition: BoostedXbbTag.h:111
JetSubStructureUtils::BoostedXbbTag::get_matched_muons
std::vector< const xAOD::Muon * > get_matched_muons(const xAOD::Jet &jet) const
Definition: BoostedXbbTag.cxx:609
JetSubStructureUtils::BoostedXbbTag::s_TransformType
static const SG::AuxElement::ConstAccessor< int > s_TransformType
Definition: BoostedXbbTag.h:89
JetSubStructureUtils::BoostedXbbTag::get_mass_window
std::pair< float, float > get_mass_window(const xAOD::Jet &jet) const
Definition: BoostedXbbTag.cxx:630
JetSubStructureUtils::BoostedXbbTag::m_algorithm_name
std::string m_algorithm_name
Definition: BoostedXbbTag.h:68
JetSubStructureUtils::BoostedXbbTag::s_ZCut
static const SG::AuxElement::ConstAccessor< float > s_ZCut
Definition: BoostedXbbTag.h:97
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
JetSubStructureUtils::BoostedXbbTag::m_muonSelectionTool
std::unique_ptr< CP::MuonSelectionTool > m_muonSelectionTool
Definition: BoostedXbbTag.h:80
SG::Decorator
Helper class to provide type-safe access to aux data.
Definition: Decorator.h:58
JetSubStructureUtils::BoostedXbbTag::m_massMax
float m_massMax
Definition: BoostedXbbTag.h:77
JetSubStructureUtils::BoostedXbbTag::result
int result(const xAOD::Jet &jet, const xAOD::MuonContainer *muons) const
Definition: BoostedXbbTag.cxx:301
JetSubStructureUtils::BoostedXbbTag::BoostedXbbTag
BoostedXbbTag(const std::string &working_point="medium", const std::string &recommendations_file="JetSubStructureUtils/data/config_13TeV_Htagging_MC15c_77WP_20160522.dat", const std::string &boson_type="Higgs", const std::string &algorithm_name="AK10LCTRIMF5R20", int num_bTags=2, const std::string &decor_prefix="", bool debug=false, bool verbose=false)
Definition: BoostedXbbTag.cxx:45
MuonSelectionTool.h
xAOD::JetAlgorithmType::ID
ID
//////////////////////////////////////// JetAlgorithmType::ID defines most common physics jet finding...
Definition: JetContainerInfo.h:29
xAOD::JetInput::Type
Type
Definition: JetContainerInfo.h:54
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
JetSubStructureUtils::BoostedXbbTag::s_RCut
static const SG::AuxElement::ConstAccessor< float > s_RCut
Definition: BoostedXbbTag.h:96
TH2
Definition: rootspy.cxx:373
JetSubStructureUtils::BoostedXbbTag::m_D2_cut_direction
std::string m_D2_cut_direction
Definition: BoostedXbbTag.h:79
debug
const bool debug
Definition: MakeUncertaintyPlots.cxx:53
JetSubStructureUtils::BoostedXbbTag::m_debug
bool m_debug
Definition: BoostedXbbTag.h:71
JetSubStructureUtils::BoostedXbbTag::s_MuMax
static const SG::AuxElement::ConstAccessor< float > s_MuMax
Definition: BoostedXbbTag.h:105
JetSubStructureUtils::BoostedXbbTag::m_bTagCut
float m_bTagCut
Definition: BoostedXbbTag.h:74
JetSubStructureUtils::BoostedXbbTag::m_bad_configuration
bool m_bad_configuration
Definition: BoostedXbbTag.h:83
MuonContainer.h
JetSubStructureUtils::BoostedXbbTag::m_decor_prefix
std::string m_decor_prefix
Definition: BoostedXbbTag.h:70
xAOD::Jet_v1
Class describing a jet.
Definition: Jet_v1.h:57
JetContainer.h
JetSubStructureUtils::BoostedXbbTag::m_recommendations_file
std::string m_recommendations_file
Definition: BoostedXbbTag.h:66
JetSubStructureUtils::BoostedXbbTag::s_SizeParameter
static const SG::AuxElement::ConstAccessor< float > s_SizeParameter
Definition: BoostedXbbTag.h:87
JetSubStructureUtils::BoostedXbbTag::s_InputType
static const SG::AuxElement::ConstAccessor< int > s_InputType
Definition: BoostedXbbTag.h:88
python.TriggerHandler.verbose
verbose
Definition: TriggerHandler.py:297
JetSubStructureUtils::BoostedXbbTag::get_bTagged_trackJets
std::vector< const xAOD::Jet * > get_bTagged_trackJets(const xAOD::Jet &jet) const
Definition: BoostedXbbTag.cxx:595
JetSubStructureUtils::BoostedXbbTag::m_correctedJetDecor
const SG::AuxElement::Decorator< TLorentzVector > m_correctedJetDecor
Definition: BoostedXbbTag.h:119
JetSubStructureUtils::BoostedXbbTag::s_YMin
static const SG::AuxElement::ConstAccessor< float > s_YMin
Definition: BoostedXbbTag.h:104
JetSubStructureUtils::BoostedXbbTag::m_working_point
std::string m_working_point
Definition: BoostedXbbTag.h:65
JetSubStructureUtils::BoostedXbbTag::get_D2_pivot
std::pair< float, std::string > get_D2_pivot(const xAOD::Jet &jet) const
Definition: BoostedXbbTag.cxx:634
JetSubStructureUtils::BoostedXbbTag::s_ECF2
static const SG::AuxElement::ConstAccessor< float > s_ECF2
Definition: BoostedXbbTag.h:110
JetSubStructureUtils::BoostedXbbTag::m_num_bTags
int m_num_bTags
Definition: BoostedXbbTag.h:69