Functions
AnodeFace.cxx File Reference
#include "WireCellGen/AnodeFace.h"

Go to the source code of this file.

Functions

static ray_pair_vector_t get_raypairs (const BoundingBox &bb, const IWirePlane::vector &planes)
 

Function Documentation

static ray_pair_vector_t get_raypairs ( const BoundingBox bb,
const IWirePlane::vector planes 
)
static

Definition at line 8 of file AnodeFace.cxx.

9 {
10  ray_pair_vector_t raypairs;
11 
12  const Ray& bbray = bb.bounds();
13 
14  // We don't care which end point is which, but conceptually assume
15  // point a is "lower" than "b" in Y and Z. X gets zeroed.
16  const Point& a = bbray.first;
17  const Point& b = bbray.second;
18 
19  // Corners of a box in X=0 plane
20  Point ll(0.0, a.y(), a.z());
21  Point lr(0.0, a.y(), b.z());
22  Point ul(0.0, b.y(), a.z());
23  Point ur(0.0, b.y(), b.z());
24 
25  // boundary in the horizontal direction (rays point at Y+)
26  Ray h1(ll, ul);
27  Ray h2(lr, ur);
28  raypairs.push_back(ray_pair_t(h1, h2));
29 
30  // boundary in the vertical direction (rays point at Z+)
31  Ray v1(ll, lr);
32  Ray v2(ul, ur);
33  raypairs.push_back(ray_pair_t(v1, v2));
34 
35 
36  // Now the wire planes.
37  for (const auto& plane : planes) {
38  const auto& wires = plane->wires();
39  const auto wray0 = wires[0]->ray();
40  const auto wray1 = wires[1]->ray();
41  const auto pitray = ray_pitch(wray0, wray1);
42  const auto pitvec = ray_vector(pitray);
43  Ray r1(wray0.first - 0.5*pitvec, wray0.second - 0.5*pitvec);
44  Ray r2(wray0.first + 0.5*pitvec, wray0.second + 0.5*pitvec);
45 
46  raypairs.push_back(ray_pair_t(r1,r2));
47 
48  }
49 
50  // for (size_t layer =0; layer<raypairs.size(); ++layer) {
51  // const auto& rp = raypairs[layer];
52  // std::cerr << "L" << layer << " " << planes[0]->planeid() << "\n"
53  // << "\twray0=" << rp.first << "\n"
54  // << "\twray1=" << rp.second << "\n";
55  // }
56 
57  return raypairs;
58 }
std::pair< Point, Point > Ray
A line segment running from a first (tail) to a second (head) point.
Definition: Point.h:21
std::tuple< double, double, const reco::ClusterHit3D * > Point
Definitions used by the VoronoiDiagram algorithm.
Definition: DCEL.h:34
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition: pointer.h:1124
std::vector< ray_pair_t > ray_pair_vector_t
Definition: Point.h:27
Ray ray_pitch(const Ray &ray1, const Ray &ray2)
Definition: Point.cxx:76
static bool * b
Definition: config.cpp:1043
Vector ray_vector(const Ray &ray)
Definition: Point.cxx:67
std::pair< Ray, Ray > ray_pair_t
Definition: Point.h:24
const Ray & bounds() const
Return the ray representing the bounds.
Definition: BoundingBox.h:36