11 using namespace WireCell::RayGrid;
21 Img::GridTiling::~GridTiling()
28 m_anode = Factory::find_tn<IAnodePlane>(cfg[
"anode"].asString());
29 m_face = m_anode->face(cfg[
"face"].asInt());
30 m_threshold =
get(
cfg,
"threshold", m_threshold);
39 cfg[
"threshold"] = m_threshold;
54 const int sbs_ident = slice->ident();
58 const int nbounds_layers = 2;
59 const int nlayers = m_face->nplanes() + nbounds_layers;
60 std::vector< std::vector<Activity::value_t> > measures(nlayers);
61 measures[0].push_back(1);
62 measures[1].push_back(1);
64 const auto anodeid = m_anode->ident();
65 const auto faceid = m_face->ident();
66 auto chvs = slice->activity();
69 anodeid, faceid, slice->ident());
73 const int nactivities = slice->activity().size();
75 if (nactivities < m_face->nplanes()) {
77 anodeid, faceid, slice->ident());
81 for (
const auto& chv : slice->activity()) {
82 for (
const auto& wire : chv.first->wires()) {
83 auto wpid = wire->planeid();
84 if (wpid.face() != faceid) {
89 const int pit_ind = wire->index();
90 const int layer = nbounds_layers + wire->planeid().index();
91 auto&
m = measures[layer];
95 if ((
int)
m.size() <= pit_ind) {
96 m.resize(pit_ind+1, 0.0);
103 if (!total_activity) {
105 anodeid, faceid, slice->ident());
108 size_t nactive_layers = 0;
109 for (
size_t ind = 0; ind<measures.size(); ++ind) {
110 const auto& blah = measures[ind];
112 SPDLOG_LOGGER_TRACE(
l,
"GridTiling: anode:{} face:{} slice:{} empty active layer ind={} out of {}",
113 anodeid, faceid, slice->ident(), ind, measures.size());
118 if (nactive_layers != measures.size()) {
119 SPDLOG_LOGGER_TRACE(
l,
"GridTiling: anode:{} face:{} slice:{} missing active layers {} != {}, {} activities",
120 anodeid, faceid, slice->ident(), nactive_layers, measures.size(), nactivities);
125 for (
int layer = 0; layer<nlayers; ++layer) {
126 auto&
m = measures[layer];
133 anodeid, faceid, slice->ident());
136 const float blob_value = 0.0;
137 for (
const auto& blob : blobs) {
142 anodeid, faceid, slice->ident(), sbs->
m_blobs.size());
std::shared_ptr< const IBlob > pointer
WIRECELL_FACTORY(GridTiling, WireCell::Img::GridTiling, WireCell::ITiling, WireCell::IConfigurable) using namespace WireCell
def activity(output, slices, slice_line, cluster_tap_file)
std::shared_ptr< const ISlice > input_pointer
std::shared_ptr< const IBlobSet > output_pointer
logptr_t logger(std::string name)
#define SPDLOG_LOGGER_TRACE(logger,...)
Json::Value Configuration
blobs_t make_blobs(const Coordinates &coords, const activities_t &activities)
std::vector< Activity > activities_t
const GenericPointer< typename T::ValueType > & pointer