314 art::ServiceHandle<geo::Geometry const> geom;
321 auto tracks = std::make_unique<std::vector<recob::Track>>();
322 auto vertices = std::make_unique<std::vector<recob::Vertex>>();
323 auto clusters = std::make_unique<std::vector<recob::Cluster>>();
324 auto allsp = std::make_unique<std::vector<recob::SpacePoint>>();
326 auto trk2hit = std::make_unique<art::Assns<recob::Track, recob::Hit>>();
327 auto trk2vtx = std::make_unique<art::Assns<recob::Track, recob::Vertex>>();
328 auto cl2hit = std::make_unique<art::Assns<recob::Cluster, recob::Hit>>();
329 auto trk2cl = std::make_unique<art::Assns<recob::Track, recob::Cluster>>();
330 auto trk2sp = std::make_unique<art::Assns<recob::Track, recob::SpacePoint>>();
331 auto sp2hit = std::make_unique<art::Assns<recob::SpacePoint, recob::Hit>>();
333 auto const clockData = art::ServiceHandle<detinfo::DetectorClocksService const>()->DataFor(
e);
335 art::ServiceHandle<detinfo::DetectorPropertiesService const>()->DataFor(
e, clockData);
343 std::vector<art::Ptr<recob::Hit>> hitlist;
362 size_t spStart = 0, spEnd = 0;
363 double sp_pos[3], sp_err[6], vtx_pos[3];
364 for (
size_t i = 0; i < 6; i++)
372 vtx_pos[0] = trk.track->front()->Point3D().X();
373 vtx_pos[1] = trk.track->front()->Point3D().Y();
374 vtx_pos[2] = trk.track->front()->Point3D().Z();
375 vertices->emplace_back(vtx_pos,
fTrkIndex);
379 std::vector<art::Ptr<recob::Cluster>> cl2d;
383 std::vector<art::Ptr<recob::Hit>> hits2d;
384 art::PtrVector<recob::Hit> sp_hits;
386 spStart = allsp->size();
387 for (
int h = trk.track->size() - 1;
h >= 0;
h--) {
391 if ((
h == 0) || (sp_pos[0] != h3d->
Point3D().X()) || (sp_pos[1] != h3d->
Point3D().Y()) ||
392 (sp_pos[2] != h3d->
Point3D().Z())) {
398 sp_pos[0] = h3d->
Point3D().X();
399 sp_pos[1] = h3d->
Point3D().Y();
400 sp_pos[2] = h3d->
Point3D().Z();
409 spEnd = allsp->size();
411 if (vertices->size()) {
412 size_t vtx_idx = (size_t)(vertices->size() - 1);
425 for (
auto const trk :
fPMA3D) {
430 std::vector<art::Ptr<recob::Cluster>> cl2d;
431 cl2d.push_back(art::Ptr<recob::Cluster>(
fCluListHandle, trk.idcl1));
432 cl2d.push_back(art::Ptr<recob::Cluster>(
fCluListHandle, trk.idcl2));
434 std::vector<art::Ptr<recob::Hit>> hits2d;
435 art::PtrVector<recob::Hit> sp_hits;
437 spStart = allsp->size();
438 for (
int h = trk.track->size() - 1;
h >= 0;
h--) {
442 if ((
h == 0) || (sp_pos[0] != h3d->
Point3D().X()) || (sp_pos[1] != h3d->
Point3D().Y()) ||
443 (sp_pos[2] != h3d->
Point3D().Z())) {
449 sp_pos[0] = h3d->
Point3D().X();
450 sp_pos[1] = h3d->
Point3D().Y();
451 sp_pos[2] = h3d->
Point3D().Z();
460 spEnd = allsp->size();
480 for (
unsigned int i = 0; i < showernviews.size(); i++)
481 delete showernviews[i];
483 for (
unsigned int i = 0; i < fSeltracks.size(); i++)
484 delete fSeltracks[i].
track;
486 for (
unsigned int i = 0; i <
fInisegs.size(); i++)
489 for (
unsigned int i = 0; i < fPMA3D.size(); i++)
490 delete fPMA3D[i].
track;
494 e.put(std::move(vertices));
495 e.put(std::move(clusters));
496 e.put(std::move(allsp));
498 e.put(std::move(trk2hit));
499 e.put(std::move(trk2vtx));
500 e.put(std::move(cl2hit));
501 e.put(std::move(trk2cl));
502 e.put(std::move(trk2sp));
503 e.put(std::move(sp2hit));
ClusterModuleLabel join with tracks
std::vector< std::vector< art::Ptr< recob::Hit > > > fClusters
art::Handle< std::vector< recob::Cluster > > fCluListHandle
TVector3 const & Point3D() const
process_name use argoneut_mc_hitfinder track
std::vector< IniSeg > fInisegs
std::vector< ems::DirOfGamma * > CollectShower2D(detinfo::DetectorPropertiesData const &detProp, art::Event const &e)
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.
std::vector< IniSeg > fPMA3D
recob::Track ConvertFrom(detinfo::DetectorClocksData const &clock_data, detinfo::DetectorPropertiesData const &det_prop, pma::Track3D &src)
void Link(art::Event const &e, detinfo::DetectorPropertiesData const &detProp, std::vector< ems::DirOfGamma * > input)
recob::Track ConvertFrom2(detinfo::DetectorClocksData const &clock_data, detinfo::DetectorPropertiesData const &det_prop, pma::Track3D &src)
std::vector< size_t > fClustersNotUsed
art::Ptr< recob::Hit > const & Hit2DPtr() const
std::vector< IniSeg > fSeltracks
void Reoptimize(detinfo::DetectorPropertiesData const &detProp)
std::string fCluModuleLabel