Belle II Software development
TrackFinder.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/complete/TrackFinder.h>
9
10#include <framework/core/ModuleParamList.templateDetails.h>
11#include <framework/core/ModuleParam.h>
12
13#include <vector>
14
15using namespace Belle2;
16using namespace TrackFindingCDC;
17using namespace TrackingUtilities;
18
20{
24
27
30
33
37
38 const std::string prefix = "";
39 // Setup m_wireHitPreparer
40 {
41 ModuleParamList moduleParamList;
42 m_wireHitPreparer.exposeParameters(&moduleParamList, prefix);
43
44 moduleParamList.getParameter<std::string>("flightTimeEstimation").setDefaultValue("outwards");
45 }
46
47 // Setup m_trackQualityAsserter
48 {
49 ModuleParamList moduleParamList;
50 m_trackQualityAsserter.exposeParameters(&moduleParamList, prefix);
51
52 std::vector<std::string> corrections({"B2B"});
53 moduleParamList.getParameter<std::vector<std::string>>("corrections")
54 .setDefaultValue(corrections);
55 }
56
57 // Setup m_finalTrackQualityAsserter
58 {
59 ModuleParamList moduleParamList;
60 m_finalTrackQualityAsserter.exposeParameters(&moduleParamList, prefix);
61
62 std::vector<std::string> corrections({"LayerBreak", "OneSuperlayer", "Small"});
63 moduleParamList.getParameter<std::vector<std::string>>("corrections")
64 .setDefaultValue(corrections);
65 }
66}
67
69{
70 return "Combined track finder using the global legendre finder as well as the cellular automaton "
71 "track finder.";
72}
73
74void TrackFinder::exposeParameters(ModuleParamList* moduleParamList, const std::string& prefix)
75{
76 // Expose a selection of the parameters
77 m_wireHitPreparer.exposeParameters(moduleParamList, prefix);
78 m_trackExporter.exposeParameters(moduleParamList, prefix);
79
80 moduleParamList->addParameter("withCA",
82 "Also run the segment linking track finder and combine results.",
84}
85
87{
88 // Reserve some space for the created objects.
89 std::vector<CDCWireHit> m_wireHits;
90 std::vector<CDCWireHitCluster> m_clusters;
91 std::vector<CDCWireHitCluster> m_superClusters;
92 std::vector<CDCSegment2D> m_segments;
93 std::vector<CDCTrack> m_axialTracks;
94 std::vector<CDCTrack> m_tracks;
95 m_wireHits.reserve(2000);
96 m_clusters.reserve(200);
97 m_superClusters.reserve(100);
98 m_segments.reserve(200);
99 m_axialTracks.reserve(30);
100 m_tracks.reserve(30);
101
102 m_wireHitPreparer.apply(m_wireHits);
103 m_clusterPreparer.apply(m_wireHits, m_clusters, m_superClusters);
104 m_segmentFinderFacetAutomaton.apply(m_clusters, m_segments);
105
106 m_axialTrackFinderLegendre.apply(m_wireHits, m_axialTracks);
107 m_trackQualityAsserter.apply(m_axialTracks);
108
109 m_stereoHitFinder.apply(m_wireHits, m_axialTracks);
110 m_segmentTrackCombiner.apply(m_segments, m_axialTracks);
111
112 if (m_param_withCA) {
113 m_trackFinderSegmentPairAutomaton.apply(m_segments, m_tracks);
114 m_trackCombiner.apply(m_axialTracks, m_tracks, m_tracks);
115 } else {
116 m_tracks.swap(m_axialTracks);
117 }
118
119 m_finalTrackQualityAsserter.apply(m_tracks);
120
121 if (m_param_withCA) {
122 m_trackCreatorSingleSegments.apply(m_segments, m_tracks);
123 }
124
125 m_trackExporter.apply(m_tracks);
126}
The Module parameter list class.
SegmentFinderFacetAutomaton m_segmentFinderFacetAutomaton
First stage cellular automaton segment finder.
Definition TrackFinder.h:67
TrackExporter m_trackExporter
Exports the generated CDCTracks as RecoTracks.
Definition TrackFinder.h:94
TrackFinder()
Constructor registering the subordinary findlets to the processing signal distribution machinery.
WireHitPreparer m_wireHitPreparer
Preparation findlet creating the wire hits from the packed CDCHits.
Definition TrackFinder.h:61
SegmentTrackCombiner m_segmentTrackCombiner
Join the matching segments into the tracks.
Definition TrackFinder.h:79
std::string getDescription() override
Short description of the findlet.
TrackCreatorSingleSegments m_trackCreatorSingleSegments
Add tracks from the first super layer that are contained with in the first super layer.
Definition TrackFinder.h:91
AxialTrackFinderLegendre m_axialTrackFinderLegendre
Axial track finder.
Definition TrackFinder.h:70
TrackCombiner m_trackCombiner
Combine the tracks from the global search with the tracks from the local search.
Definition TrackFinder.h:85
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) final
Expose the parameters to a module.
TrackFinderSegmentPairAutomaton m_trackFinderSegmentPairAutomaton
Second stage cellular automaton track finder from segments.
Definition TrackFinder.h:82
TrackQualityAsserter m_trackQualityAsserter
Improve the quality of the axial tracks.
Definition TrackFinder.h:73
void apply() final
Execute the findlet.
ClusterPreparer m_clusterPreparer
Preparation findlet creating the clusters wire hits forming locally connected groups.
Definition TrackFinder.h:64
bool m_param_withCA
Parameter: Activate the combination of the local segment linking.
Definition TrackFinder.h:56
TrackQualityAsserter m_finalTrackQualityAsserter
Final track quality assertions.
Definition TrackFinder.h:88
StereoHitFinder m_stereoHitFinder
Associate the stereo hits that best match to the axial tracks.
Definition TrackFinder.h:76
void addProcessingSignalListener(ProcessingSignalListener *psl)
ModuleParam< T > & getParameter(const std::string &name) const
Returns a reference to a parameter.
void addParameter(const std::string &name, T &paramVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module list.
Abstract base class for different kinds of events.