Belle II Software  release-08-01-10
TrackFinderAutomaton.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/TrackFinderAutomaton.h>
9 
10 #include <framework/core/ModuleParamList.templateDetails.h>
11 #include <framework/core/ModuleParam.h>
12 
13 #include <vector>
14 
15 using namespace Belle2;
16 using namespace TrackFindingCDC;
17 
19 {
23 
30 
31  ModuleParamList moduleParamList;
32  const std::string prefix = "";
33  this->exposeParameters(&moduleParamList, prefix);
34  moduleParamList.getParameter<std::string>("flightTimeEstimation").setDefaultValue("outwards");
35  moduleParamList.getParameter<std::string>("TrackOrientation").setDefaultValue("outwards");
36 
37  // Mimics earlier behaviour
38  moduleParamList.getParameter<bool>("WriteSegments").setDefaultValue(true);
39 
40  m_wireHits.reserve(1000);
41  m_clusters.reserve(100);
42  m_superClusters.reserve(100);
43  m_segments.reserve(100);
44  m_tracks.reserve(20);
45 }
46 
48 {
49  return "Performs patter recognition in the CDC based on local hit following and application of a cellular automaton in two stages.";
50 }
51 
52 void TrackFinderAutomaton::exposeParameters(ModuleParamList* moduleParamList, const std::string& prefix)
53 {
54  m_wireHitsSwapper.exposeParameters(moduleParamList, prefix);
55  m_segmentsSwapper.exposeParameters(moduleParamList, prefix);
56  m_tracksSwapper.exposeParameters(moduleParamList, prefix);
57 
58  m_wireHitPreparer.exposeParameters(moduleParamList, prefix);
59  m_clusterPreparer.exposeParameters(moduleParamList, prefix);
60  m_segmentFinderFacetAutomaton.exposeParameters(moduleParamList, prefix);
61  m_trackFinderSegmentPairAutomaton.exposeParameters(moduleParamList, prefix);
62  m_trackFlightTimeAdjuster.exposeParameters(moduleParamList, prefix);
63  m_trackExporter.exposeParameters(moduleParamList, prefix);
64 }
65 
67 {
68  m_wireHits.clear();
69  m_clusters.clear();
70  m_superClusters.clear();
71  m_segments.clear();
72  m_tracks.clear();
74 }
75 
77 {
78  // Aquire the wire hits, segments and tracks from the DataStore in case they have already been created
82 
89 
90  // Put the segments and tracks on the DataStore
94 }
The Module parameter list class.
void apply(std::vector< CDCWireHit > &inputWireHits, std::vector< CDCWireHitCluster > &clusters, std::vector< CDCWireHitCluster > &superClusters) final
Generates the segment from wire hits.
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) final
Expose the parameters to a module.
void addProcessingSignalListener(ProcessingSignalListener *psl)
Register a processing signal listener to be notified.
void beginEvent() override
Receive and dispatch signal for the start of a new event.
virtual void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix)
Forward prefixed parameters of this findlet to the module parameter list.
Definition: Findlet.h:69
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) final
Expose the parameters to a module.
void apply(std::vector< CDCWireHitCluster > &clusters, std::vector< CDCSegment2D > &outputSegments) final
Generates the segment from wire hits.
void apply(std::vector< CDCTrack > &tracks) final
Write give tracks into track store array.
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) final
Expose the parameters to a module.
SegmentFinderFacetAutomaton m_segmentFinderFacetAutomaton
First stage cellular automaton segment finder.
TrackExporter m_trackExporter
Exports the generated CDCTracks as RecoTracks.
WireHitPreparer m_wireHitPreparer
Preparation findlet creating the wire hits from the packed CDCHits.
std::string getDescription() override
Short description of the findlet.
std::vector< CDCWireHitCluster > m_superClusters
Memory for the wire hits super clusters.
void beginEvent() final
Signal the beginning of a new event.
TrackFinderAutomaton()
Constructor registering the subordinary findlets to the processing signal distribution machinery.
StoreVectorSwapper< CDCWireHit, true > m_wireHitsSwapper
Puts the internal segments on the DataStore.
StoreVectorSwapper< CDCTrack > m_tracksSwapper
Puts the internal segments on the DataStore.
std::vector< CDCWireHit > m_wireHits
Memory for the wire hits.
StoreVectorSwapper< CDCSegment2D > m_segmentsSwapper
Puts the internal segments on the DataStore.
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.
ClusterPreparer m_clusterPreparer
Preparation findlet creating the clusters wire hits forming locally connected groups.
std::vector< CDCWireHitCluster > m_clusters
Memory for the wire hits cluster.
std::vector< CDCSegment2D > m_segments
Memory for the segments.
std::vector< CDCTrack > m_tracks
Memory for the tracks.
TrackFlightTimeAdjuster m_trackFlightTimeAdjuster
Adjusts the flight time of the tracks to a setable trigger point.
void apply(const std::vector< CDCSegment2D > &inputSegments, std::vector< CDCTrack > &tracks) final
Generates the tracks from segments.
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) final
Expose the parameters to a module.
void apply(std::vector< CDCTrack > &tracks) final
Adjust the flight time of the given tracks.
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) final
Expose the parameters to a module.
void apply(std::vector< CDCWireHit > &outputWireHits) final
Main function preparing the wire hits.
ModuleParam< T > & getParameter(const std::string &name) const
Returns a reference to a parameter.
Abstract base class for different kinds of events.