33 typedef std::map< unsigned int, std::vector< tss::Hit2D > >
view_hitmap;
72 produces< std::vector<recob::Cluster> >();
73 produces< art::Assns<recob::Cluster, recob::Hit> >();
92 std::vector< art::Ptr<recob::Hit> > hitlist;
97 unsigned int cryo, tpc, view;
98 for (
auto const& h : hitlist)
100 cryo = h->WireID().Cryostat;
101 tpc = h->WireID().TPC;
102 view = h->WireID().Plane;
114 std::unique_ptr< std::vector< recob::Cluster > > clusters(
new std::vector< recob::Cluster >);
119 unsigned int cidx = 0;
120 const unsigned int emTag = 0x10000;
126 for (
const auto & v :
fHitMap[tpc_iter->Cryostat][tpc_iter->TPC])
134 int c = 0, clsSize = cls.size();
137 if (cls[c].
hits().size() < 2) { c++;
continue; }
139 std::vector< const tss::Hit2D* > trks,
ems;
141 cls.erase(cls.begin() + c);
146 cls.back().tagEM(
true);
152 mf::LogVerbatim(
"TrackShowerHits") <<
"Find EM showers by density of vtxs.";
154 int c = 0, clsSize = cls.size();
157 if (cls[c].isEM() || (cls[c].
hits().size() < 2)) { c++;
continue; }
161 for (
const auto &
s : segs) cls.emplace_back(
Cluster2D(
s));
163 cls.erase(cls.begin() + c);
170 if (!c.hits().size())
continue;
172 if (!c.isEM())
continue;
174 clusters->emplace_back(
175 recob::Cluster(0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F,
176 c.hits().size(), 0.0F, 0.0F, cidx + emTag, (
geo::View_t)c.hits().front()->View(), c.hits().front()->Hit2DPtr()->WireID().planeID()));
178 std::vector< art::Ptr< recob::Hit > > hits2d;
179 hits2d.reserve(c.hits().size());
181 for (
auto h2d : c.hits()) hits2d.push_back(h2d->Hit2DPtr());
183 if (hits2d.size())
util::CreateAssn(*
this, evt, *clusters, hits2d, *clu2hit);
191 else mf::LogWarning(
"TrackShowerHits") <<
"Hits not found in the event.";
193 evt.
put(std::move(clusters));
194 evt.
put(std::move(clu2hit));
cryo_tpc_view_hitmap fHitMap
std::map< unsigned int, view_hitmap > tpc_view_hitmap
MaybeLogger_< ELseverityLevel::ELsev_info, true > LogVerbatim
void reconfigure(fhicl::ParameterSet const &p)
TrackShowerHits & operator=(TrackShowerHits const &)=delete
tss::SimpleClustering fSimpleClustering
TPC_id_iterator begin_TPC_id() const
Returns an iterator pointing to the first TPC ID in the detector.
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
art::ServiceHandle< geo::Geometry > fGeom
Declaration of signal hit object.
tss::Segmentation2D fSegmentation2D
void splitHitsNaive(const tss::Cluster2D &inp, std::vector< const tss::Hit2D * > &trackHits, std::vector< const tss::Hit2D * > &emHits) const
Set of hits with a 2D structure.
Split into linear clusters.
TrackShowerHits(fhicl::ParameterSet const &p)
std::map< unsigned int, std::vector< tss::Hit2D > > view_hitmap
void reconfigure(const fhicl::ParameterSet &p)
ProductID put(std::unique_ptr< PROD > &&product)
#define DEFINE_ART_MODULE(klass)
T get(std::string const &key) const
std::vector< tss::Cluster2D > run(const std::vector< tss::Hit2D > &inp) const
void produce(art::Event &e) override
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< tss::Cluster2D > run(tss::Cluster2D &inp) const
Declaration of cluster object.
TPC_id_iterator end_TPC_id() const
Returns an iterator pointing after the last TPC ID in the detector.
Encapsulate the geometry of a wire.
std::map< unsigned int, tpc_view_hitmap > cryo_tpc_view_hitmap
Implementation of the Projection Matching Algorithm.
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
bool sortHits(const art::Event &evt)
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
std::string fHitModuleLabel
art framework interface to geometry description
Encapsulate the construction of a single detector plane.