ATLAS Offline Software
InDetHardScatterSelectionTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef INDETHARDSCATTERSELECTIONTOOL_INDETHARDSCATTERSELECTIONTOOL_H
6 #define INDETHARDSCATTERSELECTIONTOOL_INDETHARDSCATTERSELECTIONTOOL_H
7 
8 // Framework include(s):
9 #include "AsgTools/AsgTool.h"
10 #include "AthLinks/ElementLink.h"
11 #include "GaudiKernel/ToolHandle.h"
14 
15 // EDM include(s):
16 #include "xAODTracking/VertexFwd.h"
19 #include "xAODJet/JetFwd.h"
20 #include "xAODJet/JetContainer.h"
22 
23 // Tool include(s)
26 
27 
28 // STL includes:
29 #include <memory>
30 #include <string>
31 
32 // Forward declaration(s):
33 namespace InDet {
34  class IInDetTrackSelectionTool;
35 }
36 
42 namespace InDet {
43 
46  : public asg::AsgTool,
47  public virtual IInDetHardScatterSelectionTool
48  {
49 
51 
52 
53  // Public methods:
55  public:
56 
59 
60  enum Mode {
61  SumPt2 = 0,
62  SumPt = 1,
63  SumPtw = 2,
64  HSGN2 = 3,
65  };
66 
68 
70 
71  class Sum {
72  public:
73  virtual ~Sum() = default;
76  // the first argument a is previous cumulative sum, b is track_pT, third argument is jet_pT for sumpTw and fourth argument is the mindR for sumpTw
78  virtual float add(const float a, const float b, const float, const float )const = 0 ;
79  };
80 
82 
85 
87  InDetHardScatterSelectionTool(const std::string& name);
88 
91 
93 
96 
98  virtual StatusCode initialize() override;
99 
101  virtual StatusCode finalize() override;
102 
104 
107 
109  const xAOD::Vertex* getHardScatter(const xAOD::VertexContainer* vtxCont) const override;
110  const xAOD::Vertex* getHardScatter() const override;
111 
115 
117 
119  // Private data:
121 
122  private:
123 
126 
128  std::unique_ptr<Sum> m_sum;
129 
131  bool m_doTrkSelection = false;
132 
134  SG::ReadHandleKey<xAOD::EventInfo> m_evtInfoKey {this, "EventInfo", "EventInfo", "EventInfo key"};
135  SG::ReadHandleKey<xAOD::VertexContainer> m_vtxContKey{this, "VertexContainer", "PrimaryVertices", "Name of the primary vertex container"};
136  SG::ReadHandleKey<xAOD::JetContainer> m_jetContKey{ this, "JetContainer", "AntiKt4EMTopoJets", "Name of the jet container" };
137 
138  BooleanProperty m_redoHardScatter{ this, "RedoHardScatter", false, "If true, redo the hardscatter selection using sumpt2 or sumpt or sumptw"};
139  IntegerProperty m_mode{ this, "SelectionMode", InDet::InDetHardScatterSelectionTool::Mode::SumPt2, "Mode for selecting the hardscatter: sumpt2[0] or sumpt[1] or sumptw[2]"};
140  ToolHandle<InDet::IInDetTrackSelectionTool> m_trkSelectTool{this, "TrackSelectionTool", "InDet::InDetTrackSelectionTool/TrackSelectionTool", "Track selection tool to use"};
141  BooleanProperty m_returnDeco{ this, "ReturnDeco", false, "If true, return the hardscatter as the vertex decorated with some boolean"};
142  StringProperty m_hardScatterDeco{this, "HardScatterLinkDeco", "hardScatterVertexLink", "The decoration name of the ElementLink to the hardscatter vertex (applied to xAOD::EventInfo)"};
143  FloatProperty m_jetMinPt{this, "jetMinPt", 15000.0, "minimum jet pt"};
144  FloatProperty m_jetTrkMaxDr{this, "jetTrkMaxDr", 0.8, "max dR between jet & Trk"};
145  FloatProperty m_trkMaxPt{this, "trkMaxPt", 10045000, "max track pt"};
146 
148  SG::ReadDecorHandleKey<xAOD::EventInfo> m_hardScatterDecoKey{this, "VertexScatterKey", "" , "Overwrriten in the configuration step by the <HardScatterLinkDeco> property"};
149 
151  SG::ReadDecorHandleKey<xAOD::VertexContainer> m_gnnScoreKey {this, "GNNKey", "PrimaryVertices.HSGN2_phsvertex", "Name of the hard-scatter GNN decoration"};
152 
154 
155  }; // class: InDetHardScatterSelectionTool
156 } // namespace: InDet
157 
158 #endif // end: INDETHARDSCATTERSELECTIONTOOL_INDETHARDSCATTERSELECTIONTOOL_H
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition: AsgTool.h:47
InDet::InDetHardScatterSelectionTool::Mode
Mode
Definition: InDetHardScatterSelectionTool.h:60
InDet::InDetHardScatterSelectionTool::m_hardScatterDecoKey
SG::ReadDecorHandleKey< xAOD::EventInfo > m_hardScatterDecoKey
The decoration name of the ElementLink to the hardscatter vertex (applied to xAOD::EventInfo)
Definition: InDetHardScatterSelectionTool.h:148
InDet::InDetHardScatterSelectionTool::getHardScatterLink
ElementLink< xAOD::VertexContainer > getHardScatterLink() const override
Definition: InDetHardScatterSelectionTool.cxx:269
InDet::InDetHardScatterSelectionTool::SumPt2
@ SumPt2
Definition: InDetHardScatterSelectionTool.h:61
InDet::InDetHardScatterSelectionTool::Sum::add
virtual float add(const float a, const float b, const float, const float) const =0
The method is used within a loop of tracks, takes pT of the track and previous cumulative sum [sumpT2...
InDet::InDetHardScatterSelectionTool::m_jetContKey
SG::ReadHandleKey< xAOD::JetContainer > m_jetContKey
Definition: InDetHardScatterSelectionTool.h:136
xAODP4Helpers.h
InDet
Primary Vertex Finder.
Definition: VP1ErrorUtils.h:36
InDet::InDetHardScatterSelectionTool::~InDetHardScatterSelectionTool
~InDetHardScatterSelectionTool()
Destructor.
InDet::InDetHardScatterSelectionTool::Sum::~Sum
virtual ~Sum()=default
InDet::InDetHardScatterSelectionTool::SumPt
@ SumPt
Definition: InDetHardScatterSelectionTool.h:62
InDet::InDetHardScatterSelectionTool::HSGN2
@ HSGN2
Definition: InDetHardScatterSelectionTool.h:64
InDet::InDetHardScatterSelectionTool::m_trkMaxPt
FloatProperty m_trkMaxPt
Definition: InDetHardScatterSelectionTool.h:145
SG::ReadHandleKey< xAOD::EventInfo >
InDet::InDetHardScatterSelectionTool::m_jetMinPt
FloatProperty m_jetMinPt
Definition: InDetHardScatterSelectionTool.h:143
InDet::InDetHardScatterSelectionTool::getHardScatter
const xAOD::Vertex * getHardScatter() const override
Definition: InDetHardScatterSelectionTool.cxx:240
InDet::InDetHardScatterSelectionTool::SumPtw
@ SumPtw
Definition: InDetHardScatterSelectionTool.h:63
ReadDecorHandleKey.h
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
InDet::InDetHardScatterSelectionTool::m_redoHardScatter
BooleanProperty m_redoHardScatter
Definition: InDetHardScatterSelectionTool.h:138
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
InDet::InDetHardScatterSelectionTool::m_doTrkSelection
bool m_doTrkSelection
A flag which will be true if an InDetTrackSelectionTool was provided.
Definition: InDetHardScatterSelectionTool.h:131
InDet::InDetHardScatterSelectionTool::m_mode
IntegerProperty m_mode
Definition: InDetHardScatterSelectionTool.h:139
InDet::InDetHardScatterSelectionTool::finalize
virtual StatusCode finalize() override
Function finalizing the tool.
Definition: InDetHardScatterSelectionTool.cxx:132
InDet::InDetHardScatterSelectionTool::m_vtxContKey
SG::ReadHandleKey< xAOD::VertexContainer > m_vtxContKey
Definition: InDetHardScatterSelectionTool.h:135
InDet::InDetHardScatterSelectionTool::m_evtInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_evtInfoKey
xAOD::EventInfo ReadHandleKey
Definition: InDetHardScatterSelectionTool.h:134
InDet::InDetHardScatterSelectionTool::initialize
virtual StatusCode initialize() override
Function initialising the tool.
Definition: InDetHardScatterSelectionTool.cxx:54
InDet::InDetHardScatterSelectionTool::m_returnDeco
BooleanProperty m_returnDeco
Definition: InDetHardScatterSelectionTool.h:141
InDet::InDetHardScatterSelectionTool::InDetHardScatterSelectionTool
InDetHardScatterSelectionTool(const std::string &name)
Constructor.
Definition: InDetHardScatterSelectionTool.cxx:45
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
IInDetTrackSelectionTool.h
InDet::InDetHardScatterSelectionTool::Sum
Definition: InDetHardScatterSelectionTool.h:71
InDet::InDetHardScatterSelectionTool::m_hardScatterDeco
StringProperty m_hardScatterDeco
Definition: InDetHardScatterSelectionTool.h:142
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
InDet::InDetHardScatterSelectionTool::m_trkSelectTool
ToolHandle< InDet::IInDetTrackSelectionTool > m_trkSelectTool
Definition: InDetHardScatterSelectionTool.h:140
JetFwd.h
VertexFwd.h
EventInfo.h
VertexContainer.h
a
TList * a
Definition: liststreamerinfos.cxx:10
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
JetContainer.h
InDet::InDetHardScatterSelectionTool::m_sum
std::unique_ptr< Sum > m_sum
A helper class which either sums pt2 or pt or ptw.
Definition: InDetHardScatterSelectionTool.h:128
ASG_TOOL_CLASS
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
Definition: AsgToolMacros.h:68
IInDetHardScatterSelectionTool.h
InDet::InDetHardScatterSelectionTool::m_gnnScoreKey
SG::ReadDecorHandleKey< xAOD::VertexContainer > m_gnnScoreKey
xAOD::EventInfo ReadDecorHandleKey
Definition: InDetHardScatterSelectionTool.h:151
SG::ReadDecorHandleKey
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Definition: StoreGate/StoreGate/ReadDecorHandleKey.h:85
AsgTool.h
InDet::IInDetHardScatterSelectionTool
Definition: IInDetHardScatterSelectionTool.h:25
InDet::InDetHardScatterSelectionTool::m_jetTrkMaxDr
FloatProperty m_jetTrkMaxDr
Definition: InDetHardScatterSelectionTool.h:144
InDet::InDetHardScatterSelectionTool
Implementation of the hardscatter selection tool.
Definition: InDetHardScatterSelectionTool.h:48