The Gaudi Framework  v41r0 (bdbe7744)
Loading...
Searching...
No Matches
Gaudi::Example::TinyExperiment::TrackingAlg Class Reference

Tracking algorithm building tracks from hits using a simplified Hough transform. More...

Inheritance diagram for Gaudi::Example::TinyExperiment::TrackingAlg:
Collaboration diagram for Gaudi::Example::TinyExperiment::TrackingAlg:

Public Member Functions

 TrackingAlg (const std::string &name, ISvcLocator *pSvcLocator)
Tracks operator() (Hits const &hits) const override

Private Attributes

Gaudi::Property< unsigned int > m_nBins { this, "NumberBins", 180, "Number of bins in the Hough Transform for theta" }
Gaudi::Property< unsigned int > m_sensibility
Gaudi::Accumulators::Counter n_tracks { this, "Number of Tracks" }

Detailed Description

Tracking algorithm building tracks from hits using a simplified Hough transform.

Definition at line 26 of file TrackingAlg.cpp.

Constructor & Destructor Documentation

◆ TrackingAlg()

Gaudi::Example::TinyExperiment::TrackingAlg::TrackingAlg ( const std::string & name,
ISvcLocator * pSvcLocator )
inline

Definition at line 28 of file TrackingAlg.cpp.

29 : Transformer( name, pSvcLocator, { { "HitsLocation", "/Event/Hits" } },
30 { "TracksLocation", "/Event/Tracks" } ) {}
details::Transformer< Signature, Traits_, details::isLegacy< Traits_ > > Transformer

Member Function Documentation

◆ operator()()

Tracks Gaudi::Example::TinyExperiment::TrackingAlg::operator() ( Hits const & hits) const
inlineoverride

Definition at line 32 of file TrackingAlg.cpp.

32 {
33 // hough transform, actually only computing theta, and not dealing properly with borders of bins
34 std::vector<unsigned int> bins( m_nBins, 0 );
35 for ( auto const& hit : hits ) {
36 auto theta = std::atan( hit.y / hit.x );
37 auto index = static_cast<unsigned int>( ( theta + M_PI / 2 ) / M_PI * m_nBins );
38 ++bins.at( index );
39 }
40 // extract tracks
41 Tracks tracks;
42 tracks.reserve( hits.size() / 10 );
43 for ( unsigned int n = 0; n < m_nBins; n++ ) {
44 if ( bins[n] > 0 ) {}
45 if ( bins[n] >= m_sensibility ) {
46 tracks.emplace_back( -M_PI / 2 + ( M_PI * ( n + 0.5f ) ) / m_nBins );
47 ++n_tracks;
48 }
49 }
50 return tracks;
51 };
Gaudi::Property< unsigned int > m_sensibility
Gaudi::Accumulators::Counter n_tracks
Gaudi::Property< unsigned int > m_nBins
std::vector< Track > Tracks
Definition Track.h:28
size_t index(const Gaudi::ParticleProperty *property, const Gaudi::Interfaces::IParticlePropertySvc *service)
helper utility for mapping of Gaudi::ParticleProperty object into non-negative integral sequential id...

Member Data Documentation

◆ m_nBins

Gaudi::Property<unsigned int> Gaudi::Example::TinyExperiment::TrackingAlg::m_nBins { this, "NumberBins", 180, "Number of bins in the Hough Transform for theta" }
private

Definition at line 54 of file TrackingAlg.cpp.

54{ this, "NumberBins", 180, "Number of bins in the Hough Transform for theta" };

◆ m_sensibility

Gaudi::Property<unsigned int> Gaudi::Example::TinyExperiment::TrackingAlg::m_sensibility
private
Initial value:
{ this, "Sensibility", 6,
"How many hits do we want for considering we have a track ?" }

Definition at line 55 of file TrackingAlg.cpp.

55 { this, "Sensibility", 6,
56 "How many hits do we want for considering we have a track ?" };

◆ n_tracks

Gaudi::Accumulators::Counter Gaudi::Example::TinyExperiment::TrackingAlg::n_tracks { this, "Number of Tracks" }
mutableprivate

Definition at line 57 of file TrackingAlg.cpp.

57{ this, "Number of Tracks" };

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