ATLAS Offline Software
BTagTool.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 /* **************************************************************************
6  BTagTool.h - Description
7  -------------------
8  begin : 10.03.04
9  authors : Andreas Wildauer (CERN PH-ATC), Fredrik Akesson (CERN PH-ATC)
10  email : andreas.wildauer@cern.ch, fredrik.akesson@cern.ch
11  comments: prototype implementation of a general jet tag strategy for the case of b-tagging
12  ***************************************************************************/
13 
14 #ifndef BTAGGING_BTAGTOOL_H
15 #define BTAGGING_BTAGTOOL_H
16 
18 #include "GaudiKernel/ToolHandle.h"
19 #include "BTagging/IBTagTool.h"
20 #include "JetTagTools/ITagTool.h"
22 
23 #include <string>
24 #include <vector>
25 #include <map>
26 #include <atomic>
27 
28 
30 namespace Analysis
31 {
32 
65  class BTagTool : public extends<AthAlgTool, IBTagTool>
66  {
67  public:
68 
70  BTagTool(const std::string&,const std::string&,const IInterface*);
71  virtual ~BTagTool() = default;
72 
74  virtual StatusCode initialize() override;
75  virtual StatusCode finalize() override;
76  virtual void finalizeHistos() override;
77 
78  virtual
79  StatusCode tagJet(const xAOD::Jet*, xAOD::BTagging*, const std::string &jetName, const xAOD::Vertex* vtx = 0) const override;
80  virtual
81  StatusCode tagJet(const xAOD::JetContainer * jetContainer, xAOD::BTaggingContainer * btaggingContainer, const std::string &jetName) const override;
82 
83  private:
84 
85  mutable std::atomic<unsigned int> m_nBeamSpotPvx{};
86  mutable std::atomic<unsigned int> m_nAllJets{};
87 
88  ToolHandleArray< ITagTool > m_bTagToolHandleArray;
89  std::map<std::string, ITagTool*> m_bTagTool;
90 
91  SG::ReadHandleKey<xAOD::VertexContainer> m_VertexCollectionName {this, "vxPrimaryCollectionName", "", "Input primary vertex container"};
92 
93  }; // End class
94 } // End namespace
95 #endif
96 
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
Analysis::BTagTool::m_VertexCollectionName
SG::ReadHandleKey< xAOD::VertexContainer > m_VertexCollectionName
Definition: BTagTool.h:91
Analysis::BTagTool
Definition: BTagTool.h:66
Analysis::BTagTool::m_nBeamSpotPvx
std::atomic< unsigned int > m_nBeamSpotPvx
Definition: BTagTool.h:85
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
Analysis::BTagTool::BTagTool
BTagTool(const std::string &, const std::string &, const IInterface *)
Constructors and destructors.
Definition: BTagTool.cxx:32
Analysis::BTagTool::m_bTagToolHandleArray
ToolHandleArray< ITagTool > m_bTagToolHandleArray
Definition: BTagTool.h:88
IBTagTool.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ITagTool.h
AthAlgTool.h
xAOD::BTagging_v1
Definition: BTagging_v1.h:39
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
Analysis::BTagTool::tagJet
virtual StatusCode tagJet(const xAOD::Jet *, xAOD::BTagging *, const std::string &jetName, const xAOD::Vertex *vtx=0) const override
Definition: BTagTool.cxx:78
JetAnalysisAlgorithmsTest_EMTopo_eljob.jetContainer
string jetContainer
Definition: JetAnalysisAlgorithmsTest_EMTopo_eljob.py:36
Analysis
The namespace of all packages in PhysicsAnalysis/JetTagging.
Definition: BTaggingCnvAlg.h:20
xAOD::Jet_v1
Class describing a jet.
Definition: Jet_v1.h:57
Analysis::BTagTool::initialize
virtual StatusCode initialize() override
Main routines specific to an ATHENA algorithm.
Definition: BTagTool.cxx:41
Analysis::BTagTool::m_nAllJets
std::atomic< unsigned int > m_nAllJets
Definition: BTagTool.h:86
Analysis::BTagTool::finalizeHistos
virtual void finalizeHistos() override
This method can be called in the finalize() method of the caller algorithm.
Definition: BTagTool.cxx:208
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
Analysis::BTagTool::m_bTagTool
std::map< std::string, ITagTool * > m_bTagTool
map to the btag tools
Definition: BTagTool.h:89
Analysis::BTagTool::finalize
virtual StatusCode finalize() override
Definition: BTagTool.cxx:201
Analysis::BTagTool::~BTagTool
virtual ~BTagTool()=default