EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HoughCell.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file HoughCell.h
1 //
2 // AYK (ayk@bnl.gov)
3 //
4 // Hough transform code elementary cell structure;
5 //
6 // Initial port from OLYMPUS sources: Oct'2015;
7 //
8 
9 #ifndef _HOUGH_CELL_
10 #define _HOUGH_CELL_
11 
12 class HoughTree;
13 
14 class HoughCell {
15  public:
16  HoughCell(const HoughTree *tree);
18  delete [] mFrom; delete [] mTo;
19 
20  // FIXME: clean up contents as well; need to store dimension then;
21  delete [] mDaughters;
22  };
23 
24  bool DaughtersArrayAllocated() const { return mDaughters ? true : false; };
25 
26  void SetDaughter(unsigned iq, HoughCell *ptr) { mDaughters[iq] = ptr; };
27  // FIXME: this could have been done better?;
28  HoughCell **GetDaughterPtr(unsigned iq) const { return &mDaughters[iq]; };
29 
30  void UpdateRanges(const HoughTree *tree, const t_hough_range id[]);
31 
32  void AllocateDaughterCells(unsigned num) {
33  mDaughters = new HoughCell*[num];
34  memset(mDaughters, 0x00, num*sizeof(HoughCell*));
35  };
36 
37  void ResetRanges(const HoughTree *tree, bool immunity[] = 0);
38 
39  // Not a user call -> range check not needed (?);
40  t_hough_range From(unsigned gr) const { return mFrom[gr]; };
41  t_hough_range To (unsigned gr) const { return mTo [gr]; };
42 
43  const t_hough_range* From() const { return mFrom; };
44  const t_hough_range* To () const { return mTo; };
45 
46  private:
47  // One entry per plane group;
49 
50  // I guess it's fine to have it as a double pointer here rather
51  // than any STL class;
53 };
54 
55 #endif