Belle II Software development
TrackFinderSegmentPairAutomaton.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/TrackFinderSegmentPairAutomaton.h>
9
10#include <tracking/trackFindingCDC/utilities/Algorithms.h>
11
12#include <framework/core/ModuleParamList.templateDetails.h>
13#include <framework/core/ModuleParam.h>
14
15using namespace Belle2;
16using namespace TrackFindingCDC;
17
19{
27
28 ModuleParamList moduleParamList;
29 const std::string prefix = "";
30 this->exposeParameters(&moduleParamList, prefix);
31 moduleParamList.getParameter<int>("SegmentPairRelationOnlyBest").setDefaultValue(1);
32
33 m_segmentPairs.reserve(100);
34 m_segmentPairRelations.reserve(100);
35 m_preLinkingTracks.reserve(20);
36 m_orientedTracks.reserve(20);
37}
38
40{
41 return "Generates tracks from segments using a cellular automaton built from segment pairs.";
42}
43
45 const std::string& prefix)
46{
47 m_segmentPairCreator.exposeParameters(moduleParamList, prefixed(prefix, "SegmentPair"));
48 m_segmentPairRelationCreator.exposeParameters(moduleParamList, prefixed(prefix, "SegmentPairRelation"));
49 m_trackCreatorSegmentPairAutomaton.exposeParameters(moduleParamList, prefixed(prefix, "SegmentPairRelation"));
50 m_trackCreatorSingleSegments.exposeParameters(moduleParamList, prefix);
51 m_trackLinker.exposeParameters(moduleParamList, prefixed(prefix, "TrackRelation"));
52 m_trackOrienter.exposeParameters(moduleParamList, prefix);
53 m_segmentPairSwapper.exposeParameters(moduleParamList, prefix);
54}
55
57{
58 m_segmentPairs.clear();
60 m_preLinkingTracks.clear();
61 m_orientedTracks.clear();
63}
64
65void TrackFinderSegmentPairAutomaton::apply(const std::vector<CDCSegment2D>& inputSegments,
66 std::vector<CDCTrack>& tracks)
67{
69
70 std::vector<const CDCSegmentPair*> segmentPairPtrs =
71 as_pointers<const CDCSegmentPair>(m_segmentPairs);
73
75
77
80
81 // Put the segment pairs on the DataStore
83}
The Module parameter list class.
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.
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) final
Expose the parameters to a module.
void apply(const std::vector< CDCSegment2D > &inputSegments, std::vector< CDCSegmentPair > &segmentPairs) final
Main method constructing pairs in adjacent super layers.
void apply(const std::vector< CDCSegmentPair > &inputSegmentPairs, const std::vector< WeightedRelation< const CDCSegmentPair > > &inputSegmentPairRelations, std::vector< CDCTrack > &outputTracks) final
Main function of the segment finding by the cellular automaton.
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) final
Expose the parameters to a module.
void apply(const std::vector< CDCSegment2D > &segments, std::vector< CDCTrack > &tracks) final
Main algorithm.
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) final
Expose the parameters to a module.
void apply(const std::vector< CDCSegment2D > &inputSegments, std::vector< CDCTrack > &tracks) final
Generates the tracks from segments.
TrackOrienter m_trackOrienter
Fixes the direction of flight of tracks by a simple chooseable heuristic.
StoreVectorSwapper< CDCSegmentPair > m_segmentPairSwapper
Puts the internal segment pairs on the DataStore.
WeightedRelationCreator< const CDCSegmentPair, ChooseableSegmentPairRelationFilter > m_segmentPairRelationCreator
Findlet responsible for the creation of segment pairs relations of the CA.
TrackCreatorSingleSegments m_trackCreatorSingleSegments
Creates tracks from left over segments.
void beginEvent() final
Signal the beginning of a new event.
TrackLinker m_trackLinker
Findlet responsible for the linking of tracks.
std::string getDescription() final
Short description of the findlet.
std::vector< WeightedRelation< const CDCSegmentPair > > m_segmentPairRelations
Memory for the axial stereo segment pair relations.
TrackFinderSegmentPairAutomaton()
Constructor registering the subordinary findlets to the processing signal distribution machinery.
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) final
Expose the parameters to a module.
SegmentPairCreator m_segmentPairCreator
Findlet responsible for the creation of segment pairs.
std::vector< CDCTrack > m_preLinkingTracks
Memory for the tracks before linking was applied.
TrackCreatorSegmentPairAutomaton m_trackCreatorSegmentPairAutomaton
Reference to the relation filter to be used to construct the segment pair network.
std::vector< CDCSegmentPair > m_segmentPairs
Memory for the axial stereo segment pairs.
std::vector< CDCTrack > m_orientedTracks
Memory for the tracks after orientation was applied.
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) final
Expose the parameters to a module.
Definition: TrackLinker.cc:28
void apply(const std::vector< CDCTrack > &inputTracks, std::vector< CDCTrack > &outputTracks) final
Main algorithm.
Definition: TrackLinker.cc:34
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) final
Expose the parameters to a module.
void apply(const std::vector< CDCTrack > &inputTracks, std::vector< CDCTrack > &outputTracks) final
Main algorithm applying the adjustment of the orientation.
ModuleParam< T > & getParameter(const std::string &name) const
Returns a reference to a parameter.
Abstract base class for different kinds of events.