|
ATLAS Offline Software
|
Go to the documentation of this file.
12 HI::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" );
27 HI::HIVertexSelectionTool::~HIVertexSelectionTool() =
default;
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." );
91 if (m_maxAbsZ < 0. || std::fabs( vtx.
z() ) < m_maxAbsZ) {
95 bool countTracks = m_minNtrk >= 0;
96 bool countPt = m_minRmsPt >= 0.;
100 if ( !
track.isValid() )
continue;
101 if ( !m_trkSelTool->accept( **
track, &vtx ) )
continue;
105 if (nPassed >= m_minNtrk) {
111 auto pt = (*track)->pt();
113 if (sumPtSq >= m_minRmsPt*m_minRmsPt) {
119 if (!countTracks && !countPt)
break;
const TrackParticleLinks_t & trackParticleLinks() const
Get all the particles associated with the vertex.
Class providing the definition of the 4-vector interface.
VxType::VertexType vertexType() const
The type of the vertex.
::StatusCode StatusCode
StatusCode definition for legacy code.
float z() const
Returns the z position.
void setCutResult(const std::string &cutName, bool cutResult)
Set the result of a cut, based on the cut name (safer)
Class describing a Vertex.
int addCut(const std::string &cutName, const std::string &cutDescription)
Add a cut; returning the cut position.