Belle II Software  release-05-02-19
AxialTrackCreatorSegmentHough Class Referenceabstract

Generates axial tracks from segments using the hough algorithm. More...

#include <AxialTrackCreatorSegmentHough.h>

Inheritance diagram for AxialTrackCreatorSegmentHough:
Collaboration diagram for AxialTrackCreatorSegmentHough:

Public Types

using IOTypes = std::tuple< AIOTypes... >
 Types that should be served to apply on invokation.
 
using IOVectors = std::tuple< std::vector< AIOTypes >... >
 Vector types that should be served to apply on invokation.
 

Public Member Functions

std::string getDescription () final
 Short description of the findlet.
 
void exposeParameters (ModuleParamList *moduleParamList, const std::string &prefix) final
 Expose the parameters to a module.
 
void initialize () final
 Initialize the findlet before event processing.
 
void apply (const std::vector< CDCSegment2D > &segments, std::vector< CDCTrack > &tracks) final
 Generates the tracks from the given segments into the output argument. More...
 
void terminate () final
 Cleanup the findlet after event processing.
 
virtual void exposeParameters (ModuleParamList *moduleParamList __attribute__((unused)), const std::string &prefix __attribute__((unused)))
 Forward prefixed parameters of this findlet to the module parameter list.
 
virtual void apply (ToVector< AIOTypes > &... ioVectors)=0
 Main function executing the algorithm.
 
void beginRun () override
 Receive and dispatch signal for the beginning of a new run.
 
void beginEvent () override
 Receive and dispatch signal for the start of a new event.
 
void endRun () override
 Receive and dispatch signal for the end of the run.
 

Protected Types

using ToVector = typename ToVectorImpl< T >::Type
 Short hand for ToRangeImpl.
 

Protected Member Functions

void addProcessingSignalListener (ProcessingSignalListener *psl)
 Register a processing signal listener to be notified.
 
int getNProcessingSignalListener ()
 Get the number of currently registered listeners.
 

Private Types

using Super = Findlet< const CDCSegment2D, CDCTrack >
 Type of the base class.
 
using SimpleSegmentPhi0ImpactCurvHoughTree = SimpleSegmentHoughTree< InPhi0ImpactCurvBox, c_phi0Divisions, c_impactDivisions, c_curvDivisions >
 Type of the hough space tree search.
 

Private Attributes

double m_param_minNHits = 40
 Parameter: Absolute minimal number of hits to make an axial track.
 
double m_param_minFractionNHits = 0.5
 Parameter: Minimal number of hits as a fraction of the total hits in the event.
 
int m_param_maxLevel = 12
 Parameter: Level of divisions in the hough space.
 
std::vector< float > m_param_curvBounds {{ -0.13, 0.13}}
 Parameter: Curvature bounds of the hough space.
 
std::vector< float > m_param_impactBounds {{ -100, 100}}
 Parameter: Impact parameter bounds of the hough space.
 
int m_param_discretePhi0Width = 2
 Parameter: Width of the phi0 bins at the lowest level of the hough space.
 
int m_param_discretePhi0Overlap = 1
 Parameter: Overlap of the phi0 bins at the lowest level of the hough space.
 
int m_param_discreteImpactWidth = 2
 Parameter: Width of the impact bins at the lowest level of the hough space.
 
int m_param_discreteImpactOverlap = 1
 Parameter: Overlap of the impact bins at the lowest level of the hough space.
 
int m_param_discreteCurvWidth = 2
 Parameter: Width of the curvature bins at the lowest level of the hough space.
 
int m_param_discreteCurvOverlap = 1
 Parameter: Overlap of the curvature bins at the lowest level of the hough space.
 
std::unique_ptr< SimpleSegmentPhi0ImpactCurvHoughTreem_houghTree
 The hough space tree search.
 
std::vector< ProcessingSignalListener * > m_subordinaryProcessingSignalListeners
 References to subordinary signal processing listener contained in this findlet.
 
bool m_initialized = false
 Flag to keep track whether initialization happend before.
 
bool m_terminated = false
 Flag to keep track whether termination happend before.
 
std::string m_initializedAs
 Name of the type during initialisation.
 

Static Private Attributes

static const int c_phi0Divisions = 2
 Fixed parameter: Number of divisions in the phi0 direction.
 
static const int c_impactDivisions = 2
 Fixed parameter: Number of divisions in the impact direction.
 
static const int c_curvDivisions = 2
 Fixed parameter: Number of divisions in the curv direction.
 

Detailed Description

Generates axial tracks from segments using the hough algorithm.

Definition at line 40 of file AxialTrackCreatorSegmentHough.h.

Member Function Documentation

◆ apply()

void apply ( const std::vector< CDCSegment2D > &  segments,
std::vector< CDCTrack > &  tracks 
)
final

Generates the tracks from the given segments into the output argument.

Setting trajectories

Definition at line 127 of file AxialTrackCreatorSegmentHough.cc.

129 {
130  m_houghTree->fell();
131 
132  size_t nAxialHits = 0;
133  std::vector<const CDCSegment2D*> ptrAxialSegments;
134  ptrAxialSegments.reserve(segments.size());
135 
136  for (const CDCSegment2D& segment : segments) {
137  if (segment.getStereoKind() == EStereoKind::c_Axial) {
138  ptrAxialSegments.push_back(&segment);
139  nAxialHits += segment.size();
140  }
141  }
142 
143  m_houghTree->seed(ptrAxialSegments);
145 
146  Weight minWeight = std::min(m_param_minNHits, nAxialHits * m_param_minFractionNHits);
147 
148  using Candidate = std::pair<HoughBox, std::vector<const CDCSegment2D*> >;
149  std::vector<Candidate> candidates = m_houghTree->findBest(minWeight);
150 
151  for (const Candidate& candidate : candidates) {
152  const CDCRiemannFitter& fitter = CDCRiemannFitter::getFitter();
153  CDCObservations2D observations;
154 
155  const HoughBox& foundHoughBox = candidate.first;
156  const std::vector<const CDCSegment2D*>& foundSegments = candidate.second;
157  for (const CDCSegment2D* segment : foundSegments) {
158  observations.appendRange(*segment);
159  }
160  CDCTrajectory2D trajectory2D = fitter.fit(observations);
161 
162  // Check if the circle has been fitted reverse to the hough box by accident
163  {
164  double curv = trajectory2D.getCurvature();
165  const std::array<DiscreteCurv, 2>& curvs = foundHoughBox.getBounds<DiscreteCurv>();
166  float lowerCurv = *(curvs[0]);
167  float upperCurv = *(curvs[1]);
168  if (ESignUtil::common(lowerCurv, upperCurv) * curv < 0) {
169  trajectory2D.reverse();
170  }
171  }
172 
173  CDCTrack track;
174  for (const CDCSegment2D* segment : foundSegments) {
175  for (const CDCRecoHit2D& recoHit2D : *segment) {
176  track.push_back(CDCRecoHit3D::reconstruct(recoHit2D, trajectory2D));
177  }
178  }
179  track.sortByArcLength2D();
180 
182  if (track.empty()) continue;
183  const CDCRecoHit3D& startRecoHit3D = track.front();
184  CDCTrajectory3D startTrajectory3D(trajectory2D);
185  startTrajectory3D.setLocalOrigin(startRecoHit3D.getRecoPos3D());
186  track.setStartTrajectory3D(startTrajectory3D);
187 
188  const CDCRecoHit3D& endRecoHit3D = track.back();
189  CDCTrajectory3D endTrajectory3D(trajectory2D);
190  endTrajectory3D.setLocalOrigin(endRecoHit3D.getRecoPos3D());
191  track.setEndTrajectory3D(endTrajectory3D);
192 
193  tracks.push_back(std::move(track));
194  }
195 }

The documentation for this class was generated from the following files:
Belle2::TrackFindingCDC::ESignUtil::common
static ESign common(ESign n1, ESign n2)
Check if two values have a common sign.
Definition: ESign.h:67
Belle2::TrackFindingCDC::AxialTrackCreatorSegmentHough::m_param_minNHits
double m_param_minNHits
Parameter: Absolute minimal number of hits to make an axial track.
Definition: AxialTrackCreatorSegmentHough.h:64
Belle2::TrackFindingCDC::AxialTrackCreatorSegmentHough::m_param_minFractionNHits
double m_param_minFractionNHits
Parameter: Minimal number of hits as a fraction of the total hits in the event.
Definition: AxialTrackCreatorSegmentHough.h:67
Belle2::TrackFindingCDC::AxialTrackCreatorSegmentHough::m_houghTree
std::unique_ptr< SimpleSegmentPhi0ImpactCurvHoughTree > m_houghTree
The hough space tree search.
Definition: AxialTrackCreatorSegmentHough.h:111
Belle2::TrackFindingCDC::CDCRiemannFitter::getFitter
static const CDCRiemannFitter & getFitter()
Static getter for a general Riemann fitter.
Definition: CDCRiemannFitter.cc:22
Belle2::TrackFindingCDC::CDCRecoHit3D::reconstruct
static CDCRecoHit3D reconstruct(const CDCRecoHit2D &recoHit2D, const CDCTrajectory2D &trajectory2D)
Reconstructs the three dimensional hit from the two dimensional and the two dimensional trajectory.
Definition: CDCRecoHit3D.cc:58
Belle2::TrackFindingCDC::SimpleHitBasedHoughTree::HoughBox
typename InBox::HoughBox HoughBox
Type of the hough box.
Definition: SimpleHitBasedHoughTree.h:53