QwAnalysis
QwTrackingTreeRegion Class Reference

A container for the pattern databases for each detector region. More...

#include <QwTrackingTreeRegion.h>

+ Inheritance diagram for QwTrackingTreeRegion:
+ Collaboration diagram for QwTrackingTreeRegion:

Public Member Functions

 QwTrackingTreeRegion ()
 Default constructor. More...
 
virtual ~QwTrackingTreeRegion ()
 Destructor. More...
 
bool IsSearchable () const
 Is this region searchable? More...
 
void SetSearchable (bool searchable=true)
 Set this tree region to searchable. More...
 
shortnodeGetNode ()
 Get the node to this tree region. More...
 
double GetWidth () const
 Get the width. More...
 
void SetWidth (double width)
 Set the width. More...
 
void Print (const Option_t *options=0) const
 Print the lists of trees and nodes. More...
 
void PrintTrees () const
 Print the list of trees. More...
 
void PrintNodes () const
 Print the list of nodes. More...
 
- Public Member Functions inherited from VQwTrackingElement
 VQwTrackingElement ()
 Default constructor. More...
 
 VQwTrackingElement (const VQwTrackingElement &that)
 
virtual ~VQwTrackingElement ()
 Virtual destructor. More...
 
VQwTrackingElementoperator= (const VQwTrackingElement &that)
 Assignment operator. More...
 
const QwDetectorInfoGetDetectorInfo () const
 Get the detector info pointer. More...
 
void SetDetectorInfo (const QwDetectorInfo *detectorinfo)
 Set the detector info pointer. More...
 
EQwRegionID GetRegion () const
 Get the region. More...
 
void SetRegion (EQwRegionID region)
 Set the region. More...
 
EQwDetectorPackage GetPackage () const
 Get the package. More...
 
void SetPackage (EQwDetectorPackage package)
 Set the package. More...
 
int GetOctant () const
 Get the octant number. More...
 
void SetOctant (int octant)
 Set the octant number. More...
 
EQwDirectionID GetDirection () const
 Get the direction. More...
 
void SetDirection (EQwDirectionID direction)
 Set the direction. More...
 
int GetPlane () const
 Get the plane number. More...
 
void SetPlane (int plane)
 Set the plane number. More...
 
int GetElement () const
 Get the element number. More...
 
void SetElement (int element)
 Set the element number. More...
 
void SetGeometryTo (const VQwTrackingElement &e)
 Copy the geometry info from another object. More...
 
- Public Member Functions inherited from QwObjectCounter< QwTrackingTreeRegion >
 QwObjectCounter ()
 Default constructor. More...
 
 QwObjectCounter (const QwObjectCounter &)
 Copy constructor. More...
 
virtual ~QwObjectCounter ()
 Destructor. More...
 

Private Attributes

int fDebug
 Debug level. More...
 
bool fSearchable
 Is this tree region searchable? More...
 
shortnode fNode
 Top node of this tree region. More...
 
double fWidth
 Width of the detector plane (i.e. number of wires * wire spacing) More...
 

Additional Inherited Members

- Static Public Member Functions inherited from QwObjectCounter< QwTrackingTreeRegion >
static size_t GetObjectsCreated ()
 Get number of objects ever created. More...
 
static size_t GetObjectsAlive ()
 Get number of objects still alive. More...
 
- Protected Member Functions inherited from VQwTrackingElement
 ClassDef (VQwTrackingElement, 1)
 
- Protected Attributes inherited from VQwTrackingElement
const QwDetectorInfofDetectorInfo
 
EQwRegionID fRegion
 ///< Detector info pointer More...
 
EQwDetectorPackage fPackage
 Package. More...
 
int fOctant
 Octant number. More...
 
EQwDirectionID fDirection
 Direction. More...
 
int fPlane
 Plane number. More...
 
int fElement
 Element number. More...
 

Detailed Description

A container for the pattern databases for each detector region.

Author
Burnham Stokes besto.nosp@m.kes@.nosp@m.jlab..nosp@m.org
Wouter Deconinck wdcon.nosp@m.inc@.nosp@m.jlab..nosp@m.org
Date
2009-09-04 18:06:23

It is useful to separate the pattern database into multiple detector regions to reduce the extent by which a set of hits are compared to a pattern. For instance, there are two databases for the region 3 set of detectors. One for the 'upper' and one for the 'lower' detector sets. Track segments in the area downstream of the QTOR magnet are approximated by straight lines. Only the VDC is designed to measure track positions, so these two databases designed to contain patterns which ressemble tracks passing through the VDC.

