IWireParameters.h
Go to the documentation of this file.
1 #ifndef WIRECELLIFACE_IWIREPARAMETERS
2 #define WIRECELLIFACE_IWIREPARAMETERS
3 
5 
7 #include "WireCellUtil/Point.h"
8 
9 
10 namespace WireCell {
11 
12 // fixme: move this blah blah into the docs.
13 
14  /** Interface by which parameters describing wire planes can be
15  * accessed.
16  *
17  * Assumptions and conventions:
18  *
19  * - Each plane is parallel to the others and are perpendicular to
20  * the X-axis. In decreasing X value they are labeled: U, V and
21  * W.
22  *
23  * - The wires in a plane run parallel to each other, this is
24  * called the plane's direction which is also labeled U, V and W.
25  *
26  * - The angle of the plane is measured from the Y-axis and is
27  * signed following the right-hand-rule. (Y x Wire = X).
28  *
29  * - The perpendicular distances ("pitch") between adjacent wires
30  * is regular. The pitch direction points toward increasing wire
31  * index and is take such that (Wire x Pitch) = X
32  *
33  * The above is sufficient to define the wire planes, but further
34  * convention helps to conceptualize things.
35  *
36  * U wires:
37  * - angle: [0, +90]
38  * - points: (+Y,+Z)
39  * - pitch: (-Y,+Z)
40  * - starts: (-Y,-Z)
41  *
42  * V wires:
43  * - angle: [-90, 0]
44  * - points: (+Y,-Z)
45  * - pitch: (-Y,-Z)
46  * - starts: (+Y,-Z)
47  *
48  * W wires:
49  * - angle: 0
50  * - points: +Y
51  * - pitch: +Z
52  * - starts: -Z
53  *
54  * Given this, the wires planes are fully specified by four rays.
55  *
56  * \param bounds is a WireCell::Ray with its tail at the
57  * negative-most corner and its head at the positive-most
58  * corner of a rectangular bounding box.
59  *
60  * \param U is a WireCell::Ray with direction giving the plane's
61  * pitch and with endpoints on wires within the bounding box.
62  *
63  * \param V is same but same for V wire plane.
64  *
65  * \param W is same but for for W wire plane.
66  *
67  */
68 
69  // fixme: this doesn't need to be so grand as to be an IComponent,
70  // it is just to give an initial test vehicle.
71  class IWireParameters : virtual public IComponent<IWireParameters> {
72  public:
73  virtual ~IWireParameters();
74 
75  /** Provide access to the rays which were used to define the wires. */
76 
77  /// Defines a box that bounds the set of wires.
78  virtual const Ray& bounds() const = 0;
79 
80  /// A ray going from the center of the first U wire to the
81  /// second and perpendicular to both.
82  virtual const Ray& pitchU() const = 0;
83 
84  /// A ray going from the center of the first V wire to the
85  /// second and perpendicular to both.
86  virtual const Ray& pitchV() const = 0;
87 
88  /// A ray going from the center of the first W wire to the
89  /// second and perpendicular to both.
90  virtual const Ray& pitchW() const = 0;
91 
92  // helper to return the pitch based on dynamic layer value
93  virtual const Ray& pitch(WireCell::WirePlaneLayer_t layer) const {
94  static Ray bogus;
95  switch(layer) {
96  case kUlayer: return pitchU();
97  case kVlayer: return pitchV();
98  case kWlayer: return pitchW();
99  case kUnknownLayer: return bogus;
100  }
101  return bogus;
102  }
103 
104  };
105 
106 }
107 
108 
109 #endif
std::pair< Point, Point > Ray
A line segment running from a first (tail) to a second (head) point.
Definition: Point.h:21
virtual const Ray & pitchV() const =0
virtual const Ray & bounds() const =0
Defines a box that bounds the set of wires.
virtual const Ray & pitchU() const =0
virtual const Ray & pitch(WireCell::WirePlaneLayer_t layer) const
virtual const Ray & pitchW() const =0
Definition: Main.h:22
WirePlaneLayer_t
Enumerate layer IDs. These are not indices!
Definition: WirePlaneId.h:13