11 #include <boost/range.hpp> 33 cfg[
"wires"] = Json::arrayValue;
35 cfg[
"mode"] =
"accept";
44 m_anode = Factory::find_tn<IAnodePlane>(cfg[
"anode"].asString());
46 for (
auto face :
m_anode->faces()) {
47 if (face->planes().empty()) {
48 std::cerr <<
"Gen::WireBoundedDepos: not given multi-plane AnodeFace for face " 49 << face->ident() <<
"\n";
52 for (
auto plane : face->planes()) {
53 const size_t iplane = plane->ident();
61 m_accept = cfg[
"mode"].asString() ==
"accept";
63 auto jregions = cfg[
"regions"];
64 for (
auto jregion : jregions) {
66 for (
auto jtrio : jregion) {
69 jtrio[
"max"].asInt()));
74 std::cerr <<
"WireBoundedDepos: " << cfg [
"mode"]
75 <<
" with " <<
m_regions.size() <<
" wires in " 82 outq.push_back(
nullptr);
87 const size_t nplanes =
m_pimpos.size();
88 std::vector<bool> already(nplanes,
false);
89 std::vector<int> closest_wire(nplanes, -1);
94 for (
const auto& trio : region) {
96 const int iplane = get<0>(trio);
97 const int imin = get<1>(trio);
98 const int imax = get<2>(trio);
100 if (!already[iplane]) {
101 const double pitch =
m_pimpos[iplane]->distance(depo->pos(), 2);
102 closest_wire[iplane] =
m_pimpos[iplane]->region_binning().bin(pitch);
103 already[iplane] =
true;
105 const int iwire = closest_wire[iplane];
107 if (iwire < imin or iwire > imax) {
116 outq.push_back(depo);
124 outq.push_back(depo);
std::vector< wire_bounds_t > wire_region_t
virtual bool operator()(const input_pointer &depo, output_queue &outq)
The calling signature:
std::deque< output_pointer > output_queue
virtual ~WireBoundedDepos()
IAnodePlane::pointer m_anode
std::vector< const Pimpos * > m_pimpos
WIRECELL_FACTORY(WireBoundedDepos, WireCell::Gen::WireBoundedDepos, WireCell::IDrifter, WireCell::IConfigurable) using namespace std
std::vector< wire_region_t > m_regions
Json::Value Configuration
std::shared_ptr< const IDepo > input_pointer
std::tuple< int, int, int > wire_bounds_t