All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Public Attributes | List of all members
sbn::Stub Class Reference

#include <Stub.h>

Public Member Functions

float CoreCharge (unsigned plane_index=0) const
 Helper functions. More...
 
int CoreNHit (unsigned plane_index=0) const
 Returns the number of hits along the core of the stub on the given plane index. More...
 
float CoreCharge (const geo::PlaneID &p) const
 
int CoreNHit (const geo::PlaneID &p) const
 
int PlaneIndex (const geo::PlaneID &p) const
 
bool OnCore (const geo::WireID &w) const
 Returns whether the input wire-ID is on the core of the stub. More...
 

Public Attributes

geo::Point_t vtx
 Interaction Vertex / Start of Stub. Space charge corrected. [cm]. More...
 
geo::Point_t end
 End of Stub. Space charge corrected. [cm]. More...
 
float efield_end
 The E-Field at the stub end point. More...
 
float efield_vtx
 The E-Field at the reconstructed vertex. More...
 
std::vector< geo::PlaneIDplane
 The plane ID. More...
 
std::vector< float > pitch
 Pitch of stub on each wire [cm]. More...
 
std::vector< float > trkpitch
 Pitch of the matched track on each wire [cm]. More...
 
std::vector< float > vtx_w
 Wire coordinate of the vertex on this plane. More...
 
std::vector< short > hit_w
 Wire of the end point hit on this plane. More...
 
std::vector< std::vector
< StubHit > > 
hits
 Hits on each plane. Ordered vtx->end. More...
 

Detailed Description

Definition at line 16 of file Stub.h.

Member Function Documentation

float sbn::Stub::CoreCharge ( unsigned  plane_index = 0) const

Helper functions.

Returns the charge along the core of the stub on the given plane index

Definition at line 25 of file Stub.cxx.

25  {
26  if (plane_index >= plane.size()) return -1;
27  float ret = 0.;
28 
29  int stubdir = vtx_w[plane_index] <= hit_w[plane_index] ? 1 : -1;
30  for (const sbn::StubHit &h: hits[plane_index]) {
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) {
34  ret += h.charge;
35  }
36  }
37 
38  return ret;
39 }
std::vector< geo::PlaneID > plane
The plane ID.
Definition: Stub.h:25
std::vector< std::vector< StubHit > > hits
Hits on each plane. Ordered vtx-&gt;end.
Definition: Stub.h:32
std::vector< float > vtx_w
Wire coordinate of the vertex on this plane.
Definition: Stub.h:29
while getopts h
std::vector< short > hit_w
Wire of the end point hit on this plane.
Definition: Stub.h:30
float sbn::Stub::CoreCharge ( const geo::PlaneID p) const

Definition at line 11 of file Stub.cxx.

11  {
12  int plane_index = PlaneIndex(p);
13  if (plane_index < 0) return 0.;
14 
15  return CoreCharge(plane_index);
16 }
float CoreCharge(unsigned plane_index=0) const
Helper functions.
Definition: Stub.cxx:25
int PlaneIndex(const geo::PlaneID &p) const
Definition: Stub.cxx:3
int sbn::Stub::CoreNHit ( unsigned  plane_index = 0) const

Returns the number of hits along the core of the stub on the given plane index.

Definition at line 41 of file Stub.cxx.

41  {
42  if (plane_index >= plane.size()) return -1;
43  int ret = 0;
44 
45  int stubdir = vtx_w[plane_index] <= hit_w[plane_index] ? 1 : -1;
46  for (const sbn::StubHit &h: hits[plane_index]) {
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) {
50  ret ++;
51  }
52  }
53 
54  return ret;
55 }
std::vector< geo::PlaneID > plane
The plane ID.
Definition: Stub.h:25
std::vector< std::vector< StubHit > > hits
Hits on each plane. Ordered vtx-&gt;end.
Definition: Stub.h:32
std::vector< float > vtx_w
Wire coordinate of the vertex on this plane.
Definition: Stub.h:29
while getopts h
std::vector< short > hit_w
Wire of the end point hit on this plane.
Definition: Stub.h:30
int sbn::Stub::CoreNHit ( const geo::PlaneID p) const

Definition at line 18 of file Stub.cxx.

18  {
19  int plane_index = PlaneIndex(p);
20  if (plane_index < 0) return 0;
21 
22  return CoreNHit(plane_index);
23 }
int PlaneIndex(const geo::PlaneID &p) const
Definition: Stub.cxx:3
int CoreNHit(unsigned plane_index=0) const
Returns the number of hits along the core of the stub on the given plane index.
Definition: Stub.cxx:41
bool sbn::Stub::OnCore ( const geo::WireID w) const

Returns whether the input wire-ID is on the core of the stub.

Definition at line 57 of file Stub.cxx.

57  {
58  int plane_index = PlaneIndex(w);
59  if (plane_index < 0) return -1;
60 
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;
64 
65  return !before_vtx && !after_hit;
66 }
WireID_t Wire
Index of the wire within its plane.
Definition: geo_types.h:580
std::vector< float > vtx_w
Wire coordinate of the vertex on this plane.
Definition: Stub.h:29
std::vector< short > hit_w
Wire of the end point hit on this plane.
Definition: Stub.h:30
int PlaneIndex(const geo::PlaneID &p) const
Definition: Stub.cxx:3
int sbn::Stub::PlaneIndex ( const geo::PlaneID p) const

Definition at line 3 of file Stub.cxx.

3  {
4  for (unsigned i_p = 0; i_p < plane.size(); i_p++) {
5  if (plane[i_p] == p) return i_p;
6  }
7 
8  return -1;
9 }
std::vector< geo::PlaneID > plane
The plane ID.
Definition: Stub.h:25

Member Data Documentation

float sbn::Stub::efield_end

The E-Field at the stub end point.

Definition at line 21 of file Stub.h.

float sbn::Stub::efield_vtx

The E-Field at the reconstructed vertex.

Definition at line 22 of file Stub.h.

geo::Point_t sbn::Stub::end

End of Stub. Space charge corrected. [cm].

Definition at line 19 of file Stub.h.

std::vector<short> sbn::Stub::hit_w

Wire of the end point hit on this plane.

Definition at line 30 of file Stub.h.

std::vector<std::vector<StubHit> > sbn::Stub::hits

Hits on each plane. Ordered vtx->end.

Definition at line 32 of file Stub.h.

std::vector<float> sbn::Stub::pitch

Pitch of stub on each wire [cm].

Definition at line 27 of file Stub.h.

std::vector<geo::PlaneID> sbn::Stub::plane

The plane ID.

Definition at line 25 of file Stub.h.

std::vector<float> sbn::Stub::trkpitch

Pitch of the matched track on each wire [cm].

Definition at line 28 of file Stub.h.

geo::Point_t sbn::Stub::vtx

Interaction Vertex / Start of Stub. Space charge corrected. [cm].

Definition at line 18 of file Stub.h.

std::vector<float> sbn::Stub::vtx_w

Wire coordinate of the vertex on this plane.

Definition at line 29 of file Stub.h.


The documentation for this class was generated from the following files: