393 if (outputs.size() != inputs.size())
return;
395 size_t tracksSize(0);
396 for (
auto const& kalman_output : outputs) {
397 tracksSize += kalman_output.tracks.size();
399 tracks.reserve(tracksSize);
401 auto const tid =
evt.getProductID<std::vector<recob::Track>>();
402 auto const tidgetter =
evt.productGetter(tid);
404 auto const spacepointId =
evt.getProductID<std::vector<recob::SpacePoint>>();
405 auto const getter =
evt.productGetter(spacepointId);
407 for (
size_t i = 0; i < outputs.size(); ++i) {
409 const std::deque<KGTrack>& kalman_tracks = outputs[i].tracks;
411 for (
auto const& kalman_track : kalman_tracks) {
415 kalman_track.fillTrack(
detProp, track, tracks.size());
418 tracks.emplace_back(std::move(track));
423 std::vector<unsigned int> hittpindex;
424 kalman_track.fillHits(trhits, hittpindex);
425 if (hittpindex.back() >= numtrajpts) {
426 throw cet::exception(
"Track3DKalmanHit")
427 <<
"Last hit corresponds to trajectory point index " << hittpindex.back()
428 <<
" while the number of trajectory points is " << numtrajpts <<
'\n';
432 auto nspt = spts.size();
435 std::vector<art::Ptr<recob::SpacePoint>> sptvec;
436 for (
auto ispt = nspt; ispt < spts.size(); ++ispt) {
437 sptvec.emplace_back(spacepointId, ispt, getter);
441 for (
auto const& sphit : sphits) {
442 sph_assn.addSingle(sptvec.back(), sphit);
446 art::Ptr<recob::Track> aptr(tid, tracks.size() - 1, tidgetter);
449 for (
size_t h = 0;
h < trhits.size(); ++
h) {
450 th_assn.addSingle(aptr, trhits[
h]);
452 thm_assn.addSingle(aptr, trhits[h], metadata);
456 for (
auto const& spt : sptvec) {
457 tsp_assn.addSingle(aptr, spt);
size_t NumberTrajectoryPoints() const
Various functions related to the presence and the number of (valid) points.
process_name use argoneut_mc_hitfinder track
const art::PtrVector< recob::Hit > & getAssociatedHits(const recob::SpacePoint &spt) const
SpacePointAlg fSpacePointAlg
Space point algorithm.
void fillSpacePoints(detinfo::DetectorPropertiesData const &detProp, std::vector< recob::SpacePoint > &spts, std::multimap< double, KHitTrack > const &trackMap) const
Fill a collection of space points.
art::PtrVector< recob::Hit > Hits
bool fUsePFParticleHits
Use PFParticle hits as input.
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a "fitted" track: