Belle II Software development
AxialTrackFinderLegendre.cc
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8#include <tracking/trackFindingCDC/findlets/combined/AxialTrackFinderLegendre.h>
9
10#include <tracking/trackFindingCDC/processing/AxialTrackUtil.h>
11
12#include <tracking/trackingUtilities/eventdata/tracks/CDCTrack.h>
13#include <tracking/trackingUtilities/eventdata/hits/CDCWireHit.h>
14
15#include <tracking/trackingUtilities/utilities/StringManipulation.h>
16
17using namespace Belle2;
18using namespace TrackFindingCDC;
19using namespace TrackingUtilities;
20
29
31{
32 return "Performs the pattern recognition in the CDC with the Legendre hough finder";
33}
34
36 const std::string& prefix)
37{
38 m_axialTrackHitMigrator.exposeParameters(moduleParamList, prefix);
39 m_axialTrackMerger.exposeParameters(moduleParamList, prefixed("merge", prefix));
40 // No parameters exposed for the Legendre passes
41}
42
43void AxialTrackFinderLegendre::apply(const std::vector<TrackingUtilities::CDCWireHit>& wireHits,
44 std::vector<TrackingUtilities::CDCTrack>& tracks)
45{
46 B2DEBUG(25, "********** CDCTrackingModule ************");
47
48 // Acquire the axial hits
49 std::vector<const TrackingUtilities::CDCWireHit*> axialWireHits;
50 axialWireHits.reserve(wireHits.size());
51 for (const TrackingUtilities::CDCWireHit& wireHit : wireHits) {
52 wireHit->unsetTemporaryFlags();
53 wireHit->unsetMaskedFlag();
54 if (not wireHit.isAxial()) continue;
55 if (wireHit->hasBackgroundFlag()) continue;
56 axialWireHits.emplace_back(&wireHit);
57 }
58
59 // First Legendre pass
60 m_nonCurlerAxialTrackCreatorHitLegendre.apply(axialWireHits, tracks);
61
62 // Assign new hits to the tracks
63 m_axialTrackHitMigrator.apply(axialWireHits, tracks);
64
65 // Second Legendre pass
67
68 // Assign new hits to the tracks
69 m_axialTrackHitMigrator.apply(axialWireHits, tracks);
70
71 // Iterate the last finding pass until no track is found anymore
72
73 // Loop counter to guard against infinite loop
74 for (int iPass = 0; iPass < 20; ++iPass) {
75 int nCandsAdded = tracks.size();
76
77 // Third Legendre pass
78 m_fullRangeAxialTrackCreatorHitLegendre.apply(axialWireHits, tracks);
79
80 // Assign new hits to the tracks
81 m_axialTrackHitMigrator.apply(axialWireHits, tracks);
82
83 nCandsAdded = tracks.size() - nCandsAdded;
84
85 if (iPass == 19) B2WARNING("Reached maximal number of Legendre search passes");
86 if (nCandsAdded == 0) break;
87 }
88
89 // Merge found tracks
90 m_axialTrackMerger.apply(tracks, axialWireHits);
91
92 // Assign new hits to the tracks
93 m_axialTrackHitMigrator.apply(axialWireHits, tracks);
94
96}
The Module parameter list class.
AxialTrackCreatorHitLegendre m_fullRangeAxialTrackCreatorHitLegendre
Findlet for the full range legendre pass.
AxialTrackCreatorHitLegendre m_nonCurlerAxialTrackCreatorHitLegendre
Findlet for the non-curler legendre pass.
void apply(const std::vector< TrackingUtilities::CDCWireHit > &wireHits, std::vector< TrackingUtilities::CDCTrack > &tracks)
Main method to apply the track finding.
std::string getDescription() final
Short description of the findlet.
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) final
Expose the parameters to a module.
AxialTrackCreatorHitLegendre m_nonCurlersWithIncreasingThresholdAxialTrackCreatorHitLegendre
Findlet for the non-curler with increased threshold legendre pass.
AxialTrackMerger m_axialTrackMerger
Findlet to merge the tracks after the legendre finder.
AxialTrackHitMigrator m_axialTrackHitMigrator
Findlet to exchange hits between tracks based on their proximity to the respective trajectory.
Class representing a hit wire in the central drift chamber.
Definition CDCWireHit.h:58
Abstract base class for different kinds of events.
static void deleteShortTracks(std::vector< TrackingUtilities::CDCTrack > &axialTracks, double minimal_size=5)
Remove tracks that are shorter than the given number of hits.