HerdSoftware  0.4.0
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 () override
 Initialization of the algorithm. More...
 
bool Process () override
 Process a single event. More...
 
bool Finalize () override
 Post processing part. More...
 
int VotingIndex (float R, float Theta)
 Computes voting space index for a given pair of R-Theta. More...
 
std::pair< float, float > RTheta (int votingIndex)
 Returns R and Theta values given a voting space index. More...
 
void FindTracks (RefFrame::View view, const HFClusters &clusters)
 Takes a collection of clusters on a given view and finds all the tracks. More...
 

Private Member Functions

void ImportHits (const ClusterColl &clColl, const GeoParamsColl &geoParamsColl, HFCluster::DetectorType detType)
 
void ClearVotingSpace ()
 
void FillVotingSpace (RefFrame::View view, 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 > RThetaAverage (const std::vector< HoughTrackStub > &votes)
 
Track2D BuildTrackFromVotes (std::vector< HoughTrackStub > &votes, const HFClusters &clColl)
 
std::tuple< ScdClustersColl, FitClustersCollFillClusterCollections (const std::vector< HoughTrackStub > &votes, const HFClusters &clColl)
 

Private Attributes

std::string m_collName = "tracks2DColl_hough"
 
bool m_publishAlias = true
 
bool m_useSCD = true
 
bool m_useFIT = true
 
unsigned int m_nThetaDiv
 
unsigned int m_nRDiv
 
float m_RMax
 
unsigned int m_nVotes
 
HFClusters m_clXZ
 
HFClusters m_clYZ
 
HFClusters m_clXY
 
std::unordered_map< int, std::vector< HoughTrackStub > > m_votingSpace
 
EA::observer_ptr< ScdGeoParamsCollm_scdGeoParamsColl
 
EA::observer_ptr< FitGeoParamsCollm_fitGeoParamsColl
 
Track2DColl m_trackColl
 
EA::StorePtr m_globStore
 
EA::StorePtr m_evStore
 

Detailed Description

Finds tracks from a collection of 2D hits.

Needed event objects:

name type store optional description
fitClusterscollADC FitClustersColl evStore yes The clusters of the FIT.
scdClusterscollMC ScdClustersColl evStore yes The clusters of the SCD.

Produced event objects:

name type alias store description
${collectionName} Track2DColl tracks2DColl evStore The collection of reconstructed tracks along each view.

Parameters:

name type default value description
collectionName string tracks2DColl_hough Name of the output track collection.
publishAlias bool true Set the alias of the pubblished collection.
useSCD bool true Use SCD clusters in track-finding.
useFIT bool true Use FIT clusters in track-finding.
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()

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

◆ ClearVotingSpace()

void Herd::HoughFinder2DAlgo::ClearVotingSpace ( )
inlineprivate

◆ FillClusterCollections()

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

◆ FillVotingSpace()

void Herd::HoughFinder2DAlgo::FillVotingSpace ( RefFrame::View  view,
const HFClusters clusters 
)
private

◆ Finalize()

bool Herd::HoughFinder2DAlgo::Finalize ( )
override

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()

void Herd::HoughFinder2DAlgo::FindTracks ( RefFrame::View  view,
const HFClusters clusters 
)

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

Parameters
viewThe view in wihch track finding should be performed
clustersInput set of clusters for track finding

◆ ImportHits()

void Herd::HoughFinder2DAlgo::ImportHits ( const ClusterColl clColl,
const GeoParamsColl geoParamsColl,
HFCluster::DetectorType  detType 
)
private

◆ Initialize()

bool Herd::HoughFinder2DAlgo::Initialize ( )
override

Initialization of the algorithm.

Returns
true if the initialization procedure is successful.

◆ Process()

bool Herd::HoughFinder2DAlgo::Process ( )
override

Process a single event.

Returns
If event processing is successful.

◆ RemoveFromVotingSpace()

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

◆ RTheta()

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

Returns R and Theta values given a voting space index.

Returns
A std::pair containing R and Theta

◆ RThetaAverage()

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

◆ SearchVotes()

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

◆ VotingIndex()

int Herd::HoughFinder2DAlgo::VotingIndex ( 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

Member Data Documentation

◆ m_clXY

HFClusters Herd::HoughFinder2DAlgo::m_clXY
private

◆ m_clXZ

HFClusters Herd::HoughFinder2DAlgo::m_clXZ
private

◆ m_clYZ

HFClusters Herd::HoughFinder2DAlgo::m_clYZ
private

◆ m_collName

std::string Herd::HoughFinder2DAlgo::m_collName = "tracks2DColl_hough"
private

◆ m_evStore

EA::StorePtr Herd::HoughFinder2DAlgo::m_evStore
private

◆ m_fitGeoParamsColl

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

◆ m_globStore

EA::StorePtr Herd::HoughFinder2DAlgo::m_globStore
private

◆ m_nRDiv

unsigned int Herd::HoughFinder2DAlgo::m_nRDiv
private

◆ m_nThetaDiv

unsigned int Herd::HoughFinder2DAlgo::m_nThetaDiv
private

◆ m_nVotes

unsigned int Herd::HoughFinder2DAlgo::m_nVotes
private

◆ m_publishAlias

bool Herd::HoughFinder2DAlgo::m_publishAlias = true
private

◆ m_RMax

float Herd::HoughFinder2DAlgo::m_RMax
private

◆ m_scdGeoParamsColl

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

◆ m_trackColl

Track2DColl Herd::HoughFinder2DAlgo::m_trackColl
private

◆ m_useFIT

bool Herd::HoughFinder2DAlgo::m_useFIT = true
private

◆ m_useSCD

bool Herd::HoughFinder2DAlgo::m_useSCD = true
private

◆ m_votingSpace

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

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