Belle II Software  release-05-01-25
TrackFinderAutomaton.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2015 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Oliver Frost *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 #include <tracking/trackFindingCDC/findlets/complete/TrackFinderAutomaton.h>
11 
12 #include <framework/core/ModuleParamList.templateDetails.h>
13 #include <framework/core/ModuleParam.h>
14 
15 #include <vector>
16 
17 using namespace Belle2;
18 using namespace TrackFindingCDC;
19 
21 {
25 
32 
33  ModuleParamList moduleParamList;
34  const std::string prefix = "";
35  this->exposeParameters(&moduleParamList, prefix);
36  moduleParamList.getParameter<std::string>("flightTimeEstimation").setDefaultValue("outwards");
37  moduleParamList.getParameter<std::string>("TrackOrientation").setDefaultValue("outwards");
38 
39  // Mimics earlier behaviour
40  moduleParamList.getParameter<bool>("WriteSegments").setDefaultValue(true);
41 
42  m_wireHits.reserve(1000);
43  m_clusters.reserve(100);
44  m_superClusters.reserve(100);
45  m_segments.reserve(100);
46  m_tracks.reserve(20);
47 }
48 
50 {
51  return "Performs patter recognition in the CDC based on local hit following and application of a cellular automaton in two stages.";
52 }
53 
54 void TrackFinderAutomaton::exposeParameters(ModuleParamList* moduleParamList, const std::string& prefix)
55 {
56  m_wireHitsSwapper.exposeParameters(moduleParamList, prefix);
57  m_segmentsSwapper.exposeParameters(moduleParamList, prefix);
58  m_tracksSwapper.exposeParameters(moduleParamList, prefix);
59 
60  m_wireHitPreparer.exposeParameters(moduleParamList, prefix);
61  m_clusterPreparer.exposeParameters(moduleParamList, prefix);
62  m_segmentFinderFacetAutomaton.exposeParameters(moduleParamList, prefix);
63  m_trackFinderSegmentPairAutomaton.exposeParameters(moduleParamList, prefix);
64  m_trackFlightTimeAdjuster.exposeParameters(moduleParamList, prefix);
65  m_trackExporter.exposeParameters(moduleParamList, prefix);
66 }
67 
69 {
70  m_wireHits.clear();
71  m_clusters.clear();
72  m_superClusters.clear();
73  m_segments.clear();
74  m_tracks.clear();
76 }
77 
79 {
80  // Aquire the wire hits, segments and tracks from the DataStore in case they have already been created
84 
91 
92  // Put the segments and tracks on the DataStore
96 }
Belle2::TrackFindingCDC::TrackFinderAutomaton::TrackFinderAutomaton
TrackFinderAutomaton()
Constructor registering the subordinary findlets to the processing signal distribution machinery.
Definition: TrackFinderAutomaton.cc:20
Belle2::TrackFindingCDC::TrackExporter::exposeParameters
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) final
Expose the parameters to a module.
Definition: TrackExporter.cc:33
Belle2::TrackFindingCDC::TrackFinderAutomaton::m_tracks
std::vector< CDCTrack > m_tracks
Memory for the tracks.
Definition: TrackFinderAutomaton.h:107
Belle2::ModuleParamList::getParameter
ModuleParam< T > & getParameter(const std::string &name) const
Returns a reference to a parameter.
Definition: ModuleParamList.templateDetails.h:90
Belle2::TrackFindingCDC::TrackFinderAutomaton::m_wireHitPreparer
WireHitPreparer m_wireHitPreparer
Preparation findlet creating the wire hits from the packed CDCHits.
Definition: TrackFinderAutomaton.h:67
Belle2::TrackFindingCDC::TrackFinderAutomaton::beginEvent
void beginEvent() final
Signal the beginning of a new event.
Definition: TrackFinderAutomaton.cc:68
Belle2::TrackFindingCDC::TrackFinderAutomaton::m_segments
std::vector< CDCSegment2D > m_segments
Memory for the segments.
Definition: TrackFinderAutomaton.h:104
Belle2::TrackFindingCDC::TrackFinderAutomaton::m_trackFlightTimeAdjuster
TrackFlightTimeAdjuster m_trackFlightTimeAdjuster
Adjusts the flight time of the tracks to a setable trigger point.
Definition: TrackFinderAutomaton.h:79
Belle2::TrackFindingCDC::TrackFinderAutomaton::m_wireHits
std::vector< CDCWireHit > m_wireHits
Memory for the wire hits.
Definition: TrackFinderAutomaton.h:95
Belle2::TrackFindingCDC::TrackFinderAutomaton::getDescription
std::string getDescription() override
Short description of the findlet.
Definition: TrackFinderAutomaton.cc:49
Belle2::TrackFindingCDC::CompositeProcessingSignalListener::addProcessingSignalListener
void addProcessingSignalListener(ProcessingSignalListener *psl)
Register a processing signal listener to be notified.
Definition: CompositeProcessingSignalListener.cc:57
Belle2::TrackFindingCDC::WireHitPreparer::exposeParameters
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) final
Expose the parameters to a module.
Definition: WireHitPreparer.cc:29
Belle2::TrackFindingCDC::TrackFinderAutomaton::m_segmentsSwapper
StoreVectorSwapper< CDCSegment2D > m_segmentsSwapper
Puts the internal segments on the DataStore.
Definition: TrackFinderAutomaton.h:88
Belle2::TrackFindingCDC::SegmentFinderFacetAutomaton::exposeParameters
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) final
Expose the parameters to a module.
Definition: SegmentFinderFacetAutomaton.cc:49
Belle2::TrackFindingCDC::TrackFinderSegmentPairAutomaton::exposeParameters
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) final
Expose the parameters to a module.
Definition: TrackFinderSegmentPairAutomaton.cc:46
Belle2::TrackFindingCDC::TrackFinderAutomaton::m_tracksSwapper
StoreVectorSwapper< CDCTrack > m_tracksSwapper
Puts the internal segments on the DataStore.
Definition: TrackFinderAutomaton.h:91
Belle2::TrackFindingCDC::TrackFinderAutomaton::m_clusters
std::vector< CDCWireHitCluster > m_clusters
Memory for the wire hits cluster.
Definition: TrackFinderAutomaton.h:98
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TrackFindingCDC::Findlet::exposeParameters
virtual void exposeParameters(ModuleParamList *moduleParamList __attribute__((unused)), const std::string &prefix __attribute__((unused)))
Forward prefixed parameters of this findlet to the module parameter list.
Definition: Findlet.h:79
Belle2::TrackFindingCDC::TrackExporter::apply
void apply(std::vector< CDCTrack > &tracks) final
Write give tracks into track store array.
Definition: TrackExporter.cc:76
Belle2::TrackFindingCDC::TrackFinderAutomaton::m_segmentFinderFacetAutomaton
SegmentFinderFacetAutomaton m_segmentFinderFacetAutomaton
First stage cellular automaton segment finder.
Definition: TrackFinderAutomaton.h:73
Belle2::TrackFindingCDC::TrackFinderSegmentPairAutomaton::apply
void apply(const std::vector< CDCSegment2D > &inputSegments, std::vector< CDCTrack > &tracks) final
Generates the tracks from segments.
Definition: TrackFinderSegmentPairAutomaton.cc:67
Belle2::TrackFindingCDC::SegmentFinderFacetAutomaton::apply
void apply(std::vector< CDCWireHitCluster > &clusters, std::vector< CDCSegment2D > &outputSegments) final
Generates the segment from wire hits.
Definition: SegmentFinderFacetAutomaton.cc:72
Belle2::TrackFindingCDC::WireHitPreparer::apply
void apply(std::vector< CDCWireHit > &outputWireHits) final
Main function preparing the wire hits.
Definition: WireHitPreparer.cc:38
Belle2::TrackFindingCDC::TrackFlightTimeAdjuster::apply
void apply(std::vector< CDCTrack > &tracks) final
Adjust the flight time of the given tracks.
Definition: TrackFlightTimeAdjuster.cc:27
Belle2::TrackFindingCDC::CompositeProcessingSignalListener::beginEvent
void beginEvent() override
Receive and dispatch signal for the start of a new event.
Definition: CompositeProcessingSignalListener.cc:33
Belle2::TrackFindingCDC::TrackFinderAutomaton::m_superClusters
std::vector< CDCWireHitCluster > m_superClusters
Memory for the wire hits super clusters.
Definition: TrackFinderAutomaton.h:101
Belle2::TrackFindingCDC::ClusterPreparer::exposeParameters
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) final
Expose the parameters to a module.
Definition: ClusterPreparer.cc:29
Belle2::TrackFindingCDC::TrackFinderAutomaton::m_wireHitsSwapper
StoreVectorSwapper< CDCWireHit, true > m_wireHitsSwapper
Puts the internal segments on the DataStore.
Definition: TrackFinderAutomaton.h:85
Belle2::TrackFindingCDC::TrackFinderAutomaton::m_clusterPreparer
ClusterPreparer m_clusterPreparer
Preparation findlet creating the clusters wire hits forming locally connected groups.
Definition: TrackFinderAutomaton.h:70
Belle2::TrackFindingCDC::TrackFinderAutomaton::apply
void apply() final
Execute the findlet.
Definition: TrackFinderAutomaton.cc:78
Belle2::TrackFindingCDC::TrackFinderAutomaton::exposeParameters
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) final
Expose the parameters to a module.
Definition: TrackFinderAutomaton.cc:54
Belle2::ModuleParamList
The Module parameter list class.
Definition: ModuleParamList.h:46
Belle2::TrackFindingCDC::TrackFinderAutomaton::m_trackExporter
TrackExporter m_trackExporter
Exports the generated CDCTracks as RecoTracks.
Definition: TrackFinderAutomaton.h:82
Belle2::TrackFindingCDC::ClusterPreparer::apply
void apply(std::vector< CDCWireHit > &inputWireHits, std::vector< CDCWireHitCluster > &clusters, std::vector< CDCWireHitCluster > &superClusters) final
Generates the segment from wire hits.
Definition: ClusterPreparer.cc:36
Belle2::TrackFindingCDC::TrackFinderAutomaton::m_trackFinderSegmentPairAutomaton
TrackFinderSegmentPairAutomaton m_trackFinderSegmentPairAutomaton
Second stage cellular automaton track finder from segments.
Definition: TrackFinderAutomaton.h:76