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  };
65 
67 
69 
70  class Sum {
71  public:
72  virtual ~Sum() = default;
75  // 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
77  virtual float add(const float a, const float b, const float, const float )const = 0 ;
78  };
79 
81 
84 
86  InDetHardScatterSelectionTool(const std::string& name);
87 
90 
92 
95 
97  virtual StatusCode initialize() override;
98 
100  virtual StatusCode finalize() override;
101 
103 
106 
108  const xAOD::Vertex* getHardScatter(const xAOD::VertexContainer* vtxCont) const override;
109  const xAOD::Vertex* getHardScatter() const override;
110 
114 
116 
118  // Private data:
120 
121  private:
122 
125 
127  std::unique_ptr<Sum> m_sum;
128 
130  bool m_doTrkSelection = false;
131 
133  SG::ReadHandleKey<xAOD::EventInfo> m_evtInfoKey {this, "EventInfo", "EventInfo", "EventInfo key"};
134  SG::ReadHandleKey<xAOD::VertexContainer> m_vtxContKey{this, "VertexContainer", "PrimaryVertices", "Name of the primary vertex container"};
135  SG::ReadHandleKey<xAOD::JetContainer> m_jetContKey{ this, "JetContainer", "AntiKt4EMTopoJets", "Name of the jet container" };
136 
137  BooleanProperty m_redoHardScatter{ this, "RedoHardScatter", false, "If true, redo the hardscatter selection using sumpt2 or sumpt or sumptw"};
138  IntegerProperty m_mode{ this, "SelectionMode", InDet::InDetHardScatterSelectionTool::Mode::SumPt2, "Mode for selecting the hardscatter: sumpt2[0] or sumpt[1] or sumptw[2]"};
139  ToolHandle<InDet::IInDetTrackSelectionTool> m_trkSelectTool{this, "TrackSelectionTool", "InDet::InDetTrackSelectionTool/TrackSelectionTool", "Track selection tool to use"};
140  BooleanProperty m_returnDeco{ this, "ReturnDeco", false, "If true, return the hardscatter as the vertex decorated with some boolean"};
141  StringProperty m_hardScatterDeco{this, "HardScatterLinkDeco", "hardScatterVertexLink", "The decoration name of the ElementLink to the hardscatter vertex (applied to xAOD::EventInfo)"};
142  FloatProperty m_jetMinPt{this, "jetMinPt", 15000.0, "minimum jet pt"};
143  FloatProperty m_jetTrkMaxDr{this, "jetTrkMaxDr", 0.8, "max dR between jet & Trk"};
144  FloatProperty m_trkMaxPt{this, "trkMaxPt", 10045000, "max track pt"};
145 
147  SG::ReadDecorHandleKey<xAOD::EventInfo> m_hardScatterDecoKey{this, "VertexScatterKey", "" , "Overwrriten in the configuration step by the <HardScatterLinkDeco> property"};
148 
150 
151  }; // class: InDetHardScatterSelectionTool
152 } // namespace: InDet
153 
154 #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:147
InDet::InDetHardScatterSelectionTool::getHardScatterLink
ElementLink< xAOD::VertexContainer > getHardScatterLink() const override
Definition: InDetHardScatterSelectionTool.cxx:254
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:135
xAODP4Helpers.h
InDet
DUMMY 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::m_trkMaxPt
FloatProperty m_trkMaxPt
Definition: InDetHardScatterSelectionTool.h:144
SG::ReadHandleKey< xAOD::EventInfo >
InDet::InDetHardScatterSelectionTool::m_jetMinPt
FloatProperty m_jetMinPt
Definition: InDetHardScatterSelectionTool.h:142
InDet::InDetHardScatterSelectionTool::getHardScatter
const xAOD::Vertex * getHardScatter() const override
Definition: InDetHardScatterSelectionTool.cxx:225
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:137
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:130
InDet::InDetHardScatterSelectionTool::m_mode
IntegerProperty m_mode
Definition: InDetHardScatterSelectionTool.h:138
InDet::InDetHardScatterSelectionTool::finalize
virtual StatusCode finalize() override
Function finalizing the tool.
Definition: InDetHardScatterSelectionTool.cxx:126
InDet::InDetHardScatterSelectionTool::m_vtxContKey
SG::ReadHandleKey< xAOD::VertexContainer > m_vtxContKey
Definition: InDetHardScatterSelectionTool.h:134
InDet::InDetHardScatterSelectionTool::m_evtInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_evtInfoKey
xAOD::EventInfo ReadHandleKey
Definition: InDetHardScatterSelectionTool.h:133
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:140
InDet::InDetHardScatterSelectionTool::InDetHardScatterSelectionTool
InDetHardScatterSelectionTool(const std::string &name)
Constructor.
Definition: InDetHardScatterSelectionTool.cxx:45
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
IInDetTrackSelectionTool.h
InDet::InDetHardScatterSelectionTool::Sum
Definition: InDetHardScatterSelectionTool.h:70
InDet::InDetHardScatterSelectionTool::m_hardScatterDeco
StringProperty m_hardScatterDeco
Definition: InDetHardScatterSelectionTool.h:141
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
InDet::InDetHardScatterSelectionTool::m_trkSelectTool
ToolHandle< InDet::IInDetTrackSelectionTool > m_trkSelectTool
Definition: InDetHardScatterSelectionTool.h:139
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:127
ASG_TOOL_CLASS
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
Definition: AsgToolMacros.h:68
IInDetHardScatterSelectionTool.h
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:143
InDet::InDetHardScatterSelectionTool
Implementation of the hardscatter selection tool.
Definition: InDetHardScatterSelectionTool.h:48