90 std::unique_ptr<std::vector<recob::Track> > tcol(
new std::vector<recob::Track>);
105 mf::LogWarning(
"TrackStitcher") <<
"Trying to read Track3DKalmanXYZ-style PtrVector of std::vector of SpacePoints" <<
std::endl;
108 for (
size_t ii=0; ii<sppth->size() ;ii++)
109 for (
size_t jj=0; jj<sppth->at(ii).size() ;ii++)
112 scol->push_back(sptmp );
117 mf::LogWarning(
"TrackStitcher") <<
"Trying instead to read CosmicTracker-style already-flattened vector of SpacePoints" <<
std::endl;
120 for (
size_t ii=0; ii<sppthf->size() ;ii++)
123 scol->push_back(sptmpf);
144 if (tcol->size()!=tvcol->size())
145 throw cet::exception(
"TrackStitcher") <<
"Tracks and TrackComposites do not match: "<<tcol->size()<<
" vs "<<tvcol->size()<<
"\n";
147 std::vector<size_t> spIndices(scol->size());
149 for (
size_t ii=0; ii<scol->size(); ii++ )
152 for (
size_t ii=0; ii<tvcol->size(); ii++)
164 std::vector<std::pair<std::vector<art::Ptr<recob::Hit> >
::const_iterator, std::vector<art::Ptr<recob::Hit> >::const_iterator > > pits;
166 std::vector<art::Ptr<recob::Hit>> hitsFromSppts;
169 size_t start(0), finish(0);
170 for (
unsigned int ii=0; ii < sppts.size(); ++ii )
172 hitsFromSppts.insert(hitsFromSppts.end(),hitAssns.at(ii).begin(), hitAssns.at(ii).end());
173 finish = start+(size_t)(hitAssns.at(ii).end() - hitAssns.at(ii).begin());
174 std::pair< std::vector<art::Ptr<recob::Hit> >
::const_iterator, std::vector<art::Ptr<recob::Hit> >::const_iterator > pithittmp(hitAssns.at(ii).begin(),hitAssns.at(ii).end());
175 pits.push_back(pithittmp);
180 for (
size_t jj=0; jj<sppts.size(); jj++ )
183 size_t ll(scol->size());
187 for (
auto& kk : spIndices )
190 if ( spptnc != sppts.at(jj)) { off++;
continue;}
199 std::vector <art::Ptr <recob::Hit> > hitsThisSppt;
200 hitsThisSppt.insert(hitsThisSppt.begin(),pits.at(jj).first,pits.at(jj).second);
207 mf::LogVerbatim(
"TrackStitcher.end") <<
"There are " << tvcol->size() <<
" Tracks in this event after stitching.";
MaybeLogger_< ELseverityLevel::ELsev_info, true > LogVerbatim
void GetTracks(std::vector< recob::Track > &t) const
art::Handle< std::vector< recob::Track > > ftListHandle
void FindHeadsAndTails(const art::Event &e, const std::string &t)
bool CommonComponentStitch()
art::PtrVector< recob::Hit > GetHitsFromComponentTracks(const art::PtrVector< recob::Track > &, const art::Event &evt)
void GetTrackComposites(std::vector< art::PtrVector< recob::Track > > &c) const
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
ProductID put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
bool CreateAssn(PRODUCER const &prod, art::Event &evt, std::vector< T > const &a, art::Ptr< U > const &b, art::Assns< U, T > &assn, std::string a_instance, size_t indx=UINT_MAX)
Creates a single one-to-one association.
std::string fSpptModuleLabel
std::string fTrackModuleLabel
art::PtrVector< recob::SpacePoint > GetSpacePointsFromComponentTracks(const art::PtrVector< recob::Track > &, const art::Event &evt)
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
cet::coded_exception< error, detail::translate > exception
QTextStream & endl(QTextStream &s)