Prong.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 // \file Prong.h
3 // \brief A Prong is a Cluster with defined start position and direction.
4 // \version $Id: Prong.h,v 1.11 2012-10-26 21:31:55 bckhouse Exp $
5 // \author $Author: bckhouse $
6 // \date $Date: 2012-10-26 21:31:55 $
7 ////////////////////////////////////////////////////////////////////////
8 #ifndef RBPRONG_H
9 #define RBPRONG_H
10 
11 #include "RecoBase/Cluster.h"
12 #include "RecoBase/CellHit.h"
13 
14 #include "TVector3.h"
15 
16 namespace rb
17 {
18  /// \brief A \ref Cluster with defined start position and direction
19  class Prong : public Cluster
20  {
21  public:
22  Prong(){}
23 
24 #ifndef __GCCXML__
25 
26  /// \name 3D prong constructors
27  //@{
28  /// \param cells CellHits associated with this prong
29  /// \param start 3D position of the prong vertex
30  /// \param dir Reconstructed prong direction. Automatically normalized
32  TVector3 start, TVector3 dir, int id=0);
33  /// \param clust Cluster holding CellHits associated with this prong
34  /// \param start 3D position of the prong vertex
35  /// \param dir Reconstructed prong direction. Automatically normalized
36  Prong(const rb::Cluster& clust,
37  TVector3 start, TVector3 dir, int id=0);
38  //@}
39  /// \name 2D prong constructors
40  //@{
41  /// \param cells CellHits associated with this prong
42  /// \param view View this prong is defined in
43  /// \param v0 %Vertex position in coordinate matching \a view
44  /// \param z0 %Vertex z-position
45  /// \param dv Component of prong direction in \a view coordinate
46  /// \param dz z-component of prong direction
48  geo::View_t view, double v0, double z0, double dv, double dz, int id=0);
49  //@}
50  /// \name 2D prong constructors
51  //@{
52  /// \param cells CellHits associated with this prong
53  /// \param view View this prong is defined in
54  /// \param v0 %Vertex position in coordinate matching \a view
55  /// \param z0 %Vertex z-position
56  /// \param dv Component of prong direction in \a view coordinate
57  /// \param dz z-component of prong direction
58  Prong(const std::vector< art::Ptr<rb::CellHit> >& cells,
59  geo::View_t view, double v0, double z0, double dv, double dz, int id=0);
60  /// \param clust Cluster holding CellHits associated with this prong
61  /// \param v0 %Vertex position in coordinate matching Cluster's view
62  /// \param z0 %Vertex z-position
63  /// \param dv Component of prong direction in the Cluster's view
64  /// \param dz z-component of prong direction
65  Prong(const rb::Cluster& clust,
66  double v0, double z0, double dv, double dz, int id=0);
67  //@}
68 
69  virtual ~Prong();
70 
71  virtual bool Is3D() const {return fView == geo::kXorY;}
72 
73  virtual TVector3 Start() const {return fStart;}
74  /// \brief Unit vector describing prong direction
75  ///
76  /// For 2D prongs the unmeasured component is zero
77  virtual TVector3 Dir() const {return fDir;}
78 
79  virtual void SetStart(TVector3 start);
80  virtual void SetStart(double v0, double z0);
81 
82  virtual void SetDir(TVector3 dir);
83  /// \param dv Component of prong direction in \ref View coordinate
84  /// \param dz z-component of prong direction
85  virtual void SetDir(double dv, double dz);
86 
87  /// \brief Estimate the unmeasured coordinate of \a chit
88  ///
89  /// For \ref Prong, this is calculated by taking the position of the
90  /// straight line defined by \ref Start and \ref Dir at the z-coordinate
91  /// of the cell.
92  ///
93  /// \param chit Any \ref CellHit, not necessarily owned by this container
94  /// \return Estimated unmeasured coordinate of this hit (cm) assuming
95  /// it to be associated with this reconstructed object.
96  virtual double W(const rb::CellHit* chit) const;
97 
98  /// \brief Distance along prong to reach last cell hit
99  ///
100  /// Overridden by Track and Shower
101  virtual double TotalLength() const;
102 
103  /// \param z z-coordinate to evaluate trajectory at
104  /// \return Distance from \ref Start measured along the trajectory
105  virtual double DistanceFromStart(double z) const;
106 
107  bool operator< (const Prong& other) const;
108 
109 #endif // __GCCXML__
110  protected:
111  TVector3 fStart; ///< Start location (xyz, cm)
112  TVector3 fDir; ///< Direction at starting point
113  };
114 
115 } // end namespace
116 
117 #endif // RBPRONG_H
118 //////////////////////////////////////////////////////////////////////////////
virtual ~Prong()
Definition: Prong.cxx:69
virtual double W(const rb::CellHit *chit) const
Estimate the unmeasured coordinate of chit.
Definition: Prong.cxx:135
TVector3 fDir
Direction at starting point.
Definition: Prong.h:112
Prong()
Definition: Prong.h:22
X or Y views.
Definition: PlaneGeo.h:30
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
virtual double DistanceFromStart(double z) const
Definition: Prong.cxx:214
A collection of associated CellHits.
Definition: Cluster.h:47
virtual TVector3 Start() const
Definition: Prong.h:73
virtual void SetStart(TVector3 start)
Definition: Prong.cxx:75
virtual double TotalLength() const
Distance along prong to reach last cell hit.
Definition: Prong.cxx:186
double dz[NP][NC]
virtual void SetDir(TVector3 dir)
Definition: Prong.cxx:104
geo::View_t fView
view this cluster is in
Definition: Cluster.h:316
virtual TVector3 Dir() const
Unit vector describing prong direction.
Definition: Prong.h:77
bool operator<(const Prong &other) const
Definition: Prong.cxx:226
Perform a "2 point" Hough transform on a collection of hits.
z
Definition: test.py:28
TVector3 fStart
Start location (xyz, cm)
Definition: Prong.h:111
A rawdata::RawDigit with channel information decoded.
Definition: CellHit.h:27
A Cluster with defined start position and direction.
Definition: Prong.h:19
TDirectory * dir
Definition: macro.C:5
virtual bool Is3D() const
Definition: Prong.h:71