9 #include "cetlib_except/exception.h" 69 produces<std::vector<recob::Track>>();
70 produces<art::Assns<recob::Track, recob::Hit>>();
73 produces<std::vector<recob::SpacePoint>>();
74 produces<art::Assns<recob::Hit, recob::SpacePoint>>();
81 auto outputTracks = std::make_unique<std::vector<recob::Track>>();
82 auto outputHits = std::make_unique<art::Assns<recob::Track, recob::Hit>>();
83 auto outputHitInfo = std::make_unique<std::vector<std::vector<recob::TrackFitHitInfo>>>();
84 auto outputSpacePoints = std::make_unique<std::vector<recob::SpacePoint>>();
85 auto outputHitSpacePointAssn = std::make_unique<art::Assns<recob::Hit, recob::SpacePoint>>();
102 unsigned int iTrack = 0;
103 for (
auto hitsRange : tracksWithHits) {
107 std::vector<art::Ptr<recob::Hit>> inHits;
109 inHits.push_back(
hit);
113 std::vector<art::Ptr<recob::Hit>> outHits;
119 bool fitok =
trackMaker_->makeTrack(detProp, track, inHits, outTrack, outHits, optionals);
120 if (!fitok)
continue;
126 <<
"Produced recob::Track required to have 1-1 correspondance between hits and " 127 "points.\noutTrack.NumberTrajectoryPoints()=" 132 outputTracks->emplace_back(std::move(outTrack));
135 for (
auto const& trhit : outHits) {
136 outputHits->addSingle(aptr, trhit);
140 const double fXYZ[3] = {tp.X(), tp.Y(), tp.Z()};
141 const double fErrXYZ[6] = {0};
143 outputSpacePoints->emplace_back(std::move(sp));
145 outputHitSpacePointAssn->addSingle(trhit, apsp);
151 for (
auto it = osp.begin(); it != osp.end(); ++it) {
152 outputSpacePoints->emplace_back(std::move(it->first));
154 outputHitSpacePointAssn->addSingle(it->second, apsp);
161 e.
put(std::move(outputTracks));
162 e.
put(std::move(outputHits));
165 e.
put(std::move(outputSpacePoints));
166 e.
put(std::move(outputHitSpacePointAssn));
TrackProducerFromTrack & operator=(TrackProducerFromTrack const &)=delete
void initTrackFitInfos()
initialize the output vector of TrackFitHitInfos
const recob::TrackTrajectory & Trajectory() const
Access to the stored recob::TrackTrajectory.
EDProducer(fhicl::ParameterSet const &pset)
size_t NumberTrajectoryPoints() const
Various functions related to the presence and the number of (valid) points.
Produce a reco::Track collection, as a result of the fit of an existing recob::Track collection...
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)
T LocationAtPoint(unsigned int p) const
Position at point p. Use e.g. as:
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
art::InputTag trackInputTag
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
std::vector< recob::TrackFitHitInfo > trackFitHitInfos()
get the output vector of TrackFitHitInfos by releasing and moving
Helper functions to access associations in order.
bool spacePointsFromTrajP_
TrackProducerFromTrack(fhicl::ParameterSet const &p)
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