The structure of a tree region is as follows. The tree region contains a flat list of shorttree objects which is read in sequentially from the cached tree file. The shorttree objects have son pointers to shortnode objects. For each shorttree there is a linked list of shortnode objects using the next pointers, which branches off to other trees using the tree pointers.

Definition at line 46 of file QwTrackingTreeRegion.h.

Constructor & Destructor Documentation

QwTrackingTreeRegion::QwTrackingTreeRegion ( )
inline

Default constructor.

Definition at line 53 of file QwTrackingTreeRegion.h.

53 : fDebug(0) { };
QwTrackingTreeRegion::~QwTrackingTreeRegion ( )
virtual

Destructor.

Destructor

Definition at line 31 of file QwTrackingTreeRegion.cc.

References QwLog::endl(), fNode, QwTracking::shortnode::GetNumberOfTrees(), QwTracking::shortnode::GetTree(), QwDebug, QwVerbose, and QwTracking::shorttree::son.

32 {
33  // Debug information
34  QwDebug << "Deleting QwTrackingTreeRegion: " << this << QwLog::endl;
35 
36  // First, delete the nodes by going through the list of trees and following
37  // implicitly the linked list of next pointers without branching out through
38  // the tree pointers
39  QwDebug << "Deleting linked lists of node objects..." << QwLog::endl;
40  for (int i = 0; i < fNode.GetNumberOfTrees(); i++)
41  for (int j = 0; j < 4; j++)
42  if (fNode.GetTree(i)->son[j]) {
43  delete fNode.GetTree(i)->son[j];
44  fNode.GetTree(i)->son[j] = 0;
45  }
46 
47  // Then delete the remaining flat list of trees
48  QwDebug << "Deleting flat list of tree objects..." << QwLog::endl;
49  delete[] fNode.GetTree();
50 
51  // Report memory statistics
52  if (shortnode::GetObjectsAlive() > 0 || shorttree::GetObjectsAlive() > 0) {
53  QwVerbose << "Memory occupied by tree objects (should be a single shortnode when all trees cleared):" << QwLog::endl;
54  QwVerbose << "- allocated shortnode objects: " << shortnode::GetObjectsAlive() << QwLog::endl;
55  QwVerbose << "- allocated shorttree objects: " << shorttree::GetObjectsAlive() << QwLog::endl;
56  }
57 }
#define QwVerbose
Predefined log drain for verbose messages.
Definition: QwLog.h:55
#define QwDebug
Predefined log drain for debugging output.
Definition: QwLog.h:60
int GetNumberOfTrees() const
Get the number of trees.
Definition: shortnode.h:81
shortnode * son[4]
Each tree has four son nodes.
Definition: shorttree.h:72
shorttree * GetTree(int i=0) const
Get the tree.
Definition: shortnode.cc:54
static std::ostream & endl(std::ostream &)
End of the line.
Definition: QwLog.cc:299
shortnode fNode
Top node of this tree region.

+ Here is the call graph for this function:

Member Function Documentation

shortnode* QwTrackingTreeRegion::GetNode ( )
inline

Get the node to this tree region.

Definition at line 63 of file QwTrackingTreeRegion.h.

References fNode.

Referenced by QwTrackingTree::readtree(), and QwTrackingTreeSearch::SearchTreeLines().

63 { return &fNode; };
shortnode fNode
Top node of this tree region.

+ Here is the caller graph for this function:

double QwTrackingTreeRegion::GetWidth ( ) const
inline

Get the width.

Definition at line 66 of file QwTrackingTreeRegion.h.

References fWidth.

Referenced by QwTrackingWorker::ProcessEvent().

66 { return fWidth; };
double fWidth
Width of the detector plane (i.e. number of wires * wire spacing)

+ Here is the caller graph for this function:

bool QwTrackingTreeRegion::IsSearchable ( ) const
inline

Is this region searchable?

Definition at line 58 of file QwTrackingTreeRegion.h.

References fSearchable.

Referenced by QwTrackingWorker::ProcessEvent(), and QwTrackingTree::readtree().

58 { return fSearchable; };
bool fSearchable
Is this tree region searchable?

+ Here is the caller graph for this function:

void QwTrackingTreeRegion::Print ( const Option_t *  options = 0) const
inline

Print the lists of trees and nodes.

Definition at line 71 of file QwTrackingTreeRegion.h.

References PrintNodes(), and PrintTrees().

71 { PrintTrees(); PrintNodes(); };
void PrintTrees() const
Print the list of trees.
void PrintNodes() const
Print the list of nodes.

+ Here is the call graph for this function:

void QwTrackingTreeRegion::PrintNodes ( ) const

Print the list of nodes.

Print the list of nodes

Definition at line 76 of file QwTrackingTreeRegion.cc.

References QwLog::endl(), fNode, QwTracking::shortnode::GetNext(), QwTracking::shortnode::GetNumberOfTrees(), QwTracking::shortnode::GetTree(), QwTracking::shorttree::Print(), QwOut, and QwTracking::shorttree::son.

Referenced by QwTrackingWorker::InitTree(), and Print().

77 {
78  QwOut << "Nodes:" << QwLog::endl;
79  for (int i = 0; i < fNode.GetNumberOfTrees(); i++) {
80  QwOut << "tree " << i << ":" << QwLog::endl;
81  fNode.GetTree(i)->Print(false,1);
82  for (int j = 0; j < 4; j++) {
83  shortnode* node = fNode.GetTree(i)->son[j];
84  if (node) QwOut << " son " << j << ":" << QwLog::endl;
85  while (node) {
86  QwOut << " tree ";
87  node->GetTree(0)->Print(false,2);
88  node = node->GetNext();
89  } // loop over linked list of nodes
90  } // loop over the four sons
91  } // loop over list of trees
92 }
#define QwOut
Predefined log drain for explicit output.
Definition: QwLog.h:35
void Print(bool recursive=false, int indent=0)
Print some debugging information.
Definition: shorttree.cc:61
int GetNumberOfTrees() const
Get the number of trees.
Definition: shortnode.h:81
shortnode * son[4]
Each tree has four son nodes.
Definition: shorttree.h:72
shorttree * GetTree(int i=0) const
Get the tree.
Definition: shortnode.cc:54
static std::ostream & endl(std::ostream &)
End of the line.
Definition: QwLog.cc:299
shortnode * GetNext() const
Get the next node.
Definition: shortnode.h:69
Similar to a nodenode.
Definition: shortnode.h:38
shortnode fNode
Top node of this tree region.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void QwTrackingTreeRegion::PrintTrees ( ) const

Print the list of trees.

Print the list of trees

Definition at line 63 of file QwTrackingTreeRegion.cc.

References QwLog::endl(), fNode, QwTracking::shortnode::GetTree(), QwTracking::shorttree::Print(), and QwOut.

Referenced by Print().

64 {
65  QwOut << "Trees:" << QwLog::endl;
66  for (int i = 0; i < 1 /* fNode.GetNumberOfTrees() */; i++) {
67  QwOut << "tree " << i << ": ";
68  fNode.GetTree(i)->Print(true,1);
69  }
70 }
#define QwOut
Predefined log drain for explicit output.
Definition: QwLog.h:35
void Print(bool recursive=false, int indent=0)
Print some debugging information.
Definition: shorttree.cc:61
shorttree * GetTree(int i=0) const
Get the tree.
Definition: shortnode.cc:54
static std::ostream & endl(std::ostream &)
End of the line.
Definition: QwLog.cc:299
shortnode fNode
Top node of this tree region.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void QwTrackingTreeRegion::SetSearchable ( bool  searchable = true)
inline

Set this tree region to searchable.

Definition at line 60 of file QwTrackingTreeRegion.h.

References fSearchable.

Referenced by QwTrackingTree::readtree().

60 { fSearchable = searchable; };
bool fSearchable
Is this tree region searchable?

+ Here is the caller graph for this function:

void QwTrackingTreeRegion::SetWidth ( double  width)
inline

Set the width.

Definition at line 68 of file QwTrackingTreeRegion.h.

References fWidth.

Referenced by QwTrackingTree::readtree().

68 { fWidth = width; };
double fWidth
Width of the detector plane (i.e. number of wires * wire spacing)

+ Here is the caller graph for this function:

Field Documentation

int QwTrackingTreeRegion::fDebug
private

Debug level.

Definition at line 79 of file QwTrackingTreeRegion.h.

shortnode QwTrackingTreeRegion::fNode
private

Top node of this tree region.

Definition at line 83 of file QwTrackingTreeRegion.h.

Referenced by GetNode(), PrintNodes(), PrintTrees(), and ~QwTrackingTreeRegion().

bool QwTrackingTreeRegion::fSearchable
private

Is this tree region searchable?

Definition at line 81 of file QwTrackingTreeRegion.h.

Referenced by IsSearchable(), and SetSearchable().

double QwTrackingTreeRegion::fWidth
private

Width of the detector plane (i.e. number of wires * wire spacing)

Definition at line 85 of file QwTrackingTreeRegion.h.

Referenced by GetWidth(), and SetWidth().


The documentation for this class was generated from the following files: