100 std::unique_ptr<std::vector<recob::Cluster>> clusters(
new std::vector<recob::Cluster>);
101 std::unique_ptr<art::Assns<recob::Cluster, recob::Hit>> clu2hit(
102 new art::Assns<recob::Cluster, recob::Hit>);
105 unsigned int cidx = 0;
106 const unsigned int emTag = 0x10000;
108 for (
auto tpc_iter =
fGeom->begin_TPC_id(); tpc_iter !=
fGeom->end_TPC_id(); tpc_iter++) {
109 for (
const auto& v :
fHitMap[tpc_iter->Cryostat][tpc_iter->TPC]) {
113 mf::LogVerbatim(
"TrackShowerHits") <<
"Find huge EM showers (cores).";
115 int c = 0, clsSize = cls.size();
116 while (c < clsSize) {
117 if (cls[c].hits().
size() < 2) {
122 std::vector<const tss::Hit2D*> trks, ems;
124 cls.erase(cls.begin() + c);
127 cls.emplace_back(Cluster2D(trks));
128 cls.emplace_back(Cluster2D(ems));
129 cls.back().tagEM(
true);
134 mf::LogVerbatim(
"TrackShowerHits") <<
"Find EM showers by density of vtxs.";
136 int c = 0, clsSize = cls.size();
137 while (c < clsSize) {
138 if (cls[c].isEM() || (cls[c].hits().
size() < 2)) {
145 for (
const auto&
s : segs)
146 cls.emplace_back(Cluster2D(
s));
148 cls.erase(cls.begin() + c);
153 for (
auto& c : cls) {
154 if (!c.hits().size())
continue;
156 if (!c.isEM())
continue;
158 clusters->emplace_back(
182 c.hits().front()->Hit2DPtr()->WireID().planeID()));
184 std::vector<art::Ptr<recob::Hit>> hits2d;
185 hits2d.reserve(c.hits().size());
187 for (
auto h2d : c.hits())
188 hits2d.push_back(h2d->Hit2DPtr());
198 mf::LogWarning(
"TrackShowerHits") <<
"Hits not found in the event.";
200 evt.put(std::move(clusters));
201 evt.put(std::move(clu2hit));
cryo_tpc_view_hitmap fHitMap
tss::SimpleClustering fSimpleClustering
art::ServiceHandle< geo::Geometry const > fGeom
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
tss::Segmentation2D fSegmentation2D
std::size_t size(FixedBins< T, C > const &) noexcept
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.
std::vector< tss::Cluster2D > run(const std::vector< tss::Hit2D > &inp) const
std::vector< tss::Cluster2D > run(tss::Cluster2D &inp) const
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.
then echo File list $list not found else cat $list while read file do echo $file sed s
bool sortHits(const art::Event &evt)