LocatedChan.cxx
Go to the documentation of this file.
1 #include "TrackFit/LocatedChan.h"
2 
3 namespace trk
4 {
5  //......................................................................
7  :OfflineChan()
8  {
9  }
10  //......................................................................
12  : OfflineChan(plane, cell)
13  {
14  }
15 
16  //......................................................................
18  {
19  fHit = chit;
20  }
21 
22  //......................................................................
24  {
25  return fHit;
26  }
27 
28  //......................................................................
29  void LocatedChan::SetCenter(double x, double y, double z)
30  {
31  fcenter.SetXYZ(x,y,z);
32  }
33 
34  //......................................................................
35  /// Return the center position of a the channel
36  /// \param xyz : 3-D array. The returned location
37  void LocatedChan::GetCenter(double* xyz)
38  {
39  xyz[0] = fcenter.X();
40  xyz[1] = fcenter.Y();
41  xyz[2] = fcenter.Z();
42  }
43 
44  //......................................................................
45  void LocatedChan::SetHalfWidths(double dx, double dy, double dz)
46  {
47  fhalfwidths.SetXYZ(dx,dy,dz);
48  }
49 
50  //......................................................................
51  /// Return the half widths of the channel
52  /// \param dxyz : 3-D array. The half width of the cell in each dimension
53  void LocatedChan::GetHalfWidths(double* dxyz)
54  {
55  dxyz[0] = fhalfwidths.X();
56  dxyz[1] = fhalfwidths.Y();
57  dxyz[2] = fhalfwidths.Z();
58  }
59 
60  //......................................................................
62  {
63  return a.Plane() < b.Plane();
64  }
65 
66  //......................................................................
67  void SortByPlane(std::vector<trk::LocatedChan>& c)
68  {
69  std::sort(c.begin(), c.end(), trk::CompareByPlane);
70  }
71  //......................................................................
73  {
74  return a.Cell() < b.Cell();
75  }
76 
77  //......................................................................
78  void SortByCell(std::vector<trk::LocatedChan>& c)
79  {
80  std::sort(c.begin(), c.end(), trk::CompareByCell);
81  }
82 
83 }
void GetCenter(double *xyz)
Definition: LocatedChan.cxx:37
void SetHit(art::Ptr< rb::CellHit > chit)
Definition: LocatedChan.cxx:17
Representation of a detector channel with positional information.
Definition: LocatedChan.h:15
void SetHalfWidths(double dx, double dy, double dz)
Definition: LocatedChan.cxx:45
void SortByCell(std::vector< trk::LocatedChan > &c)
Definition: LocatedChan.cxx:78
void GetHalfWidths(double *dxyz)
Definition: LocatedChan.cxx:53
Track finder for cosmic rays.
art::Ptr< rb::CellHit > fHit
cellhit in this channel
Definition: LocatedChan.h:28
double dy[NP][NC]
double dx[NP][NC]
double dz[NP][NC]
TVector3 fcenter
cell center position
Definition: LocatedChan.h:29
const double a
void SetCenter(double x, double y, double z)
Definition: LocatedChan.cxx:29
bool CompareByPlane(const trk::LocatedChan &a, const trk::LocatedChan &b)
Definition: LocatedChan.cxx:61
z
Definition: test.py:28
unsigned short Plane() const
Definition: OfflineChan.h:31
art::Ptr< rb::CellHit > GetHit() const
Definition: LocatedChan.cxx:23
unsigned short Cell() const
Definition: OfflineChan.h:32
TVector3 fhalfwidths
half widths of cell
Definition: LocatedChan.h:30
void SortByPlane(std::vector< trk::LocatedChan > &c)
Definition: LocatedChan.cxx:67
bool CompareByCell(const trk::LocatedChan &a, const trk::LocatedChan &b)
Definition: LocatedChan.cxx:72
const hit & b
Definition: hits.cxx:21