Belle II Software  release-08-01-10
AxialTrackMerger Class Referenceabstract

Findlet implementing the merging of axial tracks found in the legendre tree search. More...

#include <AxialTrackMerger.h>

Inheritance diagram for AxialTrackMerger:
Collaboration diagram for AxialTrackMerger:

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 apply (std::vector< CDCTrack > &axialTracks, const std::vector< const CDCWireHit * > &axialWireHits) final
 Merge tracks together. Allows for axial hits to be added as it may see fit.
 
virtual void apply (ToVector< AIOTypes > &... ioVectors)=0
 Main function executing the algorithm.
 
void initialize () override
 Receive and dispatch signal before the start of the event processing.
 
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.
 
void terminate () override
 Receive and dispatch Signal for termination of the event processing.
 

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< CDCTrack &, const CDCWireHit *const >
 Type of the base class.
 

Private Member Functions

void doTracksMerging (std::vector< CDCTrack > &axialTracks, const std::vector< const CDCWireHit * > &allAxialWireHits)
 The track finding often finds two curling tracks, originating from the same particle. More...
 

Static Private Member Functions

template<class ACDCTracks >
static WithWeight< MayBePtr< CDCTrack > > calculateBestTrackToMerge (CDCTrack &track, ACDCTracks &tracks)
 Searches for the best candidate to merge this track to. More...
 
static double doTracksFitTogether (CDCTrack &track1, CDCTrack &track2)
 Fits the hit content of both tracks in a common fit repeated with an annealing schedule removing far away hits. More...
 
static void removeStrangeHits (double factor, std::vector< const CDCWireHit * > &wireHits, CDCTrajectory2D &trajectory)
 Remove all hits that are further than factor * driftlength away from the trajectory. More...
 
static void mergeTracks (CDCTrack &track1, CDCTrack &track2, const std::vector< const CDCWireHit * > &allAxialWireHits)
 Function to merge two track candidates. More...
 

Private Attributes

double m_param_minFitProb = 0.85
 Parameter : Minimal fit probability of the common fit of two tracks to be eligible for merging.
 
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.
 

Detailed Description

Findlet implementing the merging of axial tracks found in the legendre tree search.

Definition at line 30 of file AxialTrackMerger.h.

Member Function Documentation

◆ calculateBestTrackToMerge()

WithWeight< MayBePtr< CDCTrack > > calculateBestTrackToMerge ( CDCTrack track,
ACDCTracks &  tracks 
)
staticprivate

Searches for the best candidate to merge this track to.

Determine the best track for merging with the candidate track.

Parameters
tracktrack for which we try to find merging partner
trackssearch range of tracks
Returns
a pointer to the best fit candidate including a fit probability
Return values
{nullptr,0}in case no match was found

Definition at line 89 of file AxialTrackMerger.cc.

90 {
91  std::vector<WithWeight<CDCTrack*>> weightedTracks;
92  for (CDCTrack& track2 : tracks) {
93  if (&track == &track2) continue;
94  if (track2.size() < 3) continue;
95 
96  double fitProb = doTracksFitTogether(track, track2);
97  if (std::isnan(fitProb)) continue;
98 
99  weightedTracks.emplace_back(&track2, fitProb);
100  }
101 
102  auto bestMatch = std::max_element(weightedTracks.begin(), weightedTracks.end(), LessWeight());
103  if (bestMatch == weightedTracks.end()) return {nullptr, 0};
104  else return *bestMatch;
105 }
static double doTracksFitTogether(CDCTrack &track1, CDCTrack &track2)
Fits the hit content of both tracks in a common fit repeated with an annealing schedule removing far ...
Class representing a sequence of three dimensional reconstructed hits.
Definition: CDCTrack.h:41
Functor factory turning a binary functor and two functors into a new functor which executes the binar...
Definition: Functional.h:127

◆ doTracksFitTogether()

double doTracksFitTogether ( CDCTrack track1,
CDCTrack track2 
)
staticprivate

Fits the hit content of both tracks in a common fit repeated with an annealing schedule removing far away hits.

Returns
Some measure of fit probability

Definition at line 107 of file AxialTrackMerger.cc.

◆ doTracksMerging()

void doTracksMerging ( std::vector< CDCTrack > &  axialTracks,
const std::vector< const CDCWireHit * > &  allAxialWireHits 
)
private

The track finding often finds two curling tracks, originating from the same particle.

This function merges them.

Definition at line 68 of file AxialTrackMerger.cc.

◆ mergeTracks()

void mergeTracks ( CDCTrack track1,
CDCTrack track2,
const std::vector< const CDCWireHit * > &  allAxialWireHits 
)
staticprivate

Function to merge two track candidates.

The hits of track2 are deleted and transfered to track1 and the track1 is resorted. The method also applys some postprocessing and splits the track1 in case it appears to contain two back-to-back arms,

Definition at line 192 of file AxialTrackMerger.cc.

◆ removeStrangeHits()

void removeStrangeHits ( double  factor,
std::vector< const CDCWireHit * > &  wireHits,
CDCTrajectory2D trajectory 
)
staticprivate

Remove all hits that are further than factor * driftlength away from the trajectory.

Parameters
factorgives a number how far the hit is allowed to be.
wireHitsthe wirehits that should be considered
trajectorythe reference trajectory

Definition at line 179 of file AxialTrackMerger.cc.


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