HerdSoftware  0.1.1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Herd::HoughFinder2DAlgo Class Reference

Finds tracks from a collection of 2D hits. More...

#include <algorithms/tracking/HoughFinder2DAlgo.h>

Inheritance diagram for Herd::HoughFinder2DAlgo:

Public Member Functions

 HoughFinder2DAlgo (const std::string &name)
 Constructor. More...
 
bool Initialize ()
 Initialization of the algorithm. More...
 
bool Process ()
 Process a single event. More...
 
bool Finalize ()
 Post processing part. More...
 
int GetVotingIndex (float R, float Theta)
 Computes voting space index for a given pair of R-Theta. More...
 
std::pair< float, float > GetRTheta (int votingIndex)
 Returns R and Theta values given a voting space index. More...
 
template<RefFrame::View T>
void FindTracks (const HFClusters &clusters)
 Takes a collection of clusters on a given view and finds all the tracks. More...
 

Private Member Functions

void ImportSiliconDetectorHits (const SiliconDetectorClustersColl &clColl, const SiliconDetectorGeoParamsColl &geoParamsColl, HFCluster::DetectorType detType)
 
void ImportFitHits (const FitClustersColl &clColl, const FitGeoParamsColl &geoParamsColl)
 
void ClearVotingSpace ()
 
template<RefFrame::View T>
void FillVotingSpace (const HFClusters &clusters)
 
void RemoveFromVotingSpace (const Cluster &cluster)
 
int FindCandidateTrack ()
 
std::vector< HoughTrackStubAccumulateVotes (int votingIndex)
 
void SearchVotes (int votingIndex, std::vector< int > &vIndexes)
 
std::pair< bool, HFClusterFindClusterFromSeedIndex (const HFClusters &clColl, unsigned int clID)
 
std::pair< float, float > GetAvRTheta (const std::vector< HoughTrackStub > &votes)
 
void BuildTrackFromVotes (std::vector< HoughTrackStub > &votes, const HFClusters &clusters)
 
std::tuple< StkClustersColl, ScdClustersColl, FitClustersCollFillClusterCollections (const std::vector< HoughTrackStub > &votes, const HFClusters &clColl)
 

Private Attributes

unsigned int _nThetaDiv
 
unsigned int _nRDiv
 
float _RMax
 
unsigned int _nVotes
 
HFClusters _clXZ
 
HFClusters _clYZ
 
HFClusters _clXY
 
std::unordered_map< int, std::vector< HoughTrackStub > > _votingSpace
 
EA::observer_ptr< StkGeoParamsColl_stkGeoParamsColl
 
EA::observer_ptr< ScdGeoParamsColl_scdGeoParamsColl
 
EA::observer_ptr< FitGeoParamsColl_fitGeoParamsColl
 
std::vector< Track2D_trackColl
 
StorePtr _globStore
 
StorePtr _evStore
 

Detailed Description

Finds tracks from a collection of 2D hits.

Needed event objects:

name type store optional description
stkClusterscollMC StkClustersColl evStore no The clusters of the STKs.

Produced global objects:

name -type- store description
HoughTracksXZ std::vector<Track2D> evStore The collection of XZ tracks.
HoughTracksYZ std::vector<Track2D> evStore The collection of YZ tracks.
HoughTracksXY std::vector<Track2D> evStore The collection of XY tracks.

Parameters:

name type default value description
nThetaDiv int 500 Number of divisions in the theta axis.
nRDiv int 500 Number of divisions in the r axis.
RMax float 100 Max abs value of r [cm].
nVotes int 6 Minimum number of votes for a track.

Constructor & Destructor Documentation

◆ HoughFinder2DAlgo()

Herd::HoughFinder2DAlgo::HoughFinder2DAlgo ( const std::string &  name)

Constructor.

Parameters
nameThe name of the algorithm

Member Function Documentation

◆ AccumulateVotes()

std::vector< HoughTrackStub > Herd::HoughFinder2DAlgo::AccumulateVotes ( int  votingIndex)
private

◆ BuildTrackFromVotes()

void Herd::HoughFinder2DAlgo::BuildTrackFromVotes ( std::vector< HoughTrackStub > &  votes,
const HFClusters clusters 
)
private

◆ ClearVotingSpace()

void Herd::HoughFinder2DAlgo::ClearVotingSpace ( )
inlineprivate

◆ FillClusterCollections()

std::tuple< StkClustersColl, ScdClustersColl, FitClustersColl > Herd::HoughFinder2DAlgo::FillClusterCollections ( const std::vector< HoughTrackStub > &  votes,
const HFClusters clColl 
)
private

