QwAnalysis
shorttree.h
Go to the documentation of this file.
1 /*------------------------------------------------------------------------*//*!
2 
3  \file shortnode.h
4  \ingroup QwTracking
5 
6  \author Wolfgang Wander <wwc@hermes.desy.de>
7  \author Burnham Stokes <bestokes@jlab.org>
8  \author Wouter Deconinck <wdconinc@mit.edu>
9 
10  \date 2009-09-04 18:06:23
11 
12  \brief Definition of a shorttree, the short version of a treenode
13 
14 *//*-------------------------------------------------------------------------*/
15 
16 #ifndef QWTRACKINGSHORTTREE_H
17 #define QWTRACKINGSHORTTREE_H
18 
19 // Qweak headers
20 #include "shortnode.h"
21 #include "QwObjectCounter.h"
22 
23 namespace QwTracking {
24 
25 // Forward declaration due to cyclic dependency
26 class shortnode;
27 
28 /**
29  * \class shorttree
30  *
31  * \ingroup QwTracking
32  *
33  * \brief Similar to a treenode.
34  *
35  * A shorttree is basically the same as a treenode. It contains the minimum
36  * level of bin division where the bit pattern is valid, the bit pattern in
37  * the array fBit, and the width of the pattern.
38  *
39  * The difference with the treenode is that there is only a link fSon to the
40  * son nodes, no link to the next shorttree. This is because a shorttree is
41  * read from file and reconstructing that linkage information is expensive,
42  * and not necessary.
43  */
44 class shorttree: public QwObjectCounter<shorttree> {
45 
46  public:
47 
48  /// \brief Set the default size for short trees
49  static void SetDefaultSize(unsigned int size) {
51  }
52 
53  public:
54 
55  /// \brief Default constructor
56  shorttree(unsigned int size = fDefaultSize);
57  /// \brief Destructor
58  ~shorttree();
59 
60  /// Minimum level at which this node is valid
61  int fMinLevel;
62 
63  /// Hit pattern, one bin specified per detector layer
64  int* fBit;
65 
66  /// Width in bins of the hit pattern
67  int fWidth;
68 
69  public: // TODO Too many low-level calls to hide this behind a getter
70 
71  /// Each tree has four son nodes
73 
74  private:
75 
76  unsigned int fSize;
77 
78  public:
79 
80  /// Get size of the bit array
81  unsigned int size() const { return fSize; };
82 
83  private:
84 
85  static unsigned int fDefaultSize; ///< Default size
86 
87  static int fDebug; ///< Debug level
88 
89  public:
90 
91  /// \brief Print some debugging information
92  void Print(bool recursive = false, int indent = 0);
93  /// \brief Output stream operator
94  friend std::ostream& operator<< (std::ostream& stream, const shorttree& st);
95 
96 }; // class shorttree
97 
98 } // namespace QwTracking
99 
100 #endif // QWTRACKINGSHORTTREE_H
unsigned int size() const
Get size of the bit array.
Definition: shorttree.h:81
int * fBit
Hit pattern, one bin specified per detector layer.
Definition: shorttree.h:64
static unsigned int fDefaultSize
Default size.
Definition: shorttree.h:81
int fWidth
Width in bins of the hit pattern.
Definition: shorttree.h:67
void Print(bool recursive=false, int indent=0)
Print some debugging information.
Definition: shorttree.cc:61
~shorttree()
Destructor.
Definition: shorttree.cc:52
unsigned int fSize
Definition: shorttree.h:76
Memory management structure to count objects.
int fMinLevel
Minimum level at which this node is valid.
Definition: shorttree.h:61
shortnode * son[4]
Each tree has four son nodes.
Definition: shorttree.h:72
Memory management class to count object instantiations.
Similar to a treenode.
Definition: shorttree.h:44
Definition of a shortnode, the short version of a nodenode.
static void SetDefaultSize(unsigned int size)
Set the default size for short trees.
Definition: shorttree.h:49
Similar to a nodenode.
Definition: shortnode.h:38
shorttree(unsigned int size=fDefaultSize)
Default constructor.
Definition: shorttree.cc:37
friend std::ostream & operator<<(std::ostream &stream, const shorttree &st)
Output stream operator.
Definition: shorttree.cc:93
static int fDebug
Debug level.
Definition: shorttree.h:87