75 fStizatch = pset.get<
bool>(
"CommonComponentStitch",
true);
77 produces<std::vector<recob::Track>>();
78 produces<std::vector<art::PtrVector<recob::Track>>>();
79 produces<art::Assns<recob::Track, recob::Hit>>();
80 produces<art::Assns<recob::Track, recob::SpacePoint>>();
81 produces<art::Assns<recob::SpacePoint, recob::Hit>>();
95 std::unique_ptr<std::vector<recob::Track>> tcol(
new std::vector<recob::Track>);
98 std::unique_ptr<std::vector<art::PtrVector<recob::Track>>> tvcol(
100 std::unique_ptr<art::Assns<recob::Track, recob::Hit>> thassn(
102 std::unique_ptr<art::Assns<recob::Track, recob::SpacePoint>> tsptassn(
104 std::unique_ptr<art::Assns<recob::SpacePoint, recob::Hit>> spthassn(
113 <<
"Trying to read Track3DKalmanXYZ-style PtrVector of std::vector of SpacePoints" 117 for (
size_t ii = 0; ii < sppth->size(); ii++)
118 for (
size_t jj = 0; jj < sppth->at(ii).size(); ii++) {
120 scol->push_back(sptmp);
125 <<
"Trying instead to read CosmicTracker-style already-flattened vector of SpacePoints" 129 for (
size_t ii = 0; ii < sppthf->size(); ii++) {
131 scol->push_back(sptmpf);
145 <<
" Tracks in this event before stitching.";
150 if (tcol->size() != tvcol->size())
152 <<
"Tracks and TrackComposites do not match: " << tcol->size() <<
" vs " << tvcol->size()
155 std::vector<size_t> spIndices(scol->size());
157 for (
size_t ii = 0; ii < scol->size(); ii++) {
161 for (
size_t ii = 0; ii < tvcol->size(); ii++) {
174 std::vector<art::Ptr<recob::Hit>>::const_iterator>>
177 std::vector<art::Ptr<recob::Hit>> hitsFromSppts;
180 size_t start(0), finish(0);
181 for (
unsigned int ii = 0; ii < sppts.
size(); ++ii) {
182 hitsFromSppts.insert(hitsFromSppts.end(), hitAssns.at(ii).begin(), hitAssns.at(ii).end());
183 finish = start + (size_t)(hitAssns.at(ii).end() - hitAssns.at(ii).begin());
185 std::vector<art::Ptr<recob::Hit>>::const_iterator>
186 pithittmp(hitAssns.at(ii).begin(), hitAssns.at(ii).end());
187 pits.push_back(pithittmp);
188 start += (finish + 1);
192 for (
size_t jj = 0; jj < sppts.
size(); jj++) {
194 size_t ll(scol->size());
198 for (
auto& kk : spIndices) {
200 if (spptnc != sppts.
at(jj)) {
210 if (ll < scol->
size()) {
211 std::vector<art::Ptr<recob::Hit>> hitsThisSppt;
212 hitsThisSppt.insert(hitsThisSppt.begin(), pits.at(jj).first, pits.at(jj).second);
219 <<
"There are " << tvcol->size() <<
" Tracks in this event after stitching.";
220 evt.
put(std::move(tcol));
221 evt.
put(std::move(tvcol));
223 evt.
put(std::move(thassn));
224 evt.
put(std::move(tsptassn));
225 evt.
put(std::move(spthassn));
236 for (
unsigned int ii = 0; ii < tcomp.
size(); ++ii) {
237 hits.
insert(hits.
end(), hitAssns.at(ii).begin(), hitAssns.at(ii).end());
251 for (
unsigned int ii = 0; ii < tcomp.
size(); ++ii) {
252 sppts.
insert(sppts.
end(), spptAssns.at(ii).begin(), spptAssns.at(ii).end());
266 std::vector<art::Ptr<recob::Hit>>
hits;
269 size_t start(0), finish(0);
270 for (
unsigned int ii = 0; ii < sppts.
size(); ++ii) {
271 hits.insert(hits.end(), hitAssns.at(ii).begin(), hitAssns.at(ii).end());
272 finish = start + (size_t)(hitAssns.at(ii).end() - hitAssns.at(ii).begin());
274 std::vector<art::Ptr<recob::Hit>>::const_iterator>
275 pithittmp(hitAssns.at(ii).begin(), hitAssns.at(ii).end());
276 pithit.push_back(pithittmp);
277 start += (finish + 1);
MaybeLogger_< ELseverityLevel::ELsev_info, true > LogVerbatim
std::vector< art::Ptr< recob::Hit > > GetHitsFromAssdSpacePoints(const art::PtrVector< recob::SpacePoint > &, const art::Event &evt, std::vector< std::pair< std::vector< art::Ptr< recob::Hit >>::const_iterator, std::vector< art::Ptr< recob::Hit >>::const_iterator >> &vpi)
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()
Declaration of signal hit object.
EDProducer(fhicl::ParameterSet const &pset)
art::PtrVector< recob::Hit > GetHitsFromComponentTracks(const art::PtrVector< recob::Track > &, const art::Event &evt)
TrackStitcher(fhicl::ParameterSet const &pset)
PutHandle< PROD > put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
#define DEFINE_ART_MODULE(klass)
Provides recob::Track data product.
std::string fSpptModuleLabel
reference at(size_type n)
std::string fTrackModuleLabel
bool CreateAssn(art::Event &evt, std::vector< T > const &a, art::Ptr< U > const &b, art::Assns< U, T > &assn, std::string a_instance, size_t index=UINT_MAX)
Creates a single one-to-one association.
iterator insert(iterator position, Ptr< U > const &p)
art::PtrVector< recob::SpacePoint > GetSpacePointsFromComponentTracks(const art::PtrVector< recob::Track > &, const art::Event &evt)
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
Utility object to perform functions of association.
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
void GetTrackComposites(std::vector< art::PtrVector< recob::Track >> &c) const
art framework interface to geometry description
void produce(art::Event &evt) override
cet::coded_exception< error, detail::translate > exception