320 auto tracks = std::make_unique<std::vector<recob::Track>>();
321 auto vertices = std::make_unique<std::vector<recob::Vertex>>();
322 auto clusters = std::make_unique<std::vector<recob::Cluster>>();
323 auto allsp = std::make_unique<std::vector<recob::SpacePoint>>();
325 auto trk2hit = std::make_unique<art::Assns<recob::Track, recob::Hit>>();
326 auto trk2vtx = std::make_unique<art::Assns<recob::Track, recob::Vertex>>();
327 auto cl2hit = std::make_unique<art::Assns<recob::Cluster, recob::Hit>>();
328 auto trk2cl = std::make_unique<art::Assns<recob::Track, recob::Cluster>>();
329 auto trk2sp = std::make_unique<art::Assns<recob::Track, recob::SpacePoint>>();
330 auto sp2hit = std::make_unique<art::Assns<recob::SpacePoint, recob::Hit>>();
342 std::vector<art::Ptr<recob::Hit>> hitlist;
348 std::vector<ems::DirOfGamma*> showernviews =
CollectShower2D(detProp, e);
350 Link(e, detProp, showernviews);
361 size_t spStart = 0, spEnd = 0;
362 double sp_pos[3], sp_err[6], vtx_pos[3];
363 for (
size_t i = 0; i < 6; i++)
371 vtx_pos[0] =
trk.track->front()->Point3D().X();
372 vtx_pos[1] =
trk.track->front()->Point3D().Y();
373 vtx_pos[2] =
trk.track->front()->Point3D().Z();
374 vertices->emplace_back(vtx_pos,
fTrkIndex);
378 std::vector<art::Ptr<recob::Cluster>> cl2d;
382 std::vector<art::Ptr<recob::Hit>> hits2d;
385 spStart = allsp->
size();
386 for (
int h =
trk.track->size() - 1;
h >= 0;
h--) {
390 if ((
h == 0) || (sp_pos[0] != h3d->
Point3D().X()) || (sp_pos[1] != h3d->
Point3D().Y()) ||
391 (sp_pos[2] != h3d->
Point3D().Z())) {
397 sp_pos[0] = h3d->
Point3D().X();
398 sp_pos[1] = h3d->
Point3D().Y();
399 sp_pos[2] = h3d->
Point3D().Z();
408 spEnd = allsp->size();
410 if (vertices->size()) {
411 size_t vtx_idx = (size_t)(vertices->size() - 1);
429 std::vector<art::Ptr<recob::Cluster>> cl2d;
433 std::vector<art::Ptr<recob::Hit>> hits2d;
436 spStart = allsp->
size();
437 for (
int h =
trk.track->size() - 1;
h >= 0;
h--) {
441 if ((
h == 0) || (sp_pos[0] != h3d->
Point3D().X()) || (sp_pos[1] != h3d->
Point3D().Y()) ||
442 (sp_pos[2] != h3d->
Point3D().Z())) {
448 sp_pos[0] = h3d->
Point3D().X();
449 sp_pos[1] = h3d->
Point3D().Y();
450 sp_pos[2] = h3d->
Point3D().Z();
459 spEnd = allsp->size();
479 for (
unsigned int i = 0; i < showernviews.size(); i++)
480 delete showernviews[i];
482 for (
unsigned int i = 0; i < fSeltracks.size(); i++)
483 delete fSeltracks[i].track;
485 for (
unsigned int i = 0; i <
fInisegs.size(); i++)
488 for (
unsigned int i = 0; i < fPMA3D.size(); i++)
489 delete fPMA3D[i].track;
std::vector< std::vector< art::Ptr< recob::Hit > > > fClusters
art::Handle< std::vector< recob::Cluster > > fCluListHandle
TVector3 const & Point3D() const
std::vector< IniSeg > fInisegs
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
void push_back(Ptr< U > const &p)
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::vector< ems::DirOfGamma * > CollectShower2D(detinfo::DetectorPropertiesData const &detProp, art::Event const &e)
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