84 auto outputTracks = std::make_unique<std::vector<recob::Track>>();
85 auto outputHits = std::make_unique<art::Assns<recob::Track, recob::Hit>>();
86 auto outputTTjTAssn = std::make_unique<art::Assns<recob::TrackTrajectory, recob::Track>>();
87 auto outputHitInfo = std::make_unique<std::vector<std::vector<recob::TrackFitHitInfo>>>();
88 auto outputSpacePoints = std::make_unique<std::vector<recob::SpacePoint>>();
89 auto outputHitSpacePointAssn = std::make_unique<art::Assns<recob::Hit, recob::SpacePoint>>();
98 auto const& tjHitsAssn =
108 unsigned int iTraj = 0;
109 for (
auto hitsRange : trajectoriesWithHits) {
113 std::vector<art::Ptr<recob::Hit>> inHits;
115 inHits.push_back(
hit);
119 std::vector<art::Ptr<recob::Hit>> outHits;
125 bool fitok =
trackMaker_->makeTrack(detProp, traj, inHits, outTrack, outHits, optionals);
126 if (!fitok)
continue;
132 <<
"Produced recob::Track required to have 1-1 correspondance between hits and points.\n";
136 outputTracks->emplace_back(
std::move(outTrack));
138 outputTTjTAssn->addSingle(traj, aptr);
140 for (
auto const& trhit : outHits) {
141 outputHits->addSingle(aptr, trhit);
145 const double fXYZ[3] = {tp.X(), tp.Y(), tp.Z()};
146 const double fErrXYZ[6] = {0};
148 outputSpacePoints->emplace_back(
std::move(sp));
150 outputHitSpacePointAssn->addSingle(trhit, apsp);
156 for (
auto it = osp.begin(); it != osp.end(); ++it) {
157 outputSpacePoints->emplace_back(
std::move(it->first));
159 outputHitSpacePointAssn->addSingle(it->second, apsp);
void initTrackFitInfos()
initialize the output vector of TrackFitHitInfos
const recob::TrackTrajectory & Trajectory() const
Access to the stored recob::TrackTrajectory.
size_t NumberTrajectoryPoints() const
Various functions related to the presence and the number of (valid) points.
std::unique_ptr< trkmkr::TrackMaker > trackMaker_
auto associated_groups(A const &assns)
Helper functions to access associations in order.
T LocationAtPoint(unsigned int p) const
Position at point p. Use e.g. as:
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
ProductID put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
bool spacePointsFromTrajP_
Detector simulation of raw signals on wires.
std::vector< SpHitPair > spacePointHitPairs()
get the output vector of SpHitPair by releasing and moving
art::InputTag trajInputTag
std::vector< recob::TrackFitHitInfo > trackFitHitInfos()
get the output vector of TrackFitHitInfos by releasing and moving
void initSpacePoints()
initialize the output vector of SpHitPair
Struct holding optional TrackMaker outputs.
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a "fitted" track:
cet::coded_exception< error, detail::translate > exception