Belle II Software  release-08-01-10
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 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 30 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 125 of file AxialTrackCreatorSegmentHough.cc.

127 {
128  m_houghTree->fell();
129 
130  size_t nAxialHits = 0;
131  std::vector<const CDCSegment2D*> ptrAxialSegments;
132  ptrAxialSegments.reserve(segments.size());
133 
134  for (const CDCSegment2D& segment : segments) {
135  if (segment.getStereoKind() == EStereoKind::c_Axial) {
136  ptrAxialSegments.push_back(&segment);
137  nAxialHits += segment.size();
138  }
139  }
140 
141  m_houghTree->seed(ptrAxialSegments);
143 
144  Weight minWeight = std::min(m_param_minNHits, nAxialHits * m_param_minFractionNHits);
145 
146  using Candidate = std::pair<HoughBox, std::vector<const CDCSegment2D*> >;
147  std::vector<Candidate> candidates = m_houghTree->findBest(minWeight);
148 
149  for (const Candidate& candidate : candidates) {
151  CDCObservations2D observations;
152 
153  const HoughBox& foundHoughBox = candidate.first;
154  const std::vector<const CDCSegment2D*>& foundSegments = candidate.second;
155  for (const CDCSegment2D* segment : foundSegments) {
156  observations.appendRange(*segment);
157  }
158  CDCTrajectory2D trajectory2D = fitter.fit(observations);
159 
160  // Check if the circle has been fitted reverse to the hough box by accident
161  {
162  double curv = trajectory2D.getCurvature();
163  const std::array<DiscreteCurv, 2>& curvs = foundHoughBox.getBounds<DiscreteCurv>();
164  float lowerCurv = *(curvs[0]);
165  float upperCurv = *(curvs[1]);
166  if (static_cast<double>(ESignUtil::common(lowerCurv, upperCurv)) * curv < 0) {
167  trajectory2D.reverse();
168  }
169  }
170 
171  CDCTrack track;
172  for (const CDCSegment2D* segment : foundSegments) {
173  for (const CDCRecoHit2D& recoHit2D : *segment) {
174  track.push_back(CDCRecoHit3D::reconstruct(recoHit2D, trajectory2D));
175  }
176  }
177  track.sortByArcLength2D();
178 
180  if (track.empty()) continue;
181  const CDCRecoHit3D& startRecoHit3D = track.front();
182  CDCTrajectory3D startTrajectory3D(trajectory2D);
183  startTrajectory3D.setLocalOrigin(startRecoHit3D.getRecoPos3D());
184  track.setStartTrajectory3D(startTrajectory3D);
185 
186  const CDCRecoHit3D& endRecoHit3D = track.back();
187  CDCTrajectory3D endTrajectory3D(trajectory2D);
188  endTrajectory3D.setLocalOrigin(endRecoHit3D.getRecoPos3D());
189  track.setEndTrajectory3D(endTrajectory3D);
190 
191  tracks.push_back(std::move(track));
192  }
193 }
double m_param_minNHits
Parameter: Absolute minimal number of hits to make an axial track.
std::unique_ptr< SimpleSegmentPhi0ImpactCurvHoughTree > m_houghTree
The hough space tree search.
double m_param_minFractionNHits
Parameter: Minimal number of hits as a fraction of the total hits in the event.
Class serving as a storage of observed drift circles to present to the Riemann fitter.
std::size_t appendRange(const CDCSegment2D &segment2D)
Appends all reconstructed hits from the two dimensional segment.
Class representing a two dimensional reconstructed hit in the central drift chamber.
Definition: CDCRecoHit2D.h:47
Class representing a three dimensional reconstructed hit.
Definition: CDCRecoHit3D.h:52
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:56
const Vector3D & getRecoPos3D() const
Getter for the 3d position of the hit.
Definition: CDCRecoHit3D.h:285
Class implementing the Riemann fit for two dimensional trajectory circle.
static const CDCRiemannFitter & getFitter()
Static getter for a general Riemann fitter.
A reconstructed sequence of two dimensional hits in one super layer.
Definition: CDCSegment2D.h:39
Class representing a sequence of three dimensional reconstructed hits.
Definition: CDCTrack.h:41
Particle trajectory as it is seen in xy projection represented as a circle.
void reverse()
Reverses the trajectory in place.
double getCurvature() const
Getter for the curvature as seen from the xy projection.
Particle full three dimensional trajectory.
Representation for a discrete position in an array of discrete positions.
Definition: DiscreteValue.h:23
typename InBox::HoughBox HoughBox
Type of the hough box.
static ESign common(ESign n1, ESign n2)
Check if two values have a common sign.
Definition: ESign.h:57

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