ROOT logo
TreeSearch » TREESEARCH » TreeSearch::PatternGenerator

class TreeSearch::PatternGenerator

Function Members (Methods)

static TClass*Class()
TreeSearch::PatternTree*Generate(TreeSearch::TreeParam_t parameters)
TreeSearch::PatternTree*Generate(UInt_t maxdepth, Double_t detector_width, const char* zpos, Double_t maxslope)
TreeSearch::Pattern*GetRoot() const
const TreeSearch::PatternGenerator::Statistics_t&GetStatistics() const
virtual TClass*IsA() const
TreeSearch::PatternGenerator&operator=(const TreeSearch::PatternGenerator&)
TreeSearch::PatternGeneratorPatternGenerator(const TreeSearch::PatternGenerator&)
voidPrint(Option_t* opt = "", ostream& os = std::cout) const
virtual voidShowMembers(TMemberInspector& insp, char* parent)
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
TreeSearch::PatternGenerator::HashNode*AddHash(TreeSearch::Pattern* pat)
TreeSearch::PatternGenerator::HashNode*Find(const TreeSearch::Pattern& pat)
UInt_tHash(const TreeSearch::Pattern& pat) const
boolLineTest(const TreeSearch::Pattern& pat) const
voidMakeChildNodes(TreeSearch::PatternGenerator::HashNode* parent, UInt_t depth)
boolSlopeTest(const TreeSearch::Pattern& pat, UInt_t depth) const

Data Members

vector<HashNode>fHashTableHashtab for indexing patterns during build
Double_tfMaxSlopeMax allowed slope, normalized units (0-1)
UInt_tfNlevelsNumber of levels of the tree (0-nlevels-1)
UInt_tfNplanesNumber of hitpattern planes
TreeSearch::PatternGenerator::Statistics_tfStatsTree statistics
vector<double>fZz positions of planes, normalized (0-1)

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

void DeleteTree()
 Delete the build tree along with its hash table.
 Internal utility function.
void CalcStatistics()
 Collect statistics on the build tree. This is best done separately here
 because some things (averages, memory requirements) can only be
 calculated once the tree is complete.
void ClearStatistics()
void Print(Option_t* opt = "", ostream& os = std::cout) const
 Print information about the tree, depending on option
PatternTree* Generate(TreeSearch::TreeParam_t parameters)
 Generate a new pattern tree for the given parameters. Returns a pointer
 to the generated tree, or zero if error
PatternTree* Generate(UInt_t maxdepth, Double_t detector_width, const char* zpos, Double_t maxslope)
 Convenience function for use at the command line and in scripts
UInt_t Hash(const TreeSearch::Pattern& pat) const
 Calculate unique a hash value for the given pattern. The maximum value is
 2^(fNlevels-1 + fNplanes-2) - 1. With the hash computed here, collisions
 never occur for patterns that pass LineTest().
bool SlopeTest(const TreeSearch::Pattern& pat, UInt_t depth) const
bool LineTest(const TreeSearch::Pattern& pat) const
 Check if the given bit pattern is consistent with a straight line.
 The intersection plane positions are given by fZ[]. Assumes fZ[0]=0.
 The other z values must increase strictly monotonically, fZ{i] > fZ[i-1].
 In the parent class, the z-values are normalized so that
 fZ[fNplanes-1] = 1.0, but that is not required.
 Assumes a normalized pattern, for which pat[0] is always zero.
 Assumes identical bin sizes and bin boundaries in each plane.
 If any of these assumption are relaxed, the algorithm requires additional
 tests and might need to save some data in temporary variables.

 The algorithm works by computing left and right boundary lines within
 which a bin must lie. The boundaries are the connections between the
 top and bottom reference points, (SL, SR) and (BL, BR), respectively.
 Starting from the plane one below the top (fZ[fNplanes-2]), bins in
 successively lower planes are tested to lie in the allowed region. If they
 do, the boundaries are narrowed if necessary to ensure that subsequent
 bins are consistent with all bins above. If the test succeeds in all
 planes, the pattern is consistent with a line.

 Algorithm originally developed by Brandon Belew, SULI summer intern,
 Jefferson Lab, 2007.
void MakeChildNodes(TreeSearch::PatternGenerator::HashNode* parent, UInt_t depth)
 Generate child nodes for the given parent pattern
    friend class Test_PatternGenerator;
Pattern* GetRoot() const
{ return fHashTable[0].fPattern; }
const Statistics_t& GetStatistics() const
{ return fStats; }
HashNode* AddHash(TreeSearch::Pattern* pat)
HashNode* Find(const TreeSearch::Pattern& pat)