32 (
const std::string&
type,
33 const std::string& name,
34 const IInterface* parent)
37 declareProperty (
"VxSGKey",
m_targetSGKey=
"VxPrimaryCandidate");
38 declareProperty (
"Fast",
m_fast =
false);
49 return Base::initialize();
71 return p.reconstructedVertex();
78 if (
sc.isFailure() || !vxContainer) {
83 int nVx = vxContainer->
size();
88 for(
int v=0; v<nVx-1; v++){
90 const std::vector<Trk::VxTrackAtVertex*>* tracks = vx->
vxTrackAtVertex();
92 if(tracks) nTracks = tracks->size();
93 for(
int t=0; t<nTracks; t++) {
99 if(linkToTrackParticle){
101 if(particle_base == &p){
111 return vxContainer->
at(nVx-1);
131 for (
const auto vx : *vertices )
133 for (
const auto& tpLink : vx->trackParticleLinks() )
141 if (foundVertex)
break;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
Helpers for checking error return status codes and reporting errors.
#define REPORT_MESSAGE(LVL)
Report a message.
#define CHECK(...)
Evaluate an expression and check for errors.
Associate from a TrackParticle to its reconstructed vertex.
virtual StatusCode addVariable(const std::string &name, const std::type_info &ti, void *&ptr, const std::string &docstring="", const void *defval=0)
SG::ReadHandleKey< xAOD::VertexContainer > m_vertexKey
xAOD vertex container handle key
TrackParticleVertexAssociationTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard Gaudi tool constructor.
float * m_weight
weight of the track at the associated vertex
std::string m_targetSGKey
SG key for target collection.
bool m_fast
flag to just return whatever is returned by TrackParticle::reconstructedVertex()
virtual const Trk::VxCandidate * get(const Rec::TrackParticle &p) override
Return the target object.
SingleAssociationTool< Types< Rec::TrackParticle, xAOD::TrackParticle >, Types< Trk::VxCandidate, xAOD::Vertex > > Base
virtual StatusCode initialize() override
Standard Gaudi initialize method.
virtual StatusCode book() final
book ntuple variables
const T * at(size_type n) const
Access an element, as an rvalue.
size_type size() const noexcept
Returns the number of elements in the collection.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
An abstract class which is meant to represent an element link to the Trk::Track or Trk::TrackParticle...
std::vector< Trk::VxTrackAtVertex * > * vxTrackAtVertex(void)
Unconst pointer to the vector of tracks Required by some of the vertex fitters.
The VxTrackAtVertex is a common class for all present TrkVertexFitters The VxTrackAtVertex is designe...
Block filler tool for noisy FEB information.
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Vertex_v1 Vertex
Define the latest version of the vertex class.