8 #include "cetlib_except/exception.h" 70 produces<std::vector<recob::Track>>();
71 produces<art::Assns<recob::Track, recob::Hit>>();
72 produces<art::Assns<recob::TrackTrajectory, recob::Track>>();
75 produces<std::vector<recob::SpacePoint>>();
76 produces<art::Assns<recob::Hit, recob::SpacePoint>>();
83 auto outputTracks = std::make_unique<std::vector<recob::Track>>();
84 auto outputHits = std::make_unique<art::Assns<recob::Track, recob::Hit>>();
85 auto outputTTjTAssn = std::make_unique<art::Assns<recob::TrackTrajectory, recob::Track>>();
86 auto outputHitInfo = std::make_unique<std::vector<std::vector<recob::TrackFitHitInfo>>>();
87 auto outputSpacePoints = std::make_unique<std::vector<recob::SpacePoint>>();
88 auto outputHitSpacePointAssn = std::make_unique<art::Assns<recob::Hit, recob::SpacePoint>>();
97 auto const& tjHitsAssn =
107 unsigned int iTraj = 0;
108 for (
auto hitsRange : trajectoriesWithHits) {
112 std::vector<art::Ptr<recob::Hit>> inHits;
114 inHits.push_back(
hit);
118 std::vector<art::Ptr<recob::Hit>> outHits;
124 bool fitok =
trackMaker_->makeTrack(detProp, traj, inHits, outTrack, outHits, optionals);
125 if (!fitok)
continue;
131 <<
"Produced recob::Track required to have 1-1 correspondance between hits and points.\n";
135 outputTracks->emplace_back(std::move(outTrack));
137 outputTTjTAssn->addSingle(traj, aptr);
139 for (
auto const& trhit : outHits) {
140 outputHits->addSingle(aptr, trhit);
144 const double fXYZ[3] = {tp.X(), tp.Y(), tp.Z()};
145 const double fErrXYZ[6] = {0};
147 outputSpacePoints->emplace_back(std::move(sp));
149 outputHitSpacePointAssn->addSingle(trhit, apsp);
155 for (
auto it = osp.begin(); it != osp.end(); ++it) {
156 outputSpacePoints->emplace_back(std::move(it->first));
158 outputHitSpacePointAssn->addSingle(it->second, apsp);
165 e.
put(std::move(outputTracks));
166 e.
put(std::move(outputHits));
167 e.
put(std::move(outputTTjTAssn));
170 e.
put(std::move(outputSpacePoints));
171 e.
put(std::move(outputHitSpacePointAssn));
void initTrackFitInfos()
initialize the output vector of TrackFitHitInfos
const recob::TrackTrajectory & Trajectory() const
Access to the stored recob::TrackTrajectory.
EDProducer(fhicl::ParameterSet const &pset)
Produce a reco::Track collection, as a result of the fit of an existing recob::TrackTrajectory collec...
size_t NumberTrajectoryPoints() const
Various functions related to the presence and the number of (valid) points.
std::unique_ptr< trkmkr::TrackMaker > trackMaker_
PutHandle< PROD > put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
auto associated_groups(A const &assns)
Helper functions to access associations in order.
#define DEFINE_ART_MODULE(klass)
TrackProducerFromTrackTrajectory(fhicl::ParameterSet const &p)
TrackProducerFromTrackTrajectory & operator=(TrackProducerFromTrackTrajectory const &)=delete
T LocationAtPoint(unsigned int p) const
Position at point p. Use e.g. as:
bool spacePointsFromTrajP_
Detector simulation of raw signals on wires.
void produce(art::Event &e) override
std::vector< SpHitPair > spacePointHitPairs()
get the output vector of SpHitPair by releasing and moving
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
art::InputTag trajInputTag
std::vector< recob::TrackFitHitInfo > trackFitHitInfos()
get the output vector of TrackFitHitInfos by releasing and moving
Helper functions to access associations in order.
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