25 : m_wpid(wpid), m_index(index), m_ray(ray)
33 int iplane = m_wpid.
index();
35 return iplane*100000 + m_index;
40 int index()
const {
return m_index; }
48 int face()
const {
return 0;}
49 int apa()
const {
return 0;}
60 const Point pt1 = point;
61 const Point pt2 = pt1 + proto;
62 const Ray wireray(pt1, pt2);
70 if (hits.first.y() > hits.second.y()) {
71 hits =
Ray(hits.second, hits.first);
77 inline bool operator()(
const GenWire* lhs,
const GenWire* rhs) {
78 return lhs->index() < rhs->index();
87 const Point starting_point = step.first;
88 const Vector pitch = step.second - starting_point;
91 std::vector<GenWire*> these_wires;
94 Point offset = starting_point;
96 GenWire* wire =
make_wire(pos_index, offset, proto, bounds);
97 if (! wire) {
break; }
98 these_wires.push_back(wire);
99 offset = wire->center() + pitch;
104 const Vector neg_pitch = -1.0 * pitch;
105 offset = these_wires[0]->center() + neg_pitch;
107 GenWire* wire =
make_wire(neg_index, offset, proto, bounds);
108 if (! wire) {
break; }
109 these_wires.push_back(wire);
110 offset = wire->center() + neg_pitch;
115 std::sort(these_wires.begin(), these_wires.end(),
SortByIndex());
118 for (
size_t ind=0; ind<these_wires.size(); ++ind) {
119 GenWire* pwire = these_wires[ind];
120 pwire->set_index(ind);
121 pwire->set_planeid(wpid);
148 WireGenerator::WireGenerator()
152 WireGenerator::~WireGenerator()
std::pair< Point, Point > Ray
A line segment running from a first (tail) to a second (head) point.
bool operator()(const GenWire *lhs, const GenWire *rhs)
int segment() const
fixme: supply
GenWire(WirePlaneId wpid, int index, const Ray &ray)
std::vector< pointer > vector
WireCell::Ray ray() const
Return the ray representing the wire segment.
WirePlaneId planeid() const
The ID of the plane this wire is in.
std::shared_ptr< const IWireParameters > input_pointer
WIRECELL_FACTORY(WireGenerator, WireCell::WireGenerator, WireCell::IWireGenerator) using namespace WireCell
std::tuple< double, double, const reco::ClusterHit3D * > Point
Definitions used by the VoronoiDiagram algorithm.
General LArSoft Utilities.
Interface to information about a physical wire segment.
std::shared_ptr< const IWire::vector > output_pointer
BoundingBox bounds(int x, int y, int w, int h)
std::vector< float > Vector
static GenWire * make_wire(int index, const Point &point, const Point &proto, const Ray &bounds)
const GenericPointer< typename T::ValueType > & pointer
void set_planeid(WirePlaneId wpid)
int box_intersection(const Ray &bounds, const Ray &ray, Ray &hits)
int index() const
Layer as index number (0,1 or 2). -1 if unknown.
static void make_one_plane(IWire::vector &returned_wires, WirePlaneId wpid, const Ray &bounds, const Ray &step)