99 std::unique_ptr<std::vector<recob::Cluster>> clusters(
new std::vector<recob::Cluster>);
100 std::unique_ptr<art::Assns<recob::Cluster, recob::Hit>> clu2hit(
104 unsigned int cidx = 0;
105 const unsigned int emTag = 0x10000;
108 for (
const auto& v :
fHitMap[tpc_iter->Cryostat][tpc_iter->TPC]) {
114 int c = 0, clsSize = cls.size();
115 while (c < clsSize) {
116 if (cls[c].hits().
size() < 2) {
121 std::vector<const tss::Hit2D*> trks,
ems;
123 cls.erase(cls.begin() +
c);
126 cls.emplace_back(Cluster2D(trks));
127 cls.emplace_back(Cluster2D(ems));
128 cls.back().tagEM(
true);
133 mf::LogVerbatim(
"TrackShowerHits") <<
"Find EM showers by density of vtxs.";
135 int c = 0, clsSize = cls.size();
136 while (c < clsSize) {
137 if (cls[c].isEM() || (cls[c].hits().
size() < 2)) {
144 for (
const auto&
s : segs)
145 cls.emplace_back(Cluster2D(
s));
147 cls.erase(cls.begin() +
c);
152 for (
auto& c : cls) {
153 if (!c.hits().size())
continue;
155 if (!c.isEM())
continue;
157 clusters->emplace_back(
181 c.hits().front()->Hit2DPtr()->WireID().planeID()));
183 std::vector<art::Ptr<recob::Hit>> hits2d;
184 hits2d.reserve(c.hits().size());
186 for (
auto h2d : c.hits())
187 hits2d.push_back(h2d->Hit2DPtr());
197 mf::LogWarning(
"TrackShowerHits") <<
"Hits not found in the event.";
cryo_tpc_view_hitmap fHitMap
MaybeLogger_< ELseverityLevel::ELsev_info, true > LogVerbatim
tss::SimpleClustering fSimpleClustering
TPC_id_iterator begin_TPC_id() const
Returns an iterator pointing to the first TPC ID in the detector.
art::ServiceHandle< geo::Geometry const > fGeom
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
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.
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
std::vector< tss::Cluster2D > run(const std::vector< tss::Hit2D > &inp) const
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
TPC_id_iterator end_TPC_id() const
Returns an iterator pointing after the last TPC ID in the detector.
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
bool sortHits(const art::Event &evt)