58 #include "TGeoManager.h" 62 #include "TPrincipal.h" 63 #include "TDatabasePDG.h" 105 produces< std::vector<recob::Track> >();
106 produces<std::vector<art::PtrVector<recob::Track> > >();
107 produces<art::Assns<recob::Track, recob::Hit> >();
108 produces<art::Assns<recob::Track, recob::SpacePoint> >();
109 produces<art::Assns<recob::SpacePoint, recob::Hit> >();
118 fStizatch = pset.
get<
bool > (
"CommonComponentStitch",
true);
151 std::unique_ptr<std::vector<recob::Track> > tcol(
new std::vector<recob::Track>);
166 mf::LogWarning(
"TrackStitcher") <<
"Trying to read Track3DKalmanXYZ-style PtrVector of std::vector of SpacePoints" << std::endl;
169 for (
size_t ii=0; ii<sppth->size() ;ii++)
170 for (
size_t jj=0; jj<sppth->at(ii).size() ;ii++)
173 scol->push_back(sptmp );
178 mf::LogWarning(
"TrackStitcher") <<
"Trying instead to read CosmicTracker-style already-flattened vector of SpacePoints" << std::endl;
181 for (
size_t ii=0; ii<sppthf->size() ;ii++)
184 scol->push_back(sptmpf);
205 if (tcol->size()!=tvcol->size())
206 throw cet::exception(
"TrackStitcher") <<
"Tracks and TrackComposites do not match: "<<tcol->size()<<
" vs "<<tvcol->size()<<
"\n";
208 std::vector<size_t> spIndices(scol->size());
210 for (
size_t ii=0; ii<scol->size(); ii++ )
213 for (
size_t ii=0; ii<tvcol->size(); ii++)
225 std::vector<std::pair<std::vector<art::Ptr<recob::Hit> >
::const_iterator, std::vector<art::Ptr<recob::Hit> >::const_iterator > > pits;
227 std::vector<art::Ptr<recob::Hit>> hitsFromSppts;
230 size_t start(0), finish(0);
231 for (
unsigned int ii=0; ii < sppts.
size(); ++ii )
233 hitsFromSppts.insert(hitsFromSppts.end(),hitAssns.at(ii).begin(), hitAssns.at(ii).end());
234 finish = start+(size_t)(hitAssns.at(ii).end() - hitAssns.at(ii).begin());
235 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());
236 pits.push_back(pithittmp);
241 for (
size_t jj=0; jj<sppts.
size(); jj++ )
244 size_t ll(scol->size());
248 for (
auto& kk : spIndices )
251 if ( spptnc != sppts.
at(jj)) { off++;
continue;}
260 std::vector <art::Ptr <recob::Hit> > hitsThisSppt;
261 hitsThisSppt.insert(hitsThisSppt.begin(),pits.at(jj).first,pits.at(jj).second);
268 mf::LogVerbatim(
"TrackStitcher.end") <<
"There are " << tvcol->size() <<
" Tracks in this event after stitching.";
269 evt.
put(std::move(tcol));
270 evt.
put(std::move(tvcol));
272 evt.
put(std::move(thassn));
273 evt.
put(std::move(tsptassn));
274 evt.
put(std::move(spthassn));
284 for (
unsigned int ii=0; ii < tcomp.
size(); ++ii )
286 hits.
insert(hits.
end(),hitAssns.at(ii).begin(), hitAssns.at(ii).end());
299 for (
unsigned int ii=0; ii < tcomp.
size(); ++ii )
301 sppts.
insert(sppts.
end(),spptAssns.at(ii).begin(), spptAssns.at(ii).end());
311 std::vector<art::Ptr<recob::Hit>>
hits;
314 size_t start(0), finish(0);
315 for (
unsigned int ii=0; ii < sppts.
size(); ++ii )
317 hits.insert(hits.end(),hitAssns.at(ii).begin(), hitAssns.at(ii).end());
318 finish = start+(size_t)(hitAssns.at(ii).end() - hitAssns.at(ii).begin());
319 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());
320 pithit.push_back(pithittmp);
MaybeLogger_< ELseverityLevel::ELsev_info, true > LogVerbatim
art::Handle< std::vector< recob::Track > > ftListHandle
void FindHeadsAndTails(const art::Event &e, const std::string &t)
bool CommonComponentStitch()
Declaration of signal hit object.
TrackStitcher(fhicl::ParameterSet const &pset)
const 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)
ProductID put(std::unique_ptr< PROD > &&product)
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
const art::PtrVector< recob::Hit > GetHitsFromComponentTracks(const art::PtrVector< recob::Track > &, const art::Event &evt)
#define DEFINE_ART_MODULE(klass)
Provides recob::Track data product.
T get(std::string const &key) const
void reconfigure(fhicl::ParameterSet const &pset)
const art::PtrVector< recob::SpacePoint > GetSpacePointsFromComponentTracks(const art::PtrVector< recob::Track > &, const art::Event &evt)
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
void GetTrackComposites(std::vector< art::PtrVector< recob::Track > > &c)
reference at(size_type n)
void reconfigure(fhicl::ParameterSet const &p)
Encapsulate the geometry of a wire.
std::string fTrackModuleLabel
void produce(art::Event &evt)
iterator insert(iterator position, Ptr< U > const &p)
Utility object to perform functions of association.
Encapsulate the construction of a single detector plane.
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
Tools and modules for checking out the basics of the Monte Carlo.
art framework interface to geometry description
void GetTracks(std::vector< recob::Track > &t)
cet::coded_exception< error, detail::translate > exception