◆ FillVotingSpace()

template<RefFrame::View T>
void Herd::HoughFinder2DAlgo::FillVotingSpace ( const HFClusters clusters)
private

◆ Finalize()

bool Herd::HoughFinder2DAlgo::Finalize ( )

Post processing part.

Returns
If post-processing is successful.

◆ FindCandidateTrack()

int Herd::HoughFinder2DAlgo::FindCandidateTrack ( )
private

◆ FindClusterFromSeedIndex()

std::pair< bool, HFCluster > Herd::HoughFinder2DAlgo::FindClusterFromSeedIndex ( const HFClusters clColl,
unsigned int  clID 
)
private

◆ FindTracks()

template<RefFrame::View T>
void Herd::HoughFinder2DAlgo::FindTracks ( const HFClusters clusters)

Takes a collection of clusters on a given view and finds all the tracks.

Returns
A collection of 2D tracks

◆ GetAvRTheta()

std::pair< float, float > Herd::HoughFinder2DAlgo::GetAvRTheta ( const std::vector< HoughTrackStub > &  votes)
private

◆ GetRTheta()

std::pair< float, float > Herd::HoughFinder2DAlgo::GetRTheta ( int  votingIndex)

Returns R and Theta values given a voting space index.

Returns
A std::pair containing R and Theta

◆ GetVotingIndex()

int Herd::HoughFinder2DAlgo::GetVotingIndex ( float  R,
float  Theta 
)

Computes voting space index for a given pair of R-Theta.

The voting space index is computed as floor((R / _RMax + 1) * _nRDiv / 2)*_nThetaDiv + floor(Theta / M_PI * _nThetaDiv)

Returns
The voting space index

◆ ImportFitHits()

void Herd::HoughFinder2DAlgo::ImportFitHits ( const FitClustersColl clColl,
const FitGeoParamsColl geoParamsColl 
)
private

◆ ImportSiliconDetectorHits()

void Herd::HoughFinder2DAlgo::ImportSiliconDetectorHits ( const SiliconDetectorClustersColl clColl,
const SiliconDetectorGeoParamsColl geoParamsColl,
HFCluster::DetectorType  detType 
)
private

◆ Initialize()

bool Herd::HoughFinder2DAlgo::Initialize ( )

Initialization of the algorithm.

Returns
true if the initialization procedure is successful.

◆ Process()

bool Herd::HoughFinder2DAlgo::Process ( )

Process a single event.

Returns
If event processing is successful.

◆ RemoveFromVotingSpace()

void Herd::HoughFinder2DAlgo::RemoveFromVotingSpace ( const Cluster cluster)
private

◆ SearchVotes()

void Herd::HoughFinder2DAlgo::SearchVotes ( int  votingIndex,
std::vector< int > &  vIndexes 
)
private

Member Data Documentation

◆ _clXY

HFClusters Herd::HoughFinder2DAlgo::_clXY
private

◆ _clXZ

HFClusters Herd::HoughFinder2DAlgo::_clXZ
private

◆ _clYZ

HFClusters Herd::HoughFinder2DAlgo::_clYZ
private

◆ _evStore

StorePtr Herd::HoughFinder2DAlgo::_evStore
private

◆ _fitGeoParamsColl

EA::observer_ptr<FitGeoParamsColl> Herd::HoughFinder2DAlgo::_fitGeoParamsColl
private

◆ _globStore

StorePtr Herd::HoughFinder2DAlgo::_globStore
private

◆ _nRDiv

unsigned int Herd::HoughFinder2DAlgo::_nRDiv
private

◆ _nThetaDiv

unsigned int Herd::HoughFinder2DAlgo::_nThetaDiv
private

◆ _nVotes

unsigned int Herd::HoughFinder2DAlgo::_nVotes
private

◆ _RMax

float Herd::HoughFinder2DAlgo::_RMax
private

◆ _scdGeoParamsColl

EA::observer_ptr<ScdGeoParamsColl> Herd::HoughFinder2DAlgo::_scdGeoParamsColl
private

◆ _stkGeoParamsColl

EA::observer_ptr<StkGeoParamsColl> Herd::HoughFinder2DAlgo::_stkGeoParamsColl
private

◆ _trackColl

std::vector<Track2D> Herd::HoughFinder2DAlgo::_trackColl
private

◆ _votingSpace

std::unordered_map<int, std::vector<HoughTrackStub> > Herd::HoughFinder2DAlgo::_votingSpace
private

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