VecHit.cxx
Go to the documentation of this file.
1 //
2 // VecHit.cxx
3 //
4 // Created by Tom Junk on Feb. 5, 2019
5 //
7 
9 #include "TMath.h"
10 
11 namespace gar {
12  namespace rec {
13 
14  //--------------------------------------------------------------------------
16  {
17  return;
18  }
19 
20  //--------------------------------------------------------------------------
22  float *dir,
23  float len)
24  : fLength (len )
25  {
26 
27  fPosition[0] = pos[0];
28  fPosition[1] = pos[1];
29  fPosition[2] = pos[2];
30 
31  fDirection[0] = dir[0];
32  fDirection[1] = dir[1];
33  fDirection[2] = dir[2];
34 
35  return;
36  }
37 
38  //--------------------------------------------------------------------------
39  std::ostream& operator<< (std::ostream& o, gar::rec::VecHit const& h)
40  {
41 
42  o << "Vector Hit "
43  << "\n\tposition = ("
44  << h.Position()[0]
45  << ", "
46  << h.Position()[1]
47  << ", "
48  << h.Position()[2]
49  << ")"
50  << "\tdirection = ("
51  << h.Direction()[0]
52  << ", "
53  << h.Direction()[1]
54  << ", "
55  << h.Direction()[2]
56  << ")"
57  << "\tLength = " << h.Length();
58 
59  return o;
60  }
61 
62  } // rec
63 } // gar
rec
Definition: tracks.py:88
const float * Position() const
Definition: VecHit.h:47
string dir
float fPosition[3]
position of the vector hit
Definition: VecHit.h:24
const float * Direction() const
Definition: VecHit.h:48
friend std::ostream & operator<<(std::ostream &o, gar::rec::VecHit const &h)
Definition: VecHit.cxx:39
float fDirection[3]
direction cosines
Definition: VecHit.h:25
float fLength
length of VH (centered on fPosition, half of the length is in either direction)
Definition: VecHit.h:26
float Length() const
Definition: VecHit.h:49
General GArSoft Utilities.