12HI::HIVertexSelectionTool::HIVertexSelectionTool(
const string& name )
14 , m_accept(
"HIVertexSelection" )
15#ifndef XAOD_STANDALONE
17 , m_trkSelTool(
"InDet::InDetTrackSelectionTool", this )
20 declareProperty(
"RequirePrimary", m_requirePrimary,
"Require the vertex to have type PriVtx");
21 declareProperty(
"MaxAbsZ", m_maxAbsZ,
"Maximum absolute value of the vertex z position");
22 declareProperty(
"TrackSelectionTool", m_trkSelTool,
"Track selection tool" );
23 declareProperty(
"MinNTrk", m_minNtrk,
"Minimum number of associated tracks passing selection" );
24 declareProperty(
"MinRmsPt", m_minRmsPt,
"Minimum RMS pt [MeV] of associated tracks passing selection" );
36 ATH_MSG_INFO(
"Requiring vertex to be a primary vertex" );
37 m_accept.addCut(
"type",
"Whether the vertex satisfies the requirement to be a primary vertex" );
40 ATH_MSG_INFO(
"NOT requiring vertex to be a primary vertex" );
45 m_accept.addCut(
"z",
"Whether the vertex's |z| is in an allowed range" );
51 m_accept.addCut(
"ntrk",
"Whether the vertex has the minimum number of tracks" );
56 m_accept.addCut(
"pt",
"Whether the vertex's tracks RMS pt is sufficient" );
60 return StatusCode::SUCCESS;
66 return StatusCode::SUCCESS;
79 ATH_MSG_ERROR(
"Vertex selection tool should not be passed an IParticle." );
80 throw std::invalid_argument(
"Vertex selection tool given an IParticle." );
100 if ( !track.isValid() )
continue;
111 auto pt = (*track)->pt();
119 if (!countTracks && !countPt)
break;
#define ATH_CHECK
Evaluate an expression and check for errors.
void setCutResult(const std::string &cutName, bool cutResult)
Set the result of a cut, based on the cut name (safer)
Class providing the definition of the 4-vector interface.
float z() const
Returns the z position.
const TrackParticleLinks_t & trackParticleLinks() const
Get all the particles associated with the vertex.
VxType::VertexType vertexType() const
The type of the vertex.
Vertex_v1 Vertex
Define the latest version of the vertex class.