37 ATH_MSG_ERROR(
"Category key does not match output container key!");
38 return StatusCode::FAILURE;
50 return StatusCode::SUCCESS;
56 if (!charged.isValid())
59 return StatusCode::FAILURE;
62 if (!neutral.isValid())
65 return StatusCode::FAILURE;
68 std::vector<const xAOD::Vertex *> vertices;
72 if (!vertexHandle.isValid())
75 return StatusCode::FAILURE;
78 vertices.reserve(vertexHandle->size());
83 vertices.push_back(ivtx);
89 auto combined = std::make_unique<ConstDataVector<xAOD::PFOContainer>>(
SG::VIEW_ELEMENTS);
90 combined->reserve(charged->size() + neutral->size());
94 combined->push_back(ipfo);
109 isPVMatched =
m_tvaTool->isCompatible(*itrk, *priVtx);
111 isPVMatched =
m_tvaTool->getUniqueMatchVertex(*itrk, vertices) == priVtx;
121 if (accPVMatched(*ipfo))
129 combined->push_back(ipfo);
133 CHECK(outputHandle.put(ctx, std::move(combined)) !=
nullptr);
134 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.
SG::ReadHandleKey< xAOD::VertexContainer > m_inputVertexKey
The input vertex container.
bool m_manualTVA
Whether to perform track -> vertex matching manually.
virtual StatusCode initialize() override
SG::WriteHandleKey< xAOD::PFOContainer > m_outputKey
The output combined container.
SG::WriteDecorHandleKey< xAOD::PFOContainer > m_outputCategoryKey
The output classification.
PFOPrepAlg(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
ToolHandle< CP::ITrackVertexAssociationTool > m_tvaTool
Track -> vertex association.
SG::ReadHandleKey< xAOD::PFOContainer > m_inputChargedKey
The input charged container.
SG::ReadHandleKey< xAOD::PFOContainer > m_inputNeutralKey
The input neutral container.
deferred_t< SG::AuxElement::Decorator< int > > m_decCategory
Gaudi::Property< bool > m_useCompatible
Choose between the unique (many-to-one) track->vertex association and just checking compatibility wit...
virtual StatusCode execute(const EventContext &context) const override
Run the algorithm.
ToolHandle< InDet::IInDetTrackSelectionTool > m_trackSelTool
Track selection tool.
SG::ConstAccessor< T, ALLOC > ConstAccessor
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())
PFO_v1 PFO
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.