38 ATH_MSG_ERROR(
"Category key does not match output container key!");
39 return StatusCode::FAILURE;
51 return StatusCode::SUCCESS;
57 if (!charged.isValid())
60 return StatusCode::FAILURE;
63 if (!neutral.isValid())
66 return StatusCode::FAILURE;
69 std::vector<const xAOD::Vertex *> vertices;
73 if (!vertexHandle.isValid())
76 return StatusCode::FAILURE;
79 vertices.reserve(vertexHandle->size());
84 vertices.push_back(ivtx);
90 auto combined = std::make_unique<ConstDataVector<xAOD::FlowElementContainer>>(
SG::VIEW_ELEMENTS);
91 combined->reserve(charged->size() + neutral->size());
95 combined->push_back(ife);
109 ATH_MSG_ERROR(
"Could not retrieve primary track particle from FlowElement");
110 return StatusCode::FAILURE;
116 isPVMatched =
m_tvaTool->isCompatible(*itrk, *priVtx);
118 isPVMatched =
m_tvaTool->getUniqueMatchVertex(*itrk, vertices) == priVtx;
128 if (accPVMatched(*ife))
136 combined->push_back(ife);
140 CHECK(outputHandle.put(ctx, std::move(combined)) !=
nullptr);
141 return StatusCode::SUCCESS;
DataVector adapter that acts like it holds const pointers.
#define CHECK(...)
Evaluate an expression and check for errors.
Some common helper functions used by decoration handles.
Handle class for reading from StoreGate.
Handle class for recording to StoreGate.
An algorithm that can be simultaneously executed in multiple threads.
Gaudi::Property< bool > m_useCompatible
Choose between the unique (many-to-one) track->vertex association and just checking compatibility wit...
virtual StatusCode initialize() override
FlowElementPrepAlg(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
deferred_t< SG::AuxElement::Decorator< int > > m_decCategory
SG::ReadHandleKey< xAOD::VertexContainer > m_inputVertexKey
The input vertex container.
SG::ReadHandleKey< xAOD::FlowElementContainer > m_inputNeutralKey
The input neutral container.
bool m_manualTVA
Whether to perform track -> vertex matching manually.
ToolHandle< CP::ITrackVertexAssociationTool > m_tvaTool
Track -> vertex association.
ToolHandle< InDet::IInDetTrackSelectionTool > m_trackSelTool
Track selection tool.
SG::WriteHandleKey< xAOD::FlowElementContainer > m_outputKey
The output combined container.
SG::ReadHandleKey< xAOD::FlowElementContainer > m_inputChargedKey
The input charged container.
SG::WriteDecorHandleKey< xAOD::FlowElementContainer > m_outputCategoryKey
The output classification.
virtual StatusCode execute(const EventContext &context) const override
Run the algorithm.
SG::ConstAccessor< T, ALLOC > ConstAccessor
Class providing the definition of the 4-vector interface.
VxType::VertexType vertexType() const
The type of the vertex.
It used to be useful piece of code for replacing actual SG with other store of similar functionality ...
std::string contKeyFromKey(const std::string &key)
Extract the container part of key.
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
std::string decorKeyFromKey(const std::string &key, const std::string &deflt)
Extract the decoration part of key.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
FlowElement_v1 FlowElement
Definition of the current "pfo version".
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Vertex_v1 Vertex
Define the latest version of the vertex class.