QwAnalysis
QwTrackingTreeSearch.h
Go to the documentation of this file.
1 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
2 //
3 // C++ Interface: QwTrackingTreeSearch
4 //
5 // Description:
6 //
7 //
8 // Author: Burnham Stocks <bestokes@jlab.org>
9 // Original HRC Author: wolfgang Wander <wwc@hermes.desy.de>
10 //
11 // Modified by: Wouter Deconinck <wdconinc@mit.edu>, (C) 2008
12 // Jie Pan <jpan@jlab.org>, Mon May 25 10:48:12 CDT 2009
13 //
14 // Copyright: See COPYING file that comes with this distribution
15 //
16 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
17 
18 /*! \class QwTrackingTreeSearch
19 
20  \file QwTrackingTreeSearch.h
21 
22  $date: Mon May 25 10:48:12 CDT 2009 $
23 
24  \brief Performs the treesearch algorithm to generate one treeline.
25  */
26 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
27 
28 #ifndef QWTRACKINGTREESEARCH_H
29 #define QWTRACKINGTREESEARCH_H
30 
31 #define TREESEARCH_MAX_TREELINES 1000
32 
33 ///
34 /// \ingroup QwTracking
35 
36 // Standard C and C++ headers
37 #include <vector>
38 
39 // Forward declarations
40 namespace QwTracking {
41  class shortnode;
42  class shorttree;
43 }
45 
46 class QwHit;
47 class QwTreeLine;
49 
51 
52  public:
53 
54  /// \brief Constructor
56  /// \brief Destructor
57  virtual ~QwTrackingTreeSearch();
58 
59  /// \brief Set the debug level
60  void SetDebugLevel (int debug) { fDebug = debug; };
61 
62  /// \brief Set the flag to show matching patterns when they are found
63  void SetShowMatchingPatterns(bool show = true) { fShowMatchingPatterns = show; };
64 
65  /// \brief Get the list of tree lines
66  std::vector<QwTreeLine*> GetListOfTreeLines ();
67 
68  int exists (int *newa, int front, int back, int offset);
69 
70  void setpoint (double off, double h1, double res1, double h2, double res2,
71  double width, unsigned binwidth, char *pa, char *pb,
72  int *hasha, int *hashb);
73 
74  /// \brief Method to set the tree pattern
75  int TsSetPoint (double detectorwidth, double wirespacing,
76  QwHit *hit,
77  char *pattern, int *hash, unsigned binwidth);
78 
79  /// \brief Search for the tree lines consistent with the hit pattern
81  char *pattern[16], int *hashpat[16],
82  int maxlevel, int numwires, int numlayers);
83 
84 
85  private:
86 
87  int fDebug; ///< Debug level
88 
89  bool fShowMatchingPatterns; ///< Flag to show matching patterns when found
90 
91  // Maximum missed wires and planes
92  unsigned int fMaxMissedPlanes; ///< Maximum number of missed planes in region 2
93  unsigned int fMaxMissedWires; ///< Maximum number of missed wires in region 3
94 
95  // Number of rows in the bit pattern (VDC wires or HDC planes)
96  unsigned int fNumLayers; ///< Number of detector layers (general concept)
97  unsigned int& fNumPlanes; ///< Number of region 2 HDC planes
98  unsigned int& fNumWires; ///< Number of region 3 VDC wires
99 
101  int **static_hash;
102 
103  int fMaxLevel; ///< Maximum level of this tree search
104 
105  // Search pattern extents
106  unsigned int fPattern_fMaxBins;
107  unsigned int fPattern_fMaxRows;
108 
109  std::vector<QwTreeLine*> fTreeLineList;
110  unsigned int fNTreeLines; // number of tree lines found
111 
112  // Recursive tree pattern methods
113  void _setpoints (double pos_start, double pos_end, double detectorwidth,
114  unsigned binwidth, char *pattern, int *hash);
115  void _setpoint (double position, double resolution, double detectorwidth,
116  unsigned binwidth, char *pattern, int *hash);
117 
118  /// Recursive tree search algorithm
119  void _SearchTreeLines (shortnode *node, int level, int offset, int row_offset, int reverse, int numwires);
120 
121 }; // class QwTrackingTreeSearch
122 
123 #endif // QWTRACKINGTREESEARCH_H
unsigned int fMaxMissedPlanes
Maximum number of missed planes in region 2.
int exists(int *newa, int front, int back, int offset)
QwTrackingTreeSearch()
Constructor.
void SetShowMatchingPatterns(bool show=true)
Set the flag to show matching patterns when they are found.
int fMaxLevel
Maximum level of this tree search.
A container for the pattern databases for each detector region.
unsigned int & fNumPlanes
Number of region 2 HDC planes.
bool fShowMatchingPatterns
Flag to show matching patterns when found.
unsigned int & fNumWires
Number of region 3 VDC wires.
unsigned int fMaxMissedWires
Maximum number of missed wires in region 3.
void setpoint(double off, double h1, double res1, double h2, double res2, double width, unsigned binwidth, char *pa, char *pb, int *hasha, int *hashb)
std::vector< QwTreeLine * > fTreeLineList
void _SearchTreeLines(shortnode *node, int level, int offset, int row_offset, int reverse, int numwires)
Recursive tree search algorithm.
void _setpoints(double pos_start, double pos_end, double detectorwidth, unsigned binwidth, char *pattern, int *hash)
Similar to a treenode.
Definition: shorttree.h:44
void SetDebugLevel(int debug)
Set the debug level.
void _setpoint(double position, double resolution, double detectorwidth, unsigned binwidth, char *pattern, int *hash)
One-dimensional (u, v, or x) track stubs and associated hits.
Definition: QwTreeLine.h:51
std::vector< QwTreeLine * > GetListOfTreeLines()
Get the list of tree lines.
Similar to a nodenode.
Definition: shortnode.h:38
QwTreeLine * SearchTreeLines(QwTrackingTreeRegion *searchtree, char *pattern[16], int *hashpat[16], int maxlevel, int numwires, int numlayers)
Search for the tree lines consistent with the hit pattern.
Hit structure uniquely defining each hit.
Definition: QwHit.h:43
unsigned int fNumLayers
Number of detector layers (general concept)
virtual ~QwTrackingTreeSearch()
Destructor.
int TsSetPoint(double detectorwidth, double wirespacing, QwHit *hit, char *pattern, int *hash, unsigned binwidth)
Method to set the tree pattern.