4 for (
unsigned i_p = 0; i_p <
plane.size(); i_p++) {
5 if (
plane[i_p] == p)
return i_p;
12 int plane_index = PlaneIndex(p);
13 if (plane_index < 0)
return 0.;
15 return CoreCharge(plane_index);
19 int plane_index = PlaneIndex(p);
20 if (plane_index < 0)
return 0;
22 return CoreNHit(plane_index);
26 if (plane_index >= plane.size())
return -1;
29 int stubdir = vtx_w[plane_index] <= hit_w[plane_index] ? 1 : -1;
31 bool before_vtx = ((
h.wire - vtx_w[plane_index]) * stubdir) < 0;
32 bool after_hit = ((
h.wire - hit_w[plane_index]) * stubdir) > 0;
33 if (!before_vtx && !after_hit) {
42 if (plane_index >= plane.size())
return -1;
45 int stubdir = vtx_w[plane_index] <= hit_w[plane_index] ? 1 : -1;
47 bool before_vtx = ((
h.wire - vtx_w[plane_index]) * stubdir) < 0;
48 bool after_hit = ((
h.wire - hit_w[plane_index]) * stubdir) > 0;
49 if (!before_vtx && !after_hit) {
58 int plane_index = PlaneIndex(w);
59 if (plane_index < 0)
return -1;
61 int stubdir = vtx_w[plane_index] <= hit_w[plane_index] ? 1 : -1;
62 bool before_vtx = (((int)w.
Wire - vtx_w[plane_index]) * stubdir) < 0;
63 bool after_hit = (((int)w.
Wire - hit_w[plane_index]) * stubdir) > 0;
65 return !before_vtx && !after_hit;
std::vector< geo::PlaneID > plane
The plane ID.
The data type to uniquely identify a Plane.
bool OnCore(const geo::WireID &w) const
Returns whether the input wire-ID is on the core of the stub.
WireID_t Wire
Index of the wire within its plane.
float CoreCharge(unsigned plane_index=0) const
Helper functions.
int PlaneIndex(const geo::PlaneID &p) const
int CoreNHit(unsigned plane_index=0) const
Returns the number of hits along the core of the stub on the given plane index.