ATLAS Offline Software
JetQGTaggerBDT.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 JETQGTAGGERBDT_H_
6 #define JETQGTAGGERBDT_H_
7 
11 
12 #include "TMVA/Tools.h"
13 #include "TMVA/Reader.h"
14 #include "TMVA/MethodCuts.h"
15 
16 namespace InDet {
17  class IInDetTrackSelectionTool;
18 }
19 
20 namespace CP {
21 
23  public JSSTaggerBase {
25 
26  public:
27 
29  JetQGTaggerBDT(const std::string& name);
30 
32  virtual StatusCode initialize() override;
33 
35  virtual StatusCode tag(const xAOD::Jet& jet) const override;
36 
37  private:
38 
40  float getScore( const xAOD::Jet& jet, asg::AcceptData &acceptData ) const;
41 
43  bool getJetProperties( const xAOD::Jet& jet, asg::AcceptData &acceptData ) const;
44 
45  bool getPrecomputedVariables( const xAOD::Jet& jet, asg::AcceptData &acceptData ) const;
46 
47  bool calculateVariables( const xAOD::Jet& jet, asg::AcceptData &acceptData ) const;
48 
49  bool isCorrectNumberOfTracks( int expectedNTracks, int nTracksFromGhostTracks ) const;
50 
52  struct Tagger {
53  std::unique_ptr<TMVA::Reader> tmva;
54  float pt;
55  float eta;
56  float ntracks;
57  float trackwidth;
58  float trackC1;
59  };
60 
62  std::string m_BDTmethod;
63 
65 
66  int m_mode;
67 
69  SG::WriteDecorHandleKey<xAOD::JetContainer> m_decScoreKey{this, "QGTaggerBDTScore", "QGTaggerBDTScore", "SG key for QGTaggerBDTScore"};
70 
71  };
72 
73 } /* namespace CP */
74 
75 #endif
CP::JetQGTaggerBDT::Tagger::eta
float eta
Definition: JetQGTaggerBDT.h:55
CP::JetQGTaggerBDT::m_BDTmethod
std::string m_BDTmethod
Definition: JetQGTaggerBDT.h:62
SG::WriteDecorHandleKey
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Definition: StoreGate/StoreGate/WriteDecorHandleKey.h:89
asg::AnaToolHandle< InDet::IInDetTrackSelectionTool >
CP::JetQGTaggerBDT::tag
virtual StatusCode tag(const xAOD::Jet &jet) const override
IBoostedJetTagger interface.
Definition: JetQGTaggerBDT.cxx:109
CP::JetQGTaggerBDT::JetQGTaggerBDT
JetQGTaggerBDT(const std::string &name)
Constructor.
Definition: JetQGTaggerBDT.cxx:15
CP::JetQGTaggerBDT::m_decScoreKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_decScoreKey
WriteDecorHandle keys.
Definition: JetQGTaggerBDT.h:69
InDet
DUMMY Primary Vertex Finder.
Definition: VP1ErrorUtils.h:36
CP::JetQGTaggerBDT::Tagger::trackwidth
float trackwidth
Definition: JetQGTaggerBDT.h:57
CP::JetQGTaggerBDT
Definition: JetQGTaggerBDT.h:23
CP
Select isolated Photons, Electrons and Muons.
Definition: Control/xAODRootAccess/xAODRootAccess/TEvent.h:48
SG::SlotSpecificObj
Maintain a set of objects, one per slot.
Definition: AthenaKernel/AthenaKernel/SlotSpecificObj.h:70
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
SlotSpecificObj.h
Dummy implementation of AthenaKernel/SlotSpecificObj.h.
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
CP::JetQGTaggerBDT::getJetProperties
bool getJetProperties(const xAOD::Jet &jet, asg::AcceptData &acceptData) const
Update the jet substructure variables for each jet to use in BDT.
Definition: JetQGTaggerBDT.cxx:166
ASG_TOOL_CLASS0
#define ASG_TOOL_CLASS0(CLASSNAME)
Definition: AsgToolMacros.h:62
CP::JetQGTaggerBDT::getScore
float getScore(const xAOD::Jet &jet, asg::AcceptData &acceptData) const
Retrieve BDT score.
Definition: JetQGTaggerBDT.cxx:150
CP::JetQGTaggerBDT::ATLAS_THREAD_SAFE
SG::SlotSpecificObj< Tagger > m_bdtTagger ATLAS_THREAD_SAFE
Definition: JetQGTaggerBDT.h:61
CP::JetQGTaggerBDT::m_trkSelectionTool
asg::AnaToolHandle< InDet::IInDetTrackSelectionTool > m_trkSelectionTool
Definition: JetQGTaggerBDT.h:64
JSSTaggerBase
Definition: JSSTaggerBase.h:39
CP::JetQGTaggerBDT::Tagger::pt
float pt
Definition: JetQGTaggerBDT.h:54
CP::JetQGTaggerBDT::m_mode
int m_mode
Definition: JetQGTaggerBDT.h:66
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
xAOD::Jet_v1
Class describing a jet.
Definition: Jet_v1.h:57
CP::JetQGTaggerBDT::getPrecomputedVariables
bool getPrecomputedVariables(const xAOD::Jet &jet, asg::AcceptData &acceptData) const
Definition: JetQGTaggerBDT.cxx:195
CP::JetQGTaggerBDT::Tagger::trackC1
float trackC1
Definition: JetQGTaggerBDT.h:58
CP::JetQGTaggerBDT::Tagger
Slot-specific TMVA tool and associated variables.
Definition: JetQGTaggerBDT.h:52
CP::JetQGTaggerBDT::Tagger::ntracks
float ntracks
Definition: JetQGTaggerBDT.h:56
CP::JetQGTaggerBDT::calculateVariables
bool calculateVariables(const xAOD::Jet &jet, asg::AcceptData &acceptData) const
Definition: JetQGTaggerBDT.cxx:230
CP::JetQGTaggerBDT::initialize
virtual StatusCode initialize() override
Run once at the start of the job to setup everything.
Definition: JetQGTaggerBDT.cxx:34
CP::JetQGTaggerBDT::isCorrectNumberOfTracks
bool isCorrectNumberOfTracks(int expectedNTracks, int nTracksFromGhostTracks) const
Definition: JetQGTaggerBDT.cxx:350
asg::AcceptData
Definition: AcceptData.h:30
checker_macros.h
Define macros for attributes used to control the static checker.
CP::JetQGTaggerBDT::Tagger::tmva
std::unique_ptr< TMVA::Reader > tmva
Definition: JetQGTaggerBDT.h:53
JSSTaggerBase.h