53 Name(
"inputPFParticleLabel"),
54 Comment(
"Label of recob::PFParticle Collection to be fit")
57 Name(
"inputTracksLabel"),
58 Comment(
"Label of recob::Track Collection associated to PFParticles")
96 ,
fitter(p().geom3dvtxfit,p().propagator)
98 produces<std::vector<recob::Vertex> >();
99 produces<art::Assns<recob::PFParticle, recob::Vertex> >();
100 produces<art::Assns<recob::Vertex, recob::Track, recob::VertexAssnMeta> >();
108 auto outputVertices = make_unique<vector<recob::Vertex> >();
109 auto outputPFVxAssn = make_unique<art::Assns<recob::PFParticle, recob::Vertex> >();
110 auto outputVxTkMtAssn = make_unique<art::Assns<recob::Vertex, recob::Track, recob::VertexAssnMeta> >();
118 for (
size_t iPF = 0; iPF < inputPFParticle->size(); ++iPF) {
122 vector< art::Ptr<recob::Track> > tracks;
124 for (
auto ipfd : pfd) {
125 vector< art::Ptr<recob::Track> > pftracks = assocTracks->at(ipfd);
126 for (
auto t : pftracks) {
130 if (tracks.size()<2)
continue;
133 if (vtx.
isValid()==
false)
continue;
140 outputVertices->emplace_back(vtx.
vertex());
145 for (
auto t : tracks) {
146 outputVxTkMtAssn->addSingle(aptr, t, meta[itt]);
151 e.put(std::move(outputVertices));
152 e.put(std::move(outputPFVxAssn));
153 e.put(std::move(outputVxTkMtAssn));
const std::vector< size_t > & Daughters() const
Returns the collection of daughter particles.
VertexFitter & operator=(VertexFitter const &)=delete
int NumDaughters() const
Returns the number of daughter particles flowing from this one.
VertexFitter(Parameters const &p)
Wrapper class to facilitate vertex production.
art::InputTag pfParticleInputTag
std::vector< recob::VertexAssnMeta > computeMeta(const VertexWrapper &vtx)
3D vertex fitter based on the geometric properties (start position, direction, covariance) of the tra...
VertexWrapper fitTracks(const std::vector< art::Ptr< recob::Track > > &arttracks) const
Module for fitting a vertex using the Geometric3DVertexFitter.
#define DEFINE_ART_MODULE(klass)
art::InputTag trackInputTag
bool IsPrimary() const
Returns whether the particle is the root of the flow.
void setVertexId(int newID)
Geometric3DVertexFitter fitter
void produce(art::Event &e) override
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
const recob::Vertex & vertex() const