Belle II Software  release-05-01-25
AxialTrackFinderLegendre.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2015 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Bastian Kronenbitter, Thomas Hauth, Viktor Trusov, *
7  * Nils Braun *
8  * *
9  * This software is provided "as is" without any warranty. *
10  **************************************************************************/
11 #include <tracking/trackFindingCDC/findlets/combined/AxialTrackFinderLegendre.h>
12 
13 #include <tracking/trackFindingCDC/processing/AxialTrackUtil.h>
14 
15 #include <tracking/trackFindingCDC/eventdata/tracks/CDCTrack.h>
16 #include <tracking/trackFindingCDC/eventdata/hits/CDCWireHit.h>
17 
18 #include <tracking/trackFindingCDC/utilities/StringManipulation.h>
19 
20 using namespace Belle2;
21 using namespace TrackFindingCDC;
22 
24 {
30 }
31 
33 {
34  return "Performs the pattern recognition in the CDC with the legendre hough finder";
35 }
36 
38  const std::string& prefix)
39 {
40  m_axialTrackHitMigrator.exposeParameters(moduleParamList, prefix);
41  m_axialTrackMerger.exposeParameters(moduleParamList, prefixed("merge", prefix));
42  // No parameters exposed for the legendre passes
43 }
44 
45 void AxialTrackFinderLegendre::apply(const std::vector<CDCWireHit>& wireHits,
46  std::vector<CDCTrack>& tracks)
47 {
48  B2DEBUG(100, "********** CDCTrackingModule ************");
49 
50  // Acquire the axial hits
51  std::vector<const CDCWireHit*> axialWireHits;
52  axialWireHits.reserve(wireHits.size());
53  for (const CDCWireHit& wireHit : wireHits) {
54  wireHit->unsetTemporaryFlags();
55  wireHit->unsetMaskedFlag();
56  if (not wireHit.isAxial()) continue;
57  if (wireHit->hasBackgroundFlag()) continue;
58  axialWireHits.emplace_back(&wireHit);
59  }
60 
61  // First legendre pass
62  m_nonCurlerAxialTrackCreatorHitLegendre.apply(axialWireHits, tracks);
63 
64  // Assign new hits to the tracks
65  m_axialTrackHitMigrator.apply(axialWireHits, tracks);
66 
67  // Second legendre pass
69 
70  // Assign new hits to the tracks
71  m_axialTrackHitMigrator.apply(axialWireHits, tracks);
72 
73  // Iterate the last finding pass until no track is found anymore
74 
75  // Loop counter to guard against infinit loop
76  for (int iPass = 0; iPass < 20; ++iPass) {
77  int nCandsAdded = tracks.size();
78 
79  // Third legendre pass
80  m_fullRangeAxialTrackCreatorHitLegendre.apply(axialWireHits, tracks);
81 
82  // Assign new hits to the tracks
83  m_axialTrackHitMigrator.apply(axialWireHits, tracks);
84 
85  nCandsAdded = tracks.size() - nCandsAdded;
86 
87  if (iPass == 19) B2WARNING("Reached maximal number of legendre search passes");
88  if (nCandsAdded == 0) break;
89  }
90 
91  // Merge found tracks
92  m_axialTrackMerger.apply(tracks, axialWireHits);
93 
94  // Assign new hits to the tracks
95  m_axialTrackHitMigrator.apply(axialWireHits, tracks);
96 
98 }
Belle2::TrackFindingCDC::AxialTrackFinderLegendre::m_axialTrackHitMigrator
AxialTrackHitMigrator m_axialTrackHitMigrator
Findlet to exchange hits between tracks based on their proximity to the respective trajectory.
Definition: AxialTrackFinderLegendre.h:85
Belle2::TrackFindingCDC::AxialTrackFinderLegendre::exposeParameters
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) final
Expose the parameters to a module.
Definition: AxialTrackFinderLegendre.cc:37
Belle2::TrackFindingCDC::AxialTrackFinderLegendre::getDescription
std::string getDescription() final
Short description of the findlet.
Definition: AxialTrackFinderLegendre.cc:32
Belle2::TrackFindingCDC::AxialTrackFinderLegendre::AxialTrackFinderLegendre
AxialTrackFinderLegendre()
Constructor.
Definition: AxialTrackFinderLegendre.cc:23
Belle2::TrackFindingCDC::AxialTrackMerger::exposeParameters
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) final
Expose the parameters to a module.
Definition: AxialTrackMerger.cc:34
Belle2::TrackFindingCDC::AxialTrackCreatorHitLegendre::apply
void apply(const std::vector< const CDCWireHit * > &axialWireHits, std::vector< CDCTrack > &tracks) final
Execute one pass over a quad tree.
Definition: AxialTrackCreatorHitLegendre.cc:102
Belle2::TrackFindingCDC::CompositeProcessingSignalListener::addProcessingSignalListener
void addProcessingSignalListener(ProcessingSignalListener *psl)
Register a processing signal listener to be notified.
Definition: CompositeProcessingSignalListener.cc:57
Belle2::TrackFindingCDC::AxialTrackHitMigrator::exposeParameters
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) final
Expose the parameters to a module.
Definition: AxialTrackHitMigrator.cc:30
Belle2::TrackFindingCDC::AxialTrackHitMigrator::apply
void apply(const std::vector< const CDCWireHit * > &axialWireHits, std::vector< CDCTrack > &axialTracks) final
Do the hit migration.
Definition: AxialTrackHitMigrator.cc:44
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TrackFindingCDC::AxialTrackFinderLegendre::m_nonCurlersWithIncreasingThresholdAxialTrackCreatorHitLegendre
AxialTrackCreatorHitLegendre m_nonCurlersWithIncreasingThresholdAxialTrackCreatorHitLegendre
Findlet for the non-curler with increased threshold legendre pass.
Definition: AxialTrackFinderLegendre.h:78
Belle2::TrackFindingCDC::AxialTrackFinderLegendre::m_fullRangeAxialTrackCreatorHitLegendre
AxialTrackCreatorHitLegendre m_fullRangeAxialTrackCreatorHitLegendre
Findlet for the full range legendre pass.
Definition: AxialTrackFinderLegendre.h:82
Belle2::TrackFindingCDC::AxialTrackFinderLegendre::m_axialTrackMerger
AxialTrackMerger m_axialTrackMerger
Findlet to merge the tracks after the legendre finder.
Definition: AxialTrackFinderLegendre.h:88
Belle2::TrackFindingCDC::AxialTrackFinderLegendre::m_nonCurlerAxialTrackCreatorHitLegendre
AxialTrackCreatorHitLegendre m_nonCurlerAxialTrackCreatorHitLegendre
Findlet for the non-curler legendre pass.
Definition: AxialTrackFinderLegendre.h:75
Belle2::TrackFindingCDC::CDCWireHit
Class representing a hit wire in the central drift chamber.
Definition: CDCWireHit.h:65
Belle2::ModuleParamList
The Module parameter list class.
Definition: ModuleParamList.h:46
Belle2::TrackFindingCDC::AxialTrackUtil::deleteShortTracks
static void deleteShortTracks(std::vector< CDCTrack > &axialTracks, double minimal_size=5)
Remove tracks that are shorter than the given number of hits.
Definition: AxialTrackUtil.cc:198
Belle2::TrackFindingCDC::AxialTrackMerger::apply
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.
Definition: AxialTrackMerger.cc:43
Belle2::TrackFindingCDC::AxialTrackFinderLegendre::apply
void apply(const std::vector< CDCWireHit > &wireHits, std::vector< CDCTrack > &tracks)
Main method to apply the track finding.
Definition: AxialTrackFinderLegendre.cc:45