13 #include "GaudiKernel/ThreadLocalContext.h"
25 const IInterface*
p ) :
32 declareProperty(
"PrimaryVertexKey",
m_vertex_key=
"PrimaryVertices");
34 declareProperty(
"TrackSelectionTool",
m_trkSelTool,
"Track selection tool" );
45 ATH_MSG_ERROR(
"InDetTrackSelectionTool not set. Cannot initialize.");
46 return StatusCode::FAILURE;
50 if (m_vertex_scheme !=
"sumPt2" && m_vertex_scheme !=
"nTracks") {
51 ATH_MSG_ERROR(
"Invalid PrimaryVertexSelection: " << m_vertex_scheme);
52 return StatusCode::FAILURE;
55 ATH_CHECK( m_inDetSGKey.initialize(m_streamName) );
56 return StatusCode::SUCCESS;
62 return StatusCode::SUCCESS;
69 const EventContext& ctx = Gaudi::Hive::currentContext();
74 m_ntot+=tracks->size();
81 if (evtStore()->
retrieve(vtxC, m_vertex_key).isFailure()) {
82 ATH_MSG_ERROR(
"Failed to retrieve VertexContainer with key: " << m_vertex_key);
83 return StatusCode::FAILURE;
91 for (
auto vertex : *vtxC) {
96 if (m_vertex_scheme.compare(
"sumPt2") == 0) {
102 float sumPT = sumPt2Acc(*
vertex);
109 size_t ntp =
vertex->nTrackParticles();
118 if (!primary_vertex) {
123 std::vector<bool>
mask;
124 mask.reserve(tracks->size());
126 for (
auto tp : *tracks) {
131 mask.push_back(
static_cast<bool>(acceptData));
133 mask.push_back(
false);
139 return StatusCode::SUCCESS;