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>>();
82 auto outputTracks = std::make_unique<std::vector<recob::Track>>();
83 auto outputHits = std::make_unique<art::Assns<recob::Track, recob::Hit>>();
84 auto outputHitInfo = std::make_unique<std::vector<std::vector<recob::TrackFitHitInfo>>>();
85 auto outputSpacePoints = std::make_unique<std::vector<recob::SpacePoint>>();
86 auto outputHitSpacePointAssn = std::make_unique<art::Assns<recob::Hit, recob::SpacePoint>>();
103 unsigned int iTrack = 0;
104 for (
auto hitsRange : tracksWithHits) {
108 std::vector<art::Ptr<recob::Hit>> inHits;
110 inHits.push_back(
hit);
114 std::vector<art::Ptr<recob::Hit>> outHits;
120 bool fitok =
trackMaker_->makeTrack(detProp, track, inHits, outTrack, outHits, optionals);
121 if (!fitok)
continue;
127 <<
"Produced recob::Track required to have 1-1 correspondance between hits and " 128 "points.\noutTrack.NumberTrajectoryPoints()=" 133 outputTracks->emplace_back(
std::move(outTrack));
136 for (
auto const& trhit : outHits) {
137 outputHits->addSingle(aptr, trhit);
141 const double fXYZ[3] = {tp.X(), tp.Y(), tp.Z()};
142 const double fErrXYZ[6] = {0};
144 outputSpacePoints->emplace_back(
std::move(sp));
146 outputHitSpacePointAssn->addSingle(trhit, apsp);
152 for (
auto it = osp.begin(); it != osp.end(); ++it) {
153 outputSpacePoints->emplace_back(
std::move(it->first));
155 outputHitSpacePointAssn->addSingle(it->second, apsp);
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_
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:
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
ProductID put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
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
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