FairRoot/PandaRoot
Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
PndFtsHoughSpacePeak Class Reference

Class for saving peaks of a Hough space. More...

#include <PndFtsHoughSpacePeak.h>

Inheritance diagram for PndFtsHoughSpacePeak:

Public Member Functions

 PndFtsHoughSpacePeak (Int_t height=noVal, Int_t firstBin=noVal, Int_t firstHitIdx=noVal)
 
 ~PndFtsHoughSpacePeak ()
 
void resetBins ()
 
void replaceBins (Int_t height, Int_t firstBin, Int_t firstHitIdx)
 
void addBin (Int_t binNumber, Int_t hitIdx)
 
void setFinished (Bool_t newVal)
 
Bool_t isFinished () const
 
Int_t getHeight () const
 
const std::set< Int_t > & getBins () const
 
const std::set< Int_t > & getHitIds () const
 
Bool_t binsOverlapWith (const PndFtsHoughSpacePeak &toCheck)
 
void mergeWith (const PndFtsHoughSpacePeak &toAdd)
 

Static Public Attributes

static const Int_t noVal = -1
 

Private Member Functions

 ClassDef (PndFtsHoughSpacePeak, 1)
 

Private Attributes

std::set< Int_t > fBins
 
std::set< Int_t > fHitIds
 
Int_t fHeight
 
Bool_t fFinished
 

Detailed Description

Class for saving peaks of a Hough space.

Author
Martin J. Galuska <martin [dot] j [dot] galuska (at) physik [dot] uni (minus) giessen [dot] de>

Saves height and globalbin numbers belonging to this peak. TODO Use set/ unordered_set or something else rather than vectors to not store duplicate entries

Created: 25.06.2014

Definition at line 30 of file PndFtsHoughSpacePeak.h.

Constructor & Destructor Documentation

PndFtsHoughSpacePeak::PndFtsHoughSpacePeak ( Int_t  height = noVal,
Int_t  firstBin = noVal,
Int_t  firstHitIdx = noVal 
)

Definition at line 8 of file PndFtsHoughSpacePeak.cxx.

References addBin(), and noVal.

9 :
10  fHeight(height),
11  fFinished(kFALSE)
12 {
13  // warn if not all values were set
14  if ( noVal == firstHitIdx ) std::cout << "WARNING FROM PndFtsHoughSpacePeak, not all values set in initialisation!\n";
15  addBin(firstBin, firstHitIdx);
16 }
static const Int_t noVal
void addBin(Int_t binNumber, Int_t hitIdx)
PndFtsHoughSpacePeak::~PndFtsHoughSpacePeak ( )

Definition at line 18 of file PndFtsHoughSpacePeak.cxx.

19 {
20 }

Member Function Documentation

void PndFtsHoughSpacePeak::addBin ( Int_t  binNumber,
Int_t  hitIdx 
)
inline

Definition at line 64 of file PndFtsHoughSpacePeak.h.

References fBins, and fHitIds.

Referenced by PndFtsHoughSpace::FindAllPeaksScanPathsMergeBins(), PndFtsHoughSpacePeak(), and replaceBins().

64  {
65  fBins.insert(binNumber);
66  fHitIds.insert(hitIdx);
67 }
std::set< Int_t > fHitIds
std::set< Int_t > fBins
Bool_t PndFtsHoughSpacePeak::binsOverlapWith ( const PndFtsHoughSpacePeak toCheck)
inline

Definition at line 83 of file PndFtsHoughSpacePeak.h.

References fBins, and getBins().

83  {
84  // return kTRUE iif toAdd has bins in common with this
85  const std::set< Int_t > binsToSearch = toCheck.getBins();
86  // try to find elements from toAdd in this
87  for (std::set< Int_t >::iterator it = binsToSearch.begin(); it != binsToSearch.end(); ++it){
88  std::set< Int_t >::iterator itFind = fBins.find( *it );
89  if ( itFind != fBins.end() ) return kTRUE; // element from binsToSearch was found in this
90  }
91  return kFALSE; // none of the elements from binsToSearch was found in this
92 }
std::set< Int_t > fBins
const std::set< Int_t > & getBins() const
PndFtsHoughSpacePeak::ClassDef ( PndFtsHoughSpacePeak  ,
 
)
private
const std::set<Int_t>& PndFtsHoughSpacePeak::getBins ( ) const
inline

