ATLAS Offline Software
ClassifiedTrackTaggerTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 //
5 // ClassifiedTrackTaggerTool.h - Description
6 //
7 /*
8  Tool to give b-tagging score based on the track information
9  provided by the Track Classification Tool (TCT, InDetTrkInJetType)
10 
11  The three tracks with the highest probability of originating from a
12  B-hadron decay are used for the classification through a binary BDT,
13  which uses the three weights of the TCT for each of the three tracks
14  and the track multiplicity information through ptjet / ntrk
15 
16  Author: Katharina Voss
17  e-mail: katharina.voss@cern.ch
18 */
19 #ifndef Analysis_ClassifiedTrackTaggerTool_H
20 #define Analysis_ClassifiedTrackTaggerTool_H
21 
22 #include <vector>
24 #include "GaudiKernel/ToolHandle.h"
25 #include "xAODJet/JetContainer.h"
26 //Interface of InDetTrkInJetType (inside .h file of InDetTrkInJetType class)
28 
30 //
31 
32 class TLorentzVector;
33 class IChronoStatSvc;
34 namespace MVAUtils { class BDT; }
35 namespace InDet { class IInDetTrkInJetType; }
36 
37 namespace Analysis {
38 
39 //------------------------------------------------------------------------
40  class IClassifiedTrackTaggerTool : virtual public IAlgTool {
41  public:
43 //---------------------------------------------------------------------------
44 //Interface
45 
46  virtual float bJetWgts( const std::vector<const xAOD::TrackParticle*> & , const xAOD::Vertex &, const TLorentzVector &) const =0;
47  virtual void decorateJets(const std::vector<const xAOD::TrackParticle*> & , const xAOD::Vertex &, const xAOD::JetContainer & ) const =0;
48 
49  };
50 
51 
52 
53 
54  class ClassifiedTrackTaggerTool : public extends<AthAlgTool, IClassifiedTrackTaggerTool>
55  {
56  public:
57  /* Constructor */
58  ClassifiedTrackTaggerTool(const std::string& type, const std::string& name, const IInterface* parent);
59  /* Destructor */
60  virtual ~ClassifiedTrackTaggerTool() = default;
61 
62  virtual StatusCode initialize() override;
63  virtual StatusCode finalize() override;
64 
66  virtual float bJetWgts( const std::vector<const xAOD::TrackParticle*> & , const xAOD::Vertex &, const TLorentzVector &) const override;
68  virtual void decorateJets(const std::vector<const xAOD::TrackParticle*> & , const xAOD::Vertex &, const xAOD::JetContainer & ) const override;
69 
70 //------------------------------------------------------------------------------------------------------------------
71 // Private data and functions
72 //
73 
74  private:
75  //debugging
76  IChronoStatSvc* m_timingProfile{};
77 
78  //variables for retrieving the CTT classification score given the TCT weights
79  std::unique_ptr<MVAUtils::BDT> m_CTTBDT;
80 
81  //TCT Tool to retrieve TCT weights, which are input to CTT BDT
82  ToolHandle < InDet::IInDetTrkInJetType > m_trackClassificator;
83 
84  //delta R cone size determining the considered tracks around the jet axis
86 
87  //use updated TCT tool and CTT model trained with TCT weights from updated TCT tool
89 
90  //name of the BDT calibration file
91  std::string m_calibFileName;
92 
93  //name of the jet collection
94  std::string m_jetCollection;
95 
97  std::vector<int> GetSortedIndices(std::vector<std::vector<float>> unordered_vec) const;
98 
100  SG::WriteDecorHandleKey<xAOD::JetContainer> m_jetWriteDecorKey{this,"JetDecorKey","","WriteDecorHandleKey for adding CTT score to Jets"};
101 
102  };
103 
104 
105 
106 
107 } //end namespace
108 #endif
SG::WriteDecorHandleKey
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Definition: StoreGate/StoreGate/WriteDecorHandleKey.h:89
Analysis::ClassifiedTrackTaggerTool::m_trackClassificator
ToolHandle< InDet::IInDetTrkInJetType > m_trackClassificator
Definition: ClassifiedTrackTaggerTool.h:82
Analysis::ClassifiedTrackTaggerTool::m_deltaRConeSize
float m_deltaRConeSize
Definition: ClassifiedTrackTaggerTool.h:85
MVAUtils
Definition: InDetTrkInJetType.h:47
InDet
DUMMY Primary Vertex Finder.
Definition: VP1ErrorUtils.h:36
Analysis::ClassifiedTrackTaggerTool::m_calibFileName
std::string m_calibFileName
Definition: ClassifiedTrackTaggerTool.h:91
Analysis::ClassifiedTrackTaggerTool::finalize
virtual StatusCode finalize() override
Definition: ClassifiedTrackTaggerTool.cxx:84
InDetTrkInJetType.h
Analysis::ClassifiedTrackTaggerTool::m_timingProfile
IChronoStatSvc * m_timingProfile
Definition: ClassifiedTrackTaggerTool.h:76
Analysis::ClassifiedTrackTaggerTool
Definition: ClassifiedTrackTaggerTool.h:55
Analysis::ClassifiedTrackTaggerTool::m_jetCollection
std::string m_jetCollection
Definition: ClassifiedTrackTaggerTool.h:94
Analysis::ClassifiedTrackTaggerTool::ClassifiedTrackTaggerTool
ClassifiedTrackTaggerTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: ClassifiedTrackTaggerTool.cxx:18
Analysis::ClassifiedTrackTaggerTool::m_useFivePtJetBinTCT
bool m_useFivePtJetBinTCT
Definition: ClassifiedTrackTaggerTool.h:88
Analysis::ClassifiedTrackTaggerTool::bJetWgts
virtual float bJetWgts(const std::vector< const xAOD::TrackParticle * > &, const xAOD::Vertex &, const TLorentzVector &) const override
Method to retrieve the classifier score of the ClassifiedTrackTagger (CTT)
Definition: ClassifiedTrackTaggerTool.cxx:91
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthAlgTool.h
WriteDecorHandle.h
Handle class for adding a decoration to an object.
test_pyathena.parent
parent
Definition: test_pyathena.py:15
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
Analysis::ClassifiedTrackTaggerTool::decorateJets
virtual void decorateJets(const std::vector< const xAOD::TrackParticle * > &, const xAOD::Vertex &, const xAOD::JetContainer &) const override
Method to decorate the xAOD::Jet object with the CTT score.
Definition: ClassifiedTrackTaggerTool.cxx:138
Analysis
The namespace of all packages in PhysicsAnalysis/JetTagging.
Definition: BTaggingCnvAlg.h:20
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
Analysis::IClassifiedTrackTaggerTool::DeclareInterfaceID
DeclareInterfaceID(IClassifiedTrackTaggerTool, 1, 0)
Analysis::ClassifiedTrackTaggerTool::~ClassifiedTrackTaggerTool
virtual ~ClassifiedTrackTaggerTool()=default
Analysis::ClassifiedTrackTaggerTool::GetSortedIndices
std::vector< int > GetSortedIndices(std::vector< std::vector< float >> unordered_vec) const
Private method for sorting tracks according to the highest wgtB.
Definition: ClassifiedTrackTaggerTool.cxx:148
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
JetContainer.h
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
Analysis::IClassifiedTrackTaggerTool::bJetWgts
virtual float bJetWgts(const std::vector< const xAOD::TrackParticle * > &, const xAOD::Vertex &, const TLorentzVector &) const =0
Analysis::IClassifiedTrackTaggerTool
Definition: ClassifiedTrackTaggerTool.h:40
Analysis::ClassifiedTrackTaggerTool::m_jetWriteDecorKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_jetWriteDecorKey
The write key for adding CTT score to the jets.
Definition: ClassifiedTrackTaggerTool.h:100
Analysis::ClassifiedTrackTaggerTool::m_CTTBDT
std::unique_ptr< MVAUtils::BDT > m_CTTBDT
Definition: ClassifiedTrackTaggerTool.h:79
Analysis::IClassifiedTrackTaggerTool::decorateJets
virtual void decorateJets(const std::vector< const xAOD::TrackParticle * > &, const xAOD::Vertex &, const xAOD::JetContainer &) const =0
Analysis::ClassifiedTrackTaggerTool::initialize
virtual StatusCode initialize() override
Definition: ClassifiedTrackTaggerTool.cxx:36
xAOD::DiTauJetParameters::BDT
@ BDT
Definition: DiTauDefs.h:44