48 Name(
"inputPFParticleLabel"),
49 Comment(
"Label of recob::PFParticle Collection to be fit")};
51 Name(
"inputTracksLabel"),
52 Comment(
"Label of recob::Track Collection associated to PFParticles")};
86 ,
fitter(p().geom3dvtxfit, p().propagator)
88 produces<std::vector<recob::Vertex>>();
89 produces<art::Assns<recob::PFParticle, recob::Vertex>>();
90 produces<art::Assns<recob::Vertex, recob::Track, recob::VertexAssnMeta>>();
97 auto outputVertices = make_unique<vector<recob::Vertex>>();
98 auto outputPFVxAssn = make_unique<art::Assns<recob::PFParticle, recob::Vertex>>();
99 auto outputVxTkMtAssn =
100 make_unique<art::Assns<recob::Vertex, recob::Track, recob::VertexAssnMeta>>();
110 for (
size_t iPF = 0; iPF < inputPFParticle->size(); ++iPF) {
114 vector<art::Ptr<recob::Track>> tracks;
116 for (
auto ipfd : pfd) {
119 for (
size_t jPF = 0; jPF < inputPFParticle->size(); ++jPF) {
121 if (pfpd->
Self() != ipfd)
continue;
122 vector<art::Ptr<recob::Track>> pftracks = assocTracks.at(jPF);
123 for (
auto t : pftracks) {
129 if (tracks.size() < 2)
continue;
132 if (vtx.
isValid() ==
false)
continue;
139 outputVertices->emplace_back(vtx.
vertex());
144 for (
auto t : tracks) {
145 outputVxTkMtAssn->addSingle(aptr, t, meta[itt]);
150 e.
put(std::move(outputVertices));
151 e.
put(std::move(outputPFVxAssn));
152 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.
size_t Self() const
Returns the index of this particle.
VertexFitter(Parameters const &p)
Wrapper class to facilitate vertex production.
EDProducer(fhicl::ParameterSet const &pset)
art::InputTag pfParticleInputTag
std::vector< recob::VertexAssnMeta > computeMeta(detinfo::DetectorPropertiesData const &detProp, const VertexWrapper &vtx)
PutHandle< PROD > put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
3D vertex fitter based on the geometric properties (start position, direction, covariance) of the tra...
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.
VertexWrapper fitTracks(detinfo::DetectorPropertiesData const &detProp, const std::vector< art::Ptr< recob::Track >> &arttracks) const
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
void setVertexId(int newID)
Geometric3DVertexFitter fitter
void produce(art::Event &e) override
const recob::Vertex & vertex() const