Definition at line 47 of file PndFtsHoughSpacePeak.h.

References fBins.

Referenced by binsOverlapWith(), and mergeWith().

47 { return fBins; };
std::set< Int_t > fBins
Int_t PndFtsHoughSpacePeak::getHeight ( ) const
inline

Definition at line 45 of file PndFtsHoughSpacePeak.h.

References fHeight.

Referenced by PndFtsHoughSpace::FindAllPeaksScanPathsMergeBins().

45 { return fHeight; };
const std::set<Int_t>& PndFtsHoughSpacePeak::getHitIds ( ) const
inline

Definition at line 48 of file PndFtsHoughSpacePeak.h.

References fHitIds.

Referenced by mergeWith().

48 { return fHitIds; };
std::set< Int_t > fHitIds
Bool_t PndFtsHoughSpacePeak::isFinished ( ) const
inline

Definition at line 44 of file PndFtsHoughSpacePeak.h.

References fFinished.

Referenced by PndFtsHoughSpace::FindAllPeaksScanPathsMergeBins().

44 { return fFinished; };
void PndFtsHoughSpacePeak::mergeWith ( const PndFtsHoughSpacePeak toAdd)
inline

Definition at line 94 of file PndFtsHoughSpacePeak.h.

References fBins, fHitIds, getBins(), and getHitIds().

94  {
95  // merge bins
96  const std::set< Int_t > binsToMerge = toAdd.getBins();
97  fBins.insert( binsToMerge.begin(), binsToMerge.end() );
98  // merge hit indices
99  const std::set< Int_t > hitsToMerge = toAdd.getHitIds();
100  fHitIds.insert( hitsToMerge.begin(), hitsToMerge.end() );
101 }
const std::set< Int_t > & getHitIds() const
std::set< Int_t > fHitIds
std::set< Int_t > fBins
const std::set< Int_t > & getBins() const
void PndFtsHoughSpacePeak::replaceBins ( Int_t  height,
Int_t  firstBin,
Int_t  firstHitIdx 
)
inline

Definition at line 69 of file PndFtsHoughSpacePeak.h.

References addBin(), fHeight, and resetBins().

Referenced by PndFtsHoughSpace::FindAllPeaksScanPathsMergeBins().

69  {
70  resetBins();
71  addBin(firstBin, firstHitIdx);
72  fHeight = height;
73 }
void addBin(Int_t binNumber, Int_t hitIdx)
void PndFtsHoughSpacePeak::resetBins ( )
inline

Definition at line 76 of file PndFtsHoughSpacePeak.h.

References fBins, fFinished, fHeight, fHitIds, and noVal.

Referenced by replaceBins().

76  {
77  fBins.clear();
78  fHitIds.clear();
79  fFinished = kFALSE;
80  fHeight = noVal;
81 }
std::set< Int_t > fHitIds
static const Int_t noVal
std::set< Int_t > fBins
void PndFtsHoughSpacePeak::setFinished ( Bool_t  newVal)
inline

Definition at line 42 of file PndFtsHoughSpacePeak.h.

References fFinished.

Referenced by PndFtsHoughSpace::FindAllPeaksScanPathsMergeBins().

42 { fFinished = newVal; };

Member Data Documentation

std::set< Int_t > PndFtsHoughSpacePeak::fBins
private

Definition at line 55 of file PndFtsHoughSpacePeak.h.

Referenced by addBin(), binsOverlapWith(), getBins(), mergeWith(), and resetBins().

Bool_t PndFtsHoughSpacePeak::fFinished
private

Definition at line 58 of file PndFtsHoughSpacePeak.h.

Referenced by isFinished(), resetBins(), and setFinished().

Int_t PndFtsHoughSpacePeak::fHeight
private

Definition at line 57 of file PndFtsHoughSpacePeak.h.

Referenced by getHeight(), replaceBins(), and resetBins().

std::set< Int_t > PndFtsHoughSpacePeak::fHitIds
private

Definition at line 56 of file PndFtsHoughSpacePeak.h.

Referenced by addBin(), getHitIds(), mergeWith(), and resetBins().

const Int_t PndFtsHoughSpacePeak::noVal = -1
static

Definition at line 32 of file PndFtsHoughSpacePeak.h.

Referenced by PndFtsHoughSpacePeak(), and resetBins().


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