Typedefs | Functions
BlobGrouping.cxx File Reference
#include "WireCellImg/BlobGrouping.h"
#include "WireCellIface/SimpleCluster.h"
#include "WireCellUtil/NamedFactory.h"
#include <boost/graph/connected_components.hpp>

Go to the source code of this file.

Typedefs

typedef std::unordered_map< WirePlaneLayer_t, cluster_indexed_graph_t > layer_graphs_t
 

Functions

 WIRECELL_FACTORY (BlobGrouping, WireCell::Img::BlobGrouping, WireCell::IClusterFilter, WireCell::IConfigurable) using namespace WireCell
 
static void fill_blob (layer_graphs_t &lgs, const cluster_indexed_graph_t &grind, IBlob::pointer iblob)
 
static void fill_slice (cluster_indexed_graph_t &grind, ISlice::pointer islice)
 

Typedef Documentation

typedef std::unordered_map<WirePlaneLayer_t, cluster_indexed_graph_t> layer_graphs_t

Definition at line 14 of file BlobGrouping.cxx.

Function Documentation

static void fill_blob ( layer_graphs_t lgs,
const cluster_indexed_graph_t &  grind,
IBlob::pointer  iblob 
)
static

Definition at line 37 of file BlobGrouping.cxx.

40 {
41  cluster_node_t nblob{iblob};
42 
43  for (auto wvtx : grind.neighbors(nblob)) {
44  if (wvtx.code() != 'w') {
45  continue;
46  }
47  auto iwire = std::get<IWire::pointer>(wvtx.ptr);
48  auto layer = iwire->planeid().layer();
49  auto& lg = lgs[layer];
50 
51  for (auto cvtx : grind.neighbors(wvtx)) {
52  if (cvtx.code() != 'c') {
53  continue;
54  }
55  //auto ich = std::get<IChannel::pointer>(cvtx.ptr);
56  lg.edge(nblob, cvtx);
57  }
58  }
59 }
char * lg(uint32_t n, Handler h) FMT_ALWAYS_INLINE
Definition: format.h:832
static void fill_slice ( cluster_indexed_graph_t &  grind,
ISlice::pointer  islice 
)
static

Definition at line 63 of file BlobGrouping.cxx.

65 {
66  layer_graphs_t lgs;
67 
68  for (auto other : grind.neighbors(islice)) {
69  if (other.code() != 'b') {
70  continue;
71  }
72  IBlob::pointer iblob = std::get<IBlob::pointer>(other.ptr);
73  fill_blob(lgs, grind, iblob);
74  }
75 
76  for (auto lgit : lgs) {
77  auto& lgrind = lgit.second;
78  auto groups = lgrind.groups();
79  for (auto& group : groups) {
80  // add a "measurement" to the graph
82  IChannel::shared_vector imeas = IChannel::shared_vector(chans);
83 
84  for (auto& v : group.second) {
85  if (v.code() == 'b') {
86  // (b-m)
87  grind.edge(v.ptr, imeas);
88  continue;
89  }
90  if (v.code() == 'c') {
91  // (c-m)
92  grind.edge(v.ptr, imeas);
93  chans->push_back(std::get<IChannel::pointer>(v.ptr));
94  continue;
95  }
96  }
97  }
98  }
99 }
struct vector vector
static void fill_blob(layer_graphs_t &lgs, const cluster_indexed_graph_t &grind, IBlob::pointer iblob)
std::unordered_map< WirePlaneLayer_t, cluster_indexed_graph_t > layer_graphs_t
const GenericPointer< typename T::ValueType > & pointer
Definition: pointer.h:1124
WIRECELL_FACTORY ( BlobGrouping  ,
WireCell::Img::BlobGrouping  ,
WireCell::IClusterFilter  ,
WireCell::IConfigurable   
)