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;
52 return StatusCode::FAILURE;
56 return StatusCode::SUCCESS;
62 return StatusCode::SUCCESS;
69 const EventContext& ctx = Gaudi::Hive::currentContext();
81 if (evtStore()->retrieve(vtxC,
m_vertex_key).isFailure()) {
83 return StatusCode::FAILURE;
91 for (
auto vertex : *vtxC) {
102 float sumPT = sumPt2Acc(*vertex);
105 primary_vertex = vertex;
109 size_t ntp = vertex->nTrackParticles();
112 primary_vertex = vertex;
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;
#define ATH_CHECK
Evaluate an expression and check for errors.
Handle for requesting thinning for a data object.
SG::ThinningHandleKey< xAOD::TrackParticleContainer > m_inDetSGKey
std::string m_vertex_scheme
virtual StatusCode doThinning() const override
std::atomic< unsigned int > m_npass
StatusCode finalize() override
StringProperty m_streamName
ToolHandle< InDet::IInDetTrackSelectionTool > m_trkSelTool
track selection tool which can be optionally used for N_trk and sum pt cuts
std::atomic< unsigned int > m_ntot
StatusCode initialize() override
~HITrackParticleThinningTool()
HITrackParticleThinningTool(const std::string &t, const std::string &n, const IInterface *p)
Helper class to provide constant type-safe access to aux data.
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
void keep(size_t ndx)
Mark that index ndx in the container should be kept (not thinned away).
Handle for requesting thinning for a data object.
VertexContainer_v1 VertexContainer
Definition of the current "Vertex container version".
Vertex_v1 Vertex
Define the latest version of the vertex class.